]> git.gag.com Git - debian/sudo/blob - debian/rules
2cfefa971a1188677d24c860c54ec04211e9ba49
[debian/sudo] / debian / rules
1 #!/usr/bin/make -f
2
3 export DH_VERBOSE=1
4
5 CFLAGS = -O2 -Wall -Wno-comment
6 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
7 CFLAGS += -g
8 endif
9 export CFLAGS
10
11 configure: configure-stamp
12 configure-stamp:
13         dh_testdir
14         cp -f /usr/share/misc/config.sub config.sub
15         cp -f /usr/share/misc/config.guess config.guess
16
17         # simple version
18         mkdir -p build-simple
19         cd build-simple && NROFFPROG=/usr/bin/nroff $(CURDIR)/configure \
20                 --prefix=/usr -v \
21                 --with-all-insults \
22                 --with-devel \
23                 --with-pam \
24                 --with-fqdn \
25                 --with-logging=syslog \
26                 --with-logfac=authpriv \
27                 --with-env-editor \
28                 --with-editor=/usr/bin/editor \
29                 --with-timeout=15 \
30                 --with-password-timeout=0 \
31                 --with-passprompt="[sudo] password for %p: " \
32                 --with-timedir=/var/lib/sudo \
33                 --disable-root-mailer \
34                 --disable-setresuid \
35                 --with-sendmail=/usr/sbin/sendmail \
36                 --mandir=/usr/share/man \
37                 --libexecdir=/usr/lib/sudo \
38                 --with-secure-path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
39
40         # LDAP version
41         mkdir -p build-ldap
42         cd build-ldap && NROFFPROG=/usr/bin/nroff $(CURDIR)/configure \
43                 --prefix=/usr -v \
44                 --with-all-insults \
45                 --with-devel \
46                 --with-pam \
47                 --with-ldap \
48                 --with-fqdn \
49                 --with-logging=syslog \
50                 --with-logfac=authpriv \
51                 --with-env-editor \
52                 --with-editor=/usr/bin/editor \
53                 --with-timeout=15 \
54                 --with-password-timeout=0 \
55                 --with-passprompt="[sudo] password for %p: " \
56                 --disable-root-mailer \
57                 --disable-setresuid \
58                 --with-sendmail=/usr/sbin/sendmail \
59                 --with-ldap-conf-file=/etc/sudo-ldap.conf \
60                 --mandir=/usr/share/man \
61                 --libexecdir=/usr/lib/sudo \
62                 --with-secure-path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
63
64         touch config-stamp
65
66 build: build-stamp
67 build-stamp: configure-stamp
68         dh_testdir
69
70         # ensure our pod changes get picked up
71         $(MAKE) sudoers.man.in sudo.man.in visudo.man.in
72
73         $(MAKE) -C build-simple
74         $(MAKE) -C build-ldap
75
76         touch build-stamp
77
78 clean:
79         dh_testdir
80         dh_testroot
81         rm -f config-stamp build-stamp
82         rm -rf build-simple build-ldap
83         rm -f config.cache
84         dh_clean
85
86 install: build-stamp
87         dh_testdir
88         dh_testroot
89         dh_prep
90         dh_installdirs
91
92         $(MAKE) -C build-simple install DESTDIR=$(CURDIR)/debian/sudo
93         $(MAKE) -C build-ldap   install DESTDIR=$(CURDIR)/debian/sudo-ldap
94
95         # remove stuff we don't want
96         rm -f   debian/sudo/etc/sudoers \
97                 debian/sudo-ldap/etc/sudoers \
98                 debian/sudo/usr/share/doc/sudo/LICENSE* \
99                 debian/sudo-ldap/usr/share/doc/sudo/LICENSE*
100
101         # move upstream-installed docs to the right place for ldap package
102         mv      debian/sudo-ldap/usr/share/doc/sudo/* \
103                 debian/sudo-ldap/usr/share/doc/sudo-ldap/
104         rmdir   debian/sudo-ldap/usr/share/doc/sudo
105
106         # and install things we do want that make install doesn't know about
107         install -o root -g root -m 0644 debian/sudo.pam \
108                 debian/sudo/etc/pam.d/sudo
109         install -o root -g root -m 0644 debian/sudo.pam \
110                 debian/sudo-ldap/etc/pam.d/sudo
111
112         install -o root -g root -m 0644 debian/sudo.lintian \
113                 debian/sudo/usr/share/lintian/overrides/sudo
114         install -o root -g root -m 0644 debian/sudo-ldap.lintian \
115                 debian/sudo-ldap/usr/share/lintian/overrides/sudo-ldap
116
117         install -o root -g root -m 0440 debian/README \
118                 debian/sudo/etc/sudoers.d/README
119         install -o root -g root -m 0440 debian/README \
120                 debian/sudo-ldap/etc/sudoers.d/README
121
122 binary-indep: build install
123
124 binary-arch: build install
125         dh_testdir
126         dh_testroot
127         dh_installdocs -A
128         dh_installexamples -A sample.sudoers
129         dh_installinit -psudo -psudo-ldap --name=sudo
130         dh_installman -A
131         dh_installinfo -A
132         dh_installchangelogs ChangeLog 
133         dh_strip
134         dh_compress
135         dh_fixperms
136         chown root.root debian/sudo/usr/bin/sudo debian/sudo-ldap/usr/bin/sudo
137         chmod 4755 debian/sudo/usr/bin/sudo debian/sudo-ldap/usr/bin/sudo
138         chmod 0440      debian/sudo/etc/sudoers.d/README \
139                         debian/sudo-ldap/etc/sudoers.d/README
140         dh_installdeb
141         dh_shlibdeps
142         dh_gencontrol
143         dh_md5sums
144         dh_builddeb
145
146 binary: binary-indep binary-arch
147 .PHONY: configure build clean binary-indep binary-arch binary install