sql

Kreuzuebersetzer, Diskussion über Änderungen im Tuxbox-CDK und Tuxbox-CVS
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

sql

Beitrag von fergy »

Hello.
Have a question about sql.
I was handle sql storage ( sqlite3 ) under cvs, so lib's can be builded, storage is not tested yet ( but will be this week ) and dish/bev handling also...
Does We have any informations about it ( except from other two images who was handle it both ) ?
Other thing is sql libs. It compiled without problems, so My question is, should I commit that part into cvs so other developers can handle something?
Was put in this way:
in prepare:

Code: Alles auswählen

--with-sqlite
It's mainly just for build sql lib's, not an epg storage or enigma storage in this manner.
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

fergy hat geschrieben:should I commit that part into cvs so other developers can handle something?
Maybe you should post your patch here for discussion before it gets committed.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

OKi, here it is:

Code: Alles auswählen

--- cdk/rules-make 
+++ cdk/rules-make 
@@ -149,5 +149,9 @@
 dvbtune;20020918;dvbtune;dvbtune-20020918.tar.bz2;extract:dvbtune-20020918.tar.bz2
 vls;0.4.0;vls-0.4.0;vls-0.4.0.tar.bz2;extract:vls-0.4.0.tar.bz2
 
+#
+# Database
+#
+sqlite;3.6.7;sqlite-3.6.7;sqlite-3.6.7.tar.gz;extract:sqlite-3.6.7.tar.gz
 >>?;rules-make-local

Code: Alles auswählen

--- cdk/rules-install 
+++ cdk/rules-install 
@@ -143,5 +143,9 @@
 #
 squashfs
 
+#
+# Database
+#
+sqlite;make:install:prefix=TARGET
 >>?;rules-install-local

Code: Alles auswählen

--- cdk/rules-archive 
+++ cdk/rules-archive 
@@ -158,3 +158,8 @@
 squashfs2.2-r2.tar.gz;http://heanet.dl.sourceforge.net/sourceforge/squashfs
 lzma442.tar.bz2;http://heanet.dl.sourceforge.net/sourceforge/sevenzip
 
+#
+# Database
+#
+sqlite-3.6.7.tar.gz;http://www.sqlite.org
+

Code: Alles auswählen

--- cdk/configure.ac 
+++ cdk/configure.ac 
@@ -138,6 +138,13 @@
 AC_SUBST(ENIGMA_DEBUG)
 AM_CONDITIONAL(ENIGMA_DEBUG_NO,test "$ENIGMA_DEBUG" = "no")
 AM_CONDITIONAL(ENIGMA_DEBUG_YES,test "$ENIGMA_DEBUG" = "yes")
+
+AC_ARG_WITH(sqlite,
+	[  --with-sqlite          enable sql storage (default off)],
+	[SQLITE="$withval"],[SQLITE="no"])
+
+AC_SUBST(SQLITE)
+AM_CONDITIONAL(WITH_SQLITE,test "$SQLITE" = "yes")
 
 AC_SUBST(EXTFLASHTOOL)
 AM_CONDITIONAL(EXTFLASHTOOL_NO,test "$EXTFLASHTOOL" = "no")
@@ -477,6 +484,11 @@
 TUXBOX_RULES_MAKE(vls)
 
 #
+# Database
+#
+TUXBOX_RULES_MAKE(sqlite)
+
+#
 # internal
 #
 AC_SUBST_FILE(ARCHIVE)
@@ -501,6 +513,7 @@
 external flashtool:	$EXTFLASHTOOL
 reiserfs:		$REISERFS
 enigma debug:		$ENIGMA_DEBUG
+sqlite3:		$SQLITE
 host rule set:		$HOSTRULESET
 target rule set:	$TARGETRULESET
 target prefix:		$targetprefix

Code: Alles auswählen

--- tuxbox_original/cdk/Makefile.am 
+++ CLi_NEE/cdk/Makefile.am 
@@ -1057,6 +1057,25 @@
 	@CLEANUP_libz@
 	touch $@
 
