]> git.pld-linux.org Git - projects/template-specs.git/blob - horde.spec
- template for horde projects
[projects/template-specs.git] / horde.spec
1 #define _rc             rc1
2 %define _snap   2005-08-01
3 %define _rel    0.1
4
5 # REPLACE words 'SKELETON', 'Skeleton', 'skeleton' with your application
6 # GET THE Summary from here: http://www.horde.org/source/modules.php
7 # FIND .htaccess FILES AND MAKE SURE APACHE CONF DISABLES ACCESS TO
8 # THOSE DIRS: find -name '.??*' IS EASY TO LOCATE.
9
10 %include        /usr/lib/rpm/macros.php
11 Summary:        Template for horde projects
12 Name:           skeleton
13 Version:        0.1
14 Release:        %{?_rc:%{_rc}.}%{?_snap:0.%(echo %{_snap} | tr -d -).}%{_rel}
15 License:        GPL v2 (CHECK IT FIRST)
16 Group:          Applications/WWW
17 #Source0:       ftp://ftp.horde.org/pub/skeleton/%{name}-h3-%{version}.tar.gz
18 #Source0:       ftp://ftp.horde.org/pub/skeleton/%{name}-h3-%{version}-%{_rc}.tar.gz
19 #Source0:       ftp://ftp.horde.org/pub/snaps/%{_snap}/%{name}-HEAD-%{_snap}.tar.gz
20 # COPY IN SOURCES ../SOURCES/ingo.conf AS SOURCE1 HERE:
21 # cp ../SOURCES/{ingo,skeleton}.conf
22 # DON'T FORGET TO :%s#ingo#skeleton#g in that file
23 Source1:        %{name}.conf
24 URL:            http://www.horde.org/skeleton/
25 BuildRequires:  rpmbuild(macros) >= 1.226
26 Requires:       apache >= 1.3.33-2
27 Requires:       apache(mod_access)
28 Requires:       horde >= 3.0
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 # horde accesses it directly in help->about
33 %define         _noautocompressdoc  CREDITS
34 %define         _noautoreq      'pear(Horde.*)' 'pear(Text/Flowed.php)'
35
36 %define         hordedir                /usr/share/horde
37 %define         _sysconfdir             /etc/horde.org
38 %define         _appdir                 %{hordedir}/%{name}
39
40 # GET DESCRIPTION FROM PROJECT URL
41 %description
42 SKELETON
43
44 The Horde Project writes web applications in PHP and releases them
45 under the GNU Public License. For more information (including help
46 with Skeleton) please visit <http://www.horde.org/>.
47
48 %prep
49 %setup -q -n %{?_snap:%{name}}%{!?_snap:%{name}-h3-%{version}%{?_rc:-%{_rc}}}
50
51 # considered harmful (horde/docs/SECURITY)
52 rm -f test.php
53
54 %install
55 rm -rf $RPM_BUILD_ROOT
56 install -d $RPM_BUILD_ROOT{/etc/cron.daily,%{_sysconfdir}/%{name}} \
57         $RPM_BUILD_ROOT%{_appdir}/{docs,lib,locale,scripts,templates,themes}
58
59 cp -pR  *.php                   $RPM_BUILD_ROOT%{_appdir}
60 for i in config/*.dist; do
61         cp -p $i $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$(basename $i .dist)
62 done
63 echo "<?php ?>" >               $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.php
64 cp -p  config/*.xml            $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
65 > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.php.bak
66
67 cp -pR  lib/*                   $RPM_BUILD_ROOT%{_appdir}/lib
68 cp -pR  locale/*                $RPM_BUILD_ROOT%{_appdir}/locale
69 cp -pR  templates/*             $RPM_BUILD_ROOT%{_appdir}/templates
70 cp -pR  themes/*                $RPM_BUILD_ROOT%{_appdir}/themes
71
72 ln -s %{_sysconfdir}/%{name}    $RPM_BUILD_ROOT%{_appdir}/config
73 ln -s %{_defaultdocdir}/%{name}-%{version}/CREDITS $RPM_BUILD_ROOT%{_appdir}/docs
74
75 install %{SOURCE1}              $RPM_BUILD_ROOT%{_sysconfdir}/apache-%{name}.conf
76
77 %clean
78 rm -rf $RPM_BUILD_ROOT
79
80 %post
81 if [ ! -f %{_sysconfdir}/%{name}/conf.php.bak ]; then
82         install /dev/null -o root -g http -m660 %{_sysconfdir}/%{name}/conf.php.bak
83 fi
84
85 # CHECK FIRST DOES IT HAVE SQL AND FILE THERE.
86 if [ "$1" = 1 ]; then
87 %banner %{name} -e <<-EOF
88         IMPORTANT:
89         If you are installing Skeleton for the first time, You may need to
90         create the Skeleton database tables. To do so run:
91         zcat %{_docdir}/%{name}-%{version}/scripts/sql/%{name}.sql.gz | mysql horde
92 EOF
93 fi
94
95 %triggerin -- apache1 >= 1.3.33-2
96 %apache_config_install -v 1 -c %{_sysconfdir}/apache-%{name}.conf
97
98 %triggerun -- apache1 >= 1.3.33-2
99 %apache_config_uninstall -v 1
100
101 %triggerin -- apache >= 2.0.0
102 %apache_config_install -v 2 -c %{_sysconfdir}/apache-%{name}.conf
103
104 %triggerun -- apache >= 2.0.0
105 %apache_config_uninstall -v 2
106
107
108 %files
109 %defattr(644,root,root,755)
110 %doc README docs/* scripts
111 %attr(750,root,http) %dir %{_sysconfdir}/%{name}
112 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apache-%{name}.conf
113 %attr(660,root,http) %config(noreplace) %{_sysconfdir}/%{name}/conf.php
114 %attr(660,root,http) %config(noreplace) %ghost %{_sysconfdir}/%{name}/conf.php.bak
115 %attr(640,root,http) %config(noreplace) %{_sysconfdir}/%{name}/[!c]*.php
116 %attr(640,root,http) %{_sysconfdir}/%{name}/*.xml
117
118 %dir %{_appdir}
119 %{_appdir}/*.php
120 %{_appdir}/config
121 %{_appdir}/docs
122 %{_appdir}/lib
123 %{_appdir}/locale
124 %{_appdir}/templates
125 %{_appdir}/themes
This page took 0.03769 seconds and 3 git commands to generate.