Initial original import from: fuse-2.4.2-2.fc4
[captive.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 # This program 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; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 # Uncomment this to turn on verbose mode. 
20 #export DH_VERBOSE=1
21
22 # This is the debhelper compatibility version to use.
23 export DH_COMPAT=3
24
25 # This has to be exported to make some magic below work.
26 export DH_OPTIONS
27
28 ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
29 OPTFLAGS := -O2
30 else
31 OPTFLAGS := -O0
32 endif
33
34 # These are used for cross-compiling and for saving the configure script
35 # from having to guess our platform (since we know it already)
36 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
37 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
38
39
40 #ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
41 #       CFLAGS += -g
42 #endif
43 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
44         INSTALL_PROGRAM += -s
45 endif
46
47 config.status: configure
48         dh_testdir
49         ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
50                 --enable-shared --disable-static \
51                 --with-readline \
52                 --disable-bug-replay \
53                 --enable-lufs \
54                 --enable-install-pkg \
55                 --enable-sandbox-setuid=captive \
56                 --enable-sandbox-setgid=captive \
57                 --enable-sandbox-chroot=/var/lib/captive \
58                 --enable-man-pages \
59                 --enable-sbin-mountdir=/sbin \
60                 --enable-sbin-mount-fs=ntfs:fastfat:cdfs:ext2fsd \
61                 --disable-gtk-doc \
62                 --with-orbit-line=link
63
64 build-arch:  config.status build-arch-stamp
65 build-arch-stamp:
66         dh_testdir
67         $(MAKE)
68         touch build-arch-stamp
69
70 build: build-arch
71
72 clean:
73         dh_testdir
74         dh_testroot
75         rm -f build-stamp 
76         # Do not: -$(MAKE) distclean
77         # as we are run in clean distribution archive by AutoGen.pm
78         dh_clean
79
80 install: DH_OPTIONS=
81 install: build
82         dh_testdir
83         dh_testroot
84         dh_clean -k
85         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install-strip
86         dh_movefiles
87         #FIXME: dh_movefiles(1) ignores any directories
88         #       and dh_installdirs(1) creates them in debian/tmp/
89         mkdir -p   $(CURDIR)/debian/captive/var/lib/captive
90         chmod  755 $(CURDIR)/debian/captive/var/lib/captive
91         mkdir -p   $(CURDIR)/debian/captive/var/lib/captive/tmp
92         chmod 1777 $(CURDIR)/debian/captive/var/lib/captive/tmp
93
94 # Build architecture-dependent files here.
95 binary-arch: build install
96         dh_testdir -a
97         dh_testroot -a
98 #       dh_installdebconf -a
99         dh_installdocs -a
100 #       dh_installinit -a
101 #       dh_installman -a
102 #       dh_installchangelogs ChangeLog -a
103         dh_link -a
104         dh_compress -a
105         dh_fixperms -a -X/usr/sbin/captive-sandbox-server -X/var/lib/captive/tmp
106         dh_makeshlibs -a
107         dh_installdeb -a
108         # FIXME: warning: could not find path for libcaptive-0.9cvs.so
109         #dh_shlibdeps -a
110         dh_gencontrol -a
111         dh_md5sums -a
112         dh_builddeb -a
113
114 binary: binary-arch
115 .PHONY: build clean binary-arch binary install