+#######################
+#
+#	Database
+#
+
+if WITH_SQLITE
+.sqlite: .bootstrap @DEPENDS_sqlite@
+	@PREPARE_sqlite@
+	cd @DIR_sqlite@ && \
+		$(BUILDENV) \
+		./configure \
+			--build=$(build) \
+			--host=$(target) \
+			--prefix=$(targetprefix) && \
+		$(MAKE) all && \
+		@INSTALL_sqlite@
+	@CLEANUP_sqlite@
+	touch $@
+endif
 #######################
 #
 #   contrib apps
@@ -2330,7 +2349,9 @@
 endif
 	$(INSTALL) $(targetprefix)/bin/chttpd $(flashprefix)/root/bin
 endif
-
+if WITH_SQLITE
+	$(INSTALL) $(targetprefix)/bin/sqlite3 $(flashprefix)/root/bin
+endif
 	@touch $@
 
 flash-ushare: $(flashprefix)/.part_ushare
@@ -2808,6 +2829,7 @@
 		--root $(flashprefix)/root \
 		`find $(flashprefix)/root/bin/ -path "*bin/?*"` \
 		`find $(flashprefix)/root/lib/ -name "libnss_*"` \
+		`find $(flashprefix)/root/lib/ -name "libsqlite3*"` \
 		`find $(flashprefix)/root/lib/tuxbox/ -name "*.so" -type f` \
 		`find $(flashprefix)/root/lib/autofs/ -name "*.so" -type f` \
 		`find $(flashprefix)/root/sbin/ -path "*sbin/?*"`
@@ -2907,7 +2929,7 @@
 	-rm .dvbsnoop .enigma .lcars .lcdmenu .neutrino .stream .zapit
 	-rm .console_data .console_tools .dropbear .dsniff .fbset .lirc 
 	-rm .polipo .pump .ssh .tcpdump .tor .ushare .xrc .thttpd
-	-rm .dvbdate .dvbstream .dvbtext .dvbtune .vls
+	-rm .dvbdate .dvbstream .dvbtext .dvbtune .vls .sqlite
 	-rm .misc_libs .misc_tools .plugins .libtuxbox .tuxbox_libs .tuxbox_tools .tuxbox_tools_all
 	-rm -rf $(targetprefix)
 	-rm -rf $(hostprefix)
So, what is discussion needed about?
As I say, it just enable building of sqlite3 lib's, nothing else ( for now ) as I wait that friends make a test of other things before posting anything else.
Idea is mainly on choose of EPG-sql storage ( well, maybe settings of enigma too ;) )
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

fergy hat geschrieben:So, what is discussion needed about?
I asked you to show the patch not because I am against Sqlite, but because
I would like to see it before it could harm other stuff in CVS.

In your case I would like to ask you to adjust your patch to the newmake
CVS branch (cdk/make/contrib_libs.mk ?) because this branch will soon
be HEAD, the transition is not far away.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

No fight... :lol:
Newmake? Also for Dreambox branch?
OK, what is cvs command for that? Just

Code: Alles auswählen

-z3 co -P .
or something else?
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

@rhabarber1848

Code: Alles auswählen

-z3 co -P -rnewmake .
:gruebel:
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

Here I use
-z9 co -f -r newmake -P .

Please note that the newmake branch is not yet HEAD, its still oldmake.
In the case of Sqlite I do not think its a feature which is exclusively suited
for the Dreambox branch, it should be put in newmake (or HEAD after the
transition) so it can be used globally.

newmake branch does not use cdk/Makefile.am and has its own
version of cdk/configure.ac
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Thx, I see.
Was pull newmake and look in it right now.
So, in Makefile.am should be:

Code: Alles auswählen

# Sqlite
include make/sqlite.mk
in sqlite.mk:

Code: Alles auswählen

$(DEPDIR)sqlite: .bootstrap @DEPENDS_sqlite@
	@PREPARE_sqlite@
	cd @DIR_sqlite@ && \
		$(BUILDENV) \
		./configure \
			--build=$(build) \
			--host=$(target) \
			--prefix=$(targetprefix) && \
		$(MAKE) all && \
		@INSTALL_sqlite@
	@CLEANUP_sqlite@
	touch $@
and other files as is above?
Something else?
Should I make diff and attach here?
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

After looking in newmake branch, I don't thing that contrib_libs is right place for sql as database storage is not an standard library.
Well, that's just My opinion.
Please point Me on right direction as I am little confused with newmake branch.
Cheers
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

I tried to put your code into newmake format,
please try this patch: sqlite.diff

Please note that I chose cdk/make/database.mk instead of sqlite.mk because
I remembered that gdbm is part of my upcoming pulseaudio patch.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Thx! Should be ok as I see.
Well, I'll try to test in the morning and let You know what's goin' on, but I am sure that patch is ok.
If someone in a mean time want to test it, please do it and post possible problems.
Thank You again @rhabarber1848
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

Updated patch to automatically include Sqlite in flash-images, for the record:
sqlite.diff

cdk/make/flashroot.mk

Code: Alles auswählen

+if WITH_SQLITE
+         $(MAKE) flash-sqlite
+endif
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Thank You again :D
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

FYI: file sizes in flash-neutrino-squashfs

Code: Alles auswählen

-rwxr-xr-x  1 root root  40336  6. Jan 20:39 sqlite3
-rw-r--r--  1 root root 425688  6. Jan 20:39 libsqlite3.so.0
Also did some small updates for the patch, "make all PREFIX=..."
does not work as expected, setting --prefix is needed here.
Barf
Developer
Beiträge: 1475
Registriert: Dienstag 4. Februar 2003, 22:02

Re: sql

Beitrag von Barf »

I would like to suggest that you follow the automake naming convention, i.e., call your option --enable-sqlite instead of --with-sqlite. "enable/disable" is for a feature that is turned on or off, "with" for parameters and such stuff, although sometimes it is not entirely obvious.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

@rhabarber1848
OK, I will recheck. :gruebel:

@Barf
OK, will change to --enable-sqlite, thank You for suggestion.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

@Barf
Here is new diff as You request.
Hmm, cannot upload file here, so code inserted:

Code: Alles auswählen

diff -uNr ../cdk/configure.ac ../cdk/configure.ac
--- ../cdk/configure.ac	2008-12-25 19:52:59.000000000 +0100
+++ ../cdk/configure.ac	2009-01-06 23:05:02.000000000 +0100
@@ -210,6 +210,13 @@
 	exit 1
 fi
 
+AC_ARG_ENABLE(sqlite,
+	[--enable-sqlite,enable sql storage (default off)],
+	[enable_sqlite="no"])
+
+AC_SUBST(SQLITE)
+AM_CONDITIONAL(ENABLE_SQLITE,test "$enable_sqlite" = "yes")
+
 AC_ARG_WITH(rootpartitionsize,
 	[  --with-rootpartitionsize=SIZE	size of the root partition],
 	[ROOT_PARTITION_SIZE="$withval"],[ROOT_PARTITION_SIZE="0x660000"])
@@ -680,6 +687,11 @@
 TUXBOX_RULES_MAKE(bluez_utils)
 
 #
+# database
+#
+TUXBOX_RULES_MAKE(sqlite)
+
+#
 # internal
 #
 AC_SUBST_FILE(ARCHIVE)
@@ -743,6 +755,7 @@
 Neutrino UPnP-support:		$enable_upnp
 FLAC support:			$enable_flac	
 German keymaps:			$enable_german_keymaps
+sqlite3 storage:		$enable_sqlite
 ----------------------------------------
 ccache support:			$enable_ccache
 ccache installdir:		$ccachedir
