From db3715d4addb03e2f9e855ca83d082329a460e1c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 26 2020 13:56:50 +0000 Subject: import httpd24-mod_md-2.0.8-1.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6333b36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/mod_md-2.0.8.tar.gz diff --git a/.httpd24-mod_md.metadata b/.httpd24-mod_md.metadata new file mode 100644 index 0000000..083e09c --- /dev/null +++ b/.httpd24-mod_md.metadata @@ -0,0 +1 @@ +6cec32070c6fd83701be0874a2d8b4f30d929d03 SOURCES/mod_md-2.0.8.tar.gz diff --git a/SOURCES/a2md.xml b/SOURCES/a2md.xml new file mode 100644 index 0000000..0f74182 --- /dev/null +++ b/SOURCES/a2md.xml @@ -0,0 +1,418 @@ + + + + + + + a2md + mod_md + AuthorEissingStefanstefan.eissing@greenbytes.de + DocumentationUhliarikLubosluhliari@redhat.com + + + + a2md + 1 + + + + a2md + Show and manipulate Apache Managed Domains + + + + + a2md + options + + acme + add + update + drive + list + store + + cmd options + args + + + + + Description + + The a2md utility can be used to configure and update managed domains with + the mod_md module for Apache HTTP Server. Managed Domains are virtual hosts + which automatically obtain and renew TLS certificates from an ACME server. + + + + + Options + + + + + arg, + arg + + The url of the ACME server directory + + + + + arg, + arg + + Directory for file data + + + + + , + + + Print usage information + + + + + , + + + Produce JSON output + + + + + arg, + arg + + Use the HTTP proxy url + + + + + , + + + Produce less output + + + + + arg, + arg + + You agree to the terms of services (url) + + + + + , + + + Produce more output + + + + + , + + + Print version + + + + + ACME server commands + + a2md acme + + newreg + delreg + agree + authz + validate + + opts + args + + + + Play with the ACME server. For most of the commands you need to specify + the url of the ACME server directory. + + + + newreg + + newreg + contact-uri + contact-uri... + + Register a new account at ACME server with given contact-uri (email) + + + + delreg + + delreg + account + + Delete an existing ACME account + + + + agree + + agree + account + + Agree to ACME terms of service + + + + authz + + authz + account + domain + + Request a new authorization for an account and + domain + + + + validate + + validate + account + + Validate account existence + + + + + Managed domain addition + + a2md add + opts + domain + domain... + + + + Adds a new managed domain. Must not overlap with existing domains. + + + + + Updating managed domain + + a2md update + name + opts + + domains + ca + account + contacts + agreement + + + + + Update a managed domain's properties, where name belongs to managed domain which + will be updated. + + + URL of ACME server can be also updated if | + option is present. + + + domains + + domains + dname + dname... + + Update domain where dname is domain name which will be updated. + + + + ca + + ca + url + proto + + The URL where the CA offers its service. + Currently only ACME (LetsEncrypt) proto is implemented. + + + + account + + account + + Account name on corresponding ACME server. + + + + contacts + + contacts + email + email... + + Contact address which will be used by ACME server to inform about renewals or changed terms of service. + + + + agreement + + agreement + URI + + URI pointing to terms of service of ACME server. + + + + + Drive managed domains + + a2md drive + md... + options... + + + + Drive all or the mentioned managed domains toward completeness + + + Options + + + + arg, + arg + + Which challenge type to use + + + + , + + + Force driving the managed domain, even when it seems valid + + + + , + + + Reset any staging data for the managed domain + + + + + + + List managed domamins + + a2md list + + + + List all managed domains + + + + + Manipulating MD store + + a2md store + + add + remove + list + update + + opts + args + + + + Manipulate the MD store + + + + add + + add + dns + dns2... + + Add a new managed domain dns with all the additional domain names + + + + remove + + remove + -f | --force + name + name... + + Remove the managed domains name from the store + When or option is specified, force managed domain removal - be silent about missing domains + + + list + + list + + List all managed domains in the store + + + update + + update + name + + domains + dname + dname... + + + If cmd is specified followed by one or + more domains, MD store will be updated with those domains. + URL of ACME server can be also updated if | + option is present. + + + + + + + diff --git a/SOURCES/mod_md-2.0.8-duptrim-seg.patch b/SOURCES/mod_md-2.0.8-duptrim-seg.patch new file mode 100644 index 0000000..4267558 --- /dev/null +++ b/SOURCES/mod_md-2.0.8-duptrim-seg.patch @@ -0,0 +1,13 @@ +diff --git a/src/md_result.c b/src/md_result.c +index 4076d5b..0e0b688 100644 +--- a/src/md_result.c ++++ b/src/md_result.c +@@ -32,7 +32,7 @@ + static const char *dup_trim(apr_pool_t *p, const char *s) + { + char *d = apr_pstrdup(p, s); +- apr_collapse_spaces(d, d); ++ if (d) apr_collapse_spaces(d, d); + return d; + } + diff --git a/SOURCES/mod_md-2.0.8-state_dir.patch b/SOURCES/mod_md-2.0.8-state_dir.patch new file mode 100644 index 0000000..970424f --- /dev/null +++ b/SOURCES/mod_md-2.0.8-state_dir.patch @@ -0,0 +1,23 @@ + +Enable state_dir support for 2.4.x. + +--- mod_md-2.0.8/src/mod_md_config.c.state_dir ++++ mod_md-2.0.8/src/mod_md_config.c +@@ -44,7 +44,7 @@ + /* Default settings for the global conf */ + static md_mod_conf_t defmc = { + NULL, /* list of mds */ +-#if AP_MODULE_MAGIC_AT_LEAST(20180906, 2) ++#if 1 + NULL, /* base dir by default state-dir-relative */ + #else + MD_DEFAULT_BASE_DIR, +@@ -898,7 +898,7 @@ + mc->hsts_header = apr_psprintf(p, "max-age=%d", mc->hsts_max_age); + } + +-#if AP_MODULE_MAGIC_AT_LEAST(20180906, 2) ++#if 1 + if (mc->base_dir == NULL) { + mc->base_dir = ap_state_dir_relative(p, MD_DEFAULT_BASE_DIR); + } diff --git a/SPECS/mod_md.spec b/SPECS/mod_md.spec new file mode 100644 index 0000000..eb0cb53 --- /dev/null +++ b/SPECS/mod_md.spec @@ -0,0 +1,95 @@ +%{?scl:%scl_package mod_md} + +Name: %{?scl:%scl_prefix}mod_md +Version: 2.0.8 +Release: 1%{?dist} +Summary: Certificate provisioning using ACME for the Apache HTTP Server +License: ASL 2.0 +URL: https://icing.github.io/mod_md/ +Source0: https://github.com/icing/mod_md/releases/download/v%{version}/mod_md-%{version}.tar.gz +# documentation +Source10: a2md.xml +Patch1: mod_md-2.0.8-state_dir.patch +Patch2: mod_md-2.0.8-duptrim-seg.patch +BuildRequires: gcc +BuildRequires: pkgconfig, %{?scl:%scl_prefix}httpd-devel >= 0:2.4.34-16, openssl-devel >= 1.1.0 +BuildRequires: jansson-devel, %{?scl:%scl_prefix}libcurl-devel, %{?scl:%scl_prefix}libnghttp2-devel +BuildRequires: xmlto +Requires: %{?scl:%scl_prefix}httpd-mmn = %{_httpd24_mmn}, %{?scl:%scl_prefix}mod_ssl >= 1:2.4.34-16 +Conflicts: %{?scl:%scl_prefix}httpd < 2.4.34-16 +Epoch: 1 + +%description +This module manages common properties of domains for one or more +virtual hosts. Specifically it can use the ACME protocol to automate +certificate provisioning. Certificates will be configured for managed +domains and their virtual hosts automatically, including at renewal. + +%prep +%if 0%{?scl:1} +export LD_LIBRARY_PATH=%{_libdir}:$LD_LIBRARY_PATH +%endif + +%setup -q %{?scl:-n %{pkg_name}-%{version}} +%patch1 -p1 -b .state_dir +%patch2 -p1 -b .dup_trim + +xmlto man $RPM_SOURCE_DIR/a2md.xml + +%build +%if 0%{?scl:1} +export APXS=%{_httpd24_apxs} +export LIBCURL=%{_prefix} +export LD_LIBRARY_PATH=%{_libdir}:$LD_LIBRARY_PATH +%else +export APXS=%{_httpd_apxs} +export LIBCURL=%{_prefix} +%endif + +./configure \ + --prefix=%{_sysconfdir}/httpd \ + --exec-prefix=%{_prefix} \ + --bindir=%{_bindir} \ + --sbindir=%{_sbindir} \ + --mandir=%{_mandir} \ + --libdir=%{_libdir} \ + --with-apxs=$APXS \ + --with-curl=$LIBCURL + +# remove rpath +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + +%make_build V=1 + +%check +%make_build check + +%install +%make_install +rm -rf %{buildroot}%{_sysconfdir}/httpd/share/doc/ + +# remove links and rename SO files +rm -f %{buildroot}%{_httpd24_moddir}/mod_md.so +mv %{buildroot}%{_httpd24_moddir}/mod_md.so.0.0.0 %{buildroot}%{_httpd24_moddir}/mod_md.so + +# create configuration +mkdir -p %{buildroot}%{_httpd24_modconfdir} +echo "LoadModule md_module modules/mod_md.so" > %{buildroot}%{_httpd24_modconfdir}/01-md.conf + +# Install man pages +install -d $RPM_BUILD_ROOT%{_mandir}/man1 +install -m 644 -p a2md.1 $RPM_BUILD_ROOT%{_mandir}/man1 + +%files +%doc README.md ChangeLog AUTHORS +%license LICENSE +%config(noreplace) %{_httpd24_modconfdir}/01-md.conf +%{_httpd24_moddir}/mod_md.so +%{_bindir}/a2md +%{_mandir}/man1/* + +%changelog +* Tue Feb 04 2020 Lubos Uhliarik - 1:2.0.8-1 +- Initial import +- Resolves: #1788976 - RFE: updated collection for httpd 2.4