#One spec to rule them all #Adapted from fedora's spec %bcond_without docs %bcond_without tests #Missing requires for the moment %bcond_with modules %global SPHINXBUILD sphinx-build-3 %if %{with modules} %global MODULES %{expand:certbot-dns-cloudflare certbot-dns-digitalocean certbot-dns-dnsimple certbot-dns-dnsmadeeasy certbot-dns-gehirn certbot-dns-linode certbot-dns-luadns certbot-dns-nsone certbot-dns-ovh certbot-dns-rfc2136 certbot-dns-route53 certbot-dns-sakuracloud} %global MODULES %{expand:%MODULES certbot-dns-google} %else %global MODULES %{nil} %endif Name: certbot Version: 4.0.0 Release: %mkrel 2 Summary: A free, automated certificate authority client Group: Development/Python License: ASL 2.0 URL: https://github.com/certbot/certbot Source0: https://github.com/certbot/certbot/archive/v%{version}/%{name}-%{version}.tar.gz Source10: certbot-renew-systemd.service Source11: certbot-renew-systemd.timer Source12: certbot-sysconfig-certbot Source13: README.urpmi BuildArch: noarch BuildRequires: pkgconfig(python3) # For the systemd macros %{?systemd_requires} BuildRequires: pkgconfig(libsystemd) #For running tests %if %{with tests} BuildRequires: python3dist(python-augeas) BuildRequires: pkgconfig(augeas) BuildRequires: python3dist(pytest) %endif # for docs %if %{with docs} BuildRequires: make BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme %endif Requires: python3-acme %define _description() \%description -n %1\ \%{summary} %define _package() \%package -n %1\ Summary: %1 plugin for certbot\ Provides: %1 = \%{version}-\%{release}\ # adding these as manual requires because we nuke them with sed for the loop\ # of installing buildreqs and these would cause blocking since they aren't built yet\ Requires: python3-acme = \%{version}-\%{release}\ Requires: certbot = \%{version}-\%{release}\ %define _package_doc() \%package -n %1\ Summary: Documenation for %1 libraries Requires: font(fontawesome) %define _files() \%files -n certbot-dns-%1\ \%license certbot-dns-%1/LICENSE.txt\ \%doc certbot-dns-%1/README.rst\ \%{python3_sitelib}/certbot_dns_%1/\ \%{python3_sitelib}/certbot_dns_%1-\%{version}.dist-info/ %define _files_doc() \%files -n %1-doc\ \%license %1/LICENSE.txt\ \%doc %1/README.rst\ \%doc %1/docs/_build/html/ %description Certbot, previously the Let's Encrypt Client, is EFF's tool to obtain certs from Let's Encrypt, and (optionally) auto-enable HTTPS on your server. It can also act as a client for any other CA that uses the ACME protocol. %package -n python3-acme Summary: Python library for the ACME protocol %package -n certbot-apache Summary: The apache plugin for certbot Requires: mod_ssl # adding these as manual requires because we nuke them with sed for the loop # of installing buildreqs and these would cause blocking since they aren't built yet Requires: python3-acme = %{version}-%{release} Requires: certbot = %{version}-%{release} %package -n certbot-nginx Summary: The nginx plugin for certbot # adding these as manual requires because we nuke them with sed for the loop # of installing buildreqs and these would cause blocking since they aren't built yet Requires: python3-acme = %{version}-%{release} Requires: certbot = %{version}-%{release} %if %{with modules} %_package certbot-dns-cloudflare %_package certbot-dns-google %_package certbot-dns-digitalocean %_package certbot-dns-dnsimple %_package certbot-dns-dnsmadeeasy %_package certbot-dns-gehirn %_package certbot-dns-linode %_package certbot-dns-luadns %_package certbot-dns-nsone %_package certbot-dns-ovh %_package certbot-dns-rfc2136 %_package certbot-dns-route53 %_package certbot-dns-sakuracloud %endif %if %{with docs} %_package_doc python-acme-doc %_package_doc certbot-doc %if %{with modules} %_package_doc certbot-dns-cloudflare-doc %_package_doc certbot-dns-digitalocean-doc %_package_doc certbot-dns-dnsimple-doc %_package_doc certbot-dns-dnsmadeeasy-doc %_package_doc certbot-dns-gehirn-doc %_package_doc certbot-dns-google-doc %_package_doc certbot-dns-linode-doc %_package_doc certbot-dns-luadns-doc %_package_doc certbot-dns-nsone-doc %_package_doc certbot-dns-ovh-doc %_package_doc certbot-dns-rfc2136-doc %_package_doc certbot-dns-route53-doc %_package_doc certbot-dns-sakuracloud-doc %endif %endif %description -n python3-acme Python 3 library for use of the Automatic Certificate Management Environment protocol as defined by the IETF. It's used by the Let's Encrypt project. %description -n certbot-apache Plugin for certbot that allows for automatic configuration of apache %description -n certbot-nginx Plugin for certbot that allows for automatic configuration of ngnix %if %{with modules} %_description certbot-dns-cloudflare %_description certbot-dns-google %_description certbot-dns-digitalocean %_description certbot-dns-dnsimple %_description certbot-dns-dnsmadeeasy %_description certbot-dns-gehirn %_description certbot-dns-linode %_description certbot-dns-luadns %_description certbot-dns-nsone %_description certbot-dns-ovh %_description certbot-dns-rfc2136 %_description certbot-dns-route53 %_description certbot-dns-sakuracloud %endif %if %{with docs} %_description python-acme-doc %_description certbot-doc %if %{with modules} %_description certbot-dns-cloudflare-doc %_description certbot-dns-digitalocean-doc %_description certbot-dns-dnsimple-doc %_description certbot-dns-dnsmadeeasy-doc %_description certbot-dns-gehirn-doc %_description certbot-dns-google-doc %_description certbot-dns-linode-doc %_description certbot-dns-luadns-doc %_description certbot-dns-nsone-doc %_description certbot-dns-ovh-doc %_description certbot-dns-rfc2136-doc %_description certbot-dns-route53-doc %_description certbot-dns-sakuracloud-doc %endif %endif %prep %autosetup -n %{name}-%{version} -p1 install -Dpm644 %{SOURCE13} README.urpmi %generate_buildrequires for module in acme certbot %{MODULES} certbot-apache certbot-nginx do cd $module sed -Ei '/(acme|certbot)>=\{version\}/d' setup.py %pyproject_buildrequires cd .. done %build for module in acme certbot %{MODULES} certbot-apache certbot-nginx do cd $module %pyproject_wheel cd .. done %install %pyproject_install # not all modules have docs %if %{with docs} for module in acme certbot %{MODULES} do cd $module/docs && make html SPHINXBUILD=%{SPHINXBUILD} rm -rf docs/_build/html/{.buildinfo,man,_sources} cd ../.. done #Install docs in /usr/share/doc/$module #To be determined why I have to do this by hand #for module in certbot %{MODULES} #do #mkdir -p %{buildroot}/usr/share/doc/$module #pushd $module/docs/_build #mv html %{buildroot}/usr/share/doc/$module/ #popd #done %endif mv %{buildroot}%{_bindir}/certbot{,-3} # Add compatibility symlink as requested by upstream conference call ln -s certbot %{buildroot}/usr/bin/letsencrypt # Put the man pages in place #install -pD -t %%{buildroot}%%{_mandir}/man1 certbot/ocs/_build/html/man/*1* # Use python3 ln -s certbot-3 %{buildroot}%{_bindir}/certbot install -Dm 0644 --preserve-timestamps %{SOURCE10} %{buildroot}%{_unitdir}/certbot-renew.service install -Dm 0644 --preserve-timestamps %{SOURCE11} %{buildroot}%{_unitdir}/certbot-renew.timer install -Dm 0644 --preserve-timestamps %{SOURCE12} %{buildroot}%{_sysconfdir}/sysconfig/certbot install -Dm 0644 --preserve-timestamps %{SOURCE13} %{buildroot}%{_sysconfdir}/letsencrypt/cli.ini %if %{with tests} %check for module in acme certbot certbot-apache certbot-nginx %{MODULES} ; do pushd $module %pytest -v -W ignore::DeprecationWarning popd done %endif %preun %systemd_preun certbot-renew.timer %postun %systemd_postun certbot-renew.timer %files %license certbot/LICENSE.txt %doc certbot/README.rst certbot/CHANGELOG.md README.urpmi %{_bindir}/%{name} %{_bindir}/certbot-3 %{_bindir}/letsencrypt # project uses old letsencrypt dirs for compatibility %ghost %dir %{_sysconfdir}/letsencrypt %ghost %dir %{_sharedstatedir}/letsencrypt %ghost %dir %{_logdir}/letsencrypt %config %{_sysconfdir}/sysconfig/certbot %{_unitdir}/certbot-renew.service %{_unitdir}/certbot-renew.timer #{_mandir}/man*/%{name}.* %{python3_sitelib}/certbot/ %{python3_sitelib}/certbot-%{version}.dist-info/ %files -n python3-acme %license acme/LICENSE.txt %doc acme/README.rst %{python3_sitelib}/acme/ %{python3_sitelib}/acme-%{version}.dist-info/ %files -n certbot-apache %license certbot-apache/LICENSE.txt %doc certbot-apache/README.rst %{python3_sitelib}/certbot_apache/ %{python3_sitelib}/certbot_apache-%{version}.dist-info/ %files -n certbot-nginx %license certbot-nginx/LICENSE.txt %doc certbot-nginx/README.rst %{python3_sitelib}/certbot_nginx/ %{python3_sitelib}/certbot_nginx-%{version}.dist-info/ %if %{with modules} %_files cloudflare %_files google %_files digitalocean %_files dnsimple %_files dnsmadeeasy %_files gehirn %_files linode %_files luadns %_files nsone %_files ovh %_files rfc2136 %_files route53 %_files sakuracloud %endif %if %{with docs} %files -n python-acme-doc %license acme/LICENSE.txt %doc acme/README.rst %doc acme/docs/_build/html %_files_doc certbot %if %{with modules} %_files_doc certbot-dns-cloudflare %_files_doc certbot-dns-digitalocean %_files_doc certbot-dns-dnsimple %_files_doc certbot-dns-dnsmadeeasy %_files_doc certbot-dns-gehirn %_files_doc certbot-dns-google %_files_doc certbot-dns-linode %_files_doc certbot-dns-luadns %_files_doc certbot-dns-nsone %_files_doc certbot-dns-ovh %_files_doc certbot-dns-rfc2136 %_files_doc certbot-dns-route53 %_files_doc certbot-dns-sakuracloud %endif %endif