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 Source2: lighttpd.conf
13 BuildRequires: rpmbuild(macros) >= 1.268
15 # see packages/webapps/webapps.README for description and complete listing
16 #Requires: webserver(access)
17 #Requires: webserver(alias)
18 #Requires: webserver(auth)
19 #Requires: webserver(cgi)
20 #Requires: webserver(indexfile)
21 #Requires: webserver(php)
22 #Requires: webserver(rewrite)
23 #Requires: webserver(setenv)
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define _webapps /etc/webapps
28 %define _webapp %{name}
29 %define _sysconfdir %{_webapps}/%{_webapp}
30 #%define _appdir %{_datadir}/%{_webapp}
32 # in case _sysconfdir is not in webapps dir, run this replace pattern
33 # before copy-pasting to your spec: :%s#%{_sysconfdir}#%{_webapps}/%{_webapp}#g
36 This .spec is for demonstrating triggers used for linking webapp
37 configuration to webserver config dir.
39 %description -l pl.UTF-8
40 Ten plik .spec służy do pokazania triggerów służących do podłączania
41 konfiguracji aplikacji WWW do katalogu konfiguracyjnego serwera WWW.
46 cat > apache.conf <<'EOF'
47 Alias /%{name} %{_appdir}
48 <Directory %{_appdir}>
53 cat > lighttpd.conf <<'EOF'
55 "/%{name}" => "%{_appdir}",
60 rm -rf $RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT%{_sysconfdir}
62 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
64 cp -a . $RPM_BUILD_ROOT%{_appdir}
66 cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
67 cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
68 cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
70 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/apache.conf
71 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/lighttpd.conf
72 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
74 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
75 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
76 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
78 # %webapp_* macros usage extracted from /usr/lib/rpm/macros.build:
81 # %%webapp_register HTTPD WEBAPP
82 # %%webapp_unregister HTTPD WEBAPP
84 %triggerin -- apache1 < 1.3.37-3, apache1-base
85 %webapp_register apache %{_webapp}
87 %triggerun -- apache1 < 1.3.37-3, apache1-base
88 %webapp_unregister apache %{_webapp}
90 %triggerin -- apache < 2.2.0, apache-base
91 %webapp_register httpd %{_webapp}
93 %triggerun -- apache < 2.2.0, apache-base
94 %webapp_unregister httpd %{_webapp}
96 %triggerin -- lighttpd
97 %webapp_register lighttpd %{_webapp}
99 %triggerun -- lighttpd
100 %webapp_unregister lighttpd %{_webapp}
103 rm -rf $RPM_BUILD_ROOT
106 %defattr(644,root,root,755)
107 %dir %attr(750,root,http) %{_sysconfdir}
108 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
109 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
110 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
111 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php