r727: Start working on debian package for samba4
[bbaumbach/samba-autobuild/.git] / packaging / debian / rules
1 #!/usr/bin/make -f
2 # By Jelmer Vernooij
3 # Made with the aid of debmake, by Christoph Lameter,
4 # based on the sample debian/rules file for GNU hello by Ian Jackson.
5
6 package=samba4
7
8 configure:
9         $(checkdir)
10         cd source && ./autogen.sh
11         cd source && ./configure --with-fhs \
12                 --prefix=/usr \
13                 --enable-shared \
14                 --enable-static \
15                 --sysconfdir=/etc \
16                 --libdir=/etc/samba4 \
17                 --with-privatedir=/etc/samba4 \
18                 --with-piddir=/var/run/samba4 \
19                 --localstatedir=/var \
20                 --with-pam \
21                 --with-syslog \
22                 --with-readline \
23                 --with-ldap 
24
25         touch configure
26
27 build: configure
28         $(checkdir)
29         cd source && $(MAKE) proto all
30         touch build
31
32 clean:
33         $(checkdir)
34         rm -f build
35         -cd source && $(MAKE) clean
36         rm -f `find . -name "*~"`
37         rm -rf debian/tmp `find debian/* -type d ! -name CVS` debian/files* core
38         rm -f debian/*substvars
39
40 binary-indep: checkroot build
41         $(checkdir)
42 # There are no architecture-independent files to be uploaded
43 # generated by this package.  If there were any they would be
44 # made here.
45
46 binary-arch: checkroot build
47         $(checkdir)
48         rm -rf debian/tmp `find debian/* -type d ! -name CVS`
49         install -d debian/tmp
50         cd debian/tmp && install -d `cat ../dirs`
51         cd source && $(MAKE) install DESTDIR=`pwd`/../debian/tmp
52         debstd 
53         dpkg-gencontrol -isp -psamba4
54         chown -R root:root debian/tmp
55         chmod -R go=rX debian/tmp
56         dpkg --build debian/tmp ..
57
58 define checkdir
59         test -f debian/rules
60 endef
61
62 binary: binary-indep binary-arch
63
64 checkroot:
65         $(checkdir)
66         test root = "`whoami`"
67
68 .PHONY: binary binary-arch binary-indep clean checkroot