+Debian .deb packaging.
[lufs.git] / debian / rules
1 #!/usr/bin/make -f
2 # Makefile for Debian dpkg-buildpackage(1)
3 # Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
4
5 # LUFS is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9
10 # LUFS is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
20 # Uncomment this to turn on verbose mode. 
21 #export DH_VERBOSE=1
22
23 # This is the debhelper compatibility version to use.
24 export DH_COMPAT=3
25
26 # These are used for cross-compiling and for saving the configure script
27 # from having to guess our platform (since we know it already)
28 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
29 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
30
31
32 #ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
33 #       CFLAGS += -g
34 #endif
35 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
36         INSTALL_PROGRAM += -s
37 endif
38
39 config.status: configure.in
40         dh_testdir
41         aclocal
42         libtoolize --force
43         autoheader
44         automake --add-missing
45         autoconf
46         patch configure <debian/configure-subst-x.patch
47         ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
48
49 build-arch:  config.status build-arch-stamp
50 build-arch-stamp:
51         dh_testdir
52         $(MAKE)
53         touch build-arch-stamp
54
55 build: build-arch
56
57 clean:
58         dh_testdir
59         dh_testroot
60         rm -f build-stamp 
61         # Do not: -$(MAKE) distclean
62         # as we are run in clean distribution archive by AutoGen.pm
63         # Prevent diffing of autogenerated files.
64         # We will rebuild them all in 'build-arch' rule anyway.
65         echo find . -false $$(./autogen.pl cleanfilesfordir .|sed "s/.*/-o -name '&'/")|sh -|xargs rm -rf
66         dh_clean
67
68 install: DH_OPTIONS=
69 install: build
70         dh_testdir
71         dh_testroot
72         dh_clean -k
73         dh_installdirs
74         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install-strip
75         dh_movefiles
76
77 # Build architecture-dependent files here.
78 binary-arch: build install
79         dh_testdir -a
80         dh_testroot -a
81 #       dh_installdebconf -a
82         dh_installdocs -a
83 #       dh_installinit -a
84 #       dh_installman -a
85 #       dh_installchangelogs ChangeLog -a
86         dh_link -a
87         dh_compress -a
88         dh_fixperms -a
89         dh_makeshlibs -a
90         dh_installdeb -a
91         # '-X' as it fails on kernel modules:
92         dh_shlibdeps -a -X.o
93         dh_gencontrol -a
94         dh_md5sums -a
95         dh_builddeb -a
96
97 binary: binary-arch
98 .PHONY: build clean binary-arch binary install