-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
155 lines (126 loc) · 4.84 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#
# Copyright (c) 2014-2022 Opsmate, Inc.
#
# See COPYING file for license information.
#
PROJECT = sslmate
VERSION = 1.9.1
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
DOCDIR ?= $(PREFIX)/share/doc/sslmate
MANDIR ?= $(PREFIX)/share/man
PERLLIBDIR ?= $(PREFIX)/share/sslmate/perllib
LIBEXECDIR ?= $(PREFIX)/libexec/sslmate
SHAREDIR ?= $(PREFIX)/share/sslmate
DISTDIR ?= $(PROJECT)-$(VERSION)
DISTFILE ?= $(DISTDIR).tar
all: build
#
# Build
#
build: build-bin build-man
build-bin: bin/sslmate.bin
build-man:
# $(MAKE) -C man all
bin/sslmate.bin: bin/sslmate
sed \
-e "s|DEFAULT_LIBEXEC_DIR = undef|DEFAULT_LIBEXEC_DIR = '$(LIBEXECDIR)'|" \
-e "s|DEFAULT_SHARE_DIR = undef|DEFAULT_SHARE_DIR = '$(SHAREDIR)'|" \
-e "s|^use lib.*|use lib '$(PERLLIBDIR)';|" \
< bin/sslmate > bin/sslmate.bin
#
# Clean
#
clean: clean-bin clean-man
clean-bin:
rm -f bin/sslmate.bin
clean-man:
# $(MAKE) -C man clean
#
# Install
#
install: install-bin install-doc install-man install-perllib install-libexec install-share
install-bin: bin/sslmate.bin
mkdir -m 755 -p $(DESTDIR)$(BINDIR)
install -m 755 bin/sslmate.bin $(DESTDIR)$(BINDIR)/sslmate
install-doc:
mkdir -m 755 -p $(DESTDIR)$(DOCDIR)
install -m 644 README NEWS $(DESTDIR)$(DOCDIR)/
install-man:
mkdir -m 755 -p $(DESTDIR)$(MANDIR)/man1
install -m 644 man/man1/sslmate.1 $(DESTDIR)$(MANDIR)/man1/
install-perllib:
mkdir -m 755 -p $(DESTDIR)$(PERLLIBDIR)/SSLMate
install -m 644 perllib/SSLMate.pm $(DESTDIR)$(PERLLIBDIR)/
install -m 644 perllib/SSLMate/*.pm $(DESTDIR)$(PERLLIBDIR)/SSLMate/
install-libexec:
mkdir -m 755 -p $(DESTDIR)$(LIBEXECDIR)/approval/http
mkdir -m 755 -p $(DESTDIR)$(LIBEXECDIR)/approval/dns
install -m 755 libexec/sslmate/approval/http/documentroot $(DESTDIR)$(LIBEXECDIR)/approval/http/documentroot
install -m 755 libexec/sslmate/approval/dns/cloudflare $(DESTDIR)$(LIBEXECDIR)/approval/dns/cloudflare
install -m 755 libexec/sslmate/approval/dns/digitalocean $(DESTDIR)$(LIBEXECDIR)/approval/dns/digitalocean
install -m 755 libexec/sslmate/approval/dns/dnsimple $(DESTDIR)$(LIBEXECDIR)/approval/dns/dnsimple
install -m 755 libexec/sslmate/approval/dns/route53 $(DESTDIR)$(LIBEXECDIR)/approval/dns/route53
install-share:
mkdir -m 755 -p $(DESTDIR)$(SHAREDIR)/dhparams
install -m 644 share/sslmate/dhparams/dh2048-group14.pem $(DESTDIR)$(SHAREDIR)/dhparams/
install -m 644 share/sslmate/dhparams/dh3072-group15.pem $(DESTDIR)$(SHAREDIR)/dhparams/
install -m 644 share/sslmate/dhparams/dh4096-group16.pem $(DESTDIR)$(SHAREDIR)/dhparams/
install -m 644 share/sslmate/dhparams/dh6144-group17.pem $(DESTDIR)$(SHAREDIR)/dhparams/
install -m 644 share/sslmate/dhparams/dh8192-group18.pem $(DESTDIR)$(SHAREDIR)/dhparams/
install-paths:
mkdir -m 755 -p $(DESTDIR)/etc/paths.d $(DESTDIR)/etc/manpaths.d
echo $(BINDIR) > $(DESTDIR)/etc/paths.d/sslmate
echo $(MANDIR) > $(DESTDIR)/etc/manpaths.d/sslmate
#
# Uninstall
#
uninstall: uninstall-bin uninstall-doc uninstall-man uninstall-perllib uninstall-libexec uninstall-share
uninstall-bin:
rm -f $(DESTDIR)$(BINDIR)/sslmate
uninstall-doc:
rm -f $(DESTDIR)$(DOCDIR)/README
rm -f $(DESTDIR)$(DOCDIR)/NEWS
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(DOCDIR)
uninstall-man:
rm -f $(DESTDIR)$(MANDIR)/man1/sslmate.1
uninstall-perllib:
rm -f $(DESTDIR)$(PERLLIBDIR)/SSLMate/*.pm
rm -f $(DESTDIR)$(PERLLIBDIR)/SSLMate.pm
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PERLLIBDIR)/SSLMate
uninstall-libexec:
rm -f $(DESTDIR)$(LIBEXECDIR)/approval/http/documentroot
rm -f $(DESTDIR)$(LIBEXECDIR)/approval/dns/cloudflare
rm -f $(DESTDIR)$(LIBEXECDIR)/approval/dns/digitalocean
rm -f $(DESTDIR)$(LIBEXECDIR)/approval/dns/dnsimple
rm -f $(DESTDIR)$(LIBEXECDIR)/approval/dns/route53
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(LIBEXECDIR)/approval/http
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(LIBEXECDIR)/approval/dns
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(LIBEXECDIR)/approval
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(LIBEXECDIR)
uninstall-share:
rm -f $(DESTDIR)$(SHAREDIR)/dhparams/dh2048-group14.pem
rm -f $(DESTDIR)$(SHAREDIR)/dhparams/dh3072-group15.pem
rm -f $(DESTDIR)$(SHAREDIR)/dhparams/dh4096-group16.pem
rm -f $(DESTDIR)$(SHAREDIR)/dhparams/dh6144-group17.pem
rm -f $(DESTDIR)$(SHAREDIR)/dhparams/dh8192-group18.pem
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SHAREDIR)/dhparams
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SHAREDIR)
uninstall-paths:
rm -f $(DESTDIR)/etc/paths.d/sslmate $(DESTDIR)/etc/manpaths.d/sslmate
#
# 'make dist'
#
dist:
git archive --prefix=$(DISTDIR)/ $(VERSION) | gzip -n9 > $(DISTFILE).gz
#
# Misc.
#
get-version:
@echo $(VERSION)
.PHONY: all \
build build-bin build-man \
clean clean-bin clean-man \
install install-bin install-man install-perllib install-libexec install-share install-paths \
uninstall uninstall-bin uninstall-man uninstall-perllib uninstall-libexec uninstall-share uninstall-paths \
dist get-version