2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
5 # Uncomment this to turn on verbose mode.
8 # This is the debhelper compatibility version to use.
14 pkg-base := cl-sql-base
15 pkg-mysql := cl-sql-mysql
16 pkg-pg := cl-sql-postgresql
17 pkg-pg-socket := cl-sql-postgresql-socket
18 pkg-aodbc := cl-sql-aodbc
19 all-pkgs := $(pkg) $(pkg-base) $(pkg-mysql) $(pkg-pg) $(pkg-pg-socket) $(pkg-aodbc)
21 prefix := debian/$(pkg)
22 prefix-base := debian/$(pkg-base)
23 prefix-mysql := debian/$(pkg-mysql)
24 prefix-pg := debian/$(pkg-pg)
25 prefix-pg-socket := debian/$(pkg-pg-socket)
26 prefix-aodbc := debian/$(pkg-aodbc)
28 UPSTREAM_VER := $(shell sed -n -e "s/${pkg} (\(.*\)-[0-9.]).*/\1/p" < debian/changelog |head -1)
31 srcs := $(wildcard sql/*.cl)
32 srcs-base := $(wildcard base/*.cl)
33 srcs-base-uffi := $(wildcard interfaces/clsql-uffi/*.cl)
34 srcs-base-uffi-so:= $(wildcard interfaces/clsql-uffi/*.so)
35 srcs-mysql := $(wildcard interfaces/mysql/*.cl)
36 srcs-mysql-so := $(wildcard interfaces/mysql/*.so)
37 srcs-pg := $(wildcard interfaces/postgresql/*.cl)
38 srcs-pg-socket := $(wildcard interfaces/postgresql-socket/*.cl)
39 srcs-aodbc := $(wildcard interfaces/aodbc/*.cl)
42 INSTALLFLAGS := -g root -o root -m 0644
43 INSTALLEXECFLAGS := -g root -o root -m 0755
44 INSTALLDIRFLAGS := -d -g root -o root -m 0755
46 clc-base := usr/share/common-lisp
47 clc-source := $(clc-base)/source
48 clc-systems := $(clc-base)/systems
49 doc-dir := $(prefix)/usr/share/doc/cl-sql
51 clc-clsql := $(clc-source)/$(plain-pkg)-$(UPSTREAM_VER)
53 lispdir := $(prefix)/$(clc-clsql)
54 lispdir-sql := $(prefix)/$(clc-clsql)/sql
55 lispdir-base := $(prefix-base)/$(clc-clsql)/base
56 lispdir-base-uffi := $(prefix-base)/$(clc-clsql)/interfaces/clsql-uffi
57 lispdir-mysql := $(prefix-mysql)/$(clc-clsql)/interfaces/mysql
58 lispdir-pg := $(prefix-pg)/$(clc-clsql)/interfaces/postgresql
59 lispdir-pg-socket := $(prefix-pg-socket)/$(clc-clsql)/interfaces/postgresql-socket
60 lispdir-aodbc := $(prefix-aodbc)/$(clc-clsql)/interfaces/aodbc
63 configure: configure-stamp
66 # Add here commands to configure the package.
72 build-stamp: configure-stamp
74 # Compile helper libraries
81 rm -f build-stamp configure-stamp
82 # Add here commands to clean up after the build process.
90 dh_installdirs --all $(clc-systems) $(clc-source)
92 $(INSTALL) $(INSTALLDIRFLAGS) $(lispdir) $(lispdir-base) \
93 $(lispdir-base-uffi) $(lispdir-pg) $(lispdir-pg-socket) \
94 $(lispdir-mysql) $(lispdir-sql) $(lispdir-aodbc)
97 $(INSTALL) $(INSTALLDIRFLAGS) $(lispdir) $(lispdir-int)
98 $(INSTALL) $(INSTALLFLAGS) $(srcs) $(lispdir-sql)
101 $(INSTALL) $(INSTALLFLAGS) $(srcs-base) $(lispdir-base)
102 $(INSTALL) $(INSTALLFLAGS) $(srcs-base-uffi) $(lispdir-base-uffi)
103 $(INSTALL) $(INSTALLEXECFLAGS) $(srcs-base-uffi-so) $(lispdir-base-uffi)
105 $(INSTALL) $(INSTALLFLAGS) $(srcs-mysql) $(lispdir-mysql)
106 $(INSTALL) $(INSTALLEXECFLAGS) $(srcs-mysql-so) $(lispdir-mysql)
107 $(INSTALL) $(INSTALLFLAGS) $(srcs-pg) $(lispdir-pg)
108 $(INSTALL) $(INSTALLFLAGS) $(srcs-pg-socket) $(lispdir-pg-socket)
109 $(INSTALL) $(INSTALLFLAGS) $(srcs-aodbc) $(lispdir-aodbc)
112 $(INSTALL) $(INSTALLFLAGS) clsql.system $(prefix)/$(clc-systems)
113 $(INSTALL) $(INSTALLFLAGS) clsql-base.system clsql-uffi.system $(prefix-base)/$(clc-systems)
114 $(INSTALL) $(INSTALLFLAGS) clsql-mysql.system $(prefix-mysql)/$(clc-systems)
115 $(INSTALL) $(INSTALLFLAGS) clsql-postgresql.system $(prefix-pg)/$(clc-systems)
116 $(INSTALL) $(INSTALLFLAGS) clsql-postgresql-socket.system $(prefix-pg-socket)/$(clc-systems)
117 $(INSTALL) $(INSTALLFLAGS) clsql-aodbc.system $(prefix-aodbc)/$(clc-systems)
120 $(INSTALL) $(INSTALLDIRFLAGS) $(doc-dir)/html $(doc-dir)/test-suite
122 $(INSTALL) $(INSTALLFLAGS) test-suite/tester-clsql.cl test-suite/acl-compat-tester.cl $(doc-dir)/test-suite
125 $(INSTALL) $(INSTALLFLAGS) doc/html/* $(doc-dir)/html
126 cp doc/clsql.pdf doc/cl-sql.pdf
127 rm -f doc/cl-sql.pdf.gz
129 $(INSTALL) $(INSTALLFLAGS) doc/cl-sql.pdf.gz $(doc-dir)
130 rm -f doc/cl-sql.pdf.gz
132 # From UncommonSQL Debian package: build prerm postinst from templates
134 for p in $(all-pkgs); do \
135 echo "processing maintainer scripts for $$p" ;\
136 l=`echo $$p | sed -e "s/^cl-/cl/;"` ;\
137 sed -e "s/%%/$$l/;" debian/prerm.template > debian/$$p.prerm ;\
138 sed -e "s/%%/$$l/;" debian/postinst.template > debian/$$p.postinst ;\
142 # Build architecture-independent files here.
143 binary-indep: build install
147 # Build architecture-dependent files here.
148 binary-arch: build install
154 dh_installchangelogs ChangeLog
155 dh_link -p $(pkg-base) $(clc-clsql) $(clc-source)/clsql-base
156 dh_link -p $(pkg-mysql) $(clc-clsql) $(clc-source)/clsql-mysql
157 dh_link -p $(pkg-pg) $(clc-clsql) $(clc-source)/clsql-postgresql
158 dh_link -p $(pkg-pg-socket) $(clc-clsql) $(clc-source)/clsql-postgresql-socket
159 dh_link -p $(pkg-aodbc) $(clc-clsql) $(clc-source)/clsql-aodbc
171 binary: binary-indep binary-arch
172 .PHONY: build clean binary-indep binary-arch binary install configure