File: rules

package info (click to toggle)
ssmtp 2.64-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 948 kB
  • sloc: ansic: 2,044; sh: 497; makefile: 133
file content (93 lines) | stat: -rwxr-xr-x 3,378 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
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
93
#!/usr/bin/make -f
#
# Rules for making sSMTP - Matt Ryan
# Copyright (C) 2004-2005 Anibal Monsalve Salazar <anibal@debian.org>
#

#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk

SHELL=/bin/bash
export CC=$(DEB_HOST_GNU_TYPE)-gcc
INSTALL=install '--strip-program=$(DEB_HOST_GNU_TYPE)-strip'
CFLAGS+=-O2 -g -Wall

do_cfg:
	test -f Makefile || ./configure --exec-prefix="/usr" --prefix="" --enable-ssl --enable-inet6 --enable-md5auth --with-cflags="$(CFLAGS)"

build-arch: build
build-indep: build
build:	do_cfg
	make

binary:	binary-arch binary-indep

binary-arch:	checkroot configure build
	-rm -rf debian/tmp

	dpkg-shlibdeps ssmtp

	$(INSTALL) -d -m 755 -o root -g root debian/tmp/DEBIAN
	dpkg-gencontrol -isp
	po2debconf --podir=debian/po debian/templates > debian/tmp/DEBIAN/templates
	chmod 644 debian/tmp/DEBIAN/templates
	$(INSTALL) -m 644 debian/conffiles debian/tmp/DEBIAN
	$(INSTALL) -m 755 debian/preinst debian/tmp/DEBIAN
	$(INSTALL) -m 755 debian/postinst debian/tmp/DEBIAN
	$(INSTALL) -m 755 debian/postrm debian/tmp/DEBIAN
	$(INSTALL) -m 755 debian/config debian/tmp/DEBIAN

	$(INSTALL) -d -m 755 debian/tmp/usr/sbin
	$(INSTALL) -s -g mail -m 2755 ssmtp debian/tmp/usr/sbin/ssmtp
	$(INSTALL) -d -m 755 debian/tmp/usr/share/man/man8
	$(INSTALL) -m 644 ssmtp.8 debian/tmp/usr/share/man/man8/ssmtp.8
	$(INSTALL) -d -m 755 debian/tmp/usr/share/man/man5
	$(INSTALL) -m 644 ssmtp.conf.5 debian/tmp/usr/share/man/man5/ssmtp.conf.5
	$(INSTALL) -d -g mail -m 750 debian/tmp/etc/ssmtp
	$(INSTALL) -g mail -m 640 revaliases debian/tmp/etc/ssmtp/revaliases

	-cd debian/tmp/usr/sbin && ln -sf ssmtp sendmail
	$(INSTALL) -d -m 755 -o root -g root debian/tmp/usr/lib
	-cd debian/tmp/usr/lib && ln -sf ../sbin/sendmail .

	-cd debian/tmp/usr/sbin && ln -sf ssmtp newaliases
	$(INSTALL) -m 644 debian/newaliases.8 debian/tmp/usr/share/man/man8
	-cd debian/tmp/usr/sbin && ln -sf ssmtp mailq
	$(INSTALL) -m 644 debian/mailq.8 debian/tmp/usr/share/man/man8

	gzip -9nv debian/tmp/usr/share/man/man5/*
	gzip -9nv debian/tmp/usr/share/man/man8/*
	-cd debian/tmp/usr/share/man/man8 && ln -sf ssmtp.8.gz sendmail.8.gz

	$(INSTALL) -d -m 755 -o root -g root debian/tmp/usr/share/doc/ssmtp
	$(INSTALL) -m 644 TLS debian/tmp/usr/share/doc/ssmtp
	$(INSTALL) -m 644 README debian/tmp/usr/share/doc/ssmtp
	$(INSTALL) -m 644 debian/README.debian debian/tmp/usr/share/doc/ssmtp/README.Debian
	$(INSTALL) -m 644 debian/copyright debian/tmp/usr/share/doc/ssmtp
	$(INSTALL) -m 644 debian/changelog debian/tmp/usr/share/doc/ssmtp/changelog.Debian
	$(INSTALL) -m 644 CHANGELOG_OLD debian/tmp/usr/share/doc/ssmtp/changelog
	$(INSTALL) -m 644 debian/AddHeader debian/tmp/usr/share/doc/ssmtp/AddHeader
	gzip -9n debian/tmp/usr/share/doc/ssmtp/{changelog.Debian,changelog}

	$(INSTALL) -d -m 755 debian/tmp/etc/logcheck/ignore.d.server
	$(INSTALL) -m 640 debian/logcheck.server \
		debian/tmp/etc/logcheck/ignore.d.server/ssmtp
	
	$(INSTALL) -d -m 755 debian/tmp/usr/share/lintian/overrides/
	$(INSTALL) -m 644 debian/ssmtp.lintian debian/tmp/usr/share/lintian/overrides/ssmtp

	dpkg --build debian/tmp ..

binary-indep:

clean:
	test \! -f Makefile || make distclean
	-rm -rf debian/tmp
	-rm -f debian/{files,substvars}

checkroot:
	test root = "`whoami`"

.PHONY: build binary clean checkroot