The unified diff between revisions [3da6ddd6..] and [808b3c87..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'debian/rules'

#
#
# patch "debian/rules"
#  from [11788645d4eae7869a71ea20a76df29ce520c316]
#    to [79ef55bf8dfccc56a287df9530db82ca0098d73b]
#
============================================================
--- debian/rules	11788645d4eae7869a71ea20a76df29ce520c316
+++ debian/rules	79ef55bf8dfccc56a287df9530db82ca0098d73b
@@ -19,10 +19,14 @@
 # 02110-1301 USA
 #
 # To build this package:
-# cd ..; sudo schroot --chroot=unstable -- dpkg-buildpackage -uc -us -i"_MTN|\\.mtn-ignore"
+# sudo schroot -d `cd ..; pwd` --chroot=unstable -- dpkg-buildpackage -uc -us -i"_MTN|\\.mtn-ignore"
 #
 # To run lintian:
-# cd ..; schroot --chroot=unstable -- make -f debian/rules lint
+# schroot -d `cd ..; pwd` --chroot=unstable -- make -f debian/rules lint
+#
+# To install the packages and run the examples:
+# sudo /etc/init.d/mysql stop
+# sudo schroot --chroot=unstable -- ./test_installed.sh

 .SUFFIXES=

@@ -58,7 +62,7 @@ build-indep:

 build-indep:

-all_packages += $(foreach l,$(libs), libgnade$(l)-so libgnade$(l)-dev)
+all_packages := $(foreach l,$(libs), libgnade$(l)-so libgnade$(l)-dev) libgnadeodbc-example libgnadesqlite3-example

 binary: binary-arch

@@ -80,8 +84,9 @@ clean: unpatch

 clean: unpatch
 	dh_clean
-# despite the man page, dh_clean does not do this
 	rm -f debian/*-stamp
+	rm -f debian/gnadesqlite3*-dev.README.Debian
+	rm -f debian/gnadeodbc*-dev.README.Debian

 # Helper targets

@@ -97,7 +102,7 @@ odbc_preprocessed_files := $(patsubst %.
 odbc_gpb_files := $(wildcard dbi/odbc/*.gpb)
 odbc_preprocessed_files := $(patsubst %.gpb,debian/tmp/odbc-prep/%.adb,$(notdir $(odbc_gpb_files)))

-.PRECIOUS: debian/tmp/odbc-prep
+.PRECIOUS: debian/tmp/odbc-prep debian/tmp/odbc-example-prep

 GNATPREP_FLAGS=-r -DDEBUG=False -DUNICODE=True -DCALLCONVENTION=C -DLINKOPT=\"-lodbc\"

@@ -110,10 +115,15 @@ debian/libgnade%-stamp:
 	gnatmake -p -j$(CPUS) -Pdebian/gnade_$*_build -XLIBTYPE=dynamic -Xsoversion=$($*_soversion)
 	touch $@

-debian/libgnadeodbc-stamp: $(odbc_preprocessed_files)
+debian/libgnadeodbc-stamp: $(odbc_preprocessed_files) debian/gnadeodbc$(odbc_aliversion)-dev.README.Debian

 debian/libgnadeodbc-stamp debian/libgnadesqlite3-stamp: debian/libgnadecommon-stamp

+debian/libgnadesqlite3-stamp: debian/gnadesqlite3$(sqlite3_aliversion)-dev.README.Debian
+
+debian/gnade%-dev.README.Debian:
+	cd debian; ln -s gnadecommon$(common_aliversion)-dev.README.Debian gnade$*-dev.README.Debian
+
 # Make a directory.
 debian/tmp/%-prep:
 	-mkdir -p $@
@@ -149,13 +159,24 @@ libgnade%-dev: debian/libgnade%-stamp
 	dh_link -p$(package) /usr/lib/libgnade$*.so.$($*_soversion) /usr/lib/libgnade$*.so
 	dh_install -p$(package) debian/gnade$*.gpr /usr/share/ada/adainclude

+# dh_installexamples compresses demo.adb. The Debian Ada Policy says
+# to not compress, but any decent editor can read a compressed file.
+libgnadeodbc-example: package := libgnadeodbc$(odbc_aliversion)-dev
+libgnadeodbc-example: debian/tmp/odbc-example-prep/demo.adb
+	dh_installexamples -p$(package) debian/tmp/odbc-example-prep/demo.adb
+
+libgnadesqlite3-example: package := libgnadesqlite3-$(sqlite3_aliversion)-dev
+libgnadesqlite3-example:
+	dh_installexamples -p$(package) samples/sqlite3/demo.adb
+
 # Check the build by running some examples.
 check: patch debian/check-sqlite3-stamp

 # create 'gnade' mysql account, 'gnade' mysql database
 # install 'MySQL' odbc driver, 'gnade_mysql' odbc source
 # assumes mysql root account has no password
-# assumes mysqld has been started; use '/etc/init.d/mysql start'
+# assumes mysqld in main install has been stopped; use 'sudo /etc/init.d/mysql stop'
+# assumes mysqld in main chroot has been started; use 'sudo schroot -- /etc/init.d/mysql start'
 # assumes gnade db and user have not already been created
 debian/odbc-source-stamp:
 	mysqladmin -uroot create gnade
@@ -183,9 +204,7 @@ debian/check-sqlite3-stamp: debian/libgn
 	export LD_LIBRARY_PATH=`pwd`/debian/tmp; debian/tmp/sqlite3-example-obj/demo debian/tmp/demo.db
 	touch $@

-lint: regexp := ^Version: \([0-9.]\+-.\+\)$$
-lint: version := $(shell dpkg-parsechangelog | grep ^Version | sed 's/$(regexp)/\1/')
 lint:
-	cd ..; lintian --lab ../../lint/gnade-$(version) -i gnade*.changes
+	cd ..; lintian -i gnade*.changes

 # end of file