diff -uNr ../cdk/make/database.mk ../cdk/make/database.mk
--- ../cdk/make/database.mk	1970-01-01 01:00:00.000000000 +0100
+++ ../cdk/make/database.mk	2009-01-06 23:06:55.000000000 +0100
@@ -0,0 +1,39 @@
+#######################
+#
+#   database
+#
+
+if ENABLE_SQLITE
+$(DEPDIR)/sqlite: bootstrap @DEPENDS_sqlite@
+	@PREPARE_sqlite@
+	cd @DIR_sqlite@ && \
+		$(BUILDENV) \
+		./configure \
+			--build=$(build) \
+			--host=$(target) \
+			--prefix=$(targetprefix) && \
+		$(MAKE) all && \
+		@INSTALL_sqlite@
+	@CLEANUP_sqlite@
+	touch $@
+
+if TARGETRULESET_FLASH
+flash-sqlite: $(flashprefix)/root/bin/sqlite3
+
+$(flashprefix)/root/bin/sqlite3: @DEPENDS_sqlite@ | $(flashprefix)/root
+	@PREPARE_sqlite@
+	cd @DIR_sqlite@ && \
+		$(BUILDENV) \
+		./configure \
+			--build=$(build) \
+			--host=$(target) \
+			--prefix=$(targetprefix) && \
+		$(MAKE) all && \
+		$(MAKE) install PREFIX=$(flashprefix)/root
+	@INSTALL_sqlite@
+	@CLEANUP_sqlite@
+	@FLASHROOTDIR_MODIFIED@
+
+endif
+
+endif
diff -uNr ../cdk/make/flashroot.mk ../cdk/make/flashroot.mk
--- ../cdk/make/flashroot.mk	2008-12-02 00:57:52.000000000 +0100
+++ ../cdk/make/flashroot.mk	2009-01-06 23:07:21.000000000 +0100
@@ -69,6 +69,9 @@
 if ENABLE_GERMAN_KEYMAPS
 	$(MAKE) flash-german-keymaps
 endif
+if ENABLE_SQLITE
+	$(MAKE) flash-sqlite
+endif
 	$(MAKE) flash-defaultlocale
 	$(MAKE) flash-version
 	@FLASHROOTDIR_MODIFIED@
diff -uNr ../cdk/make/reduce-libs.mk ../cdk/make/reduce-libs.mk
--- ../cdk/make/reduce-libs.mk	2008-12-11 21:44:29.000000000 +0100
+++ ../cdk/make/reduce-libs.mk	2009-01-06 23:08:15.000000000 +0100
@@ -35,6 +35,9 @@
 		${MKLIBS_UCLIBCOPTS} \
 		`find $</bin/ -path "*bin/?*" -type f` \
 		`find $</lib/ -name "libnss_*" -type f` \
+if ENABLE_SQLITE 
+		`find $</lib/ -name "libsqlite3*" -type f` \
+endif
 		`find $</lib/ -name "*.so" -type f` \
 		`find $</sbin/ -path "*sbin/?*" -type f`
 if TARGETRULESET_UCLIBC
diff -uNr ../cdk/Makefile.am ../cdk/Makefile.am
--- ../cdk/Makefile.am	2008-12-02 18:12:30.000000000 +0100
+++ ../cdk/Makefile.am	2009-01-06 23:05:43.000000000 +0100
@@ -69,6 +69,9 @@
 # Bluetooth (nonessential)
 include make/bluetooth.mk
 
+# sqlite3 database
+include make/database.mk
+
 # FUSE and djmount for uPnP support (non-essential)
 include make/upnp.mk
diff -uNr ../cdk/rules-archive ../cdk/rules-archive
--- ../cdk/rules-archive	2008-11-21 22:28:05.000000000 +0100
+++ ../cdk/rules-archive	2009-01-06 22:52:52.000000000 +0100
@@ -172,3 +172,8 @@
 #
 squashfs3.0.tar.gz;http://heanet.dl.sourceforge.net/sourceforge/squashfs
 lzma442.tar.bz2;http://heanet.dl.sourceforge.net/sourceforge/sevenzip
+
+#
+# database
+#
+sqlite-3.6.7.tar.gz;http://www.sqlite.org
diff -uNr ../cdk/rules-install ../cdk/rules-install
--- ../cdk/rules-install	2008-12-06 00:09:36.000000000 +0100
+++ ../cdk/rules-install	2009-01-06 22:53:17.000000000 +0100
@@ -159,4 +159,9 @@
 #
 squashfs
 
+#
+# database
+#
+sqlite;make:install:prefix=TARGET
+
 >>?;rules-install-local
