chiark / gitweb /
Tidy up command-line handling
[xtrlock.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules file for xtrlock-2.0
3 # Based upon the sample debian.rules file by Ian Jackson.
4
5 package=xtrlock
6
7 arch=$(shell dpkg --print-architecture)
8 STRIP=strip
9
10 CFLAGS=-O2 -g -DSHADOW_PWD
11
12 build:
13         $(checkdir)
14         xmkmf
15         $(MAKE) CFLAGS="$(CFLAGS)" CDEBUGFLAGS="" xtrlock
16         touch build
17
18 clean:
19         $(checkdir)
20         -rm -f build
21         -rm -f xtrlock *.o *.bak Makefile
22         -rm -rf debian/tmp *~ debian/files debian/substvars debian/*~
23
24 binary-indep:   checkroot
25 #No binary independent files in this package
26
27 binary-arch:    checkroot build
28         -rm -rf debian/tmp
29         install -m 755 -d debian/tmp/usr/bin debian/tmp/usr/share/man/man1
30         install -m 755 -d debian/tmp/usr/share/doc/xtrlock debian/tmp/DEBIAN
31         install -m 755 -d debian/tmp/usr/share/menu
32         install -m 755 -d debian/tmp/usr/share/lintian/overrides
33         # has to be setgid shadow to support shadow passwords.  --marekm
34         install -m 755 xtrlock debian/tmp/usr/bin/xtrlock
35         # Is nostrip set in DEB_BUILD_OPTIONS?
36         case "$$DEB_BUILD_OPTIONS" in \
37         *nostrip*)\
38         ;; \
39         *) \
40         $(STRIP) debian/tmp/usr/bin/xtrlock \
41         ;; \
42         esac
43         install -m 644 xtrlock.man debian/tmp/usr/share/man/man1/xtrlock.1x
44         gzip -9v debian/tmp/usr/share/man/man1/xtrlock.1x
45         install -m 644 debian/changelog debian/tmp/usr/share/doc/xtrlock
46         gzip -9v debian/tmp/usr/share/doc/xtrlock/*
47         install -m 644 debian/copyright debian/tmp/usr/share/doc/xtrlock
48         install -m 644 debian/menu debian/tmp/usr/share/menu/xtrlock
49         install -m 644 debian/xtrlock.lintian-overrides \
50         debian/tmp/usr/share/lintian/overrides/xtrlock
51         install -m 755 debian/postinst debian/postrm debian/tmp/DEBIAN
52         cp debian/control debian/tmp/DEBIAN/control
53         dpkg-shlibdeps debian/tmp/usr/bin/xtrlock
54         dpkg-gencontrol -isp
55         chown -R root.root debian/tmp
56         chown root.shadow debian/tmp/usr/bin/xtrlock
57         chmod -R g-w debian/tmp
58         chmod 2755 debian/tmp/usr/bin/xtrlock
59         dpkg --build debian/tmp ..
60
61 binary: binary-indep binary-arch
62
63 define checkdir
64         test -f debian/rules
65 endef
66
67 checkroot:
68         $(checkdir)
69         test root = "`whoami`"
70
71 .PHONY: binary clean checkroot