Summary: Package that uses Apache configuration Summary(pl): Pakiet używający konfiguracji Apache'a Name: template-apache-package Version: 0.1 Release: 0.19 License: GPL Group: Development Requires: apache >= 1.3.33-2 BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description This spec is for demonstrating triggers used for linking package config to apache1/apache2 configuration dir. %description -l pl Ten spec służy do pokazania triggerów służących do podłączania konfiguracji pakietu do katalogu konfiguracyjnego apache1/apache2. %prep %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_sysconfdir} cat >> $RPM_BUILD_ROOT%{_sysconfdir}/apache-%{name}.conf <= 1.3.33-2 %{?debug:set -x; echo "triggerin apache1 %{name}-%{version}-%{release} 1:[$1]; 2:[$2]"} if [ "$1" = "1" ] && [ "$2" = "1" ] && [ -d /etc/apache/conf.d ]; then ln -sf %{_sysconfdir}/apache-%{name}.conf /etc/apache/conf.d/99_%{name}.conf fi # restart apache if the config symlink is there if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then if [ -f /var/lock/subsys/apache ]; then /etc/rc.d/init.d/apache restart 1>&2 fi fi %triggerun -- apache1 >= 1.3.33-2 %{?debug:set -x; echo "triggerun apache1 %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"} # remove link if eighter of the packages are gone if [ "$1" = "0" ] || [ "$2" = "0" ]; then if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then rm -f /etc/apache/conf.d/99_%{name}.conf if [ -f /var/lock/subsys/apache ]; then /etc/rc.d/init.d/apache restart 1>&2 fi fi fi %triggerin -- apache >= 2.0.0 %{?debug:set -x; echo "triggerin apache2 %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"} if [ "$1" = "1" ] && [ "$2" = "1" ] && [ -d /etc/httpd/httpd.conf ]; then ln -sf %{_sysconfdir}/apache-%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf fi # restart apache if the config symlink is there if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then if [ -f /var/lock/subsys/httpd ]; then /etc/rc.d/init.d/httpd restart 1>&2 fi fi %triggerun -- apache >= 2.0.0 %{?debug:set -x; echo "triggerun apache2 %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"} # remove link if eighter of the packages are gone if [ "$1" = "0" ] || [ "$2" = "0" ]; then if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then rm -f /etc/httpd/httpd.conf/99_%{name}.conf if [ -f /var/lock/subsys/httpd ]; then /etc/rc.d/init.d/httpd restart 1>&2 fi fi fi %files %defattr(644,root,root,755) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache-%{name}.conf