2 # debian/rules for the dpkg suite.
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>
5 WFLAGS
:= -Wall
-Wextra
-Wno-unused-parameter
-Wno-missing-field-initializers
8 CXXFLAGS
= -g
$(WFLAGS
)
10 # Disable optimisations if ‘noopt’ found in $DEB_BUILD_OPTIONS
11 ifneq (,$(filter noopt
,$(DEB_BUILD_OPTIONS
)))
19 # These are used for cross-compiling and for saving the configure script
20 # from having to guess our platform (since we know it already)
21 DEB_HOST_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_HOST_GNU_TYPE
)
22 DEB_BUILD_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_BUILD_GNU_TYPE
)
24 ifeq ($(DEB_BUILD_GNU_TYPE
), $(DEB_HOST_GNU_TYPE
))
25 confflags
+= --build
=$(DEB_HOST_GNU_TYPE
)
27 confflags
+= --build
=$(DEB_BUILD_GNU_TYPE
) --host
=$(DEB_HOST_GNU_TYPE
)
30 # Don't enable everything on all platforms
31 DEB_HOST_ARCH_OS ?
= $(shell dpkg-architecture
-qDEB_HOST_ARCH_OS
)
33 ifeq ($(DEB_HOST_ARCH_OS
),linux
)
34 confflags
+= --with-selinux
38 # Create configure script if necessary, automake handles rebuilding it.
44 # Configure the build tree
45 build-tree
/config.status
: configure
49 cd build-tree
&& ..
/configure
$(confflags
) \
50 CFLAGS
="$(CFLAGS)" CXXFLAGS
="$(CXXFLAGS)" \
51 --disable-silent-rules \
53 --mandir=\
$${datadir}/man \
54 --infodir=\
$${datadir}/info \
56 --localstatedir
=/var \
60 # Build the package in build-tree
61 build
: build-tree
/config.status
64 cd build-tree
&& $(MAKE
)
70 ifeq (,$(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
71 cd build-tree
&& $(MAKE
) check
74 # Install the package underneath debian/tmp
81 cd build-tree
&& $(MAKE
) DESTDIR
="$(CURDIR)/debian/tmp" install
83 # Put together the dpkg and dselect packages
87 dh_install
--sourcedir
=debian
/tmp
-a
89 dh_installlogrotate
-a
91 install -d debian
/dpkg
/sbin
92 mv debian
/dpkg
/usr
/sbin
/start-stop-daemon debian
/dpkg
/sbin
94 dh_installchangelogs
-a ChangeLog
*
107 # Put together the dpkg-dev package
108 binary-indep
: install
111 dh_install
--sourcedir
=debian
/tmp
-i
113 dh_installchangelogs
-i ChangeLog
*
125 binary
: binary-arch binary-indep
128 # Clean up the mess we made
132 [ ! -f Makefile
] ||
$(MAKE
) distclean
137 .PHONY
: build
check install binary-arch binary-indep binary
clean