-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (53 loc) · 1.64 KB
/
Makefile
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
ifeq ($(DESTDIR),)
destdir=$(HOME)
else
destdir=$(DESTDIR)
endif
ifeq ($(OPENSMTPD),)
opensmtpd=$(HOME)/usr/src/OpenSMTPD
else
opensmtpd=$(OPENSMTPD)
endif
ifeq ($(PACKAGES),)
packages=$(HOME)/usr/debian-packages
else
packages=$(PACKAGES)
endif
prefix=$(destdir)/usr/local
exec_prefix=$(prefix)
bindir=$(exec_prefix)/bin
sysconfdir=$(prefix)/etc
sysconfsubdir=$(sysconfdir)/OpenSMTPD-deb
CHMOD=chmod
INSTALL=install
RM=rm
RMDIR=rmdir
all:
install: install-bin install-sysconf
install-bin: create-opensmtpd-deb.sh
$(INSTALL) -d $(bindir)
$(INSTALL) $< $(bindir)
sed -i -e 's!%%packages%%!$(packages)!' $(bindir)/$<
sed -i -e 's!%%OpenSMTPD%%!$(opensmtpd)!' $(bindir)/$<
sed -i -e 's!%%sysconfdir%%!$(sysconfdir)!' $(bindir)/$<
$(CHMOD) 755 $(bindir)/$<
install-sysconf: DEBIAN/postinst DEBIAN/postrm DEBIAN/preinst DEBIAN/prerm \
DEBIAN/config DEBIAN/10_smtpd.conf.diff
$(INSTALL) -d $(sysconfsubdir)/etc/init.d
$(INSTALL) etc/init.d/opensmtpd $(sysconfsubdir)/etc/init.d
$(INSTALL) -d $(sysconfsubdir)/usr/share/doc/opensmtpd
$(INSTALL) -m 644 usr/share/doc/opensmtpd/* \
$(sysconfsubdir)/usr/share/doc/opensmtpd
$(INSTALL) -d $(sysconfsubdir)/usr/share/lintian/overrides
$(INSTALL) -m 644 usr/share/lintian/overrides/opensmtpd \
$(sysconfsubdir)/usr/share/lintian/overrides
$(INSTALL) $^ $(sysconfsubdir)
$(CHMOD) 644 $(sysconfsubdir)/10_smtpd.conf.diff
uninstall: uninstall-bin uninstall-sysconf
uninstall-bin: create-opensmtpd-deb.sh
$(RM) -f $(bindir)/$<
-$(RMDIR) -p --ignore-fail-on-non-empty $(bindir)
uninstall-sysconf:
$(RM) -fr $(sysconfsubdir)
-$(RMDIR) -p --ignore-fail-on-non-empty $(sysconfdir)
.PHONY: all install uninstall