]> git.pld-linux.org Git - projects/template-specs.git/blame - webapp.spec
update to use _noautoreq_pear
[projects/template-specs.git] / webapp.spec
CommitLineData
ff60f2d3 1Summary: Package that uses webapps configuration
ce39d734 2Summary(pl.UTF-8): Pakiet używający konfiguracji aplikacji WWW
ff60f2d3 3Name: template-webapp
8185008c
ER
4Version: 0.3
5Release: 0.3
5ba5cc7a 6License: GPL
1b5d0c9a 7Group: Applications/WWW
1ddef0d1
ER
8#Source0: %{name}-%{version}.tar.gz
9# Source0-md5: -
51422de5 10Source1: apache.conf
8185008c 11Source2: lighttpd.conf
1ddef0d1 12#URL: -
b53f8131 13BuildRequires: rpmbuild(macros) >= 1.268
ff60f2d3 14Requires: webapps
bc8ecf1d 15# see packages/webapps/webapps.README for description and complete listing
b65061da
ER
16#Requires: webserver(access)
17#Requires: webserver(alias)
18#Requires: webserver(auth)
ff3ba9b3 19#Requires: webserver(cgi)
367a5ad4 20#Requires: webserver(indexfile)
c7e3b118 21#Requires: webserver(php)
584d77a2 22#Requires: webserver(rewrite)
69fb8d33 23#Requires: webserver(setenv)
9407df51
ER
24BuildArch: noarch
25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
ff60f2d3 27%define _webapps /etc/webapps
c1b7608a 28%define _webapp %{name}
ff60f2d3 29%define _sysconfdir %{_webapps}/%{_webapp}
e4a4f082 30#%define _appdir %{_datadir}/%{_webapp}
87b72dfa 31
38caece8
ER
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
34
9407df51 35%description
d9acef23
ER
36This .spec is for demonstrating triggers used for linking webapp
37configuration to webserver config dir.
9407df51 38
9be49f18
JR
39%description -l pl.UTF-8
40Ten plik .spec służy do pokazania triggerów służących do podłączania
cbe1381a 41konfiguracji aplikacji WWW do katalogu konfiguracyjnego serwera WWW.
832823fd 42
9407df51 43%prep
c27fb8a9
ER
44%setup -q
45
66ac8cb1 46cat > apache.conf <<'EOF'
98da39be
ER
47Alias /%{name} %{_appdir}
48<Directory %{_appdir}>
794d0abc
ER
49 # Apache 2.x
50 <IfModule !mod_authz_core.c>
51 Order allow,deny
52 Allow from all
53 </IfModule>
54 # Apache 2.4
55 <IfModule mod_authz_core.c>
56 Require all granted
57 </IfModule>
c27fb8a9 58</Directory>
ff60f2d3 59EOF
9407df51 60
324cf851
ER
61cat > lighttpd.conf <<'EOF'
62alias.url += (
574da12a 63 "/%{name}" => "%{_appdir}",
324cf851
ER
64)
65EOF
66
9407df51
ER
67%install
68rm -rf $RPM_BUILD_ROOT
69install -d $RPM_BUILD_ROOT%{_sysconfdir}
f36a6fcb 70install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
498b0e06 71
b6cd57ed
ER
72cp -a . $RPM_BUILD_ROOT%{_appdir}
73
7f007c8b 74cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
8185008c 75cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
7f007c8b 76cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
c1b7608a 77
d22a0298
ER
78mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/apache.conf
79mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/lighttpd.conf
8185008c 80cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
d22a0298 81
7f007c8b 82cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
8185008c
ER
83cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
84cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
d22a0298 85
0430c8f6
ER
86%clean
87rm -rf $RPM_BUILD_ROOT
88
ff60f2d3 89# %webapp_* macros usage extracted from /usr/lib/rpm/macros.build:
4f853f24
ER
90#
91# Usage:
ff60f2d3
ER
92# %%webapp_register HTTPD WEBAPP
93# %%webapp_unregister HTTPD WEBAPP
4f853f24 94
a5bcddf5 95%triggerin -- apache1 < 1.3.37-3, apache1-base
ff60f2d3 96%webapp_register apache %{_webapp}
9407df51 97
a5bcddf5 98%triggerun -- apache1 < 1.3.37-3, apache1-base
ff60f2d3 99%webapp_unregister apache %{_webapp}
9407df51 100
8185008c 101%triggerin -- apache < 2.2.0, apache-base
ff60f2d3 102%webapp_register httpd %{_webapp}
9407df51 103
8185008c 104%triggerun -- apache < 2.2.0, apache-base
ff60f2d3
ER
105%webapp_unregister httpd %{_webapp}
106
107%triggerin -- lighttpd
108%webapp_register lighttpd %{_webapp}
109
110%triggerun -- lighttpd
111%webapp_unregister lighttpd %{_webapp}
e2b18c9c
ER
112
113%files
114%defattr(644,root,root,755)
38caece8
ER
115%dir %attr(750,root,http) %{_sysconfdir}
116%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
117%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
118%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
119%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
f36a6fcb 120%{_appdir}
This page took 0.366276 seconds and 4 git commands to generate.