Update Swedish translation.
[dpkg.git] / debian / rules
blobb4b70b80b2e10f1f87162b40d6346147f6d1c90b
1 #!/usr/bin/make -f
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
7 CFLAGS = -g $(WFLAGS)
8 CXXFLAGS = -g $(WFLAGS)
10 # Disable optimisations if ‘noopt’ found in $DEB_BUILD_OPTIONS
11 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
12 CFLAGS += -O0
13 CXXFLAGS += -O0
14 else
15 CFLAGS += -O2
16 CXXFLAGS += -O2
17 endif
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)
26 else
27 confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
28 endif
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
35 endif
38 # Create configure script if necessary, automake handles rebuilding it.
39 configure:
40 dh_testdir
42 autoreconf -v -i
44 # Configure the build tree
45 build-tree/config.status: configure
46 dh_testdir
48 install -d build-tree
49 cd build-tree && ../configure $(confflags) \
50 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
51 --disable-silent-rules \
52 --prefix=/usr \
53 --mandir=\$${datadir}/man \
54 --infodir=\$${datadir}/info \
55 --sysconfdir=/etc \
56 --localstatedir=/var \
57 --with-zlib \
58 --with-bz2
60 # Build the package in build-tree
61 build: build-tree/config.status
62 dh_testdir
64 cd build-tree && $(MAKE)
66 # Run the test suites
67 check: build
68 dh_testdir
70 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
71 cd build-tree && $(MAKE) check
72 endif
74 # Install the package underneath debian/tmp
75 install: check
76 dh_testdir
77 dh_testroot
78 dh_clean -k
79 dh_installdirs
81 cd build-tree && $(MAKE) DESTDIR="$(CURDIR)/debian/tmp" install
83 # Put together the dpkg and dselect packages
84 binary-arch: install
85 dh_testdir -a
86 dh_testroot -a
87 dh_install --sourcedir=debian/tmp -a
88 dh_installcron -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*
95 dh_installdocs -a
96 dh_link -a
97 dh_lintian -a
98 dh_strip -a
99 dh_compress -a
100 dh_fixperms -a
101 dh_installdeb -a
102 dh_shlibdeps -a
103 dh_gencontrol -a
104 dh_md5sums -a
105 dh_builddeb -a
107 # Put together the dpkg-dev package
108 binary-indep: install
109 dh_testdir -i
110 dh_testroot -i
111 dh_install --sourcedir=debian/tmp -i
112 dh_installcron -i
113 dh_installchangelogs -i ChangeLog*
114 dh_installdocs -i
115 dh_link -i
116 dh_lintian -i
117 dh_strip -i
118 dh_compress -i
119 dh_fixperms -i
120 dh_installdeb -i
121 dh_gencontrol -i
122 dh_md5sums -i
123 dh_builddeb -i
125 binary: binary-arch binary-indep
128 # Clean up the mess we made
129 clean:
130 dh_testdir
132 [ ! -f Makefile ] || $(MAKE) distclean
133 rm -rf build-tree
134 dh_clean
137 .PHONY: build check install binary-arch binary-indep binary clean