]>
Commit | Line | Data |
---|---|---|
5f6950b4 ER |
1 | # TODO |
2 | # - lighttpd support | |
02bce657 ER |
3 | |
4 | # REPLACE words 'SKELETON', 'Skeleton', 'skeleton' with your application | |
5 | # GET THE Summary from here: http://www.horde.org/source/modules.php | |
6 | # FIND .htaccess FILES AND MAKE SURE APACHE CONF DISABLES ACCESS TO | |
7 | # THOSE DIRS: find -name '.??*' IS EASY TO LOCATE. | |
8 | ||
37454f21 | 9 | %define hordeapp skeleton |
02bce657 | 10 | Summary: Template for horde projects |
37454f21 | 11 | Name: horde-%{hordeapp} |
02bce657 | 12 | Version: 0.1 |
37454f21 | 13 | Release: 0.1 |
29fed2f2 | 14 | License: GPL v2 (CHECK IT FIRST, could be ASL) |
02bce657 | 15 | Group: Applications/WWW |
37454f21 | 16 | Source0: ftp://ftp.horde.org/pub/skeleton/%{hordeapp}-h3-%{version}.tar.gz |
eeb8a3ce | 17 | # Source0-md5: - |
d17c4743 ER |
18 | Source1: apache.conf |
19 | Patch0: prefs.patch | |
02bce657 | 20 | URL: http://www.horde.org/skeleton/ |
29fed2f2 | 21 | BuildRequires: rpm-php-pearprov >= 4.0.2-98 |
58b78444 | 22 | BuildRequires: rpmbuild(macros) >= 1.745 |
02bce657 | 23 | Requires: horde >= 3.0 |
5f6950b4 | 24 | Requires: webapps |
d17c4743 | 25 | Requires: webserver(access) |
02bce657 ER |
26 | BuildArch: noarch |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29fed2f2 | 29 | %define hordedir /usr/share/horde |
37454f21 | 30 | %define _appdir %{hordedir}/%{hordeapp} |
5f6950b4 | 31 | %define _webapps /etc/webapps |
37454f21 | 32 | %define _webapp horde-%{hordeapp} |
5f6950b4 | 33 | %define _sysconfdir %{_webapps}/%{_webapp} |
02bce657 | 34 | |
37454f21 ER |
35 | %define _noautoreq pear(Horde.*) |
36 | ||
02bce657 ER |
37 | # GET DESCRIPTION FROM PROJECT URL |
38 | %description | |
39 | SKELETON | |
40 | ||
41 | The Horde Project writes web applications in PHP and releases them | |
42 | under the GNU Public License. For more information (including help | |
43 | with Skeleton) please visit <http://www.horde.org/>. | |
44 | ||
9be49f18 | 45 | %description -l pl.UTF-8 |
f01e19b1 JB |
46 | SKELETON |
47 | ||
48 | Projekt Horde tworzy aplikacje WWW w PHP i wydaje je na licencji GNU | |
9be49f18 JR |
49 | General Public License. Więcej informacji (włącznie z pomocą dla |
50 | Skeleton) można znaleźć na stronie <http://www.horde.org/>. | |
f01e19b1 | 51 | |
02bce657 | 52 | %prep |
37454f21 | 53 | %setup -q -n %{hordeapp}-h3-%{version} |
d17c4743 | 54 | %patch0 -p1 |
02bce657 | 55 | |
c3ce0920 | 56 | rm {,*/}.htaccess |
2b86993c ER |
57 | for i in config/*.dist; do |
58 | mv $i config/$(basename $i .dist) | |
59 | done | |
02bce657 | 60 | # considered harmful (horde/docs/SECURITY) |
c3ce0920 | 61 | rm test.php |
02bce657 ER |
62 | |
63 | %install | |
64 | rm -rf $RPM_BUILD_ROOT | |
2b86993c | 65 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}/docs} |
02bce657 | 66 | |
2b86993c ER |
67 | cp -a *.php $RPM_BUILD_ROOT%{_appdir} |
68 | cp -a config/* $RPM_BUILD_ROOT%{_sysconfdir} | |
69 | echo '<?php ?>' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.php | |
70 | touch $RPM_BUILD_ROOT%{_sysconfdir}/conf.php.bak | |
71 | cp -a lib locale templates themes $RPM_BUILD_ROOT%{_appdir} | |
8dcd635c | 72 | cp -a docs/CREDITS $RPM_BUILD_ROOT%{_appdir}/docs |
02bce657 | 73 | |
5f6950b4 | 74 | ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/config |
37454f21 ER |
75 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
76 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
02bce657 ER |
77 | |
78 | %clean | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %post | |
5f6950b4 | 82 | if [ ! -f %{_sysconfdir}/conf.php.bak ]; then |
d17c4743 | 83 | install /dev/null -o root -g http -m 0660 %{_sysconfdir}/conf.php.bak |
02bce657 ER |
84 | fi |
85 | ||
86 | # CHECK FIRST DOES IT HAVE SQL AND FILE THERE. | |
87 | if [ "$1" = 1 ]; then | |
d17c4743 | 88 | %banner %{name} -e <<-EOF |
02bce657 ER |
89 | IMPORTANT: |
90 | If you are installing Skeleton for the first time, You may need to | |
91 | create the Skeleton database tables. To do so run: | |
37454f21 | 92 | zcat %{_docdir}/%{name}-%{version}/scripts/sql/%{hordeapp}.sql.gz | mysql horde |
d17c4743 | 93 | EOF |
02bce657 ER |
94 | fi |
95 | ||
2b76dd46 | 96 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
5f6950b4 | 97 | %webapp_register apache %{_webapp} |
02bce657 | 98 | |
2b76dd46 | 99 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
5f6950b4 | 100 | %webapp_unregister apache %{_webapp} |
02bce657 | 101 | |
0da251d1 | 102 | %triggerin -- apache < 2.2.0, apache-base |
5f6950b4 | 103 | %webapp_register httpd %{_webapp} |
02bce657 | 104 | |
0da251d1 | 105 | %triggerun -- apache < 2.2.0, apache-base |
5f6950b4 | 106 | %webapp_unregister httpd %{_webapp} |
02bce657 | 107 | |
02bce657 ER |
108 | %files |
109 | %defattr(644,root,root,755) | |
110 | %doc README docs/* scripts | |
5f6950b4 | 111 | %dir %attr(750,root,http) %{_sysconfdir} |
8bc565a0 ER |
112 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf |
113 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
5f6950b4 ER |
114 | %attr(660,root,http) %config(noreplace) %{_sysconfdir}/conf.php |
115 | %attr(660,root,http) %config(noreplace) %ghost %{_sysconfdir}/conf.php.bak | |
116 | %attr(640,root,http) %config(noreplace) %{_sysconfdir}/[!c]*.php | |
117 | %attr(640,root,http) %{_sysconfdir}/conf.xml | |
02bce657 ER |
118 | |
119 | %dir %{_appdir} | |
120 | %{_appdir}/*.php | |
121 | %{_appdir}/config | |
122 | %{_appdir}/docs | |
123 | %{_appdir}/lib | |
124 | %{_appdir}/locale | |
125 | %{_appdir}/templates | |
126 | %{_appdir}/themes |