chiark / gitweb /
pcre3 (1:8.30-5) unstable; urgency=low
[pcre3.git] / debian / rules
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
7
8 # These are used for cross-compiling and for saving the configure script
9 # from having to guess our platform (since we know it already)
10 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
11 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12 DEB_HOST_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
13
14 CFLAGS = -Wall -g
15 INSTALL = install
16 INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
17 INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
18 INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
19 INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
20
21 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
22 CFLAGS += -O0
23 else
24 CFLAGS += -O2
25 endif
26 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
27 INSTALL_PROGRAM += -s
28 endif
29
30
31 config.status: configure
32         dh_testdir
33         # Add here commands to configure the package.
34         CC_FOR_BUILD=cc CFLAGS="$(CFLAGS)" ./configure \
35                 --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
36                 --prefix=/usr --mandir=\$${prefix}/share/man \
37                 --infodir=\$${prefix}/share/info \
38                 --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
39                 --enable-utf8 --enable-unicode-properties
40
41 build: build-arch build-indep
42 build-arch: build-stamp
43 build-indep: build-stamp
44 build-stamp:  config.status
45         dh_testdir
46
47         # Add here commands to compile the package.
48         $(MAKE)
49 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
50         $(MAKE) check
51 endif
52
53         touch build-stamp
54
55 clean: config.status
56         dh_testdir
57         dh_testroot
58         rm -f build-stamp
59         # Add here commands to clean up after the build process.
60         [ ! -f Makefile ] || $(MAKE) distclean
61 ###     -test -r /usr/share/misc/config.sub && \
62 ###       cp -f /usr/share/misc/config.sub config.sub
63 ###     -test -r /usr/share/misc/config.guess && \
64 ###       cp -f /usr/share/misc/config.guess config.guess
65         rm -f dftables testsavedregex
66         dh_clean
67
68 install: build
69         dh_testdir
70         dh_testroot
71         dh_clean -k
72         dh_installdirs
73
74         # Add here commands to install the package into debian/tmp
75         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
76
77 # Build architecture-dependent files here.
78 binary-arch: build install
79         dh_testdir -a
80         dh_testroot -a
81         dh_install -a
82         # This man page is in the main package, don't want it in -dev
83         rm debian/libpcre3-dev/usr/share/man/man3/pcrepattern.3
84         # Move actual library to /lib
85         mkdir -p debian/libpcre3/lib/$(DEB_HOST_MULTIARCH)
86         mv debian/libpcre3/usr/lib/$(DEB_HOST_MULTIARCH)/libpcre.so.* debian/libpcre3/lib/$(DEB_HOST_MULTIARCH)
87         ln -sf /lib/$(DEB_HOST_MULTIARCH)/libpcre.so.3 debian/libpcre3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libpcre.so
88
89         dh_link -a
90
91 #       dh_installdebconf -a
92         dh_installdocs -a
93         dh_installexamples -a
94 #       dh_installmenu -a
95 #       dh_installlogrotate -a
96 #       dh_installemacsen -a
97 #       dh_installpam -a
98 #       dh_installmime -a
99 #       dh_installinit -a
100 #       dh_installcron -a
101         dh_installman -a
102         dh_installinfo -a
103 #       dh_undocumented -a
104         dh_installchangelogs -a ChangeLog
105         dh_strip -a --dbg-package=libpcre3-dbg
106         # Don't include pcregrep or libraries from udeb in debug package
107         rm -r debian/libpcre3-dbg/usr/lib/debug/usr/bin 
108         rm debian/libpcre3-dbg/usr/lib/debug/usr/lib/libpcre*
109         dh_compress -a
110         dh_fixperms -a
111         dh_makeshlibs -plibpcre3 --add-udeb="libpcre3-udeb" -V 'libpcre3 (>= 8.10)'
112         dh_makeshlibs -plibpcrecpp0 -V 'libpcrecpp0 (>= 7.7)'
113         dh_installdeb -a
114 #       dh_perl -a
115         dh_shlibdeps -a -ldebian/libpcre3/usr/lib/$(DEB_HOST_MULTIARCH)
116         dh_gencontrol -a
117         dh_md5sums -a
118         dh_builddeb -a
119
120 binary-indep:
121
122 binary: binary-arch binary-indep
123 .PHONY: build clean binary-arch binary install