X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=debian%2Frules;h=e934d0a43290750cf7395b8a8f0ecdf11cb4bed3;hb=21cd6d665b303f493eab5bb9d71e198d704e914d;hp=f72fb51fe4dea95c177fcbf0c89255b931963918;hpb=c86ceae4227949bc6a43469d265fbac3d7355d4e;p=clsql.git diff --git a/debian/rules b/debian/rules index f72fb51..e934d0a 100755 --- a/debian/rules +++ b/debian/rules @@ -6,26 +6,66 @@ export DH_VERBOSE=1 # This is the debhelper compatibility version to use. -export DH_COMPAT=3 - -pkg := cl-sql -prefix := debian/$(pkg) +export DH_COMPAT=4 + +plain-pkg := clsql + +pkg := cl-sql +pkg-base := cl-sql-base +pkg-mysql := cl-sql-mysql +pkg-pg := cl-sql-postgresql +pkg-pg-socket := cl-sql-postgresql-socket +pkg-aodbc := cl-sql-aodbc +all-pkgs := $(pkg) $(pkg-base) $(pkg-mysql) $(pkg-pg) $(pkg-pg-socket) $(pkg-aodbc) + +prefix := debian/$(pkg) +prefix-base := debian/$(pkg-base) +prefix-mysql := debian/$(pkg-mysql) +prefix-pg := debian/$(pkg-pg) +prefix-pg-socket := debian/$(pkg-pg-socket) +prefix-aodbc := debian/$(pkg-aodbc) + +UPSTREAM_VER := $(shell sed -n -e "s/${pkg} (\(.*\)-[0-9.]).*/\1/p" < debian/changelog |head -1) + +## Lisp sources +srcs := $(wildcard sql/*.cl) +srcs-base := $(wildcard base/*.cl) +srcs-base-uffi := $(wildcard interfaces/clsql-uffi/*.cl) +srcs-base-uffi-so:= $(wildcard interfaces/clsql-uffi/*.so) +srcs-mysql := $(wildcard interfaces/mysql/*.cl) +srcs-mysql-so := $(wildcard interfaces/mysql/*.so) +srcs-pg := $(wildcard interfaces/postgresql/*.cl) +srcs-pg-socket := $(wildcard interfaces/postgresql-socket/*.cl) +srcs-aodbc := $(wildcard interfaces/aodbc/*.cl) INSTALL := install INSTALLFLAGS := -g root -o root -m 0644 +INSTALLEXECFLAGS := -g root -o root -m 0755 INSTALLDIRFLAGS := -d -g root -o root -m 0755 -SOURCEDIR := $(prefix)/usr/share/common-lisp/source -REPOSITORYDIR := $(prefix)/usr/share/common-lisp/repositories/clsql -SYSDIR := $(prefix)/usr/share/common-lisp/systems -DOCDIR := $(prefix)/usr/share/doc/cl-sql +clc-base := usr/share/common-lisp +clc-source := $(clc-base)/source +clc-systems := $(clc-base)/systems +doc-dir := $(prefix-base)/usr/share/doc/cl-sql + +clc-clsql := $(clc-source)/$(plain-pkg)-$(UPSTREAM_VER) + +lispdir := $(prefix)/$(clc-clsql) +lispdir-sql := $(prefix)/$(clc-clsql)/sql +lispdir-base := $(prefix-base)/$(clc-clsql)/base +lispdir-base-uffi := $(prefix-base)/$(clc-clsql)/interfaces/clsql-uffi +sodir-base-uffi := $(prefix-base)/usr/lib/clsql +lispdir-mysql := $(prefix-mysql)/$(clc-clsql)/interfaces/mysql +sodir-mysql := $(prefix-mysql)/usr/lib/clsql +lispdir-pg := $(prefix-pg)/$(clc-clsql)/interfaces/postgresql +lispdir-pg-socket := $(prefix-pg-socket)/$(clc-clsql)/interfaces/postgresql-socket +lispdir-aodbc := $(prefix-aodbc)/$(clc-clsql)/interfaces/aodbc configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. - touch configure-stamp @@ -33,41 +73,77 @@ build: build-stamp build-stamp: configure-stamp dh_testdir - - # Add here commands to compile the package. - $(MAKE) doc - #/usr/bin/docbook-to-man debian/clsql.sgml > cl-sql.1 - + # Compile helper libraries + $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp - # Add here commands to clean up after the build process. - -$(MAKE) clean - + $(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/cl-sql. - $(INSTALL) $(INSTALLDIRFLAGS) $(REPOSITORYDIR) $(REPOSITORYDIR)/mcl $(SYSDIR) $(DOCDIR) $(DOCDIR)/html $(SOURCEDIR) - $(INSTALL) $(INSTALLFLAGS) clsql.system.debian $(SYSDIR) - mv $(SYSDIR)/clsql.system.debian $(SYSDIR)/clsql.system - $(INSTALL) $(INSTALLFLAGS) $(shell echo sql/*.cl) $(REPOSITORYDIR)/sql - $(INSTALL) $(INSTALLFLAGS) $(shell echo src/interfaces/*.cl) $(REPOSITORYDIR)/interfaces - $(INSTALL) $(INSTALLFLAGS) doc/html/* $(DOCDIR)/html - cp doc/clsql.ps doc/cl-sql.ps - rm -f doc/cl-sql.ps.gz - gzip doc/cl-sql.ps - $(INSTALL) $(INSTALLFLAGS) doc/cl-sql.ps.gz $(DOCDIR) - rm -f doc/cl-sql.ps.gz + dh_installdirs --all $(clc-systems) $(clc-source) + + $(INSTALL) $(INSTALLDIRFLAGS) $(lispdir) $(lispdir-base) \ + $(lispdir-base-uffi) $(lispdir-pg) $(lispdir-pg-socket) \ + $(lispdir-mysql) $(lispdir-sql) $(lispdir-aodbc) \ + $(sodir-base-uffi) $(sodir-mysql) + + # Main package + $(INSTALL) $(INSTALLDIRFLAGS) $(lispdir) $(lispdir-int) + $(INSTALL) $(INSTALLFLAGS) $(srcs) $(lispdir-sql) + + # Base + $(INSTALL) $(INSTALLFLAGS) $(srcs-base) $(lispdir-base) + $(INSTALL) $(INSTALLFLAGS) $(srcs-base-uffi) $(lispdir-base-uffi) + $(INSTALL) $(INSTALLEXECFLAGS) $(srcs-base-uffi-so) $(sodir-base-uffi) + + $(INSTALL) $(INSTALLFLAGS) $(srcs-mysql) $(lispdir-mysql) + $(INSTALL) $(INSTALLEXECFLAGS) $(srcs-mysql-so) $(sodir-mysql) + $(INSTALL) $(INSTALLFLAGS) $(srcs-pg) $(lispdir-pg) + $(INSTALL) $(INSTALLFLAGS) $(srcs-pg-socket) $(lispdir-pg-socket) + $(INSTALL) $(INSTALLFLAGS) $(srcs-aodbc) $(lispdir-aodbc) + + # CLC Systems + $(INSTALL) $(INSTALLFLAGS) clsql.system $(prefix)/$(clc-systems) + $(INSTALL) $(INSTALLFLAGS) clsql-base.system clsql-uffi.system $(prefix-base)/$(clc-systems) + $(INSTALL) $(INSTALLFLAGS) clsql-mysql.system $(prefix-mysql)/$(clc-systems) + $(INSTALL) $(INSTALLFLAGS) clsql-postgresql.system $(prefix-pg)/$(clc-systems) + $(INSTALL) $(INSTALLFLAGS) clsql-postgresql-socket.system $(prefix-pg-socket)/$(clc-systems) + $(INSTALL) $(INSTALLFLAGS) clsql-aodbc.system $(prefix-aodbc)/$(clc-systems) + + # Test suite + $(INSTALL) $(INSTALLDIRFLAGS) $(doc-dir)/html $(doc-dir)/test-suite + + $(INSTALL) $(INSTALLFLAGS) test-suite/tester-clsql.cl test-suite/acl-compat-tester.cl $(doc-dir)/test-suite + + # Documentation + rm -rf doc/html + (cd doc; tar xzf html.tar.gz; cd ..) + $(INSTALL) $(INSTALLFLAGS) doc/html/* $(doc-dir)/html + rm -rf doc/html + cp doc/clsql.pdf doc/cl-sql.pdf + rm -f doc/cl-sql.pdf.gz + gzip doc/cl-sql.pdf + $(INSTALL) $(INSTALLFLAGS) doc/cl-sql.pdf.gz $(doc-dir) + rm -f doc/cl-sql.pdf.gz + +# From UncommonSQL Debian package: build prerm postinst from templates + set -e ;\ + for p in $(all-pkgs); do \ + echo "processing maintainer scripts for $$p" ;\ + l=`echo $$p | sed -e "s/^cl-/cl/;"` ;\ + sed -e "s/%%/$$l/;" debian/prerm.template > debian/$$p.prerm ;\ + sed -e "s/%%/$$l/;" debian/postinst.template > debian/$$p.postinst ;\ + done + # Build architecture-independent files here. binary-indep: build install @@ -80,30 +156,24 @@ binary-arch: build install dh_testroot # dh_installdebconf dh_installdocs - dh_installexamples examples/*.cl -# dh_installmenu -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installman -# dh_installinfo -# dh_undocumented +# dh_installexamples dh_installchangelogs ChangeLog - dh_link + dh_link -p $(pkg-base) $(clc-clsql) $(clc-source)/clsql + dh_link -p $(pkg-base) $(clc-clsql) $(clc-source)/clsql-base + dh_link -p $(pkg-mysql) $(clc-clsql) $(clc-source)/clsql-mysql + dh_link -p $(pkg-pg) $(clc-clsql) $(clc-source)/clsql-postgresql + dh_link -p $(pkg-pg-socket) $(clc-clsql) $(clc-source)/clsql-postgresql-socket + dh_link -p $(pkg-aodbc) $(clc-clsql) $(clc-source)/clsql-aodbc dh_strip dh_compress dh_fixperms # dh_makeshlibs dh_installdeb # dh_perl -# dh_shlibdeps + dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure -