6 pkg-base := cl-sql-base
7 pkg-uffi := cl-sql-uffi
8 pkg-classic := cl-sql-classic
9 pkg-mysql := cl-sql-mysql
10 pkg-pg := cl-sql-postgresql
11 pkg-pg-socket := cl-sql-postgresql-socket
12 pkg-aodbc := cl-sql-aodbc
13 pkg-odbc := cl-sql-odbc
14 pkg-sqlite := cl-sql-sqlite
15 pkg-tests := cl-sql-tests
16 all-pkgs := $(pkg) $(pkg-base) $(pkg-uffi) $(pkg-mysql) $(pkg-pg) $(pkg-pg-socket) $(pkg-aodbc) $(pkg-odbc) $(pkg-sqlite) $(pkg-tests)
19 UPSTREAM_VER := $(shell sed -n -e "s/${pkg} (\(.*\)-[0-9A-Za-z\.]).*/\1/p" < debian/changelog |head -1)
22 srcs := $(wildcard sql/*.lisp) clsql.asd
23 srcs-base := $(wildcard base/*.lisp)
24 srcs-classic := $(wildcard classic/*.lisp)
25 srcs-uffi := $(wildcard uffi/*.lisp) $(wildcard uffi/*.c)
26 srcs-uffi-so := $(wildcard uffi/*.so)
27 srcs-mysql := $(wildcard db-mysql/*.lisp) $(wildcard db-mysql/*.c)
28 srcs-mysql-so := $(wildcard db-mysql/*.so)
29 srcs-pg := $(wildcard db-postgresql/*.lisp)
30 srcs-pg-socket := $(wildcard db-postgresql-socket/*.lisp)
31 srcs-aodbc := $(wildcard db-aodbc/*.lisp)
32 srcs-odbc := $(wildcard db-odbc/*.lisp)
33 srcs-sqlite := $(wildcard db-sqlite/*.lisp)
34 srcs-tests := $(wildcard tests/*.lisp)
36 clc-base := usr/share/common-lisp
37 clc-source := $(clc-base)/source
38 clc-systems := $(clc-base)/systems
39 doc-dir := usr/share/doc/cl-sql
41 clc-clsql := $(clc-source)/$(plain-pkg)
43 clc-sql := $(clc-source)/clsql
44 lispdir-sql := $(clc-sql)/sql
45 clc-base := $(clc-source)/clsql-base
46 lispdir-base := $(clc-base)/base
47 clc-classic := $(clc-source)/clsql-classic
48 lispdir-classic := $(clc-classic)/classic
49 clc-uffi := $(clc-source)/clsql-uffi
50 lispdir-uffi := $(clc-uffi)/uffi
51 sodir-uffi := usr/lib/clsql
52 clc-mysql := $(clc-source)/clsql-mysql
53 lispdir-mysql := $(clc-mysql)/db-mysql
54 sodir-mysql := usr/lib/clsql
55 clc-pg := $(clc-source)/clsql-postgresql
56 lispdir-pg := $(clc-pg)/db-postgresql
57 clc-pg-socket := $(clc-source)/clsql-postgresql-socket
58 lispdir-pg-socket := $(clc-pg-socket)/db-postgresql-socket
59 clc-aodbc := $(clc-source)/clsql-aodbc
60 lispdir-aodbc := $(clc-aodbc)/db-aodbc
61 clc-odbc := $(clc-source)/clsql-odbc
62 lispdir-odbc := $(clc-odbc)/db-odbc
63 clc-sqlite := $(clc-source)/clsql-sqlite
64 lispdir-sqlite := $(clc-sqlite)/db-sqlite
65 clc-tests := $(clc-source)/clsql-tests
66 lispdir-tests := $(clc-tests)/tests
68 configure: configure-stamp
71 # Add here commands to configure the package.
75 build-arch: configure-stamp build-arch-stamp
78 # Add here commands to compile the package.
80 touch build-arch-stamp
82 build-indep: configure-stamp build-indep-stamp
85 # Add here command to compile/build the arch indep package.
86 # It's ok not to do anything here, if you don't need to build
87 # anything for this package.
88 #/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
89 touch build-indep-stamp
91 build: build-arch build-indep
96 rm -f build-arch-stamp build-indep-stamp configure-stamp
97 # Add here commands to clean up after the build process.
99 find . -type f -and -name \*~ -or -name .\*~ -exec rm -f {} \;
109 # Add here commands to install the package into debian/uffi.
110 dh_installdirs --all $(clc-systems) $(clc-source)
111 dh_installdirs -p $(pkg) $(lispdir-sql)
112 dh_installdirs -p $(pkg-base) $(lispdir-base)
113 dh_installdirs -p $(pkg-uffi) $(lispdir-uffi) $(sodir-uffi)
114 dh_installdirs -p $(pkg-pg) $(lispdir-pg)
115 dh_installdirs -p $(pkg-pg-socket) $(lispdir-pg-socket)
116 dh_installdirs -p $(pkg-mysql) $(lispdir-mysql) $(sodir-mysql)
117 dh_installdirs -p $(pkg-aodbc) $(lispdir-aodbc)
118 dh_installdirs -p $(pkg-odbc) $(lispdir-odbc)
119 dh_installdirs -p $(pkg-sqlite) $(lispdir-sqlite)
120 dh_installdirs -p $(pkg-tests) $(lispdir-tests)
123 dh_install -p $(pkg) $(srcs) $(lispdir-sql)
124 dh_install -p $(pkg) clsql.asd $(clc-clsql)
127 dh_install -p $(pkg-base) $(srcs-base) $(lispdir-base)
128 dh_install -p $(pkg-base) clsql-base.asd $(clc-base)
131 dh_install -p $(pkg-classic) $(srcs-classic) $(lispdir-classic)
132 dh_install -p $(pkg-classic) clsql-classic.asd $(clc-classic)
135 dh_install -p $(pkg-uffi) $(srcs-uffi) $(lispdir-uffi)
136 dh_install -p $(pkg-uffi) $(srcs-uffi-so) $(sodir-uffi)
137 dh_install -p $(pkg-uffi) clsql-uffi.asd $(clc-uffi)
140 dh_install -p $(pkg-mysql) $(srcs-mysql) $(lispdir-mysql)
141 dh_install -p $(pkg-mysql) clsql-mysql.asd $(clc-mysql)
142 dh_install -p $(pkg-mysql) $(srcs-mysql-so) $(sodir-mysql)
143 dh_install -p $(pkg-pg) $(srcs-pg) $(lispdir-pg)
144 dh_install -p $(pkg-pg) clsql-postgresql.asd $(clc-pg)
145 dh_install -p $(pkg-pg-socket) $(srcs-pg-socket) $(lispdir-pg-socket)
146 dh_install -p $(pkg-pg-socket) clsql-postgresql-socket.asd $(clc-pg-socket)
147 dh_install -p $(pkg-aodbc) $(srcs-aodbc) $(lispdir-aodbc)
148 dh_install -p $(pkg-aodbc) clsql-aodbc.asd $(clc-aodbc)
149 dh_install -p $(pkg-odbc) $(srcs-odbc) $(lispdir-odbc)
150 dh_install -p $(pkg-odbc) clsql-odbc.asd $(clc-odbc)
151 dh_install -p $(pkg-sqlite) $(srcs-sqlite) $(lispdir-sqlite)
152 dh_install -p $(pkg-sqlite) clsql-sqlite.asd $(clc-sqlite)
154 dh_install -p $(pkg-tests) $(srcs-tests) $(lispdir-tests)
155 dh_install -p $(pkg-tests) clsql-tests.asd $(clc-tests)
158 dh_link -p $(pkg) $(clc-clsql)/clsql.asd $(clc-systems)/clsql.asd
159 dh_link -p $(pkg-base) $(clc-base)/clsql-base.asd $(clc-systems)/clsql-base.asd
160 dh_link -p $(pkg-classic) $(clc-classic)/clsql-classic.asd $(clc-systems)/clsql-classic.asd
161 dh_link -p $(pkg-uffi) $(clc-uffi)/clsql-uffi.asd $(clc-systems)/clsql-uffi.asd
162 dh_link -p $(pkg-mysql) $(clc-mysql)/clsql-mysql.asd $(clc-systems)/clsql-mysql.asd
163 dh_link -p $(pkg-pg) $(clc-pg)/clsql-postgresql.asd $(clc-systems)/clsql-postgresql.asd
164 dh_link -p $(pkg-pg-socket) $(clc-pg-socket)/clsql-postgresql-socket.asd $(clc-systems)/clsql-postgresql-socket.asd
165 dh_link -p $(pkg-aodbc) $(clc-aodbc)/clsql-aodbc.asd $(clc-systems)/clsql-aodbc.asd
166 dh_link -p $(pkg-odbc) $(clc-odbc)/clsql-odbc.asd $(clc-systems)/clsql-odbc.asd
167 dh_link -p $(pkg-sqlite) $(clc-sqlite)/clsql-sqlite.asd $(clc-systems)/clsql-sqlite.asd
168 dh_link -p $(pkg-tests) $(clc-tests)/clsql-tests.asd $(clc-systems)/clsql-tests.asd
172 (cd doc; tar xzf html.tar.gz; cd ..)
173 dh_install -p $(pkg) doc/html $(doc-dir)
175 cp doc/clsql.pdf doc/cl-sql.pdf
176 rm -f doc/cl-sql.pdf.gz
178 dh_install -p $(pkg) doc/cl-sql.pdf.gz $(doc-dir)
179 rm -f doc/cl-sql.pdf.gz
182 for p in $(all-pkgs); do \
183 echo "processing maintainer scripts for $$p" ;\
184 l=`echo $$p | sed -e "s/^cl-/cl/;"` ;\
185 sed -e "s/%%/$$l/;" debian/preinst.template > debian/$$p.preinst ;\
186 sed -e "s/%%/$$l/;" debian/prerm.template > debian/$$p.prerm ;\
187 sed -e "s/%%/$$l/;" debian/postinst.template > debian/$$p.postinst ;\
188 chown root.root debian/$$p.prerm debian/$$p.prerm debian/$$p.preinst; \
189 chmod +x debian/$$p.prerm debian/$$p.prerm debian/$$p.preinst; \
193 # Build architecture-independent files here.
194 # Pass -i to all debhelper commands in this target to reduce clutter.
195 binary-indep: build install
198 # dh_installdebconf -i
200 dh_installexamples -i examples/*
202 # dh_installlogrotate -i
203 # dh_installemacsen -i
211 dh_installchangelogs ChangeLog -i
221 # Build architecture-dependent files here.
222 binary-arch: build install
225 # dh_installdebconf -a
227 dh_installexamples -a
229 # dh_installlogrotate -a
230 # dh_installemacsen -a
238 dh_installchangelogs ChangeLog -a
251 binary: binary-indep binary-arch
253 .PHONY: build clean binary-indep binary-arch binary install configure