[mod_annodex] update packaging (#803064)

jorton jorton at fedoraproject.org
Mon Apr 23 21:06:15 UTC 2012


commit e8aa60ed29967da5ffc9eb08a0f4107950a040e0
Author: Joe Orton <jorton at redhat.com>
Date:   Mon Apr 23 22:06:03 2012 +0100

    update packaging (#803064)
    
    Resolves: rhbz#803064

 annodex.conf     |    2 +-
 mod_annodex.spec |   46 ++++++++++++++++++++++++++++++++--------------
 2 files changed, 33 insertions(+), 15 deletions(-)
---
diff --git a/annodex.conf b/annodex.conf
index 9d969ba..e6f7505 100644
--- a/annodex.conf
+++ b/annodex.conf
@@ -1,4 +1,4 @@
-LoadModule annodex_module /usr/lib/httpd/modules/mod_annodex.so
+LoadModule annodex_module modules/mod_annodex.so
 
 # mod_annodex
 <IfModule mod_annodex.c>
diff --git a/mod_annodex.spec b/mod_annodex.spec
index 8c08bce..0c0f13a 100644
--- a/mod_annodex.spec
+++ b/mod_annodex.spec
@@ -1,6 +1,12 @@
+%{!?_httpd_apxs:       %{expand: %%global _httpd_apxs       %%{_sbindir}/apxs}}
+%{!?_httpd_mmn:        %{expand: %%global _httpd_mmn        %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
+%{!?_httpd_confdir:    %{expand: %%global _httpd_confdir    %%{_sysconfdir}/httpd/conf.d}}
+# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
+%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
+
 Name:           mod_annodex
 Version:        0.2.2
-Release:        14%{?dist}
+Release:        15%{?dist}
 Summary:        Apache module for server-side support of annodex media
 
 Group:          System Environment/Daemons
@@ -16,7 +22,7 @@ BuildRequires:	httpd-devel >= 2.0.40
 BuildRequires:  pkgconfig
 BuildRequires:	sed
 
-Requires:	httpd >= 2.0.40
+Requires:	httpd-mmn = %{_httpd_mmn}
 
 %description
 mod_annodex provides full support for Annodex.net media. For more details
@@ -40,36 +46,48 @@ following features:
 %setup -q -n %{name}-ap20-%{version}
 
 %build
-%{_sbindir}/apxs -c mod_annodex.c `pkg-config annodex cmml --cflags --libs`
+%{_httpd_apxs} -c mod_annodex.c `pkg-config annodex cmml --cflags --libs`
 mv .libs/%{name}.so .
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/httpd/modules
-install -m755 %{name}.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules
+mkdir -p $RPM_BUILD_ROOT%{_httpd_moddir}
+install -m755 %{name}.so $RPM_BUILD_ROOT%{_httpd_moddir}
 
 # install config file
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
-%ifarch x86_64
-sed 's at lib@lib64 at g' %{SOURCE1} > conf
+mkdir -p $RPM_BUILD_ROOT%{_httpd_confdir} \
+         $RPM_BUILD_ROOT%{_httpd_modconfdir}
+
+%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
+# httpd >= 2.4.x
+sed -n /^LoadModule/p %{SOURCE1} > 10-annodex.conf
+sed /^LoadModule/d %{SOURCE1} > annodex.conf
+touch -r %{SOURCE1} 10-annodex.conf annodex.conf
+install -Dp -m 0644 annodex.conf $RPM_BUILD_ROOT%{_httpd_confdir}/annodex.conf
+install -Dp -m 0644 10-annodex.conf $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-annodex.conf
 %else
-cat %{SOURCE1} > conf
+# httpd <= 2.2.x
+install -Dp -m 644 annodex.conf \
+   $RPM_BUILD_ROOT%{_httpd_confdir}/annodex.conf
 %endif
 
-install -m 644 conf \
-   $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/annodex.conf
-
 %clean
 rm -rf $RPM_BUILD_ROOT
                                                                                 
 %files
 %defattr(-,root,root)
 %doc LICENSE README
-%{_libdir}/httpd/modules/mod_annodex.so
-%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
+%{_httpd_moddir}/mod_annodex.so
+%config(noreplace) %{_httpd_confdir}/*.conf
+%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
+%config(noreplace) %{_httpd_modconfdir}/*.conf
+%endif
 
 %changelog
+* Mon Apr 23 2012 Joe Orton <jorton at redhat.com> - 0.2.2-15
+- update packaging (#803064)
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.2.2-14
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list