]> git.pld-linux.org Git - projects/template-specs.git/blob - webapp.spec
07e3c89265f787cae0ecda2634115505c26a2623
[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.2
5 Release:        0.7
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 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)
23 BuildArch:      noarch
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %define         _webapps        /etc/webapps
27 %define         _webapp         %{name}
28 %define         _sysconfdir     %{_webapps}/%{_webapp}
29 #%define                _appdir         %{_datadir}/%{_webapp}
30
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
33
34 %description
35 This .spec is for demonstrating triggers used for linking webapp
36 configuration to webserver config dir.
37
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.
41
42 %prep
43 %setup -q
44
45 cat > apache.conf <<'EOF'
46 Alias /%{name} %{_appdir}
47 <Directory %{_appdir}>
48         Allow from all
49 </Directory>
50 EOF
51
52 %install
53 rm -rf $RPM_BUILD_ROOT
54 install -d $RPM_BUILD_ROOT%{_sysconfdir}
55 #install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
56
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
61
62 # %webapp_* macros usage extracted from /usr/lib/rpm/macros.build:
63 #
64 # Usage:
65 #   %%webapp_register HTTPD WEBAPP
66 #   %%webapp_unregister HTTPD WEBAPP
67
68 %triggerin -- apache1 < 1.3.37-3, apache1-base
69 %webapp_register apache %{_webapp}
70
71 %triggerun -- apache1 < 1.3.37-3, apache1-base
72 %webapp_unregister apache %{_webapp}
73
74 %triggerin -- apache < 2.2.0, apache-base
75 %webapp_register httpd %{_webapp}
76
77 %triggerun -- apache < 2.2.0, apache-base
78 %webapp_unregister httpd %{_webapp}
79
80 %triggerin -- lighttpd
81 %webapp_register lighttpd %{_webapp}
82
83 %triggerun -- lighttpd
84 %webapp_unregister lighttpd %{_webapp}
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %files
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
96 #%{_appdir}
This page took 0.753073 seconds and 3 git commands to generate.