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