File: rules

package info (click to toggle)
sformat 3.4-3.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,044 kB
  • ctags: 3,434
  • sloc: ansic: 20,882; makefile: 102; sh: 100
file content (71 lines) | stat: -rwxr-xr-x 1,926 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
#!/usr/bin/make -f

SOURCEDIR := $(shell pwd)
TMPDIR=$(SOURCEDIR)/debian/tmp
MAKE := make MAKEPROG=gmake

build:
	$(checkdir)
	-cd RULES; sh MKLINKS
	$(MAKE) CFLAGS='-O2 -g -Wall' all
	touch build

binary-indep:

binary-arch: checkroot build
	$(checkdir)
	-rm -rf $(TMPDIR)
	install -d $(TMPDIR)/DEBIAN $(TMPDIR)/etc $(TMPDIR)/usr/share/doc/sformat
	$(MAKE) INS_BASE=$(TMPDIR)/usr MANDIR=share/man DEFUMASK=022 install
#	fix ups
	mv $(TMPDIR)/usr/etc/sformat.dat $(TMPDIR)/etc
	mv $(TMPDIR)/usr/bin $(TMPDIR)/usr/sbin
	rm -rf $(TMPDIR)/usr/lib $(TMPDIR)/usr/share/man/man5 $(TMPDIR)/usr/etc
	gzip -9 $(TMPDIR)/usr/share/man/man8/sformat.8
#	copyright etc
	install -m 644 README README.database README.seagate \
		doc/sformat.doc $(TMPDIR)/usr/share/doc/sformat
	install -m 644 debian/changelog \
		$(TMPDIR)/usr/share/doc/sformat/changelog.Debian
	gzip -9 $(TMPDIR)/usr/share/doc/sformat/*
	install -m 644 debian/copyright $(TMPDIR)/usr/share/doc/sformat
#	strip it
	strip -s -R .comment -R .note $(TMPDIR)/usr/sbin/sformat
#	maintaner
	install -m 644 debian/conffiles $(TMPDIR)/DEBIAN/conffiles
	install debian/postinst $(TMPDIR)/DEBIAN
	install debian/prerm $(TMPDIR)/DEBIAN
	chown -R root:root $(TMPDIR)
	dpkg-shlibdeps -psformat $(TMPDIR)/usr/sbin/sformat
	cd $(TMPDIR);  find * -type f \
		`sed -e 's@^/\?\(.*\)$$@\! -path \1@' \
		$(TMPDIR)/DEBIAN/conffiles`\
		! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum \
	   	> $(TMPDIR)/DEBIAN/md5sums
	dpkg-gencontrol -isp -psformat -P$(TMPDIR)
	dpkg --build $(TMPDIR) ..

clean:
	-cd RULES; sh MKLINKS
	$(MAKE) distclean
	-rm -rf $(TMPDIR)
	-rm -f debian/files debian/substvars build
	-rmdir libs
	find RULES -type l | xargs rm -f

define checkdir
	test -f debian/rules
	test -d sformat
endef

binary: binary-indep binary-arch

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

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

# Local Variables:
# mode:makefile
# end: