]> TLD Linux GIT Repositories - packages/dehydrated.git/blob - dehydrated.spec
- updated to 0.6.5
[packages/dehydrated.git] / dehydrated.spec
1 Summary:        letsencrypt/acme client implemented as a shell-script
2 Name:           dehydrated
3 Version:        0.6.5
4 Release:        1
5 License:        MIT
6 Group:          Applications/Networking
7 Source0:        https://github.com/lukas2511/dehydrated/archive/v%{version}/%{name}-%{version}.tar.gz
8 # Source0-md5:  cedf07369517c317c4e1075540b94699
9 Source1:        httpd.conf
10 Source2:        lighttpd.conf
11 Source3:        nginx.conf
12 Source4:        domains.txt
13 Source5:        crontab
14 Source6:        config.sh
15 Source7:        01-ca-path.sh
16 Source8:        02-challenge-type.sh
17 Source9:        03-keys.sh
18 Source10:       04-renew.sh
19 Source11:       05-ocsp.sh
20 Source12:       06-hook.sh
21 Source13:       07-contact.sh
22 Source14:       hook.sh
23 Source15:       hook.functions
24 Source16:       hook.custom_functions
25 Source17:       hook.global
26 Source18:       sudoers
27 Patch0:         tld.patch
28 URL:            https://github.com/lukas2511/dehydrated
29 BuildRequires:  rpmbuild(macros) >= 1.713
30 Requires:       ca-certificates
31 Requires:       crondaemon
32 Requires:       curl
33 Requires:       diffutils
34 Requires:       grep
35 Requires:       mktemp
36 Requires:       openssl-tools
37 Requires:       sed
38 Requires:       sudo
39 Requires:       webapps
40 Requires(postun):       /usr/sbin/groupdel
41 Requires(pre):  /usr/bin/getgid
42 Requires(pre):  /usr/sbin/groupadd
43 Suggests:       webserver(access)
44 Suggests:       webserver(alias)
45 BuildArch:      noarch
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %define         _webapps        /etc/webapps
49
50 %description
51 This is a client for signing certificates with an ACME-server
52 (currently only provided by letsencrypt) implemented as a relatively
53 simple bash-script.
54
55 Current features:
56 - Signing of a list of domains
57 - Signing of a CSR
58 - Renewal if a certificate is about to expire or SAN (subdomains)
59   changed
60 - Certificate revocation
61
62 %prep
63 %setup -q
64 %patch0 -p1
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT{%{_sbindir},{/etc/%{name},%{_webapps}/%{name}}/{conf.d,hooks,hooks.d},/etc/{cron,sudoers}.d} \
69         $RPM_BUILD_ROOT/var/lib/%{name}/{accounts,acme-challenges,alpn-certs,certs}
70
71 install -p %{name} $RPM_BUILD_ROOT%{_sbindir}
72 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{name}/httpd.conf
73 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{name}/lighttpd.conf
74 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_webapps}/%{name}/nginx.conf
75 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/%{name}/domains.txt
76 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/cron.d/%{name}
77 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/%{name}/config
78 cp -p %{SOURCE7} %{SOURCE8} %{SOURCE9} %{SOURCE10} \
79         %{SOURCE11} %{SOURCE12} %{SOURCE13} \
80         $RPM_BUILD_ROOT/etc/%{name}/conf.d/
81 install -p %{SOURCE14} $RPM_BUILD_ROOT/etc/%{name}/hooks/hook.sh
82 cp -p %{SOURCE15} $RPM_BUILD_ROOT/etc/%{name}/hooks/functions
83 cp -p %{SOURCE16} $RPM_BUILD_ROOT/etc/%{name}/hooks/custom_functions
84 cp -p %{SOURCE17} $RPM_BUILD_ROOT/etc/%{name}/hooks.d/global
85 cp -p %{SOURCE18} $RPM_BUILD_ROOT/etc/sudoers.d/%{name}
86
87 %pre
88 %groupadd -g 184 dehydrated
89
90 %postun
91 if [ "$1" = "0" ]; then
92         %groupremove dehydrated
93 fi
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %triggerin -- apache < 2.2.0, apache-base
99 %webapp_register httpd %{name}
100
101 %triggerun -- apache < 2.2.0, apache-base
102 %webapp_unregister httpd %{name}
103
104 %triggerin -- lighttpd
105 %webapp_register lighttpd %{name}
106
107 %triggerun -- lighttpd
108 %webapp_unregister lighttpd %{name}
109
110 %triggerin -- nginx
111 %webapp_register nginx %{name}
112
113 %triggerun -- nginx
114 %webapp_unregister nginx %{name}
115
116 %files
117 %defattr(644,root,root,755)
118 %doc README.md CHANGELOG LICENSE docs/*.md docs/examples/config
119 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
120 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sudoers.d/%{name}
121 %dir %attr(750,root,http) %{_webapps}/%{name}
122 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{name}/httpd.conf
123 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{name}/lighttpd.conf
124 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{name}/nginx.conf
125 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/config
126 %dir %attr(755,root,root) /etc/%{name}
127 %dir %attr(755,root,root) /etc/%{name}/conf.d
128 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/conf.d/*.sh
129 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/domains.txt
130 %dir %attr(755,root,root) /etc/%{name}/hooks
131 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/hooks/custom_functions
132 %attr(640,root,root) /etc/%{name}/hooks/functions
133 %attr(750,root,root) /etc/%{name}/hooks/hook.sh
134 %dir %attr(755,root,root) /etc/%{name}/hooks.d
135 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/%{name}/hooks.d/global
136 %attr(755,root,root) %{_sbindir}/%{name}
137 %dir %attr(751,root,root) /var/lib/%{name}
138 %dir %attr(700,root,root) /var/lib/%{name}/accounts
139 %dir %attr(750,root,dehydrated) /var/lib/%{name}/alpn-certs
140 %dir %attr(750,root,dehydrated) /var/lib/%{name}/certs
141 # challenges are written here, need to be readable by webserver
142 %dir %attr(751,root,dehydrated) /var/lib/%{name}/acme-challenges