When error is returned from present handler, non-surrogate diagnostic
[yaz-moved-to-github.git] / debian / rules
1 #!/usr/bin/make -f
2 # Debian rules for YAZ
3 # $Id: rules,v 1.2 2001-06-13 20:47:40 adam Exp $
4 #
5 # Modified from:
6 # Sample debian/rules file - for GNU Hello (1.3).
7 # Copyright 1994,1995 by Ian Jackson.
8 # I hereby give you perpetual unlimited permission to copy,
9 # modify and relicense this file, provided that you do not remove
10 # my name from the file itself.  (I assert my moral right of
11 # paternity under the Copyright, Designs and Patents Act 1988.)
12 # This file may have to be extensively modified
13
14 package=yaz
15 soversion=1.0.0
16
17 build:
18         $(checkdir)
19         mkdir build
20         cd build; ../configure --prefix=/usr --enable-shared
21         cd build; $(MAKE) CFLAGS=-O2 
22         cd build/doc; $(MAKE) CFLAGS=-O2 
23         touch build
24
25 clean:
26         $(checkdir)
27         rm -rf build
28         rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars
29
30 binary-indep:   checkroot build
31         $(checkdir)
32 # There are no architecture-independent files to be uploaded
33 # generated by this package.  If there were any they would be
34 # made here.
35
36 binary-arch:    checkroot build
37         $(checkdir)
38         rm -rf debian/tmp
39         install -d debian/tmp/DEBIAN\
40                 -d debian/tmp/usr/share/doc/$(package)
41         install -m 755 debian/postinst debian/prerm debian/tmp/DEBIAN
42         install -m 644 debian/shlibs debian/tmp/DEBIAN
43         cd build; $(MAKE) prefix=`pwd`/../debian/tmp/usr install
44         if test -f doc/yaz.txt; then \
45                 install -m 644 doc/*.html doc/*.ps doc/*.txt debian/tmp/usr/share/doc/$(package); \
46         else \
47                 install -m 644 build/doc/*.html build/doc/*.ps build/doc/*.txt debian/tmp/usr/share/doc/$(package); \
48         fi
49         gzip debian/tmp/usr/share/doc/$(package)/*.ps
50         gzip debian/tmp/usr/share/doc/$(package)/*.txt
51         cp debian/copyright debian/tmp/usr/share/doc/$(package)/.
52         cp debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
53         cp CHANGELOG debian/tmp/usr/share/doc/$(package)/changelog
54         strip --strip-debug debian/tmp/usr/lib/*.a
55         strip --strip-unneeded debian/tmp/usr/lib/lib*.so.$(soversion)
56         cp debian/shlibs debian/shlibs.local
57         dpkg-shlibdeps debian/tmp/usr/bin/yaz-client debian/tmp/usr/bin/yaz-ztest
58         dpkg-gencontrol
59         chown -R root.root debian/tmp
60         chmod -R g-ws debian/tmp
61         dpkg --build debian/tmp ..
62
63 define checkdir
64         test -f debian/rules
65 endef
66
67 # Below here is fairly generic really
68
69 binary:         binary-indep binary-arch
70
71 checkroot:
72         $(checkdir)
73         test root = "`whoami`"
74
75 .PHONY: binary binary-arch binary-indep clean checkroot