From 829106189246ba5bc243d33a34ac2c77ab61dc95 Mon Sep 17 00:00:00 2001 From: Christopher Engelhard Date: Aug 18 2020 15:22:40 +0000 Subject: change package name to acme-sh --- diff --git a/acme-sh/.gitignore b/acme-sh/.gitignore new file mode 100644 index 0000000..3ca1f11 --- /dev/null +++ b/acme-sh/.gitignore @@ -0,0 +1 @@ +acme.sh-2.8.6 diff --git a/acme-sh/2.8.6.tar.gz b/acme-sh/2.8.6.tar.gz new file mode 100644 index 0000000..810807a Binary files /dev/null and b/acme-sh/2.8.6.tar.gz differ diff --git a/acme-sh/README-fedora.md b/acme-sh/README-fedora.md new file mode 100644 index 0000000..023cb98 --- /dev/null +++ b/acme-sh/README-fedora.md @@ -0,0 +1 @@ +blablabl diff --git a/acme-sh/README.md b/acme-sh/README.md new file mode 100644 index 0000000..28f5157 --- /dev/null +++ b/acme-sh/README.md @@ -0,0 +1,3 @@ +# acme.sh-rpm + +RPM packaging for acme.sh \ No newline at end of file diff --git a/acme-sh/acme-sh.service b/acme-sh/acme-sh.service new file mode 100644 index 0000000..079f749 --- /dev/null +++ b/acme-sh/acme-sh.service @@ -0,0 +1,9 @@ +[Unit] +Description=Renew certificates using acme.sh +After=network-online.target + +[Service] +Type=oneshot +ExecStart=%{_bindir}/acme.sh --renew-all +# acme.sh returns 2 when renewal is skipped (i.e. certs up to date) +SuccessExitStatus=0 2 diff --git a/acme-sh/acme-sh.timer b/acme-sh/acme-sh.timer new file mode 100644 index 0000000..789daf9 --- /dev/null +++ b/acme-sh/acme-sh.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Automatically renew certificates using acme.sh + +[Timer] +OnCalendar=daily +RandomizedDelaySec=1h +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/acme-sh/acme.sh.conf b/acme-sh/acme.sh.conf new file mode 100644 index 0000000..e994117 --- /dev/null +++ b/acme-sh/acme.sh.conf @@ -0,0 +1 @@ +# example config file diff --git a/acme-sh/acme.sh.rpmlintrc b/acme-sh/acme.sh.rpmlintrc new file mode 100644 index 0000000..1bd41bb --- /dev/null +++ b/acme-sh/acme.sh.rpmlintrc @@ -0,0 +1,2 @@ +# ignore spurios spelling errors +addFilter("spelling-error .*(wildcard|usr|md).*") diff --git a/acme-sh/acme.sh.spec b/acme-sh/acme.sh.spec new file mode 100644 index 0000000..3d48052 --- /dev/null +++ b/acme-sh/acme.sh.spec @@ -0,0 +1,105 @@ +%global binname acme.sh + +Name: acme-sh +Version: 2.8.6 +Release: 0.2%{?dist} +Summary: An ACME client written purely in POSIX Shell +Url: https://github.com/acmesh-official/acme.sh +License: GPLv3 +Source0: https://github.com/acmesh-official/%{binname}/archive/%{version}.tar.gz +Source1: %{binname}_launcher +Source2: %{binname}.conf +Source3: %{name}.service +Source4: %{name}.timer + +BuildArch: noarch +Requires: /usr/bin/sh +Requires: systemd +BuildRequires: systemd-rpm-macros + + +%description +Acme.sh is an ACME client written purely in POSIX Shell language. It implements +the full ACME protocol and supports both ACMEv1 and ACMEv2 as well as ACMEv2 +wildcard certificates. + +It can automatically issue, renew and install certificates and supports a +wide variety of DNS provider APIs for DNS-01 challenges. + +The Fedora version of this package is configured for using system-wide +directories. See %{_docdir}/README-fedora.md for details. + +#-- PREP, BUILD & INSTALL -----------------------------------------------------# +%prep +%autosetup -p1 + +sed -i -e "s|%%{_bindir}|%{_bindir}|g" \ + -e "s|%%{_sbindir}|%{_sbindir}|g" \ + -e "s|%%{_libexecdir}|%{_libexecdir}|g" \ + -e "s|%%{_sysconfdir}|%{_sysconfdir}|g" \ + -e "s|%%{_initddir}|%{_initddir}|g" \ + -e "s|%%{_localstatedir}|%{_localstatedir}|g" \ + -e "s|%%{_sharedstatedir}|%{_sharedstatedir}|g" \ + -e "s|%%{_rundir}|%{_rundir}|g" \ + -e "s|%%{_pkgdocdir}|%{_pkgdocdir}|g" \ + -e "s|%%{_datadir}|%{_datadir}|g" \ + -e "s|%%{name}|%{name}|g" \ + %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} + +mv deploy/README.md README-deploy.md +mv dnsapi/README.md README-dnsapi.md + +%build +# nothing to build + +%install +install -p -d -m 0755 %{buildroot}/%{_bindir} +install -p -d -m 0755 %{buildroot}/%{_unitdir} +install -p -d -m 0755 %{buildroot}/%{_datadir}/%{name}/ +install -p -d -m 0700 %{buildroot}/%{_sysconfdir}/%{name}/ +install -p -d -m 0700 %{buildroot}/%{_sharedstatedir}/%{name}/ + +install -p -d -m 0755 %{buildroot}/%{_datadir}/%{name}/deploy +install -p -d -m 0755 %{buildroot}/%{_datadir}/%{name}/dnsapi +install -p -d -m 0755 %{buildroot}/%{_datadir}/%{name}/notify +install -p -m 0755 %{binname} %{buildroot}/%{_datadir}/%{name}/%{name} +install -m 0755 deploy/*.sh %{buildroot}/%{_datadir}/%{name}/deploy +install -m 0755 dnsapi/*.sh %{buildroot}/%{_datadir}/%{name}/dnsapi +install -m 0755 notify/*.sh %{buildroot}/%{_datadir}/%{name}/notify + +install -p -m 0755 %{SOURCE1} %{buildroot}/%{_bindir}/%{name} +install -p -m 0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name}/%{name}.conf +install -p -m 0644 %{SOURCE3} %{buildroot}/%{_unitdir}/%{name}.service +install -p -m 0644 %{SOURCE4} %{buildroot}/%{_unitdir}/%{name}.timer + +#-- SCRIPTLETS -----------------------------------------------------------------# +%post +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service + +#-- FILES ---------------------------------------------------------------------# +%files +%doc README.md +%doc README-deploy.md +%doc README-dnsapi.md +%license LICENSE.md +%{_bindir}/%{name} +%{_datadir}/%{name}/ +%{_unitdir}/%{name}.* +%dir %attr(0700, root, -) %{_sharedstatedir}/%{name}/ +%dir %attr(0700, root, -) %{_sysconfdir}/%{name}/ +%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf + +#-- CHANGELOG -----------------------------------------------------------------# +%changelog +* Tue Aug 18 2020 Christopher Engelhard 2.8.6-0.2 +- (test release) add description & summary (ce@lcts.de) + +* Tue Aug 18 2020 Christopher Engelhard 2.8.6-0.1 +- this is just a test release + diff --git a/acme-sh/acme.sh_launcher b/acme-sh/acme.sh_launcher new file mode 100644 index 0000000..d950f5a --- /dev/null +++ b/acme-sh/acme.sh_launcher @@ -0,0 +1,23 @@ +#!/usr/bin/sh +# set up environment for acme.sh before launching the script + +# set default paths unless user has set them already +# everything else can be set through account.conf +LE_WORKING_DIR=${LE_WORKING_DIR:-"%{_datadir}/acme.sh"} +LE_CONFIG_HOME=${LE_CONFIG_HOME:-"%{_sharedstatedir}/acme.sh"} +ACCOUNT_CONF_PATH=${ACCOUNT_CONF_PATH:-"%{_sysconfdir}/acme.sh/acme.sh.conf"} + +# file to source DNS API credentials from +#DNSAPI_CONF_PATH="%{_sysconfdir}/acme.sh/dnsapi.conf" + +# if that file exists, source & export variables from it +#if [ -f "$DNSAPI_CONF_PATH" ]; then +# set -o allexport +# . "$DNSAPI_CONF_PATH" +# set +o allexport +#fi + +# launch acme.sh +.%{_datadir}/acme.sh/acme.sh "$@" + +exit $? diff --git a/acme-sh/dnsapi.conf b/acme-sh/dnsapi.conf new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/acme-sh/dnsapi.conf