Initial Debian directory checkin
[darcs-mirror-pam-dbus.debian.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # These are used for cross-compiling and for saving the configure script
4 # from having to guess our platform (since we know it already)
5 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
6 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
7
8
9 CFLAGS = -Wall -g
10
11 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
12         CFLAGS += -O0
13 else
14         CFLAGS += -O2
15 endif
16 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
17         INSTALL_PROGRAM += -s
18 endif
19
20 config.status: configure
21         dh_testdir
22 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
23         cp -f /usr/share/misc/config.sub config.sub
24 endif
25 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
26         cp -f /usr/share/misc/config.guess config.guess
27 endif
28         ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man 
29
30 build: build-stamp
31
32 build-stamp:  config.status
33         dh_testdir
34
35         $(MAKE)
36
37         touch build-stamp
38
39 clean:
40         dh_testdir
41         dh_testroot
42         rm -f build-stamp 
43         rm -f config.sub config.guess
44         [ ! -f Makefile ] || $(MAKE) distclean
45         dh_clean
46
47 install: build
48         dh_testdir
49         dh_testroot
50         dh_clean -k
51         dh_installdirs
52
53         $(MAKE) install DESTDIR=$(CURDIR)/debian/libpam-dbus
54         rm -f $(CURDIR)/debian/libpam-dbus/lib/security/pam_dbus.a
55         rm -f $(CURDIR)/debian/libpam-dbus/lib/security/pam_dbus.la
56         rm -f $(CURDIR)/debian/libpam-dbus/usr/bin/testpam
57
58 # Build architecture-independent files here.
59 binary-indep: build install
60 # We have nothing to do by default.
61
62 # Build architecture-dependent files here.
63 binary-arch: build install
64         dh_testdir
65         dh_testroot
66         dh_installchangelogs 
67         dh_installdocs
68         dh_installman
69         dh_link
70         dh_strip
71         dh_compress
72         dh_fixperms 
73         dh_installdeb
74         dh_shlibdeps
75         dh_gencontrol
76         dh_md5sums
77         dh_builddeb
78
79 binary: binary-indep binary-arch
80 .PHONY: build clean binary-indep binary-arch binary install