3 %define _hordeapp skeleton
4 #define _snap 2005-08-01
8 # REPLACE words 'SKELETON', 'Skeleton', 'skeleton' with your application
9 # GET THE Summary from here: http://www.horde.org/source/modules.php
10 # FIND .htaccess FILES AND MAKE SURE APACHE CONF DISABLES ACCESS TO
11 # THOSE DIRS: find -name '.??*' IS EASY TO LOCATE.
13 %include /usr/lib/rpm/macros.php
14 Summary: Template for horde projects
15 Name: horde-%{_hordeapp}
17 Release: %{?_rc:0.%{_rc}.}%{?_snap:0.%(echo %{_snap} | tr -d -).}%{_rel}
18 License: GPL v2 (CHECK IT FIRST, could be ASL)
19 Group: Applications/WWW
20 # due builder limitations can't have complrex macros in Source0
21 #Source0: ftp://ftp.horde.org/pub/skeleton/%{_hordeapp}-h3-%{version}.tar.gz
22 #Source0: ftp://ftp.horde.org/pub/skeleton/%{_hordeapp}-h3-%{version}-%{_rc}.tar.gz
23 #Source0: ftp://ftp.horde.org/pub/snaps/%{_snap}/%{_hordeapp}-HEAD-%{_snap}.tar.gz
25 # COPY IN SOURCES ../SOURCES/ingo.conf AS SOURCE1 HERE:
26 # cp ../SOURCES/{ingo,skeleton}.conf
27 # DON'T FORGET TO :%s#ingo#skeleton#g in that file
28 Source1: %{_hordeapp}.conf
29 Patch0: %{_hordeapp}-prefs.patch
30 URL: http://www.horde.org/skeleton/
31 BuildRequires: rpm-php-pearprov >= 4.0.2-98
32 BuildRequires: rpmbuild(macros) >= 1.264
33 BuildRequires: tar >= 1:1.15.1
34 Requires: apache(mod_access)
35 Requires: horde >= 3.0
37 #Obsoletes: %{_hordeapp}
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 # horde accesses it directly in help->about
42 %define _noautocompressdoc CREDITS
43 %define _noautoreq 'pear(Horde.*)'
45 %define hordedir /usr/share/horde
46 %define _appdir %{hordedir}/%{_hordeapp}
47 %define _webapps /etc/webapps
48 %define _webapp horde-%{_hordeapp}
49 %define _sysconfdir %{_webapps}/%{_webapp}
51 # GET DESCRIPTION FROM PROJECT URL
55 The Horde Project writes web applications in PHP and releases them
56 under the GNU Public License. For more information (including help
57 with Skeleton) please visit <http://www.horde.org/>.
62 Projekt Horde tworzy aplikacje WWW w PHP i wydaje je na licencji GNU
63 General Public License. Wiêcej informacji (w³±cznie z pomoc± dla
64 Skeleton) mo¿na znale¼æ na stronie <http://www.horde.org/>.
67 %setup -qcT -n %{?_snap:%{_hordeapp}-%{_snap}}%{!?_snap:%{_hordeapp}-%{version}%{?_rc:-%{_rc}}}
68 tar zxf %{SOURCE0} --strip-components=1
71 for i in config/*.dist; do
72 mv $i config/$(basename $i .dist)
74 # considered harmful (horde/docs/SECURITY)
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}/docs}
81 cp -a *.php $RPM_BUILD_ROOT%{_appdir}
82 cp -a config/* $RPM_BUILD_ROOT%{_sysconfdir}
83 echo '<?php ?>' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.php
84 touch $RPM_BUILD_ROOT%{_sysconfdir}/conf.php.bak
85 cp -a lib locale templates themes $RPM_BUILD_ROOT%{_appdir}
87 ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/config
88 ln -s %{_docdir}/%{name}-%{version}/CREDITS $RPM_BUILD_ROOT%{_appdir}/docs
89 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
90 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
93 rm -rf $RPM_BUILD_ROOT
96 if [ ! -f %{_sysconfdir}/conf.php.bak ]; then
97 install /dev/null -o root -g http -m660 %{_sysconfdir}/conf.php.bak
100 # CHECK FIRST DOES IT HAVE SQL AND FILE THERE.
101 if [ "$1" = 1 ]; then
102 %banner %{name} -e <<-EOF
104 If you are installing Skeleton for the first time, You may need to
105 create the Skeleton database tables. To do so run:
106 zcat %{_docdir}/%{name}-%{version}/scripts/sql/%{_hordeapp}.sql.gz | mysql horde
110 %triggerin -- apache1
111 %webapp_register apache %{_webapp}
113 %triggerun -- apache1
114 %webapp_unregister apache %{_webapp}
116 %triggerin -- apache < 2.2.0, apache-base
117 %webapp_register httpd %{_webapp}
119 %triggerun -- apache < 2.2.0, apache-base
120 %webapp_unregister httpd %{_webapp}
123 %defattr(644,root,root,755)
124 %doc README docs/* scripts
125 %dir %attr(750,root,http) %{_sysconfdir}
126 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
127 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
128 %attr(660,root,http) %config(noreplace) %{_sysconfdir}/conf.php
129 %attr(660,root,http) %config(noreplace) %ghost %{_sysconfdir}/conf.php.bak
130 %attr(640,root,http) %config(noreplace) %{_sysconfdir}/[!c]*.php
131 %attr(640,root,http) %{_sysconfdir}/conf.xml