From 4b87cbd83e91f8caebd1589edacc43174b5798b7 Mon Sep 17 00:00:00 2001 From: Lubos Uhliarik Date: Thu, 13 Jun 2019 17:41:24 +0200 Subject: [PATCH] Initial import (#1719248). --- .gitignore | 1 + README.md | 3 -- mod_md-2.0.3-state_dir.patch | 42 +++++++++++++++++++++++++ mod_md.spec | 61 ++++++++++++++++++++++++++++++++++++ sources | 1 + 5 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 .gitignore delete mode 100644 README.md create mode 100644 mod_md-2.0.3-state_dir.patch create mode 100644 mod_md.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..22efd95 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/mod_md-2.0.3.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 5ebc5e1..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# mod_md - -The mod_md package \ No newline at end of file diff --git a/mod_md-2.0.3-state_dir.patch b/mod_md-2.0.3-state_dir.patch new file mode 100644 index 0000000..80ad5e8 --- /dev/null +++ b/mod_md-2.0.3-state_dir.patch @@ -0,0 +1,42 @@ +From 67cb21cae6ce9b1d76479f2fff14fe5ea106f994 Mon Sep 17 00:00:00 2001 +From: Joe Orton +Date: Tue, 11 Jun 2019 15:17:59 +0100 +Subject: [PATCH] Fix use of StateDir after httpd trunk r1852982: + +* src/mod_md_config.c (md_config_post_config): Pick up base_dir + from statedir in post-config phase so StateDir can influence it. + +(Sync with httpd r1857731) +--- + src/mod_md_config.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/mod_md_config.c b/src/mod_md_config.c +index f9dd128..8a9330f 100644 +--- a/src/mod_md_config.c ++++ b/src/mod_md_config.c +@@ -131,11 +131,6 @@ static md_mod_conf_t *md_mod_conf_get(apr_pool_t *pool, int create) + mod_md_config->env = apr_table_make(pool, 10); + mod_md_config->init_errors = apr_hash_make(pool); + +-#if AP_MODULE_MAGIC_AT_LEAST(20180906, 2) +- mod_md_config->base_dir = ap_state_dir_relative(pool, +- MD_DEFAULT_BASE_DIR); +-#endif +- + apr_pool_cleanup_register(pool, NULL, cleanup_mod_config, apr_pool_cleanup_null); + } + +@@ -853,6 +848,12 @@ apr_status_t md_config_post_config(server_rec *s, apr_pool_t *p) + if (mc->hsts_max_age > 0) { + mc->hsts_header = apr_psprintf(p, "max-age=%d", mc->hsts_max_age); + } ++ ++#if 1 ++ if (mc->base_dir == NULL) { ++ mc->base_dir = ap_state_dir_relative(p, MD_DEFAULT_BASE_DIR); ++ } ++#endif + + return APR_SUCCESS; + } diff --git a/mod_md.spec b/mod_md.spec new file mode 100644 index 0000000..4b73cfa --- /dev/null +++ b/mod_md.spec @@ -0,0 +1,61 @@ +# Module Magic Number +%{!?_httpd_mmn: %global _httpd_mmn %(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo 0-0)} + +Name: mod_md +Version: 2.0.3 +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 +Patch1: mod_md-2.0.3-state_dir.patch +BuildRequires: gcc +BuildRequires: pkgconfig, httpd-devel >= 2.4.38, openssl-devel >= 1.1.0, jansson-devel, libcurl-devel +Requires: httpd-mmn = %{_httpd_mmn} +Conflicts: httpd < 2.4.39-7 +Epoch: 1 + +%description +This module manages common properties of domains for one or more +virtual hosts. Specifically it can use the ACME protocol (RFC Draft) +to automate certificate provisioning. These will be configured for +managed domains and their virtual hosts automatically. This includes +renewal of certificates before they expire. + +%prep +%setup -q +%patch1 -p1 -b .state_dir + +%build +%configure +# 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 check + +%install +%make_install +rm -rf %{buildroot}/etc/httpd/share/doc/ + +# remove links and rename SO files +rm -f %{buildroot}%{_httpd_moddir}/mod_md.so +mv %{buildroot}%{_httpd_moddir}/mod_md.so.0.0.0 %{buildroot}%{_httpd_moddir}/mod_md.so + +# create configuration +mkdir -p %{buildroot}%{_httpd_modconfdir} +echo "LoadModule md_module modules/mod_md.so" > %{buildroot}%{_httpd_modconfdir}/01-md.conf + +%files +%doc README.md ChangeLog AUTHORS +%license LICENSE +%config(noreplace) %{_httpd_modconfdir}/01-md.conf +%{_httpd_moddir}/mod_md.so +%{_bindir}/a2md + +%changelog +* Tue Jun 11 2019 Lubos Uhliarik - 2.0.3-1 +- Initial import (#1719248). diff --git a/sources b/sources new file mode 100644 index 0000000..1d870ab --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (mod_md-2.0.3.tar.gz) = af76224d1f7c38336b189b9e324524a20c08936c5c8cf5be8b208c9af0b4209b9bc0bed62e6199f0ad87b712afd07f066dce4ec50af7bf1731bec97b3fd6a767