File acmetool.spec of Package acmetool

# spec file for package acmetool
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           acmetool
Version:        0.0.63
Release:        0
Summary:        A automatic certificate acquisition tool for ACME (Let's Encrypt) 
License:        MIT
Group:          Productivity/Networking/Security
Source1:        acmetool.service
Source2:        acmetool.timer
Source3:        acmetool.tmpfile
Recommends:     cron
ExclusiveArch:  x86_64
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Acmetool is an easy-to-use command line tool for automatically acquiring
certificates from ACME servers (such as Let's Encrypt).  Designed to
flexibly integrate into your webserver setup to enable automatic
verification.  Unlike the official Let's Encrypt client, this doesn't modify
your web server configuration.

%setup -qn acmetool-v%{version}-linux_amd64_cgo
sed -i 's@/var/run@%{_rundir}@g' %{S:3}

#nothing to do binary distribution for now :)

install -D -m 0755 bin/acmetool %{buildroot}%{_bindir}/acmetool
install -Dm0644 doc/acmetool.8 %{buildroot}%{_mandir}/man8/acmetool.8
install -Dm0644 %{S:1} %{buildroot}%{_unitdir}/acmetool.service
install -Dm0644 %{S:2} %{buildroot}%{_unitdir}/acmetool.timer
install -Dm0644 %{S:3} %{buildroot}%{_tmpfilesdir}/acmetool.conf
install -dm0755 %{buildroot}%{_sbindir}
install -dm0755 %{buildroot}%{_prefix}/%{_lib}/acme/hooks
install -dm0755 %{buildroot}%{_var}/lib/acme/conf

( cd %{buildroot}%{_sbindir} && ln -s service rcacmetool )

%tmpfiles_create %_tmpfilesdir/acmetool.conf
%service_add_post acmetool.service

%service_del_postun acmetool.service

%service_add_pre acmetool.service

%service_del_preun acmetool.service

%ghost %{_rundir}/acme
# This is more for user to know where this package puts its files
%ghost %{_var}/lib/acme/accounts
%ghost %{_var}/lib/acme/certs
%ghost %{_var}/lib/acme/conf/target
%ghost %{_var}/lib/acme/desired
%ghost %{_var}/lib/acme/keys
%ghost %{_var}/lib/acme/live
%ghost %{_var}/lib/acme/tmp
%ghost %{_var}/lib/acme/conf
%ghost %{_sysconfdir}/cron.d/acmetool
%dir %{_prefix}/%{_lib}/acme
%dir %{_var}/lib/acme/conf
%dir %{_prefix}/%{_lib}/acme/hooks
%ghost %config(noreplace) %{_prefix}/%{_lib}/acme/hooks/haproxy
%ghost %config(noreplace) %{_prefix}/%{_lib}/acme/hooks/reload