File: rules

package info (click to toggle)
uruk 20080330-1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 620 kB
  • ctags: 18
  • sloc: sh: 1,181; makefile: 117; xml: 51
file content (92 lines) | stat: -rwxr-xr-x 3,309 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/make -f

# This file is maintained using GNU Arch at http://arch.gna.org/uruk/
#
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

# Copyright (C) 2003, 2004, 2005 Joost van Baal
#
# This file is part of the Debian uruk package.  This script is free
# software; you can redistribute it and/or modify it under the terms
# of the GNU GPL, available on-line at
# http://www.gnu.org/copyleft/gpl.html .

# debmake includes deb-make(1).  We don't use dh_make: let's see if
# we can get rid of build-depending on debhelper (and on debmake too,
# when we're at it).

package=uruk
docdir = debian/$(package)/usr/share/doc/$(package)

define checkdir
	test -f debian/rules
endef

build:
	$(checkdir)
	./configure --prefix=/usr --mandir=\$${prefix}/share/man \
          --sysconfdir=/etc --localstatedir=/var
	$(MAKE)
	touch build

clean:
	$(checkdir)
	rm -f build
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f `find . -name "*~"`
	rm -rf debian/$(package) debian/files* debian/substvars

binary-indep: checkroot build
	$(checkdir)
	rm -rf debian/$(package)
	install -d debian/$(package)
	cd debian/$(package) && install -d `cat ../dirs`
	$(MAKE) install prefix=$(CURDIR)/debian/$(package)/usr \
          mandir=$(CURDIR)/debian/$(package)/usr/share/man \
          sysconfdir=$(CURDIR)/debian/$(package)/etc \
          localstatedir=$(CURDIR)/debian/$(package)/var
	mkdir -p debian/$(package)/etc/uruk
	mkdir -p debian/$(package)/etc/default
	cp -a debian/rc debian/$(package)/etc/uruk
	mv $(CURDIR)/debian/$(package)/usr/share/doc/$(package)/examples/default debian/$(package)/etc/default/uruk
	rm $(CURDIR)/debian/$(package)/usr/share/doc/$(package)/COPYING
	rm $(CURDIR)/debian/$(package)/usr/share/doc/$(package)/ChangeLog
	rm $(CURDIR)/debian/$(package)/usr/share/doc/$(package)/uruk*.azm
	rm $(CURDIR)/debian/$(package)/usr/share/doc/$(package)/uruk*.ps
	rm $(CURDIR)/debian/$(package)/usr/share/doc/$(package)/uruk*.txt
	cp -a NEWS debian/copyright $(docdir)
	cp -a debian/changelog $(docdir)/changelog.Debian
	cp -a debian/NEWS $(docdir)/NEWS.Debian
	cp -a debian/README $(docdir)/README.Debian
	cp -a debian/TODO $(docdir)/TODO.Debian
	cp -a ChangeLog $(docdir)/changelog
	cd $(docdir) && gzip -9 changelog changelog.Debian ChangeLog.2003 NEWS.Debian
	gzip -r9 debian/$(package)/usr/share/man
	mkdir debian/$(package)/DEBIAN
#       # generate md5sums.  pathnames should not have leading /.
#       # conffiles should be excluded.  for now, assume conffiles are precisely
#       # the files in /etc/ .
	cd debian/$(package); \
          find . -type f ! -path './etc*' ! -regex '.*/DEBIAN/.*' -printf '%P\0' | xargs -r0 md5sum > DEBIAN/md5sums
#       # generate binary package control file
	dpkg-gencontrol -isp -Pdebian/$(package)
	cp -a debian/conffiles debian/$(package)/DEBIAN
	for f in postinst prerm postrm; do \
          cp -a debian/$$f debian/$(package)/DEBIAN; \
          chmod a+x debian/$(package)/DEBIAN/$$f; \
        done
	chown -R root.root debian/$(package)
	chmod -R go=rX debian/$(package)
	dpkg --build debian/$(package) ..

binary-arch: checkroot build

binary: binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot