yaz-marcdump man page
[yaz-moved-to-github.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Script for building YAZ from source to .deb-packages.
4 #
5 # Created by Morten Hendriksen <mgh@dbc.dk> based on sample
6 # debhelper script from Joey Hess. GPL copyright 1997 to 1999 by Joey Hess.
7
8 # Uncomment this to turn on verbose mode.
9 #export DH_VERBOSE=1
10
11 # This is the debhelper compatability version to use.
12 export DH_COMPAT=2
13
14 CONFIG_FLAGS=--with-xml2=/usr --enable-static --enable-shared --enable-tcpd --prefix=/usr --with-openssl
15
16 # Enable parallel builds if CONCURRENCY_LEVEL is set
17 ifdef CONCURRENCY_LEVEL
18 MCFLAGS=-j$(CONCURRENCY_LEVEL)
19 else
20 MCFLAGS=
21 endif
22
23 YAZSRCDIR?=$(shell pwd)
24
25 # Local library path for linking with right dependencies
26 LOCAL_LINK=-ldebian/libyaz/usr/lib
27
28 $(YAZSRCDIR)/configure: $(YAZSRCDIR)/configure.in
29         cd $(YAZSRCDIR); sh buildconf.sh
30
31 stamp-configure: $(YAZSRCDIR)/configure
32         dh_testdir
33
34         -rm -rf build
35         mkdir build
36         cd build; $(YAZSRCDIR)/configure $(CONFIG_FLAGS)
37         touch stamp-configure
38
39 build: stamp-build
40 stamp-build: stamp-configure
41         dh_testdir
42
43         # Add here commands to compile the package.
44         $(MAKE) -C build $(MCFLAGS)
45
46         touch stamp-build
47
48 clean:
49         dh_testdir
50         #dh_testroot
51         -rm -f stamp-*
52         -rm -rf build
53
54         dh_clean
55         -rm -rf debian/libyaz debian/libyaz-dev \
56                 debian/*.debhelper debian/substvars debian/shlibs.yaz-*
57
58 install: stamp-install
59 stamp-install: stamp-build
60         dh_testdir
61         dh_testroot
62         dh_clean -k -a
63         dh_installdirs -a
64
65         # Add here commands to install the package into debian/tmp.
66         -mkdirhier debian/tmp/usr
67         $(MAKE) -C build install prefix=`pwd`/debian/tmp/usr
68
69         touch stamp-install
70
71 # Build architecture-independent files here.
72 binary-indep: build install
73         dh_testdir
74         dh_testroot
75         dh_installdocs -p yaz-doc doc/*.html doc/*.pdf doc/*.png
76         dh_installchangelogs -p yaz-doc
77         dh_link -p yaz-doc
78         dh_strip -p yaz-doc
79         dh_compress -p yaz-doc
80         dh_fixperms -p yaz-doc
81         dh_gencontrol -p yaz-doc
82         dh_md5sums -p yaz-doc
83
84         dh_builddeb -p yaz-doc
85
86 # Build architecture-dependent files here.
87 binary-arch: build install
88         dh_testdir
89         dh_testroot
90         dh_movefiles -p libyaz-dev  usr/share/aclocal usr/lib/*.a usr/lib/*.la usr/lib/*.so usr/include usr/bin/yaz-config usr/bin/yaz-asncomp usr/share/yaz/ill usr/share/yaz/z39.50
91         dh_movefiles -p yaz usr/bin
92         dh_movefiles -p libyaz usr/lib usr/share/yaz/etc
93         dh_installexamples -p libyaz-dev
94
95         cp LICENSE debian/copyright
96         cp CHANGELOG changelog
97         dh_installdocs --all README TODO changelog debian/copyright
98
99         dh_installchangelogs
100         dh_link
101
102         dh_installdeb -p libyaz
103         dh_installdeb -p libyaz-dev
104         dh_installdeb -p yaz
105
106         dh_installman -p libyaz-dev doc/yaz-config.8
107         dh_installman -p libyaz-dev doc/yaz-asncomp.1
108         dh_installman -p libyaz doc/yaz.7
109         dh_installman -p yaz doc/yaz-client.1 doc/yaz-ztest.8 doc/zoomsh.1
110         dh_installman -p yaz doc/yaz-client-ssl.1 doc/yaz-ztest-ssl.8
111         dh_installman -p libyaz-dev doc/yaz-marcdump.1
112
113         dh_strip
114         dh_compress -a
115         dh_fixperms -a
116
117         echo "libyaz 2 libyaz (>= 2.0.2)" > debian/libyaz/DEBIAN/shlibs
118         echo "libyazthread 2 libyaz (>= 2.0.2)" >> debian/libyaz/DEBIAN/shlibs
119         echo "libyazmalloc 2 libyaz (>= 2.0.2)" >> debian/libyaz/DEBIAN/shlibs
120         echo "libyazssl 2 libyaz (>= 2.0.2)" >> debian/libyaz/DEBIAN/shlibs
121         chmod 644 debian/libyaz/DEBIAN/shlibs
122         dh_shlibdeps -p libyaz $(LOCAL_LINK) 
123
124         dh_gencontrol -p libyaz
125         dh_md5sums -p libyaz
126
127         dh_gencontrol -p libyaz-dev
128         dh_md5sums -p libyaz-dev
129
130         dh_gencontrol -p yaz
131         dh_md5sums -p yaz
132
133         # Go kill those CVS-dirs before build
134         -find debian/tmp -type d -name CVS | xargs rm -rf
135         # For some reason it is necessary to remove empty-dirs in yaz-doc
136         -rm -rf debian/tmp/usr/include debian/tmp/usr/share/aclocal debian/tmp/usr/lib debian/tmp/usr/bin \
137                 debian/tmp/usr/share/yaz
138
139         dh_builddeb -p libyaz
140         dh_builddeb -p libyaz-dev
141         dh_builddeb -p yaz
142
143
144 binary: binary-indep binary-arch
145 .PHONY: build clean binary-indep binary-arch binary install install-stamp configure
146
147 yazrelease:
148         # Conveniency target for building YAZ
149         dh_testdir
150         dpkg-buildpackage $(EXTRA_OPTS) -rfakeroot