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