File: rules

package info (click to toggle)
procmail 3.22-26%2Bdeb11u1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 2,128 kB
  • sloc: ansic: 9,888; sh: 1,957; makefile: 136
file content (74 lines) | stat: -rwxr-xr-x 2,380 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/make -f

package = procmail
docdir = debian/tmp/usr/share/doc/$(package)

BUILD_DATE := $(shell dpkg-parsechangelog -S Date)

CC = gcc
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $$(getconf LFS_CFLAGS)
LDFLAGS := `dpkg-buildflags --get LDFLAGS`
CPPFLAGS := `dpkg-buildflags --get CPPFLAGS`
SEARCHLIBS = -lm
STRIP = true

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  STRIP = strip --remove-section=.comment --remove-section=.note
endif

build:
	$(MAKE) CC="$(CC)" CFLAGS0="" \
		LDFLAGS0="$(LDFLAGS)" SEARCHLIBS="$(SEARCHLIBS)" autoconf.h
	$(MAKE) CC="$(CC)" CFLAGS0="$(CFLAGS) $(CPPFLAGS)" \
		LDFLAGS0="$(LDFLAGS)" SEARCHLIBS="$(SEARCHLIBS)"
	touch build

clean:
	rm -f build
	$(MAKE) realclean SEARCHLIBS=""
	rm -f `find . -name "*~"`
	rm -rf debian/tmp debian/files* core debian/substvars

binary-indep: build

binary-arch: build
	rm -rf debian/tmp
	install -d debian/tmp/DEBIAN $(docdir)/examples
	cd debian/tmp && install -d usr/bin usr/share/lintian/overrides
	$(MAKE) BASENAME=`pwd`/debian/tmp/usr install.man install-suid
	$(STRIP) debian/tmp/usr/bin/procmail
	$(STRIP) debian/tmp/usr/bin/lockfile
	$(STRIP) debian/tmp/usr/bin/formail
	cp -p debian/copyright $(docdir)
	cp -p debian/changelog $(docdir)/changelog.Debian
	cp -p debian/lintian debian/tmp/usr/share/lintian/overrides/$(package)
	install -m 644 debian/mailstat.1 debian/tmp/usr/man/man1
	cp -p FEATURES HISTORY README FAQ KNOWN_BUGS \
		debian/QuickStart debian/README.Maildir $(docdir)
	cp -p examples/* $(docdir)/examples
	cd $(docdir)/examples && rm -f dirname mailstat procmail-rpm.spec
	cd $(docdir) && gzip -9n HISTORY changelog.Debian
	ln -s HISTORY.gz $(docdir)/changelog.gz
	mv debian/tmp/usr/man debian/tmp/usr/share
	gzip -r9n debian/tmp/usr/share/man
	dpkg-shlibdeps debian/tmp/usr/bin/*
	dpkg-gencontrol
	cd debian/tmp && \
		find * -type f ! -regex "DEBIAN/.*" -print0 |\
		LC_ALL=C sort -z | xargs -0r md5sum > DEBIAN/md5sums
	chown -R 0:0 debian/tmp
	chmod -R go=rX debian/tmp
	chgrp mail debian/tmp/usr/bin/procmail debian/tmp/usr/bin/lockfile
	chmod 6755 debian/tmp/usr/bin/procmail
	chmod 2755 debian/tmp/usr/bin/lockfile
	find debian/tmp -newermt '$(BUILD_DATE)' -print0 |\
		xargs -0r touch -h --date='$(BUILD_DATE)'
	dpkg --build debian/tmp ..

binary: binary-indep binary-arch

build-arch: build

build-indep: build

.PHONY: binary binary-arch binary-indep clean