chiark / gitweb /
fa177e94931ad0d6dee4cb6fca1b109560c09697
[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 INSTALL = install
15 INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
16 INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
17 INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
18 INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
19
20 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
21 INSTALL_PROGRAM += -s
22 endif
23
24 configure-stamp:
25         dh_testdir
26         # Add here commands to configure the package.
27         dh_autoreconf
28         CC_FOR_BUILD=cc ./configure \
29                 --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
30                 --prefix=/usr --mandir=\$${prefix}/share/man \
31                 --infodir=\$${prefix}/share/info \
32                 --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
33                 --enable-utf8 --enable-unicode-properties \
34                 --disable-silent-rules \
35                 --enable-pcre16 \
36                 --enable-pcre32 \
37                 $(shell . debian/jit-test) \
38                 $(shell DEB_CFLAGS_MAINT_APPEND=-Wall DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags --export=configure)
39         touch configure-stamp
40
41 build: build-arch build-indep
42 build-arch: build-stamp
43 build-indep: build-stamp
44 build-stamp:  configure-stamp
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 VERBOSE=1
51 endif
52
53         touch build-stamp
54
55 clean:
56         dh_testdir
57         dh_testroot
58         rm -f configure-stamp 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_autoreconf_clean
67         dh_clean
68
69 install: build
70         dh_testdir
71         dh_testroot
72         dh_clean -k
73         dh_installdirs
74
75         # Add here commands to install the package into debian/tmp
76         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
77
78 # Build architecture-dependent files here.
79 binary-arch: build install
80         dh_testdir -a
81         dh_testroot -a
82         dh_install -a
83         # This man page is in the main package, don't want it in -dev
84         rm debian/libpcre3-dev/usr/share/man/man3/pcrepattern.3
85         # Move actual library to /lib
86         mkdir -p debian/libpcre3/lib/$(DEB_HOST_MULTIARCH)
87         mv debian/libpcre3/usr/lib/$(DEB_HOST_MULTIARCH)/libpcre.so.* debian/libpcre3/lib/$(DEB_HOST_MULTIARCH)
88         ln -sf /lib/$(DEB_HOST_MULTIARCH)/libpcre.so.3 debian/libpcre3-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libpcre.so
89         # we never need to reference the library path in pcre-config on
90         # Debian, so clip it out so that the script will be multiarch-safe.
91         sed -i -e"s,/$(DEB_HOST_MULTIARCH),,g" debian/libpcre3-dev/usr/bin/pcre-config
92
93         dh_link -a
94
95 #       dh_installdebconf -a
96         dh_installdocs -a
97         dh_installexamples -a
98 #       dh_installmenu -a
99 #       dh_installlogrotate -a
100 #       dh_installemacsen -a
101 #       dh_installpam -a
102 #       dh_installmime -a
103 #       dh_installinit -a
104 #       dh_installcron -a
105         dh_installman -a
106         dh_installinfo -a
107 #       dh_undocumented -a
108         dh_installchangelogs -a ChangeLog
109         dh_strip -a --dbg-package=libpcre3-dbg
110         # Don't include pcregrep or libraries from udeb in debug package
111         rm -r debian/libpcre3-dbg/usr/lib/debug/usr/bin 
112         rm debian/libpcre3-dbg/usr/lib/debug/usr/lib/libpcre*
113         dh_compress -a
114         dh_fixperms -a
115         dh_makeshlibs -plibpcre3 --add-udeb="libpcre3-udeb" -V 'libpcre3 (>= 1:8.35)'
116         dh_makeshlibs -plibpcrecpp0v5 -V 'libpcrecpp0v5 (>= 7.7)' -- -c4
117         dh_makeshlibs -plibpcre16-3 -plibpcre32-3
118         dh_installdeb -a
119 #       dh_perl -a
120         dh_shlibdeps -a -ldebian/libpcre3/usr/lib/$(DEB_HOST_MULTIARCH)
121         dh_gencontrol -a
122         dh_md5sums -a
123         dh_builddeb -a
124
125 binary-indep:
126
127 binary: binary-arch binary-indep
128 .PHONY: build clean binary-arch binary install