Initial import (#1719248).

This commit is contained in:
Lubos Uhliarik 2019-06-13 17:41:24 +02:00
parent 73975abcd9
commit 4b87cbd83e
5 changed files with 105 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/mod_md-2.0.3.tar.gz

View File

@ -1,3 +0,0 @@
# mod_md
The mod_md package

View File

@ -0,0 +1,42 @@
From 67cb21cae6ce9b1d76479f2fff14fe5ea106f994 Mon Sep 17 00:00:00 2001
From: Joe Orton <jorton@redhat.com>
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;
}

61
mod_md.spec Normal file
View File

@ -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 <luhliari@redhat.com> - 2.0.3-1
- Initial import (#1719248).

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (mod_md-2.0.3.tar.gz) = af76224d1f7c38336b189b9e324524a20c08936c5c8cf5be8b208c9af0b4209b9bc0bed62e6199f0ad87b712afd07f066dce4ec50af7bf1731bec97b3fd6a767