]> git.pld-linux.org Git - projects/template-specs.git/blob - webapp.spec
- update path
[projects/template-specs.git] / webapp.spec
1 Summary:        Package that uses webapps configuration
2 Summary(pl.UTF-8):      Pakiet używający konfiguracji aplikacji WWW
3 Name:           template-webapp
4 Version:        0.3
5 Release:        0.1
6 License:        GPL
7 Group:          Applications/WWW
8 #Source0:       %{name}-%{version}.tar.gz
9 # Source0-md5:  -
10 #URL:           -
11 BuildRequires:  rpmbuild(macros) >= 1.268
12 Requires:       webapps
13 %if %{with trigger}
14 Requires(triggerpostun):        sed >= 4.0
15 %endif
16 # see packages/webapps/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)
23 #Requires:      webserver(setenv)
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         _webapps        /etc/webapps
28 %define         _webapp         %{name}
29 %define         _sysconfdir     %{_webapps}/%{_webapp}
30 #%define                _appdir         %{_datadir}/%{_webapp}
31
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
35 %description
36 This .spec is for demonstrating triggers used for linking webapp
37 configuration to webserver config dir.
38
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.
42
43 %prep
44 %setup -q
45
46 cat > apache.conf <<'EOF'
47 Alias /%{name} %{_appdir}
48 <Directory %{_appdir}>
49         Allow from all
50 </Directory>
51 EOF
52
53 cat > lighttpd.conf <<'EOF'
54 alias.url += (
55     "/%{name}" => "%{_appdir}",
56 )
57 EOF
58
59 %install
60 rm -rf $RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT%{_sysconfdir}
62 #install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
63
64 #cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
65 cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
66 cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
67 cp -a lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
68
69 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/apache.conf
70 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/lighttpd.conf
71 cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
72
73 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
74 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
75 cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
76
77 # %webapp_* macros usage extracted from /usr/lib/rpm/macros.build:
78 #
79 # Usage:
80 #   %%webapp_register HTTPD WEBAPP
81 #   %%webapp_unregister HTTPD WEBAPP
82
83 %triggerin -- apache1 < 1.3.37-3, apache1-base
84 %webapp_register apache %{_webapp}
85
86 %triggerun -- apache1 < 1.3.37-3, apache1-base
87 %webapp_unregister apache %{_webapp}
88
89 %triggerin -- apache < 2.2.0, apache-base
90 %webapp_register httpd %{_webapp}
91
92 %triggerun -- apache < 2.2.0, apache-base
93 %webapp_unregister httpd %{_webapp}
94
95 %triggerin -- lighttpd
96 %webapp_register lighttpd %{_webapp}
97
98 %triggerun -- lighttpd
99 %webapp_unregister lighttpd %{_webapp}
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %files
105 %defattr(644,root,root,755)
106 %dir %attr(750,root,http) %{_sysconfdir}
107 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
108 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
109 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
110 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
111 #%{_appdir}
This page took 0.047097 seconds and 4 git commands to generate.