]> git.pld-linux.org Git - projects/template-specs.git/blob - apache1-module.spec
pecl: add example how to make failed tests as XFAIL
[projects/template-specs.git] / apache1-module.spec
1 # You'll need ipv6 bcond and patch if the module alters IP related structures.
2 %bcond_without  ipv6            # disable IPv6 support
3 #
4 # Replace MODNAME with real module name (example for mod_example)
5 # Replace VERSION with version since what confdir support was
6 # introduced for the module. only needed for older .specs, not needed
7 # for new packages.
8 #
9 %define         mod_name        MODNAME
10 %define         apxs            %{_sbindir}/apxs1
11 Summary:        Apache HTTPD module: ..
12 Summary(pl.UTF-8):      ModuĊ‚ Apache'a: ...
13 Name:           apache1-mod_%{mod_name}
14 Version:        -
15 Release:        0.1
16 License:        - (enter Apache/GPL/LGPL/BSD/BSD-like/other license name here)
17 Group:          Networking/Daemons
18 Source0:        -
19 # Source0-md5:  -
20 Source1:        %{name}.conf
21 URL:            -
22 %{?with_ipv6:BuildRequires:     apache1(ipv6)-devel}
23 BuildRequires:  apache1-devel >= 1.3.33-2
24 BuildRequires:  rpmbuild(macros) >= 1.228
25 %{!?with_ipv6:BuildConflicts:   apache1(ipv6)-devel}
26 Requires(triggerpostun):        %{apxs}
27 Requires(triggerpostun):        grep
28 Requires(triggerpostun):        sed >= 4.0
29 Requires:       apache1(EAPI)
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
33 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
34
35 %description
36 MODNAME is Apache HTTPD module...
37
38 %description -l pl.UTF-8
39
40 %prep
41 %setup -q -n mod_%{mod_name}-%{version}
42
43 %build
44 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
45
46 %install
47 rm -rf $RPM_BUILD_ROOT
48 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
49
50 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
51
52 # module configuration
53 # - should contain LoadModule line
54 # - and directives must be between IfModule (so user could disable the module easily)
55 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
56
57 # or, if no directives needed, put just LoadModule line
58 echo 'LoadModule %{mod_name}_module     modules/mod_%{mod_name}.so' > \
59         $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63
64 %post
65 %service apache restart
66
67 %postun
68 if [ "$1" = "0" ]; then
69         %service -q apache restart
70 fi
71
72 %if 0 # triggers for upgrading from pre confdir module
73 # if there was "Include modulename.conf"
74 %triggerpostun -- %{name} < VERSION
75 if grep -q '^Include conf\.d/\*\.conf' /etc/apache/apache.conf; then
76         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
77         sed -i -e '
78                 /^Include.*mod_%{mod_name}\.conf/d
79 ' /etc/apache/apache.conf
80 else
81         # they're still using old apache.conf
82         sed -i -e '
83                 s,^Include.*mod_%{mod_name}\.conf,Include %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf,
84 ' /etc/apache/apache.conf
85 fi
86 %service -q apache restart
87
88 # or, if there was just apxs usage
89 %triggerpostun -- apache1-mod_%{mod_name} < VERSION
90 # check that they're not using old apache.conf
91 if grep -q '^Include conf\.d/\*\.conf' /etc/apache/apache.conf; then
92         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
93 fi
94
95 %endif
96
97 %files
98 %defattr(644,root,root,755)
99 %doc README
100 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
101 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.041929 seconds and 3 git commands to generate.