diff -uNr ../cdk/rules-make ../cdk/rules-make
--- ../cdk/rules-make	2009-01-05 17:30:28.000000000 +0100
+++ ../cdk/rules-make	2009-01-06 22:53:39.000000000 +0100
@@ -170,4 +170,9 @@
 bluez_sdp;1.5;bluez-sdp-1.5;bluez-sdp-1.5.tar.gz;extract:bluez-sdp-1.5.tar.gz
 bluez_utils;2.4;bluez-utils-2.4;bluez-utils-2.4.tar.gz;extract:bluez-utils-2.4.tar.gz
 
+#
+# database
+#
+sqlite;3.6.7;sqlite-3.6.7;sqlite-3.6.7.tar.gz;extract:sqlite-3.6.7.tar.gz
+
 >>?;rules-make-local
@rhabarber1848
does not work as expected, setting --prefix is needed here.
What actually not work as expected? Too big library?
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

fergy hat geschrieben:@rhabarber1848
does not work as expected, setting --prefix is needed here.
What actually not work as expected? Too big library?
The old code was
make install PREFIX=(somewhere)/cdkflash/root

but PREFIX was ignored, for the flash-sqlite target I had to use
./configure --prefix=(somewhere)
instead, otherwise the file did not land in the flash image.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Well, in Dreambox cdk it is placed in /root/cdkroot/bin and /root/cdkroot/lib after compiling.
After execute make rebuild-flash it was copyed on /root/cdkflash/root/bin + /root/cdkflash/root/lib and then stripped.
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

fergy hat geschrieben:+if WITH_SQLITE
+ $(INSTALL) $(targetprefix)/bin/sqlite3 $(flashprefix)/root/bin
+endif
Thats true, but with newmake things go a bit differently and my first approach
was copied from bzip2 install code which had "make install PREFIX=...", which
fails for Sqlite. With the current patch everything should work well, I was
just talking to myself about this, never mind ;)
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Ahh, ok, understand. :dash:
When (if) You get a time, please insert those lines on proper place as I really don't have a clue where to put that.
:lol: must study newmake :gruebel:
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

@rhabarber1848
Where can I put Your patch for newmake sql install? database.mk?
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

FYI: newmake branch is inactive now, commit the patch I wrote to CVS HEAD, please

Yes, please use cdk/make/database.mk instead of sqlite.mk because gdbm, another
database, will soon be part of Tuxbox pulseaudio support.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

OK.
Just note that it is not anymore "--WITH" .
Now is "--ENABLE" on @BArf's request ( and He is 100% right in that )
Will commit soon.
Cheers
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

rhabarber1848 hat geschrieben:
fergy hat geschrieben:+if WITH_SQLITE
+ $(INSTALL) $(targetprefix)/bin/sqlite3 $(flashprefix)/root/bin
+endif
Thats true, but with newmake things go a bit differently and my first approach
was copied from bzip2 install code which had "make install PREFIX=...", which
fails for Sqlite. With the current patch everything should work well, I was
just talking to myself about this, never mind ;)
@rhabarber1848
I know that I am pain in the ass, but please put Your patch in this as I don't know where to put:

Code: Alles auswählen

#######################
#
#   database
#

if ENABLE_SQLITE
$(DEPDIR)/sqlite: bootstrap @DEPENDS_sqlite@
   @PREPARE_sqlite@
   cd @DIR_sqlite@ && \
      $(BUILDENV) \
      ./configure \
         --build=$(build) \
         --host=$(target) \
         --prefix=$(targetprefix) && \
      $(MAKE) all && \
      @INSTALL_sqlite@
   @CLEANUP_sqlite@
   touch $@

if TARGETRULESET_FLASH
flash-sqlite: $(flashprefix)/root/bin/sqlite3

$(flashprefix)/root/bin/sqlite3: @DEPENDS_sqlite@ | $(flashprefix)/root
   @PREPARE_sqlite@
   cd @DIR_sqlite@ && \
      $(BUILDENV) \
      ./configure \
         --build=$(build) \
         --host=$(target) \
         --prefix=$(targetprefix) && \
      $(MAKE) all && \
      $(MAKE) install PREFIX=$(flashprefix)/root
   @INSTALL_sqlite@
   @CLEANUP_sqlite@
   @FLASHROOTDIR_MODIFIED@

endif

endif
Thank You