5d288449677ed68b170a19ab667d8b177c6e5ed8
[yazpp-moved-to-github.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
14
15 CFLAGS = -Wall -g
16
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21 endif
22 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
23         INSTALL_PROGRAM += -s
24 endif
25
26 # shared library versions, option 1
27 version=1.0.0
28 major=1
29 # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
30 #version=`ls src/.libs/lib*.so.* | \
31 # awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
32 #major=`ls src/.libs/lib*.so.* | \
33 # awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
34
35 config.status: configure
36         dh_testdir
37         # Add here commands to configure the package.
38         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-shared --with-yaz=/usr/bin
39
40
41 build: build-stamp
42 build-stamp:  config.status
43         dh_testdir
44
45         # Add here commands to compile the package.
46         $(MAKE)
47
48         touch build-stamp
49
50 clean:
51         dh_testdir
52         dh_testroot
53         rm -f build-stamp 
54
55         # Add here commands to clean up after the build process.
56         -$(MAKE) distclean
57 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
58         cp -f /usr/share/misc/config.sub config.sub
59 endif
60 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
61         cp -f /usr/share/misc/config.guess config.guess
62 endif
63
64
65         dh_clean 
66
67 install: build
68         dh_testdir
69         dh_testroot
70         dh_clean -k 
71         dh_installdirs
72
73         # Add here commands to install the package into debian/tmp
74         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
75
76
77 # Build architecture-independent files here.
78 binary-indep: build install
79 # We have nothing to do by default.
80
81 # Build architecture-dependent files here.
82 binary-arch: build install
83         dh_testdir
84         dh_testroot
85         cp LICENSE debian/copyright
86         dh_installdocs -A README
87         dh_installchangelogs NEWS
88         dh_installdocs
89         dh_installexamples
90         mv debian/tmp/usr/share/doc/yazpp debian/tmp/usr/share/doc/yazpp-doc
91         dh_install
92 #       dh_installmenu
93 #       dh_installdebconf       
94 #       dh_installlogrotate
95 #       dh_installemacsen
96 #       dh_installpam
97 #       dh_installmime
98 #       dh_installinit
99 #       dh_installcron
100 #       dh_installinfo
101         dh_installman
102         dh_link
103         dh_strip
104         dh_compress
105         dh_fixperms
106 #       dh_perl
107 #       dh_python
108         dh_makeshlibs -V 'libyazpp4 (>= 1.3.1)'
109         dh_installdeb
110         dh_shlibdeps -l debian/libyazpp4/usr/lib
111         dh_gencontrol
112         dh_md5sums
113         dh_builddeb
114
115 binary: binary-indep binary-arch
116 .PHONY: build clean binary-indep binary-arch binary install