debian/0000755000000000000000000000000011642150046007165 5ustar debian/changelog0000644000000000000000000002776011642146773011067 0ustar gnade (1.6.2-9) unstable; urgency=low * upgrade to build with gnat-4.6; bump aliversion -- Stephen Leake Sun, 17 Jul 2011 15:00:59 -0400 gnade (1.6.2-8) unstable; urgency=low * debian/source/format: New file; change to 3.0 (quilt) * debian/patches/*.patch: document according to DEP-3 * debian/compat: bump to 7 * debian/copyright (Format-Specification): use dep5 format. * debian/rules: improve build instructions, drop quilt rules * debian/test_installed.sh: do sudo on install steps -- Stephen Leake Wed, 30 Jun 2010 04:54:55 -0400 gnade (1.6.2-7) unstable; urgency=low * debian/control (DM-Upload-Allowed): yes, not true. (Standards-Version): bump to 3.8.4 with no changes required. (*): add ${misc:Depends} everywhere, per lintian. (Uploaders): remove myself, Stephe taking over now. -- Ludovic Brenta Sat, 5 Jun 2010 22:20:25 +0200 gnade (1.6.2-6) unstable; urgency=low * debian/control (DM-Upload-Allowed): true. (Architecture): add armel to all packages. Closes: #568436. Comply with Fifth Edition of the Debian Policy for Ada: (*-dev): depend on gnat and ada-compiler in addition to gnat-4.4. (*-dbg): suggest gnat, ada-compiler to be more visible in aptitude. -- Ludovic Brenta Sat, 5 Jun 2010 21:42:29 +0200 gnade (1.6.2-5) unstable; urgency=low * debian/gnade_{common,odbc,sqlite3}_ref.gpr: delete -fstack-check from compiler options; broken in gcc 4.4. Closes: #558980 * debian/rules: get soversion, aliversion from debian/control * debian/gnade_{odbc, sqlite3}_example_installed.gpr: new, used in running demos with installed packages. -- Stephen Leake Mon, 14 Dec 2009 17:02:46 -0500 gnade (1.6.2-4) unstable; urgency=low * debian/gnade_{common,odbc,sqlite3}_ref.gpr: add Library_ALI_Dir; fixes weird FTBFS on i386. Necessary anyway since the libraries are not in the same place as the .ali files. * debian/control (Architectures): temporarily disable alpha due to http://gcc.gnu.org/PR42073. -- Ludovic Brenta Tue, 17 Nov 2009 00:09:10 +0100 gnade (1.6.2-3) unstable; urgency=low * debian/rules: Install source, ali files in correct directories according to Debian Ada Policy. Install examples. * debian/odbc.gpr: renamed to debian/gnadeodbc.gpr, refer to correct directories * debian/sqlite3.gpr: renamed to debian/gnadesqlite3.gpr, refer to correct directories * debian/gnadecommon.gpr: new * debian/compat: change to 6. * debian/test_installed.sh: New file, for running examples against installed packages. -- Stephen Leake Thu, 05 Nov 2009 06:14:01 -0500 gnade (1.6.2-2) unstable; urgency=low [Stephen Leake] * Change -dev package names to reflect the change in .ali files (see extensive discussion at http://people.debian.org/~lbrenta/debian-ada-policy.html): - libgnadeodbc-dev -> libgnadeodbc1-dev - libgnadesqlite-dev -> libgnadesqlite3-1-dev * Change sonames and package names for shared libraries: - libgnadeodbc.so.1.6.2 -> libgnadeodbc.so.2 - libgnadesqlite.so.1.6.2 -> libgnadesqlite3.so.2 (we are linking to libsqlite3, not libsqlite). * New packages: - libgnadecommon1-dev, libgnadecommon1, libgnadecommon-dbg: factorize code shared by the ODBC and SQLite3 bindings. * Deleted packages: - libgnademysql{1.6.2,-dev,-dbg}: clearly broken. - libgnadepostgresql{1.6.2,,-dev,-dbg}: uses questionable C import techniques. - gnade-bin: the embedded SQL preprocessor was clearly broken. * debian/control (Build-Depends): delete libmysqlclient; add quilt. (Architecture): add kfreebsd-amd64. Closes: #542413. (libgnadeodbc1-dev, libgnadesqlite3-1-dev): depend on libgnadecommon1-dev. * debian/rules: - ensure dbi/sqlite3 source is used - add patch, unpatch targets - delete mysql, postgresql, gesql - add check target; run gnade demos * patches/bug-538643.patch: new. In *Binding, check size of object, not size of type. Closes: #538643. * patches/demo_warnings.patch: new. [Ludovic Brenta] * debian/control (Vcs-Mtn, Vcs-Browse): new. (Maintainer): new maintainer Stephen Leake. Closes: #496787. (Uploaders): add myself as the sponsor. (*): switch to gnat-4.4. (*-dev): ensure Conflicts: and Replaces: with superseded packages. Suggest the -dbg packages. -- Stephen Leake Thu, 22 Oct 2009 22:19:46 +0200 gnade (1.6.2-1.1) unstable; urgency=low * NMU per release team's encouragement. * debian/control (Build-Depends, libgnademysql-dev): list unversioned libmysqlclient-dev rather than libmysqlclient15-dev. (Closes: #538522.) (gnade-bin, libgnade*-{dev,dbg}): correct ${source:Version} to ${binary:Version} as needed to ensure binNMU-safety, and generally correct -dbg packages' metadata (extraneous dependencies cleaned up, section changed to debug). (Closes: #542325.) -- Aaron M. Ucko Tue, 01 Sep 2009 20:59:02 -0400 gnade (1.6.2-1) unstable; urgency=low * Migrate to gnat-4.3; change the sonames to *.1.6.2. * New upstream version from CVS. Closes: #471619. * debian/control (Architectures): add mips, mipsel and ppc64. (Standards-Version): update to 3.8.0. * patches/*: remove, no longer necessary. Do not b-d on quilt anymore. * Introduce -dbg packages for all interfaces (ODBC, MySQL, PostgreSQL and SQLite). -- Ludovic Brenta Sun, 20 Jul 2008 22:19:46 +0200 gnade (1.6.1-2) unstable; urgency=low * Install the preprocessed source files in libgnadeodbc-dev. -- Ludovic Brenta Wed, 17 Oct 2007 16:10:27 +0200 gnade (1.6.1-1) unstable; urgency=low * Acknowledge NMU. Thanks, Luk. Closes: #362979, #356760. * New upstream version from the CVS server. * Make the following changes to the directory structure: cd dbi; mv sqlite sqlite2; ln -s sqlite3 sqlite. Thus, libgnadesqlite has now switched to SQLite 3. Made possible by the Ada.Containers shipped with GCC 4.1. * debian/control (Maintainer): change my email address; now a full DD. (Build-Depends): switch to gnat >= 4.1, libsqlite3-dev. Add quilt. (Standards-Version): update to 3.7.2 with no changes required. (Architecture): add alpha, amd64, hppa, ia64, and s390. (libgnadeodbc1, libgnademysql1, libgnadepostgresql1, libgnadesqlite1): rename to *1.6 due to ABI change, with Conflicts and Replaces. Update descriptions. Closes: #363609. (libgnadeodbc-dev, libgnademysql-dev, libgnadepostgresql-dev, libgnadesqlite-dev): new packages, separated from the preprocessor for future multilib support. Depend on their respective database packages. (gnade-doc): remove, non-free due to a one-line invariant section :( Suggested, not Recommended, by the other packages. * debian/rules: ditto. Adjust parallel gnatmakes to the number of CPUS present in the system. Use quilt to apply patches. Arrange to never delete object files during a build anymore; this makes it possible to restart an interrupted build. Do not use stamps anymore; compute dependencies correctly in the first place. Use pattern targets instead of repeating target rules over and over. * patches/series: new. * patches/inline_functions_returning_unconstrained_types.patch: new. Closes: #358301. * Remove the doc directory from the .orig.tar.gz. -- Ludovic Brenta Fri, 27 Oct 2006 21:15:50 +0200 gnade (1.5.1-4.1) unstable; urgency=high * Non-maintainer upload. * Update build-dep to libmysqlclient15-dev (Closes: #358301). -- Luk Claes Sun, 16 Apr 2006 20:41:05 +0200 gnade (1.5.1-4) unstable; urgency=low * debian/control: enable support for GNU/kFreeBSD; build-depend on gnat (>=3.15p-19). Add Alexander Wirt to the list of uploaders. * debian/gnade.postinst: remove, no longer needed. -- Ludovic Brenta Thu, 2 Mar 2006 08:19:19 +0100 gnade (1.5.1-3) unstable; urgency=low * Rebuild against libpq4 (PostgreSQL 8.1) instead of libpq3 (PostgreSQL 7.4). Closes: #343203. - debian/control: do not recommend postgresql-dev or libpq3. * debian/changelog: change maintainer's email address. Change Standards-Version to 3.6.2. -- Ludovic Brenta Tue, 13 Dec 2005 20:46:17 +0100 gnade (1.5.1-2) unstable; urgency=low * Rebuild against libmysqlclient12 instead of libmysqlclient10, per MySQL policy. -- Ludovic Brenta Sat, 29 Jan 2005 00:12:53 +0100 gnade (1.5.1-1) unstable; urgency=low * New upstream version. * Support revision numbers with dots in them for future NMUs. * As per upstream, changed some package names (with apropriate Replaces): libadamysql1 -> libgnademysql1 libadaodbc1 -> libgnadeodbc1 libadapostgresql1 -> libgnadepostgresql1 * As per upstream, new package: libgnadesqlite1; Build-Depend on libsqllite0-dev. * gnade-dev Depends on, instead of Recommends, all the library packages. * Fix the documentation that mentions libadaodbc instead of libgnadeodbc. * Link libadaodbc.so against libodbc.so. * New README.Debian. -- Ludovic Brenta Wed, 10 Mar 2004 15:45:26 +0100 gnade (1.4.3a-4) unstable; urgency=low * Revert to using a postinst script to fix the permissions on .ali files because lintian complains about them. * Compile libadaodbc1 on powerpc sparc, too. * debian/rules (build-arch, build-indep): Fix the NTBFS when using dpkg-buildpackage -b -B. * Closes: #226923. -- Ludovic Brenta Sat, 10 Jan 2004 20:38:28 +0100 gnade (1.4.3a-3) unstable; urgency=low * Removed debian/files to prevent problems with dpkg-buildpackage. * Build against MySQL 3.23 because unixodbc does too. * Build on powerpc and sparc, too. -- Ludovic Brenta Tue, 6 jan 2004 20:02:35 +0100 gnade (1.4.3a-2) unstable; urgency=low * Added a postinst script to gnade-dev to make all the *.ali files read-only, as required by GNAT. * Rebuild with all validity checks enabled (-gnatVa). -- Ludovic Brenta Tue, 27 nov 2003 17:50:10 +0100 gnade (1.4.3a-1) unstable; urgency=low * New upstream version. * New maintainer (Closes: #215518). * Use gnat 3.15p (Closes: #156638). * Better package descriptions (Closes: #210009). * Do not build-depend on autoconf; we do not change the *.in files and do not require it. * Removed shlibs.defs and other manifest files; generate the information at build time. * Bumped up Standards-Version to 3.6.1 (from 3.5.6). * Moved gnade-dev to section libdevel (from libs). * Provide a GNAT project file, /usr/share/ada/adaincude/gnade.gpr. -- Ludovic Brenta Mon, 24 Nov 2003 16:29:09 +0100 gnade (1.2.0-4) unstable; urgency=high * NMU * Rebuild so gnat 3.14 can get in Woody * Added autoconf to build dependency -- David Starner Wed, 13 Mar 2002 18:29:20 -0600 gnade (1.2.0-3) unstable; urgency=low * Restricted build to i386 (gnat is only available for i386, sparc, and powerpc; build fails with a gnat bug on sparc and powerpc) * Corrected shlibs.local -- Harry Henry Gebel Tue, 22 Jan 2002 10:59:23 -0500 gnade (1.2.0-2) unstable; urgency=low * Added docbook-to-man to build-depends * Restricted build to i386, sparc, and powerpc -- Harry Henry Gebel Sun, 20 Jan 2002 21:19:41 -0500 gnade (1.2.0-1) unstable; urgency=low * Initial Release (closes: #107363) * Added install prefix support to Makefile.in * Don't make libraries owned by 'bin' * Added ability to install into /usr instead of /usr/local * Added man page for gesql * Removed -rpath from link -- Harry Henry Gebel Thu, 17 Jan 2002 08:53:36 -0500 Local variables: left-margin: 2 End: debian/compat0000644000000000000000000000000211642146773010377 0ustar 7 debian/control0000644000000000000000000001344711642146773010615 0ustar Source: gnade Section: libs Priority: optional Maintainer: Stephen Leake DM-Upload-Allowed: yes # sqlite3, libsqlite3-dev are used to test the sqlite3 interface Build-Depends: debhelper (>= 7.2.4), gnat-4.6, unixodbc-dev, libsqlite3-dev Standards-Version: 3.9.2 XS-Vcs-Mtn: www.ada-france.org org.debian.gnade XS-Vcs-Browser: http://www.ada-france.org:8081/branch/changes/org.debian.gnade # lib*-dev integer is aliversion # lib integer is soversion # when change aliversion, also need to change: # gnadecommon2-dev.README.Debian filename Package: libgnadecommon2-dev Architecture: any Section: libdevel Depends: gnat, gnat-4.6, ada-compiler, libgnadecommon1 (= ${binary:Version}), ${misc:Depends} Suggests: libgnadecommon-dbg Description: GNat Ada Database Environment - subprograms common to other GNADE packages GNADE is a complete database development environment for Ada programmers. It consists of: . a. A Thin binding to the ODBC API. With this API, you can write programs that query any ODBC-compliant database server. . b. A thin binding to SQLite3. . This package contains the development files and static library for the common subprograms. Package: libgnadecommon-dbg Priority: extra Architecture: any Section: debug Depends: libgnadecommon1 (= ${binary:Version}), ${misc:Depends} Suggests: gnat, ada-compiler Description: GNat Ada Database Environment - common debugging symbols GNADE is a complete database development environment for Ada programmers. It consists of: . a. A Thin binding to the ODBC API. With this API, you can write programs that query any ODBC-compliant database server. . b. A thin binding to SQLite3. . This package contains the debugging symbols for the common library. Package: libgnadecommon1 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: GNat Ada Database Environment - common subprograms library GNADE is a complete database development environment for Ada programmers. It consists of: . a. A Thin binding to the ODBC API. With this API, you can write programs that query any ODBC-compliant database server. . b. A thin binding to SQLite3. . This package contains the shared library for the common subprograms. Package: libgnadeodbc2-dev Architecture: any Section: libdevel Depends: gnat, gnat-4.6, ada-compiler, libgnadecommon2-dev (= ${binary:Version}), unixodbc (>= 2.2.11-16), libgnadeodbc2 (= ${binary:Version}), ${misc:Depends} Suggests: libgnadesqlite3-2-dev, libgnadeodbc-dbg Conflicts: gnade-dev, libgnadeodbc-dev Replaces: libgnadeodbc-dev Description: GNat Ada Database Environment - ODBC programming interface GNADE is a complete database development environment for Ada programmers. It consists of: . a. A Thin binding to the ODBC API. With this API, you can write programs that query any ODBC-compliant database server. . b. A thin binding to SQLite3. . This package contains the development files and static library for the ODBC interface. Package: libgnadeodbc-dbg Priority: extra Architecture: any Section: debug Depends: libgnadeodbc2 (= ${binary:Version}), ${misc:Depends} Suggests: gnat, ada-compiler Description: GNat Ada Database Environment - ODBC debugging symbols GNADE is a complete database development environment for Ada programmers. It consists of: . a. A Thin binding to the ODBC API. With this API, you can write programs that query any ODBC-compliant database server. . b. A thin binding to SQLite3. . This package contains the debugging symbols for the ODBC interface. Package: libgnadeodbc2 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: GNat Ada Database Environment - ODBC interface GNADE is a complete database development environment for Ada programmers. It consists of: . a. A Thin binding to the ODBC API. With this API, you can write programs that query any ODBC-compliant database server. . b. A thin binding to SQLite3. . This package contains the shared library for the ODBC interface. Package: libgnadesqlite3-2-dev Architecture: any Depends: gnat, gnat-4.6, ada-compiler, libgnadecommon2-dev (= ${binary:Version}), libsqlite3-dev, libgnadesqlite3-2 (= ${binary:Version}), ${misc:Depends} Section: libdevel Suggests: libgnadesqlite3-dbg Conflicts: libgnadesqlite-dev Replaces: libgnadesqlite-dev Description: GNat Ada Database Environment - SQLite3 programming interface GNADE is a complete database development environment for Ada programmers. It consists of: . a. A Thin binding to the ODBC API. With this API, you can write programs that query any ODBC-compliant database server. . b. A thin binding to SQLite3. . This package contains the development files and static library for the SQLite3 interface. Package: libgnadesqlite3-dbg Priority: extra Architecture: any Depends: libgnadesqlite3-2 (= ${binary:Version}), ${misc:Depends} Section: debug Suggests: gnat, ada-compiler Description: GNat Ada Database Environment - SQLite3 debugging symbols GNADE is a complete database development environment for Ada programmers. It consists of: . a. A Thin binding to the ODBC API. With this API, you can write programs that query any ODBC-compliant database server. . b. A thin binding to SQLite3. . This package contains the debugging symbols for the SQLite3 interface. # when change soversion, also need to change: # libgnadesqlite3-2.lintian-overrides filename Package: libgnadesqlite3-2 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: GNat Ada Database Environment - SQLite3 interface GNADE is a complete database development environment for Ada programmers. It consists of: . a. A Thin binding to the ODBC API. With this API, you can write programs that query any ODBC-compliant database server. . b. A thin binding to SQLite3. . This package contains the shared library for the SQLite3 interface. debian/copyright0000644000000000000000000000155711642146773011144 0ustar Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 Name: gnade Maintainer: Stephen Leake Source: http://gnade.sourceforge.net/ Files: * Copyright: 2000-2006 Jürgen Pfeifer and Michael Erdmann License: GMGPL-2 You are free to distribute this software under the terms of the GNU General Public Licence. On Debian systems, the complete text of the GNU General Public Licence can be found in /usr/share/common-licenses/GPL file. As a special exception, if other files instantiate generics from this unit, or you link this unit with other files to produce an executable, this unit does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License. debian/rules0000755000000000000000000002143111642146773010262 0ustar #!/usr/bin/make -f # Debian Makefile for gnade # Copyright (c) 2009, 2010 Stephen Leake # Copyright (c) 2003-2006 Ludovic Brenta # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA # # To setup for building this package from the latest Debian: # sudo schroot -d `cd ..; pwd` --chroot=unstable -- apt-get build-dep gnade # # To build this package in a chroot: # schroot -d `cd ..; pwd` --chroot=unstable -- dpkg-buildpackage -uc -us # # To run lintian: # 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 # schroot -d `cd ..; pwd` --chroot=unstable -- make -f debian/rules run_test # # To review changes from previous version: # schroot -d `cd ..; pwd` --chroot=unstable -- debdiff .SUFFIXES= # We use gnatmake, not make, for parallel builds. .NOTPARALLEL: CPUS := $(shell getconf _NPROCESSORS_ONLN) # get soversions, aliversions from debian/control common_soversion := $(shell sed -n -e "s/^Package: libgnadecommon\([0123456789]\+\)$$/\1/p" debian/control) odbc_soversion := $(shell sed -n -e "s/^Package: libgnadeodbc\([0123456789]\+\)$$/\1/p" debian/control) sqlite3_soversion := $(shell sed -n -e "s/^Package: libgnadesqlite3-\([0123456789]\+\)$$/\1/p" debian/control) common_aliversion := $(shell sed -n -e "s/^Package: libgnadecommon\(.\+\)-dev$$/\1/p" debian/control) odbc_aliversion := $(shell sed -n -e "s/^Package: libgnadeodbc\(.\+\)-dev$$/\1/p" debian/control) sqlite3_aliversion := $(shell sed -n -e "s/^Package: libgnadesqlite3-\(.\+\)-dev$$/\1/p" debian/control) # Targets mandated by the Debian Policy .PHONY: build build-arch build-indep binary binary-arch binary-indep clean build: build-arch build-indep ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) $(MAKE) -f debian/rules check endif libs := common odbc sqlite3 build-arch: $(addprefix debian/libgnade,$(addsuffix -stamp,$(libs))) build-indep: all_packages := $(foreach l,$(libs), libgnade$(l)-so libgnade$(l)-dev) libgnadeodbc-example libgnadesqlite3-example clean: dh_clean rm -f debian/*-stamp rm -f debian/gnadesqlite3*-dev.README.Debian rm -f debian/gnadeodbc*-dev.README.Debian binary: binary-arch binary-indep: # we ignore the warnings about "dependency on libgnadecommon.so.1 # could be avoided" for libgnadeodbc; see gnade_odbc_build.gpr for # more info. binary-arch: build-arch testroot $(all_packages) dh_shlibdeps -a dh_installdeb -a dh_installdocs -a dh_installchangelogs -a dh_compress -a dh_fixperms -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a # Helper targets .PHONY: testroot testroot: dh_testdir dh_testroot ############################################################################## # Targets that build. 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 debian/tmp/odbc-example-prep GNATPREP_FLAGS=-r -DDEBUG=False -DUNICODE=True -DCALLCONVENTION=C -DLINKOPT=\"-lodbc\" debian/tmp/odbc-prep/%.adb: dbi/odbc/%.gpb | debian/tmp/odbc-prep gnatprep $(GNATPREP_FLAGS) $< $@ # Make the libraries for a package. debian/libgnade%-stamp: gnatmake -p -j$(CPUS) -Pdebian/gnade_$*_build -XLIBTYPE=static -Xsoversion=$($*_soversion) gnatmake -p -j$(CPUS) -Pdebian/gnade_$*_build -XLIBTYPE=dynamic -Xsoversion=$($*_soversion) touch $@ 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 $@ ############################################################################## # Targets that move files into the proper packages # Install a shared object library package libgnadecommon-so: package := libgnadecommon$(common_soversion) libgnadeodbc-so: package := libgnadeodbc$(odbc_soversion) libgnadesqlite3-so: package := libgnadesqlite3-$(sqlite3_soversion) libgnade%-so: debian/libgnade%-stamp dh_installdirs -p$(package) usr/lib dh_install -p$(package) debian/tmp/libgnade$*.so.$($*_soversion) usr/lib dh_strip -p$(package) --dbg-package=libgnade$*-dbg dh_makeshlibs -p$(package) dh_lintian -p$(package) # Install a -dev and -dbg package. libgnadecommon-dev: package := libgnadecommon$(common_aliversion)-dev libgnadeodbc-dev: package := libgnadeodbc$(odbc_aliversion)-dev libgnadesqlite3-dev: package := libgnadesqlite3-$(sqlite3_aliversion)-dev libgnade%-dev: debian/libgnade%-stamp dh_installdirs -p$(package) usr/share/ada/adainclude/gnade$* usr/lib/ada/adalib/gnade$* dh_install -p$(package) debian/tmp/$*-dynamic/*.ali usr/lib/ada/adalib/gnade$* if [ -d dbi/$* ]; then \ dh_install -p$(package) dbi/$*/*.ad[bs] usr/share/ada/adainclude/gnade$* ; \ else \ dh_install -p$(package) support/*.ad[bs] usr/share/ada/adainclude/gnade$* ; \ fi if [ -d debian/tmp/$*-prep ]; then dh_install -p$(package) debian/tmp/$*-prep/*.ad[bs] usr/share/ada/adainclude/gnade$*; fi dh_install -p$(package) debian/tmp/libgnade$*.a /usr/lib 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: 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 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 echo "create user gnade identified by 'gnade'" | mysql -uroot echo "grant all on gnade.* to gnade" | mysql -uroot mysql -ugnade -pgnade < samples/sample_db/gnade.mysql.sql odbcinst -i -d -f debian/odbc_mysql_driver.ini odbcinst -i -s -l -f debian/odbc_mysql_source.ini touch $@ # Running the odbc example requires root privs to set it up, so we # can't run it as part of the package build process. We keep the odbc # target here so we can easily run it while developing the next # release. debian/check-odbc-stamp: debian/libgnadeodbc-stamp debian/odbc-source-stamp debian/tmp/odbc-example-prep/demo.adb gnatmake -p -Pdebian/gnade_odbc_example_build -XLIBTYPE=dynamic export LD_LIBRARY_PATH=`pwd`/debian/tmp; debian/tmp/odbc-example-obj/demo touch $@ debian/tmp/odbc-example-prep/%.adb: samples/odbc/%.gpb | debian/tmp/odbc-example-prep gnatprep -r -DDBSOURCE=\"gnade_mysql\" -DDBUSER=\"gnade\" -DDBPASSWD=\"gnade\" $< $@ debian/check-sqlite3-stamp: debian/libgnadesqlite3-stamp gnatmake -p -Pdebian/gnade_sqlite3_example_build -XLIBTYPE=dynamic export LD_LIBRARY_PATH=`pwd`/debian/tmp; debian/tmp/sqlite3-example-obj/demo debian/tmp/demo.db touch $@ lint: version := $(shell dpkg-parsechangelog | grep "Version: " | sed "s/Version: //") lint: arch := $(shell dpkg-architecture -qDEB_BUILD_ARCH) lint: cd ..; lintian -i gnade_$(version)_$(arch).changes # get debian version (used by test_installed) from debian/changelog export debversion := $(shell dpkg-parsechangelog | sed -r -n -e "s/^Version: [0123456789.]+-([0123456789]+)$$/\1/p") export common_aliversion export odbc_aliversion export sqlite3_aliversion export common_soversion export odbc_soversion export sqlite3_soversion run_test: cd debian; ./test_installed.sh # end of file debian/README.source0000644000000000000000000000452711642146773011370 0ustar The upstream SourceForge repository has switched to svn. However, there are no stable releases from the svn repository yet. The upstream CVS head was not officially released from SourceForge; we call that version 1.6.2 here. gnade_1.6.2.orig.tar.gz was produced manually from a CVS checkout. The SourceForge GNADE distribution uses autotools to create some files. We do not use autotools in the Debian build. We suppress the lintian error for the out-of-date autotools files in the GNADE source in source.lintian-overrides. Many Ada files in GNADE import C structs and functions. Those imports must be manually checked against the corresponding C header files (given in Ada comments) for each soname change in the corresponding C library. This was not done for gnade releases before Debian 1.6.2-2. Nominally, there is one library in the Debian gnade package for each directory in gnade/dbi. However, most of those packages are rejected for one reason or another. Here is the list: adbc This is an early attempt at a higher level abstract database binding. It is not well tested. mysql This code clearly does not match the current C headers for libmysqlclient. oci This is a binding to the Oracle database. Apparently there is a free version of Oracle that can be installed on Debian, but I have simply not tried to do that, so I don't know if this package would work. It contains many C bindings that need to be checked. odbc This is a binding to the industry standard ODBC. Since there is strong incentive for it to not change, we assume the imports are ok. postgres This code uses some very questionable techniques in interfacing to C. sqlite This is obsolete; use sqlite3 instead sqlite3 The SQLite3 API appears to be very stable (and cleanly designed). The C bindings were last checked for sqlite3 version 3.6.17 (Sep 2009). In addition, gnade/esql contains a preprocessor that allows embedding SQL code in Ada code. It generates a lot of warnings from the gnat compiler. In the process of eliminating those warnings, it became clear esql is broken. Therefore we package only odbc and SQLite3. debian/control restricts the version of each C library to a range that should guarantee no C API changes. When the dependency cannot be satisfied, it is time to check the C headers again. debian/gnade_common_build.gpr0000644000000000000000000000212311311534056013502 0ustar project GNADE_Common_Build is Soversion := External ("soversion"); type Lib_Type is ("static", "dynamic"); Libtype : Lib_Type := external ("LIBTYPE"); for Languages use ("Ada"); -- At install time, Source_Dirs must reflect the build source -- directories for Source_Dirs use ("../support"); -- Library_Dir must be a single directory containing all the -- library files (*.ali, *.a, *.so) for all of the gnade packages. for Library_Dir use "tmp"; -- Object_Dir is only used at build time; it must be distinct from -- the other package object directories, and from the library -- directory. for Object_Dir use "tmp/common-" & Libtype; for Library_Name use "gnadecommon"; for Library_Kind use Libtype; -- Library_Version is not used when Library_Kind is "static" for Library_Version use "libgnadecommon.so." & Soversion; package Compiler is for Default_Switches ("Ada") use ("-g", "-O2", "-gnat05", "-gnatfno", "-gnatwa", "-gnatVa"); end Compiler; end GNADE_Common_Build; debian/gnade_common_ref.gpr0000644000000000000000000000200311300351007013143 0ustar -- Copyright (c) 2009 Stephen Leake -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- Used in building the GNADE packages project GNADE_Common_Ref is type Lib_Type is ("static", "dynamic"); Libtype : Lib_Type := external ("LIBTYPE"); for Languages use ("Ada"); for Source_Dirs use ("../support"); for Library_Dir use "tmp"; for Library_ALI_Dir use "tmp/common-" & Libtype; for Library_Name use "gnadecommon"; for Library_Kind use Libtype; for Externally_Built use "true"; end GNADE_Common_Ref; debian/gnade_odbc_build.gpr0000644000000000000000000000325311311534056013126 0ustar with "gnade_common_ref"; project GNADE_ODBC_Build is Soversion := External ("soversion"); type Lib_Type is ("static", "dynamic"); Libtype : Lib_Type := external ("LIBTYPE"); for Languages use ("Ada"); -- We we only need gnu.ads, gnu-db.ads from ../support; the rest -- of the files in ../support go in libgnadecommon, which we don't -- need otherwise. However, if we don't depend on -- gnade_common_ref, there would be two packages installing -- gnu.ads, gnu-db.ads. That's a problem when one package is -- removed without the other. We also need libgnadecommon to -- install gnade.gpr. -- -- So we just ignore the warning from dh_shlibdeps about the -- useless dependency on libgnadecommon. for Source_Dirs use ("../dbi/odbc", "tmp/odbc-prep"); for Library_Dir use "tmp"; for Object_Dir use "tmp/odbc-" & Libtype; for Library_Name use "gnadeodbc"; for Library_Kind use Libtype; -- Library_Version is not used when Library_Kind is "static" for Library_Version use "libgnadeodbc.so." & Soversion; -- We want libgnadeodbc.so to contain a dynamic link to libodbc, -- so dh_shlibdeps will create the correct package dependencies. for Library_Options use ("-lodbc"); package Compiler is Base_Switches := ("-g", "-O2", "-gnat05", "-gnatfno", "-gnatwa", "-gnatVa"); for Default_Switches ("Ada") use Base_Switches; -- This has generic formal subpgrogram parameters that are used -- only in the child packages. for Switches ("gnu-db-sqlcli-generic_attr.ads") use Base_Switches & ("-gnatwU"); end Compiler; end GNADE_ODBC_Build; debian/gnade_odbc_ref.gpr0000644000000000000000000000202711300351206012571 0ustar -- Copyright (c) 2009 Stephen Leake -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- Used in building the non-odbc GNADE packages project GNADE_ODBC_Ref is type Lib_Type is ("static", "dynamic"); Libtype : Lib_Type := external ("LIBTYPE"); for Languages use ("Ada"); for Source_Dirs use ("../dbi/odbc", "tmp/odbc-prep"); for Library_Name use "gnadeodbc"; for Library_Dir use "tmp"; for Library_ALI_Dir use "tmp/odbc-" & Libtype; for Library_Kind use Libtype; for Externally_Built use "true"; end GNADE_ODBC_Ref; debian/gnade_sqlite3_build.gpr0000644000000000000000000000225211311534056013601 0ustar with "gnade_common_ref"; project GNADE_Sqlite3_Build is Soversion := External ("soversion"); type Lib_Type is ("static", "dynamic"); Libtype : Lib_Type := external ("LIBTYPE"); for Languages use ("Ada"); -- libgnadeodbc doesn't need ../support, so could just link it in -- here, rather than creating a separate library package. However, -- then we'd have to decide which package would install gnade.gpr, -- gnu.ads, and gnu-db.ads. for Source_Dirs use ("../dbi/sqlite3"); for Library_Dir use "tmp"; for Object_Dir use "tmp/sqlite3-" & Libtype; for Library_Name use "gnadesqlite3"; for Library_Kind use Libtype; -- Library_Version is not used when Library_Kind is "static" for Library_Version use "libgnadesqlite3.so." & Soversion; -- We want libgnadesqlite3.so to contain a dynamic link to libsqlite3, -- so dh_shlibdeps will create the correct package dependencies. for Library_Options use ("-lsqlite3"); package Compiler is for Default_Switches ("Ada") use ("-g", "-O2", "-gnat05", "-gnatfno", "-gnatwa", "-gnatVa"); end Compiler; end GNADE_Sqlite3_Build; debian/gnade_odbc_example_build.gpr0000644000000000000000000000123011311534056014632 0ustar with "gnade_odbc_ref"; project GNADE_ODBC_Example_Build is for Languages use ("Ada"); for Source_Dirs use ("tmp/odbc-example-prep"); for Object_Dir use "tmp/odbc-example-obj"; for Main use ("demo.adb"); package Compiler is Base_Switches := ("-g", "-O2", "-gnat05", "-gnatfno", "-gnatwa", "-gnatVa"); for Default_Switches ("Ada") use Base_Switches; end Compiler; -- Note that we don't need any linker options here; 'with -- gnadeodbc_ref' pulls in libgnadeodbc.so, and a 'pragma -- Linker_Options' in gnu.db.sqlcli pulls in libodbc. end GNADE_ODBC_Example_Build; debian/patches/0000755000000000000000000000000011642146773010630 5ustar debian/patches/bug-538643.patch0000644000000000000000000001552511642146773013210 0ustar Description: In *Binding, check size of object, not size of type. Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538643 Forwarded: http://sf.net/tracker/?func=detail&aid=1875874&group_id=23045&atid=377333 Reviewed-by: Stephen Leake Index: gnade-1.6.2/dbi/odbc/gnu-db-sqlcli.gpb =================================================================== --- gnade-1.6.2.orig/dbi/odbc/gnu-db-sqlcli.gpb 2009-09-07 08:20:52.000000000 -0400 +++ gnade-1.6.2/dbi/odbc/gnu-db-sqlcli.gpb 2009-09-07 08:21:32.000000000 -0400 @@ -831,14 +831,15 @@ return SQLRETURN; pragma Import ($CALLCONVENTION, BindCol, "SQLBindCol"); DT : SQL_C_DATA_TYPE; + Size : constant Positive := TargetValue.all'Size; begin - if Int'Size = SQLTINYINT'Size then + if Size = SQLTINYINT'Size then DT := SQL_C_TINYINT; - elsif Int'Size = SQLSMALLINT'Size then + elsif Size = SQLSMALLINT'Size then DT := SQL_C_SHORT; - elsif Int'Size = SQLINTEGER'Size then + elsif Size = SQLINTEGER'Size then DT := SQL_C_LONG; - elsif Int'Size = SQLBIGINT'Size then + elsif Size = SQLBIGINT'Size then DT := SQL_C_SBIGINT; else raise Constraint_Error; @@ -847,7 +848,7 @@ ColumnNumber, DT, TargetValue, - SQLINTEGER (Int'Size / 8), + SQLINTEGER (Size / 8), IndPtr); end SQLBindCol; @@ -877,20 +878,21 @@ C_DataType : SQL_C_DATA_TYPE; SQL_DataType : SQL_DATA_TYPE; ColumnSize : SQLUINTEGER; + Size : constant Positive := Value.all'Size; begin - if Int'Size = SQLTINYINT'Size then + if Size = SQLTINYINT'Size then C_DataType := SQL_C_TINYINT; SQL_DataType := SQL_TINYINT; ColumnSize := 3; - elsif Int'Size = SQLSMALLINT'Size then + elsif Size = SQLSMALLINT'Size then C_DataType := SQL_C_SHORT; SQL_DataType := SQL_SMALLINT; ColumnSize := 5; - elsif Int'Size = SQLINTEGER'Size then + elsif Size = SQLINTEGER'Size then C_DataType := SQL_C_LONG; SQL_DataType := SQL_INTEGER; ColumnSize := 10; - elsif Int'Size = SQLBIGINT'Size then + elsif Size = SQLBIGINT'Size then C_DataType := SQL_C_SBIGINT; SQL_DataType := SQL_BIGINT; ColumnSize := 19; @@ -944,14 +946,15 @@ return SQLRETURN; pragma Import ($CALLCONVENTION, BindCol, "SQLBindCol"); DT : SQL_C_DATA_TYPE; + Size : constant Positive := TargetValue.all'Size; begin - if Unsigned'Size = SQLTINYINT'Size then + if Size = SQLTINYINT'Size then DT := SQL_C_UTINYINT; - elsif Unsigned'Size = SQLSMALLINT'Size then + elsif Size = SQLSMALLINT'Size then DT := SQL_C_USHORT; - elsif Unsigned'Size = SQLINTEGER'Size then + elsif Size = SQLINTEGER'Size then DT := SQL_C_ULONG; - elsif Unsigned'Size = SQLBIGINT'Size then + elsif Size = SQLBIGINT'Size then DT := SQL_C_UBIGINT; else raise Constraint_Error; @@ -960,7 +963,7 @@ ColumnNumber, DT, TargetValue, - SQLINTEGER (Unsigned'Size / 8), + SQLINTEGER (Size / 8), IndPtr); end SQLBindCol; @@ -992,20 +995,21 @@ C_DataType : SQL_C_DATA_TYPE; SQL_DataType : SQL_DATA_TYPE; ColumnSize : SQLUINTEGER; + Size : constant Positive := Value.all'Size; begin - if Unsigned'Size = SQLTINYINT'Size then + if Size = SQLTINYINT'Size then C_DataType := SQL_C_UTINYINT; SQL_DataType := SQL_TINYINT; ColumnSize := 3; - elsif Unsigned'Size = SQLSMALLINT'Size then + elsif Size = SQLSMALLINT'Size then C_DataType := SQL_C_USHORT; SQL_DataType := SQL_SMALLINT; ColumnSize := 5; - elsif Unsigned'Size = SQLINTEGER'Size then + elsif Size = SQLINTEGER'Size then C_DataType := SQL_C_ULONG; SQL_DataType := SQL_INTEGER; ColumnSize := 10; - elsif Unsigned'Size = SQLBIGINT'Size then + elsif Size = SQLBIGINT'Size then C_DataType := SQL_C_UBIGINT; SQL_DataType := SQL_BIGINT; ColumnSize := 20; @@ -1155,14 +1159,15 @@ return SQLRETURN; pragma Import ($CALLCONVENTION, BindCol, "SQLBindCol"); DT : SQL_C_DATA_TYPE; + Size : constant Positive := TargetValue.all'Size; begin - if Enum'Size = SQLTINYINT'Size then + if Size = SQLTINYINT'Size then DT := SQL_C_TINYINT; - elsif Enum'Size = SQLSMALLINT'Size then + elsif Size = SQLSMALLINT'Size then DT := SQL_C_SHORT; - elsif Enum'Size = SQLINTEGER'Size then + elsif Size = SQLINTEGER'Size then DT := SQL_C_LONG; - elsif Enum'Size = SQLBIGINT'Size then + elsif Size = SQLBIGINT'Size then DT := SQL_C_SBIGINT; else raise Constraint_Error; @@ -1171,7 +1176,7 @@ ColumnNumber, DT, TargetValue, - SQLINTEGER (Enum'Size / 8), + SQLINTEGER (Size / 8), IndPtr); end SQLBindCol; @@ -1201,20 +1206,21 @@ C_DataType : SQL_C_DATA_TYPE; SQL_DataType : SQL_DATA_TYPE; ColumnSize : SQLUINTEGER; + Size : constant Positive := Value.all'Size; begin - if Enum'Size = SQLTINYINT'Size then + if Size = SQLTINYINT'Size then C_DataType := SQL_C_UTINYINT; SQL_DataType := SQL_TINYINT; ColumnSize := 3; - elsif Enum'Size = SQLSMALLINT'Size then + elsif Size = SQLSMALLINT'Size then C_DataType := SQL_C_USHORT; SQL_DataType := SQL_SMALLINT; ColumnSize := 5; - elsif Enum'Size = SQLINTEGER'Size then + elsif Size = SQLINTEGER'Size then C_DataType := SQL_C_ULONG; SQL_DataType := SQL_INTEGER; ColumnSize := 10; - elsif Enum'Size = SQLBIGINT'Size then + elsif Size = SQLBIGINT'Size then C_DataType := SQL_C_UBIGINT; SQL_DataType := SQL_BIGINT; ColumnSize := 20; debian/patches/series0000644000000000000000000000004611271673066012043 0ustar bug-538643.patch demo_warnings.patch debian/patches/demo_warnings.patch0000644000000000000000000003027511642146773014514 0ustar Description: Fix compiler warnings in demo code. . Improve odbc demo output format. . Improve sqlite3 demo. Author: Stephen Leake Index: gnade-1.6.2/samples/odbc/demo.gpb =================================================================== --- gnade-1.6.2.orig/samples/odbc/demo.gpb 2009-10-05 02:20:57.000000000 -0400 +++ gnade-1.6.2/samples/odbc/demo.gpb 2009-10-05 02:21:00.000000000 -0400 @@ -37,7 +37,6 @@ with Ada.Command_Line; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Text_IO; use Ada.Text_IO; -with Ada.Exceptions; use Ada.Exceptions; with GNU.DB.SQLCLI; use GNU.DB.SQLCLI; with GNU.DB.SQLCLI.Bind; @@ -72,9 +71,9 @@ EnvironmentHandle : SQLHENV; ConnectionHandle : SQLHDBC; - ServerName : String := String'($DBSOURCE); - UserName : String := String'($DBUSER); - Authentication : String := String'($DBPASSWD); + ServerName : constant String := String'($DBSOURCE); + UserName : constant String := String'($DBUSER); + Authentication : constant String := String'($DBPASSWD); Quoting_Character : Character := Character'Val (34); @@ -178,7 +177,9 @@ end if; if Do_All or else Do_Dump_Sources then + Header ("ODBC Data Sources"); Dump_Sources; + Header; end if; SQLAllocHandle (SQL_HANDLE_DBC, EnvironmentHandle, ConnectionHandle); @@ -285,7 +286,7 @@ SQLFreeHandle (SQL_HANDLE_ENV, EnvironmentHandle); #if addr2lines'Defined then - + exception when Event : others => declare Index: gnade-1.6.2/samples/sample_db/gnade.mysql.sql =================================================================== --- gnade-1.6.2.orig/samples/sample_db/gnade.mysql.sql 2009-10-05 02:20:57.000000000 -0400 +++ gnade-1.6.2/samples/sample_db/gnade.mysql.sql 2009-10-05 03:07:58.000000000 -0400 @@ -4,7 +4,7 @@ -- -- -- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/gnade.mysql.sql,v $ -- Description : Makefile for the PostgreSQL sample database --- Author : Michael Erdmann +-- Author : Michael Erdmann -- Created On : 02-April-2001 -- Last Modified By: $Author: merdmann $ -- Last Modified On: $Date: 2002/01/23 20:07:01 $ @@ -38,23 +38,24 @@ -- GNADE is implemented to work with GNAT, the GNU Ada compiler. -- -- -- -- ---------------------------------------------------------------------------- --- Functional Description --- ====================== --- This SQL Script generates the test data base as it is used by --- the code in the ./samples directory. The demo user has username="gnade" --- and password="gnade". --- --- --- Restrictions --- ============ +-- Functional Description +-- ====================== +-- This SQL Script generates the test data base as it is used by +-- the code in the ./samples directory. The demo user has username="gnade" +-- and password="gnade". +-- +-- +-- Restrictions +-- ============ -- This script is intended for use with MySQL. --- --- References --- ========== --- +-- +-- References +-- ========== +-- --- build the test data base and store some tupples in it +-- build the test data base and store some tupples in it +use gnade; CREATE TABLE EMPLOYEES ( empno int4 NOT NULL, @@ -72,49 +73,49 @@ deptno int4 NOT NULL, name character(20) NOT NULL, location character(20) -); +); ---- Testdata -insert into EMPLOYEES values -( 1, 'Erdmann', 'Michael', 1001, '1999-12-31', 2, 'Coding Monkey', 'T', 200.1234 ); -insert into EMPLOYEES values -( 2, 'Massalski', 'Marina', 1000, '2000-01-09', null, 'Supervisor', 'F', 200.00 ); -insert into EMPLOYEES values -( 3, 'Tully', 'Noel', 1001, '1959-01-23', 2, 'Supervisor', 'T', 200.00 ); -insert into EMPLOYEES values -( 4, 'Pfeifer', 'Jürgen', 1001, '2001-01-01', 2, 'Designer', 'T', 200.00 ); -insert into EMPLOYEES values -( 5, 'Smith', 'John', 1000, '1980-06-11', 3, 'Coding Monkey', 'T', 250.00 ); -insert into EMPLOYEES values -( 6, 'Smith', 'John', 1001, '1972-06-11', 3, 'Designer', 'T', 820.00 ); -insert into EMPLOYEES values -( 50, 'Simpson', 'Bud', 1003, '1980-06-11', 3, 'Clerk', 'F', 20.00 ); -insert into EMPLOYEES values -( 51, 'Bundy', 'Al', 1003, '1980-06-11', 3, 'Clerk', 'F', 10.00 ); -insert into EMPLOYEES values -( 52, 'Bundy', 'Peggy', 1003, '1988-06-15', 3, null, 'F', -10.00 ); -insert into EMPLOYEES values -( 53, 'Simpson', 'Kelly', 1003, '1995-09-11', 3, 'Secretary', 'F', 20.00 ); -insert into EMPLOYEES values -(500, 'Rutherford', 'Ernest', 2000, '1930-05-30', 3, 'Genius', 'T',1200.00 ); -insert into EMPLOYEES values -(501, 'Fermi', null, 2000, '1940-07-29', 3, 'Genius', 'T',1200.00 ); -insert into EMPLOYEES values -(502, 'Einstein', 'Albert', 2000, '1941-04-30', 2, 'Genius', 'T',1200.00 ); -insert into EMPLOYEES values -(503, 'Fermi', null, 2000, '1020-08-15', 2, 'Genius', 'T',1200.99 ); +-- Testdata +insert into EMPLOYEES values +( 1, 'Erdmann', 'Michael', 1001, '1999-12-31', 2, 'Coding Monkey', 1, 200.1234 ); +insert into EMPLOYEES values +( 2, 'Massalski', 'Marina', 1000, '2000-01-09', null, 'Supervisor', 0, 200.00 ); +insert into EMPLOYEES values +( 3, 'Tully', 'Noel', 1001, '1959-01-23', 2, 'Supervisor', 1, 200.00 ); +insert into EMPLOYEES values +( 4, 'Pfeifer', 'Jürgen', 1001, '2001-01-01', 2, 'Designer', 1, 200.00 ); +insert into EMPLOYEES values +( 5, 'Smith', 'John', 1000, '1980-06-11', 3, 'Coding Monkey', 1, 250.00 ); +insert into EMPLOYEES values +( 6, 'Smith', 'John', 1001, '1972-06-11', 3, 'Designer', 1, 820.00 ); +insert into EMPLOYEES values +( 50, 'Simpson', 'Bud', 1003, '1980-06-11', 3, 'Clerk', 0, 20.00 ); +insert into EMPLOYEES values +( 51, 'Bundy', 'Al', 1003, '1980-06-11', 3, 'Clerk', 0, 10.00 ); +insert into EMPLOYEES values +( 52, 'Bundy', 'Peggy', 1003, '1988-06-15', 3, null, 0, -10.00 ); +insert into EMPLOYEES values +( 53, 'Simpson', 'Kelly', 1003, '1995-09-11', 3, 'Secretary', 0, 20.00 ); +insert into EMPLOYEES values +(500, 'Rutherford', 'Ernest', 2000, '1930-05-30', 3, 'Genius', 1, 1200.00 ); +insert into EMPLOYEES values +(501, 'Fermi', null, 2000, '1940-07-29', 3, 'Genius', 1, 1200.00 ); +insert into EMPLOYEES values +(502, 'Einstein', 'Albert', 2000, '1941-04-30', 2, 'Genius', 1, 1200.00 ); +insert into EMPLOYEES values +(503, 'Fermi', null, 2000, '1020-08-15', 2, 'Genius', 1, 1200.99 ); -insert into DEPARTMENTS +insert into DEPARTMENTS values( 1001, 'Sales', 'Berlin' ); -insert into DEPARTMENTS +insert into DEPARTMENTS values( 1000, 'Developement', 'Stuttgart' ); -insert into DEPARTMENTS +insert into DEPARTMENTS values( 1002, 'CM and Production', 'Bonn' ); -insert into DEPARTMENTS +insert into DEPARTMENTS values( 1003, 'Support', 'Chicago' ); -insert into DEPARTMENTS - values( 2000, 'Masterminds', null ); +insert into DEPARTMENTS + values( 2000, 'Masterminds', null ); CREATE TABLE LOCATIONS ( @@ -123,14 +124,14 @@ STREET VARCHAR(80), NO CHARACTER(5), ZIPCODE INT -) ; +) ; insert into LOCATIONS - values( 'Berlin', 'Berlin','Siemensdamm', '50a', 10243 ); + values( 'Berlin', 'Berlin','Siemensdamm', '50a', 10243 ); insert into LOCATIONS - values( 'Bonn', 'Bonn','Oberkasselerstrasse', '8', 47112 ); + values( 'Bonn', 'Bonn','Oberkasselerstrasse', '8', 47112 ); insert into LOCATIONS - values( 'Stuttgart', 'Stuttgart','Lorenzweg', '1', 60001 ); + values( 'Stuttgart', 'Stuttgart','Lorenzweg', '1', 60001 ); insert into LOCATIONS - values( 'Chicage', 'Chicago','Bundy Stree', '9996', 70001 ); + values( 'Chicage', 'Chicago','Bundy Stree', '9996', 70001 ); Index: gnade-1.6.2/samples/sqlite3/demo.adb =================================================================== --- gnade-1.6.2.orig/samples/sqlite3/demo.adb 2009-10-05 02:20:57.000000000 -0400 +++ gnade-1.6.2/samples/sqlite3/demo.adb 2009-10-05 03:21:45.000000000 -0400 @@ -1,18 +1,26 @@ -with Ada.Text_IO; use Ada.Text_IO; - -with GNU.DB.SQLite3; use GNU.DB.SQLite3; - +with Ada.Command_Line; use Ada.Command_Line; +with Ada.Directories; +with Ada.Text_IO; use Ada.Text_IO; +with GNU.DB.SQLite3; use GNU.DB.SQLite3; +with GNU.DB.Support.String_Tables; +with GNU.DB.Support.String_Vectors; procedure Demo is - --Version : constant String := "$Id: demo.adb,v 1.2 2007/08/24 21:22:42 persan Exp $"; + use GNU.DB.Support; function List (Argc : Integer; Argv : String_Vectors.Vector; ColumnNames : String_Vectors.Vector) - return Return_Value is - begin - for I in Natural'(0) .. Natural (Argc - 1) loop + return Return_Value; + + function List + (Argc : Integer; + Argv : String_Vectors.Vector; + ColumnNames : String_Vectors.Vector) + return Return_Value + is begin + for I in Natural'(0) .. Natural (Argc) loop Put_Line (ColumnNames.Element (I) & ": " & Argv.Element (I)); end loop; @@ -21,14 +29,38 @@ Db : aliased GNU.DB.SQLite3.Object; - Table : Table_Reference := new String_Tables.Vector; - Result : Return_Value; - pragma Warnings (Off, Table); - pragma Warnings (Off, Result); -begin - Put_Line ("Opening the file example.db"); + Table : constant Table_Reference := new String_Tables.Vector; + Row_Cur : String_Tables.Cursor; + Col_Cur : String_Vectors.Cursor; + + Result : Return_Value; + + procedure Recreate_Db (File_Name : in String); + procedure Recreate_Db (File_Name : in String) + is + use Ada.Directories; + begin + if Exists (File_Name) then + Delete_File (File_Name); + end if; + + Put_Line ("Opening database " & File_Name); + Result := Db.Open (File_Name); + end Recreate_Db; - Result := Db.Open ("demo.db"); + use type String_Tables.Cursor; +begin + if Argument_Count = 0 then + Recreate_Db ("demo.db"); + else + Recreate_Db (Argument (1)); + end if; + + if Result /= SQLITE_OK then + Put_Line ("error opening database"); + Set_Exit_Status (Failure); + return; + end if; Put_Line ("Create a table called DEMO with fields bla, ble and blo"); @@ -36,7 +68,7 @@ Db.Exec ("CREATE TABLE tare(Name String, Time Float, Data BLOB);"); New_Line; - Put_Line ("Insert 10 rows with (100, 200, 300)"); + Put_Line ("Insert 10 rows with (, 200, 300)"); for I in 1 .. 10 loop Db.Exec ("INSERT INTO demo VALUES(" & I'Img & ", 200, 300);"); @@ -50,23 +82,30 @@ Result := Db.Get_Table ("SELECT * FROM demo;", Table); - --- for I in Table.Table'Range loop --- for J in Table.Table (I)'Range loop --- Put (To_String (Table.Table (I) (J))); --- Put (" "); --- end loop; --- --- New_Line; --- end loop; + Row_Cur := Table.First; + loop + exit when Row_Cur = String_Tables.No_Element; + declare + Row : String_Vectors.Vector renames + Table.Element (String_Tables.To_Index (Row_Cur)); + use type String_Vectors.Cursor; + begin + Col_Cur := String_Vectors.First (Row); + loop + exit when Col_Cur = String_Vectors.No_Element; + Put (Row.Element (String_Vectors.To_Index (Col_Cur))); + Put (", "); + String_Vectors.Next (Col_Cur); + end loop; + end; + New_Line; + String_Tables.Next (Row_Cur); + end loop; New_Line; - Put_Line ("2: Using exec_with_callback"); + Put_Line ("2: Using exec_with_callback; bla > 4"); Db.Exec ("SELECT * FROM demo where bla > 4;", List'Unrestricted_Access); New_Line; - Put_Line ("Drop table DEMO"); - - Result := Db.Exec ("DROP TABLE demo;"); Db.Close; end Demo; debian/gnade_sqlite3_example_build.gpr0000644000000000000000000000102611311534056015312 0ustar with "gnade_common_ref"; with "gnade_sqlite3_ref"; project GNADE_Sqlite3_Example_Build is for Languages use ("Ada"); for Source_Dirs use ("../samples/sqlite3"); for Object_Dir use "tmp/sqlite3-example-obj"; for Main use ("demo.adb"); package Compiler is Base_Switches := ("-g", "-O2", "-gnat05", "-gnaty", "-gnatfno", "-gnatwa", "-gnatVa"); for Default_Switches ("Ada") use Base_Switches; end Compiler; end GNADE_Sqlite3_Example_Build; debian/gnade_sqlite3_ref.gpr0000644000000000000000000000201211300351235013242 0ustar -- Copyright (c) 2009 Stephen Leake -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- Used in building the sqlite3 demo project GNADE_Sqlite3_Ref is type Lib_Type is ("static", "dynamic"); Libtype : Lib_Type := external ("LIBTYPE"); for Languages use ("Ada"); for Source_Dirs use ("../dbi/sqlite3"); for Library_Name use "gnadesqlite3"; for Library_Dir use "tmp"; for Library_ALI_Dir use "tmp/sqlite3-" & Libtype; for Library_Kind use Libtype; for Externally_Built use "true"; end GNADE_Sqlite3_Ref; debian/odbc_mysql_driver.ini0000644000000000000000000000024011262724031013370 0ustar [MySQL] Description = MySQL driver for Linux Driver = /usr/lib/odbc/libmyodbc.so Setup = /usr/lib/odbc/libodbcmyS.so FileUsage = 1 debian/odbc_mysql_source.ini0000644000000000000000000000037011262724031013401 0ustar [gnade_mysql] Description = Test GNADE/MySQL connection Driver = MySQL Trace = No TraceFile = Database = gnade Server = localhost Port = 3306 Socket = debian/source.lintian-overrides0000644000000000000000000000023011270543564014050 0ustar gnade source: ancient-autotools-helper-file autoconf/config.guess 2001-09-04 gnade source: ancient-autotools-helper-file autoconf/config.sub 2001-09-07 debian/stamp-patched0000644000000000000000000000000011402531645011632 0ustar debian/gnade_sqlite3_example_installed.gpr0000644000000000000000000000112411311534056016171 0ustar -- Build the sqlite3 example with the installed libraries with "gnadecommon"; with "gnadesqlite3"; project GNADE_Sqlite3_Example_Installed is for Languages use ("Ada"); for Source_Dirs use ("tmp/sqlite3-example-src"); for Object_Dir use "tmp/sqlite3-example-obj"; for Main use ("demo.adb"); package Compiler is Base_Switches := ("-g", "-O2", "-gnat05", "-gnaty", "-gnatfno", "-gnatwa", "-gnatVa"); for Default_Switches ("Ada") use Base_Switches; end Compiler; end GNADE_Sqlite3_Example_Installed; debian/source/0000755000000000000000000000000011642146772010500 5ustar debian/source/format0000644000000000000000000000001411642146772011706 0ustar 3.0 (quilt) debian/gnadecommon.gpr0000644000000000000000000000212011275235713012170 0ustar -- GNADE project file for use with GNAT -- Copyright (c) 2009 Stephen Leake -- Copyright (c) 2003-2009 Ludovic Brenta -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- This project file is only used by gnadeodbc and gnadesqlite3; it -- is not useful on its own. project GNADECommon is for Library_Name use "gnadecommon"; for Library_Dir use "/usr/lib"; for Library_Kind use "dynamic"; for Source_Dirs use ("/usr/share/ada/adainclude/gnadecommon"); for Library_ALI_Dir use "/usr/lib/ada/adalib/gnadecommon"; for Externally_Built use "true"; end GNADECommon; debian/gnadeodbc.gpr0000644000000000000000000000250211275235713011613 0ustar -- GNADE project file for use with GNAT -- Copyright (c) 2009 Stephen Leake -- Copyright (c) 2003-2009 Ludovic Brenta -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- This project file is designed to help build applications that use -- the ODBC binding of GNADE, the GNU Ada Database Environment. Here -- is an example of how to use this project file: -- -- with "gnadeodbc"; -- project Example is -- for Object_Dir use "obj"; -- for Exec_Dir use "."; -- for Main use ("example"); -- end Example; project GNADEODBC is for Library_Name use "gnadeodbc"; for Library_Dir use "/usr/lib"; for Library_Kind use "dynamic"; for Source_Dirs use ("/usr/share/ada/adainclude/gnadeodbc"); for Library_ALI_Dir use "/usr/lib/ada/adalib/gnadeodbc"; for Externally_Built use "true"; end GNADEODBC; debian/gnadesqlite3.gpr0000644000000000000000000000252711275235713012277 0ustar -- GNADE project file for use with GNAT -- Copyright (c) 2009 Stephen Leake -- Copyright (c) 2003-2009 Ludovic Brenta -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- This project file is designed to help build applications that use -- the SQLite3 binding of GNADE, the GNU Ada Database Environment. -- Here is an example of how to use this project file: -- -- with "gnadesqlite3"; -- project Example is -- for Object_Dir use "obj"; -- for Exec_Dir use "."; -- for Main use ("example"); -- end Example; project GNADESQLite3 is for Library_Name use "gnadesqlite3"; for Library_Dir use "/usr/lib"; for Library_Kind use "dynamic"; for Source_Dirs use ("/usr/share/ada/adainclude/gnadesqlite3"); for Library_ALI_Dir use "/usr/lib/ada/adalib/gnadesqlite3"; for Externally_Built use "true"; end GNADESQLite3; debian/libgnadesqlite3-2.lintian-overrides0000644000000000000000000000012311275235713015761 0ustar libgnadesqlite3-2 binary: shlib-with-executable-stack usr/lib/libgnadesqlite3.so.2 debian/gnade_odbc_example_installed.gpr0000644000000000000000000000124611311534056015521 0ustar -- Build the odbc example with the installed libraries with "gnadecommon"; with "gnadeodbc"; project GNADE_ODBC_Example_Installed is for Languages use ("Ada"); for Source_Dirs use ("tmp/odbc-example-src"); for Object_Dir use "tmp/odbc-example-obj"; for Main use ("demo.adb"); package Compiler is Base_Switches := ("-g", "-O2", "-gnat05", "-gnatfno", "-gnatwa", "-gnatVa"); for Default_Switches ("Ada") use Base_Switches; end Compiler; -- Note that we don't need any linker options here; 'with -- gnadeodbc' pulls in libgnadeodbc.so and libodbc. end GNADE_ODBC_Example_Installed; debian/gnadecommon2-dev.README.Debian0000644000000000000000000000234311275235713014363 0ustar gnade for Debian ---------------- There are three gnade packages; gnadecommon, gnadeodbc, and gnadesqlite3. The binary library packages have a shared object version appended to the package name; the development packages have an ali version appended to the package name; see http://people.debian.org/~lbrenta/debian-ada-policy.html for more information on these version numbers. gnadecommon is used by gnadeodbc and gnadesqlite3; it is not useful on its own. The Ada specifications and bodies are in the directories /usr/share/ada/adainclude/gnadecommon, gnadeodbc, gnadesqlite3. The Ada Library Information (*.ali) files are in the directories /usr/lib/ada/adalib/gnadecommon, gnadeodbc, gnadesqlite3. The static libraries with debugging symbols and the stripped shared libraries are in /usr/lib. There is a GNAT project file for each library in /usr/share/ada/adainclude/gnadecommon.gpr, gnadeodbc.gpr, gnadesqlite.gpr; they contains usage instructions. To use GNADE in your Ada programs, write a GNAT project file for your project, and "with" either gnadeodbc or gnadesqlite3 (or both). See the usage instructions inside the *.gpr files for more details. -- Stephen Leake , Wed, 4 Nov 2009 03:56:35 -0500 debian/test_installed.sh0000755000000000000000000000366011642146773012563 0ustar #!/bin/bash # # install gnade packages (normally in the chroot that just built it), # and run examples using installed libraries. # usage (as root, not yet in chroot): # cd gnade-/debian # /etc/init.d/mysql stop # schroot ./test_installed.sh # This re-installs the latest version. sudo dpkg --install ../../libgnadecommon${common_soversion}_1.6.2-${debversion}_i386.deb sudo dpkg --install ../../libgnadeodbc${odbc_soversion}_1.6.2-${debversion}_i386.deb sudo dpkg --install ../../libgnadesqlite3-${sqlite3_soversion}_1.6.2-${debversion}_i386.deb sudo dpkg --install ../../libgnadecommon${common_aliversion}-dev_1.6.2-${debversion}_i386.deb sudo dpkg --install ../../libgnadeodbc${odbc_aliversion}-dev_1.6.2-${debversion}_i386.deb sudo dpkg --install ../../libgnadesqlite3-${sqlite3_aliversion}-dev_1.6.2-${debversion}_i386.deb # tmp is owned by root; we need write permission sudo chmod -R o+w tmp rm -rf tmp/odbc-example-obj rm -rf tmp/sqlite3-example-obj if [ ! -d tmp/odbc-example-src ]; then mkdir tmp/odbc-example-src; fi if [ ! -d tmp/sqlite3-example-src ]; then mkdir tmp/sqlite3-example-src; fi gunzip -c /usr/share/doc/libgnadeodbc${odbc_aliversion}-dev/examples/demo.adb.gz > tmp/odbc-example-src/demo.adb cp /usr/share/doc/libgnadesqlite3-${sqlite3_aliversion}-dev/examples/demo.adb tmp/sqlite3-example-src gnatmake -p -Pgnade_odbc_example_installed gnatmake -p -Pgnade_sqlite3_example_installed if [ ! -f odbc-sqladmin-stamp ]; then /etc/init.d/mysql start; mysqladmin -uroot create gnade; echo "create user gnade identified by 'gnade'" | mysql -uroot; echo "grant all on gnade.* to gnade" | mysql -uroot; mysql -ugnade -pgnade < ../samples/sample_db/gnade.mysql.sql; odbcinst -i -d -f odbc_mysql_driver.ini; odbcinst -i -s -l -f odbc_mysql_source.ini; touch odbc-sqladmin-stamp fi tmp/odbc-example-obj/demo # this creates 'demo.db' in current directory cd tmp; sqlite3-example-obj/demo # end of file