2 # debian/rules for the dpkg suite.
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>
8 # Disable optimisations if ‘noopt’ found in $DEB_BUILD_OPTIONS
9 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
17 # These are used for cross-compiling and for saving the configure script
18 # from having to guess our platform (since we know it already)
19 DEB_HOST_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_HOST_GNU_TYPE
)
20 DEB_BUILD_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_BUILD_GNU_TYPE
)
22 ifeq ($(DEB_BUILD_GNU_TYPE
), $(DEB_HOST_GNU_TYPE
))
23 confflags
+= --build
=$(DEB_HOST_GNU_TYPE
)
25 confflags
+= --build
=$(DEB_BUILD_GNU_TYPE
) --host
=$(DEB_HOST_GNU_TYPE
)
29 # Create configure script if necessary, automake handles rebuilding it.
35 # Configure the build tree
36 build-tree
/config.status
: configure
40 cd build-tree
&& ..
/configure
$(confflags
) \
41 CFLAGS
="$(CFLAGS)" CXXFLAGS
="$(CXXFLAGS)" \
43 --mandir=\
$${datadir}/man \
44 --infodir=\
$${datadir}/info \
46 --localstatedir
=/var
/lib \
50 # Build the package in build-tree
51 build
: build-tree
/build-stamp
52 build-tree
/build-stamp
: build-tree
/config.status
55 cd build-tree
&& $(MAKE
)
59 # Install the package underneath debian/tmp
66 cd build-tree
&& $(MAKE
) DESTDIR
="$(CURDIR)/debian/tmp" install
68 # Put together the dpkg and dselect packages
72 dh_install
--sourcedir
=debian
/tmp
-a
73 install -d debian
/dpkg
/etc
/logrotate.d
74 install -m
644 debian
/dpkg.logrotate debian
/dpkg
/etc
/logrotate.d
/dpkg
76 dh_installchangelogs
-pdpkg ChangeLog
78 install -d debian
/dselect
/usr
/share
/doc
79 ln
-s dpkg debian
/dselect
/usr
/share
/doc
/dselect
90 # Put together the dpkg-dev package
94 dh_install
--sourcedir
=debian
/tmp
-i
96 install -d debian
/dpkg-dev
/usr
/share
/doc
97 ln
-s dpkg debian
/dpkg-dev
/usr
/share
/doc
/dpkg-dev
107 binary
: binary-arch binary-indep
110 # Clean up the mess we made
118 .PHONY
: build
install binary-arch binary-indep binary
clean