1 Summary: Package that uses Apache configuration
2 Summary(pl): Pakiet u¿ywaj±cy konfiguracji Apache'a
3 Name: template-apache-package
7 Group: Applications/WWW
9 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
11 %define _apache1dir /etc/apache
12 %define _apache2dir /etc/httpd
15 This spec is for demonstrating triggers used for linking package
16 config to apache1/apache2 configuration dir.
19 Ten spec s³u¿y do pokazania triggerów s³u¿±cych do pod³±czania
20 konfiguracji pakietu do katalogu konfiguracyjnego apache1/apache2.
25 rm -rf $RPM_BUILD_ROOT
26 install -d $RPM_BUILD_ROOT%{_sysconfdir}
27 cat >> $RPM_BUILD_ROOT%{_sysconfdir}/apache-%{name}.conf <<EOF
28 # This is sample apache config
31 %triggerin -- apache1 >= 1.3.33-2
32 %{?debug:set -x; echo "triggerin apache1 %{name}-%{version}-%{release} 1:[$1]; 2:[$2]"}
33 if [ "$1" = "1" ] && [ "$2" = "1" ] && [ -d %{_apache1dir}/conf.d ]; then
34 ln -sf %{_sysconfdir}/apache-%{name}.conf %{_apache1dir}/conf.d/99_%{name}.conf
35 if [ -f /var/lock/subsys/apache ]; then
36 /etc/rc.d/init.d/apache restart 1>&2
40 %triggerun -- apache1 >= 1.3.33-2
41 %{?debug:set -x; echo "triggerun apache1 %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"}
42 # remove link if eighter of the packages are gone
43 if [ "$1" = "0" ] || [ "$2" = "0" ]; then
44 if [ -L %{_apache1dir}/conf.d/99_%{name}.conf ]; then
45 rm -f %{_apache1dir}/conf.d/99_%{name}.conf
46 if [ -f /var/lock/subsys/apache ]; then
47 /etc/rc.d/init.d/apache restart 1>&2
52 %triggerin -- apache >= 2.0.0
53 %{?debug:set -x; echo "triggerin apache2 %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"}
54 if [ "$1" = "1" ] && [ "$2" = "1" ] && [ -d %{_apache2dir}/httpd.conf ]; then
55 ln -sf %{_sysconfdir}/apache-%{name}.conf %{_apache2dir}/httpd.conf/99_%{name}.conf
56 if [ -f /var/lock/subsys/httpd ]; then
57 /etc/rc.d/init.d/httpd restart 1>&2
61 %triggerun -- apache >= 2.0.0
62 %{?debug:set -x; echo "triggerun apache2 %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"}
63 # remove link if eighter of the packages are gone
64 if [ "$1" = "0" ] || [ "$2" = "0" ]; then
65 if [ -L %{_apache2dir}/httpd.conf/99_%{name}.conf ]; then
66 rm -f %{_apache2dir}/httpd.conf/99_%{name}.conf
67 if [ -f /var/lock/subsys/httpd ]; then
68 /etc/rc.d/init.d/httpd restart 1>&2
74 %defattr(644,root,root,755)
75 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache-%{name}.conf