/[smeserver]/rpms/dehydrated/sme10/dehydrated.spec
ViewVC logotype

Annotation of /rpms/dehydrated/sme10/dehydrated.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (hide annotations) (download)
Fri Feb 16 22:37:42 2018 UTC (6 years, 9 months ago) by jpp
Branch: MAIN
Changes since 1.4: +5 -2 lines
* Fri Feb 16 2018 Jean-Philipe Pialasse <tests@pialasse.com> 0.5.0-1.sme
- upgrade to upstream version [SME: 10521]

1 unnilennium 1.1 Name: dehydrated
2 jpp 1.5 Version: 0.5.0
3 unnilennium 1.4 %define release 1
4     Release: %{release}%{?dist}
5 unnilennium 1.1 Summary: ACME client in bash
6    
7     Group: Application/System
8     License: MIT
9     URL: https://github.com/lukas2511/dehydrated
10 unnilennium 1.4 #download released zip and prepend dehydrated- to name
11 jpp 1.5 Source0: dehydrated-v0.5.0.tar.gz
12 unnilennium 1.4 Source1: integration.tgz
13 unnilennium 1.1
14     BuildArch: noarch
15     BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
16    
17     BuildRequires: httpd
18     Requires: openssl
19     Requires: sed
20     Requires: /bin/awk
21     Requires: curl
22     Requires: /bin/mktemp
23    
24     Conflicts: letsencrypt.sh
25     Obsoletes: letsencrypt.sh
26    
27     %if 0%{?fedora} >= 11 || 0%{?rhel} >= 5
28     %global useselinux 1
29     %else
30     %global useselinux 0
31     %endif
32    
33     %description
34     This is a client for signing certificates with an ACME server
35     (currently only provided by Let's Encrypt) implemented as a
36     relatively simple bash-script.
37    
38     %prep
39 unnilennium 1.4 #unpack source 1
40     %setup -n dehydrated-%{version}
41     # unpack integration package aka source 1; do not delete previous -D, and disable default unpacking -T
42     # this wil unpack the integration file in the previous unpacked dehydrated folder
43     %setup -T -D -a 1
44 unnilennium 1.1
45     %build
46     sed -i -e "s|#BASEDIR=.*|BASEDIR=%{_localstatedir}/lib/%{name}/certificates|" \
47     -e "s|#WELLKNOWN=.*|WELLKNOWN=%{_localstatedir}/lib/%{name}/challenges|" \
48     -e "s|#HOOK=.*|HOOK=%{_bindir}/le_hooks.sh|" \
49     -e "s|#DOMAINS_TXT=.*|DOMAINS_TXT=%{_sysconfdir}/%{name}/domains.txt|" \
50     docs/examples/config
51    
52     %install
53     install -d $RPM_BUILD_ROOT/%{_localstatedir}/lib/%{name}/challenges
54     install -d $RPM_BUILD_ROOT/%{_localstatedir}/lib/%{name}/certificates
55     install -D dehydrated $RPM_BUILD_ROOT/%{_bindir}/%{name}
56 unnilennium 1.4 install integration/dehydrated_hooks $RPM_BUILD_ROOT/%{_bindir}/dehydrated_hooks
57     install integration/dehydrated_revoke $RPM_BUILD_ROOT/%{_bindir}/dehydrated_revoke
58 unnilennium 1.1 install -d $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/hooks_deploy_cert.d
59     install -d $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/hooks_clean_challenge.d
60 unnilennium 1.4 install -D -m 0644 integration/httpd.sh.sample $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/hooks_deploy_cert.d/10httpd.sh.sample
61 unnilennium 1.1 install -D -m 0644 docs/examples/config $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/config
62     install -D -m 0644 docs/examples/domains.txt $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/domains.txt
63     install -d $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily/
64     cat <<"_EOF" > $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily/%{name}
65     #!/bin/sh
66     # Uncomment to enable auto-renewal
67     # %{_bindir}/%{name} -c 2>&1 | awk '{ print strftime(), $0; fflush(); }' >> %{_localstatedir}/log/%{name}.log
68    
69     # Uncomment this to auto revoke old certs
70     # %{_bindir}/dehydrated_revoke 2>&1 | awk '{ print strftime(), $0; fflush(); }' >> %{_localstatedir}/log/%{name}.log
71    
72     _EOF
73     install -d $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d
74     cat <<"_EOF" > $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/dehydrated.conf
75    
76     Alias /.well-known/acme-challenge/ %{_localstatedir}/lib/%{name}/challenges/
77    
78     <Directory %{_localstatedir}/lib/%{name}/challenges>
79     Options None
80     AllowOverride None
81     Header set Content-Type "application/jose+json"
82     <IfModule mod_authz_core.c>
83     # Apache 2.4
84     Require all granted
85     </IfModule>
86     <IfModule !mod_authz_core.c>
87     # Apache 2.2
88     Order deny,allow
89     Allow from all
90     </IfModule>
91     </Directory>
92     _EOF
93     install -d -m 750 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d
94     cat <<"_EOF" > $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/%{name}
95     /var/log/%{name}.log {
96     missingok
97     copytruncate
98     rotate 12
99     compress
100     weekly
101     create 0660 root root
102     }
103     _EOF
104    
105     %post
106     %if %{useselinux}
107     (
108     # New File context
109     semanage fcontext -a -t var_lib_t "%{_localstatedir}/lib/dehydrated(/.*)?"
110     # files created by app
111     restorecon -R %{_localstatedir}/lib/dehydrated
112     ) &>/dev/null || :
113     %endif
114    
115     # Migrate from letsencrypt.sh
116     if [ -e %{_sysconfdir}/letsencrypt.sh/config ]; then
117     sed -e 's/letsencrypt.sh/dehydrated/g' \
118     -e 's/le_hooks.sh/dehydrated_hooks/g' \
119     %{_sysconfdir}/letsencrypt.sh/config > %{_sysconfdir}/%{name}/config
120     fi
121     if [ -e %{_sysconfdir}/letsencrypt.sh/domains.txt ]; then
122     cat %{_sysconfdir}/letsencrypt.sh/domains.txt > %{_sysconfdir}/%{name}/domains.txt
123     fi
124     if [ -d %{_localstatedir}/lib/letsencrypt.sh/certificates/certs ]; then
125     mv %{_localstatedir}/lib/letsencrypt.sh/certificates/* %{_localstatedir}/lib/%{name}/certificates/
126     fi
127     sed -i -e 's|%{_localstatedir}/lib/letsencrypt.sh|%{_localstatedir}/lib/%{name}|g' %{_sysconfdir}/httpd/conf.d/ssl.conf
128     if [ -d %{_sysconfdir}/letsencrypt.sh/hooks_deploy_cert.d/ ]; then
129     find %{_sysconfdir}/letsencrypt.sh/hooks_deploy_cert.d/ -type f -perm /111 -exec mv "{}" %{_sysconfdir}/%{name}/hooks_deploy_cert.d/ \;
130     fi
131     if [ -d %{_sysconfdir}/letsencrypt.sh/hooks_clean_challenge.d/ ]; then
132     find %{_sysconfdir}/letsencrypt.sh/hooks_clean_challenge.d/ -type f -perm /111 -exec mv "{}" %{_sysconfdir}/%{name}/hooks_clean_challenge.d/ \;
133     fi
134    
135     %postun
136     %if %{useselinux}
137     if [ "$1" -eq "0" ]; then
138     # Remove the File Context
139     (
140     semanage fcontext -d "%{_localstatedir}/lib/dehydrated(/.*)?"
141     ) &>/dev/null || :
142     fi
143     %endif
144    
145     %files
146     %doc LICENSE README.md docs/examples/hook.sh
147 unnilennium 1.3 %dir %attr(0755,root,root) %{_sysconfdir}/%{name}/hooks_clean_challenge.d/
148     %attr(0644, root,root) %{_sysconfdir}/%{name}/hooks_deploy_cert.d/*
149     %config(noreplace) %{_sysconfdir}/%{name}/domains.txt
150     %config(noreplace) %{_sysconfdir}/%{name}/config
151 unnilennium 1.1 %config(noreplace) %attr(0755,root,root) %{_sysconfdir}/cron.daily/%{name}
152     %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
153     %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
154     %attr(0755,root,root) %{_bindir}/%{name}
155     %attr(0755,root,root) %{_bindir}/dehydrated_hooks
156     %attr(0755,root,root) %{_bindir}/dehydrated_revoke
157     %dir %attr(0750,root,apache) %{_localstatedir}/lib/%{name}/challenges
158     %dir %attr(0750,root,root) %{_localstatedir}/lib/%{name}/certificates
159    
160     %changelog
161 jpp 1.5 * Fri Feb 16 2018 Jean-Philipe Pialasse <tests@pialasse.com> 0.5.0-1.sme
162     - upgrade to upstream version [SME: 10521]
163    
164 unnilennium 1.4 * Fri Feb 10 2017 Jean-Philipe Pialasse <tests@pialasse.com> - 0.4.0-1.sme
165     - update architecture of sources and release/version number
166     - according to Charlie Brady recomendations
167     - see [SME 9901]
168 unnilennium 1.3 * Mon Feb 06 2017 Jean-Philipe Pialasse <tests@pialasse.com> - 0.4.0.20170205.git1163864.sme
169     - update dehydrated to 0.4 [SME: 10080]
170     - see https://github.com/lukas2511/dehydrated/releases/tag/v0.4.0
171 unnilennium 1.4 - upstream release Version 0.4.0 commit 116386486b3749e4c5e1b4da35904f30f8b2749b
172 unnilennium 1.3
173 unnilennium 1.2 * Fri Jan 06 2017 Jean-Philipe Pialasse <tests@pialasse.com> - 0.3.0.20160914.gitcaeed7d-4.sme
174 unnilennium 1.4 - Initial import in SME Server Buildsys [SME: 9901]
175 unnilennium 1.2
176 unnilennium 1.1 * Mon Oct 24 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.3.0.20160914.gitcaeed7d-3
177     - Fix warning when installing dehydrated without upgrading from letsencrypt.sh
178    
179     * Mon Sep 19 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.3.0.20160914.gitcaeed7d-2
180     - Fix find command to work with older find versions (on el5), replace -executable with -perm /111
181    
182     * Wed Sep 14 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.3.0.20160914.gitcaeed7d-1
183     - Renamed to dehydrated
184    
185     * Wed Aug 24 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160803.gitafabfff-2
186     - Set var_lib_t context to files
187    
188     * Wed Aug 3 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160803.gitafabfff-1
189     - Update to git afabfff
190    
191     * Mon Jun 6 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160531.gitec48906-4
192     - Default to enable HOOK in config
193    
194     * Fri Jun 3 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160531.gitec48906-3
195     - Add missing exec permission on daily cronjob script
196    
197     * Wed Jun 1 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160531.gitec48906-2
198     - Fix le_revoke.sh script to use config instead of config.sh
199    
200     * Tue May 31 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160531.gitec48906-1
201     - Update to git ec48906
202    
203     * Fri May 13 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160513.gita286741-1
204     - Update to git a286741
205    
206     * Wed Mar 30 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160330.gitdca25e8-1
207     - Update to git dca25e8
208     - Fix arg shifting in le_hooks script
209    
210     * Tue Feb 23 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160223.git2099c77-1
211     - Update to GIT git2099c77
212    
213     * Sat Jan 30 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160127.git79ff846-2
214     - Rename httpd.sh hook to 10httpd.sh
215     - Provide le_revoke.sh script to revoke old certificates
216     - Add timestamp to logs using awk
217    
218     * Fri Jan 29 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.20160127.git79ff846-1
219     - Use date based version number
220    
221     * Wed Jan 27 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.3.git79ff846-1
222     - Update to git 79ff846
223    
224     * Mon Jan 25 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.2.git3432f60-1
225     - Add hooks directory
226    
227     * Mon Jan 25 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.0.1.git3432f60-1
228     - First package

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed