]> git.pld-linux.org Git - projects/template-specs.git/blob - horde.spec
- unify
[projects/template-specs.git] / horde.spec
1 # TODO
2 # - lighttpd support
3 %define _hordeapp skeleton
4 #define _snap   2005-08-01
5 #define _rc             rc1
6 %define _rel    1
7
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.
12
13 %include        /usr/lib/rpm/macros.php
14 Summary:        Template for horde projects
15 Name:           horde-%{_hordeapp}
16 Version:        0.1
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
24 # Source0-md5:  -
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
36 Requires:       webapps
37 #Obsoletes:     %{_hordeapp}
38 BuildArch:      noarch
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 # horde accesses it directly in help->about
42 %define         _noautocompressdoc  CREDITS
43 %define         _noautoreq      'pear(Horde.*)'
44
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}
50
51 # GET DESCRIPTION FROM PROJECT URL
52 %description
53 SKELETON
54
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/>.
58
59 %description -l pl
60 SKELETON
61
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/>.
65
66 %prep
67 %setup -qcT -n %{?_snap:%{_hordeapp}-%{_snap}}%{!?_snap:%{_hordeapp}-%{version}%{?_rc:-%{_rc}}}
68 tar zxf %{SOURCE0} --strip-components=1
69
70 # considered harmful (horde/docs/SECURITY)
71 rm -f test.php
72
73 %install
74 rm -rf $RPM_BUILD_ROOT
75 install -d $RPM_BUILD_ROOT%{_sysconfdir} \
76         $RPM_BUILD_ROOT%{_appdir}/{docs,lib,locale,templates,themes}
77
78 cp -a *.php                     $RPM_BUILD_ROOT%{_appdir}
79 for i in config/*.dist; do
80         cp -a $i $RPM_BUILD_ROOT%{_sysconfdir}/$(basename $i .dist)
81 done
82 echo '<?php ?>' >               $RPM_BUILD_ROOT%{_sysconfdir}/conf.php
83 cp -p config/conf.xml   $RPM_BUILD_ROOT%{_sysconfdir}/conf.xml
84 touch                                   $RPM_BUILD_ROOT%{_sysconfdir}/conf.php.bak
85
86 cp -a   lib/*                   $RPM_BUILD_ROOT%{_appdir}/lib
87 cp -a   locale/*                $RPM_BUILD_ROOT%{_appdir}/locale
88 cp -a   templates/*             $RPM_BUILD_ROOT%{_appdir}/templates
89 cp -a   themes/*                $RPM_BUILD_ROOT%{_appdir}/themes
90
91 ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/config
92 ln -s %{_docdir}/%{name}-%{version}/CREDITS $RPM_BUILD_ROOT%{_appdir}/docs
93 install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
94 install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %post
100 if [ ! -f %{_sysconfdir}/conf.php.bak ]; then
101         install /dev/null -o root -g http -m660 %{_sysconfdir}/conf.php.bak
102 fi
103
104 # CHECK FIRST DOES IT HAVE SQL AND FILE THERE.
105 if [ "$1" = 1 ]; then
106 %banner %{name} -e <<-EOF
107         IMPORTANT:
108         If you are installing Skeleton for the first time, You may need to
109         create the Skeleton database tables. To do so run:
110         zcat %{_docdir}/%{name}-%{version}/scripts/sql/%{_hordeapp}.sql.gz | mysql horde
111 EOF
112 fi
113
114 %triggerin -- apache1
115 %webapp_register apache %{_webapp}
116
117 %triggerun -- apache1
118 %webapp_unregister apache %{_webapp}
119
120 %triggerin -- apache >= 2.0.0
121 %webapp_register httpd %{_webapp}
122
123 %triggerun -- apache >= 2.0.0
124 %webapp_unregister httpd %{_webapp}
125
126 %files
127 %defattr(644,root,root,755)
128 %doc README docs/* scripts
129 %dir %attr(750,root,http) %{_sysconfdir}
130 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apache.conf
131 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/httpd.conf
132 %attr(660,root,http) %config(noreplace) %{_sysconfdir}/conf.php
133 %attr(660,root,http) %config(noreplace) %ghost %{_sysconfdir}/conf.php.bak
134 %attr(640,root,http) %config(noreplace) %{_sysconfdir}/[!c]*.php
135 %attr(640,root,http) %{_sysconfdir}/conf.xml
136
137 %dir %{_appdir}
138 %{_appdir}/*.php
139 %{_appdir}/config
140 %{_appdir}/docs
141 %{_appdir}/lib
142 %{_appdir}/locale
143 %{_appdir}/templates
144 %{_appdir}/themes
This page took 0.234284 seconds and 3 git commands to generate.