File: rules

package info (click to toggle)
procmail 3.22-19%2Bdeb6u1
  • links: PTS
  • area: main
  • in suites: squeeze-lts
  • size: 1,984 kB
  • ctags: 2,732
  • sloc: ansic: 9,885; sh: 1,957; makefile: 131
file content (66 lines) | stat: -rwxr-xr-x 2,007 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

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

CC = gcc
CFLAGS0 = -g $$(getconf LFS_CFLAGS)
LDFLAGS0 =
SEARCHLIBS = -lm
STRIP = true

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

build:
	$(MAKE) CC="$(CC)" CFLAGS0="" LDFLAGS0="$(LDFLAGS0)" \
		SEARCHLIBS="$(SEARCHLIBS)" autoconf.h
	$(MAKE) CC="$(CC)" CFLAGS0="$(CFLAGS0)" LDFLAGS0="$(LDFLAGS0)" \
		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
	$(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
	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 -9 HISTORY changelog.Debian
	ln -s HISTORY.gz $(docdir)/changelog.gz
	mv debian/tmp/usr/man debian/tmp/usr/share
	gzip -r9 debian/tmp/usr/share/man
	dpkg-shlibdeps debian/tmp/usr/bin/*
	dpkg-gencontrol
	cd debian/tmp && \
		md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
	chown -R root:root 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
	dpkg --build debian/tmp ..

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean