blob: 95577e76095d7743e342a28dd142818c45e6e55b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# 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 HTTPD 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/HTTP
Source0: -
# Source0-md5: -
Source1: apache.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 HTTPD 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 -p 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)
cp -p %{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 -q httpd restart
%postun
if [ "$1" = "0" ]; then
%service -q httpd restart
fi
%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}/mod_%{mod_name}.so
|