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