1 Summary: Package that uses webapps configuration
2 Summary(pl.UTF-8): Pakiet używający konfiguracji aplikacji WWW
7 Group: Applications/WWW
8 #Source0: %{name}-%{version}.tar.gz
11 BuildRequires: rpmbuild(macros) >= 1.268
14 Requires(triggerpostun): sed >= 4.0
16 # see SOURCES/webapps.README for description and complete listing
17 #Requires: webserver(access)
18 #Requires: webserver(alias)
19 #Requires: webserver(auth)
20 #Requires: webserver(cgi)
21 #Requires: webserver(indexfile)
22 #Requires: webserver(php)
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 %define _webapps /etc/webapps
27 %define _webapp %{name}
28 %define _sysconfdir %{_webapps}/%{_webapp}
29 #%define _appdir %{_datadir}/%{_webapp}
31 # in case _sysconfdir is not in webapps dir, run this replace pattern
32 # before copy-pasting to your spec: :%s#%{_sysconfdir}#%{_webapps}/%{_webapp}#g
35 This .spec is for demonstrating triggers used for linking webapp
36 configuration to webserver config dir.
38 %description -l pl.UTF-8
39 Ten plik .spec służy do pokazania triggerów służących do podłączania
40 konfiguracji aplikacji WWW do katalogu konfiguracyjnego serwera WWW.
45 cat > apache.conf <<'EOF'
46 Alias /%{name} %{_appdir}
47 <Directory %{_appdir}>
53 rm -rf $RPM_BUILD_ROOT
54 install -d $RPM_BUILD_ROOT%{_sysconfdir}
55 #install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
57 #install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
58 install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
59 install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
60 install lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
62 # %webapp_* macros usage extracted from /usr/lib/rpm/macros.build:
65 # %%webapp_register HTTPD WEBAPP
66 # %%webapp_unregister HTTPD WEBAPP
68 %triggerin -- apache1 < 1.3.37-3, apache1-base
69 %webapp_register apache %{_webapp}
71 %triggerun -- apache1 < 1.3.37-3, apache1-base
72 %webapp_unregister apache %{_webapp}
74 %triggerin -- apache < 2.2.0, apache-base
75 %webapp_register httpd %{_webapp}
77 %triggerun -- apache < 2.2.0, apache-base
78 %webapp_unregister httpd %{_webapp}
80 %triggerin -- lighttpd
81 %webapp_register lighttpd %{_webapp}
83 %triggerun -- lighttpd
84 %webapp_unregister lighttpd %{_webapp}
87 rm -rf $RPM_BUILD_ROOT
90 %defattr(644,root,root,755)
91 %dir %attr(750,root,http) %{_sysconfdir}
92 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
93 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
94 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
95 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php