SPECS: template-apache_module.spec (NEW) - based on template-apache1_module...

glen glen at pld-linux.org
Mon Oct 27 22:28:45 CET 2008


Author: glen                         Date: Mon Oct 27 21:28:45 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- based on template-apache1_module.spec

---- Files affected:
SPECS:
   template-apache_module.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SPECS/template-apache_module.spec
diff -u /dev/null SPECS/template-apache_module.spec:1.1
--- /dev/null	Mon Oct 27 22:28:45 2008
+++ SPECS/template-apache_module.spec	Mon Oct 27 22:28:39 2008
@@ -0,0 +1,105 @@
+# $Revision$, $Date$
+# Replace MODNAME with real module name (example for mod_example)
+# Replace VERSION with version since what confdir support was
+# introduced for the module. only needed for older .specs, not needed
+# for new packages.
+#
+%define		mod_name	MODNAME
+%define 	apxs		%{_sbindir}/apxs
+Summary:	Apache module: ..
+Summary(pl.UTF-8):	Moduł Apache'a: ...
+Name:		apache-mod_%{mod_name}
+Version:	-
+Release:	0.1
+License:	- (enter Apache/GPL/LGPL/BSD/BSD-like/other license name here)
+Group:		Networking/Daemons
+Source0:	-
+# Source0-md5:	-
+Source1:	%{name}.conf
+URL:		-
+BuildRequires:	%{apxs}
+BuildRequires:	apache-devel >= 2.2
+BuildRequires:	rpmbuild(macros) >= 1.268
+Requires:	apache(modules-api) = %apache_modules_api
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define		_pkglibdir	%(%{apxs} -q LIBEXECDIR 2>/dev/null)
+%define		_sysconfdir	%(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
+
+%description
+MODNAME is Apache module...
+
+%description -l pl.UTF-8
+
+%prep
+%setup -q -n mod_%{mod_name}-%{version}
+
+%build
+%{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
+
+install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
+
+# module configuration
+# - should contain LoadModule line
+# - and directives must be between IfModule (so user could disable the module easily)
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
+
+# or, if no directives needed, put just LoadModule line
+echo 'LoadModule %{mod_name}_module	modules/mod_%{mod_name}.so' > \
+	$RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%service apache restart
+
+%postun
+if [ "$1" = "0" ]; then
+	%service -q apache restart
+fi
+
+%if 0 # triggers for upgrading from pre confdir module
+# if there was "Include modulename.conf"
+%triggerpostun -- %{name} < VERSION
+if grep -q '^Include conf\.d/\*\.conf' /etc/apache/apache.conf; then
+	%{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
+	sed -i -e '
+		/^Include.*mod_%{mod_name}\.conf/d
+' /etc/apache/apache.conf
+else
+	# they're still using old apache.conf
+	sed -i -e '
+		s,^Include.*mod_%{mod_name}\.conf,Include %{_sysconfdir}/*_mod_%{mod_name}.conf,
+' /etc/apache/apache.conf
+fi
+%service -q apache restart
+
+# or, if there was just apxs usage
+%triggerpostun -- apache1-mod_%{mod_name} < VERSION
+# check that they're not using old apache.conf
+if grep -q '^Include conf\.d/\*\.conf' /etc/apache/apache.conf; then
+	%{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
+fi
+
+%endif
+
+%files
+%defattr(644,root,root,755)
+%doc README
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
+%attr(755,root,root) %{_pkglibdir}/*
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2008/10/27 21:28:39  glen
+- based on template-apache1_module.spec
+
================================================================


More information about the pld-cvs-commit mailing list