1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
%define _hordeapp vacation
%define _rel 0.1
#
%include /usr/lib/rpm/macros.php
Summary: vacation - vacation manager module for Horde
Name: horde-%{_hordeapp}
Version: 2.2.2
Release: %{?_rc:0.%{_rc}.}%{?_snap:0.%(echo %{_snap} | tr -d -).}%{_rel}
License: ASL
Group: Applications/WWW
#Source0: ftp://ftp.horde.org/pub/snaps/%{_snap}/%{_hordeapp}-HEAD-%{_snap}.tar.gz
Source0: ftp://ftp.horde.org/pub/vacation/%{_hordeapp}-%{version}.tar.gz
# Source0-md5: 1345ff8e30a98de7085f01f0abde3007
Source1: %{name}.conf
URL: http://www.horde.org/vacation/
BuildRequires: rpm-php-pearprov >= 4.0.2-98
BuildRequires: rpmbuild(macros) >= 1.226
BuildRequires: tar >= 1:1.15.1
Requires: apache >= 1.3.33-2
Requires: apache(mod_access)
Requires: horde >= 3.0
Requires: php-xml >= 4.1.0
Requires: vacation
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
# horde accesses it directly in help->about
%define _noautocompressdoc CREDITS
%define _noautoreq 'pear(Horde.*)'
%define hordedir /usr/share/horde
%define _sysconfdir /etc/horde.org
%define _appdir %{hordedir}/%{_hordeapp}
%description
Vacation is a Horde module for managing user e-mail "vacation notices" or "auto-responders." It works via a local vacation program which must be installed and functioning on the server. It supports vacation programs using the .forward-style forwarding mechanism supported by several popular mailers, as well as qmail and sql based implementations. While it has been released and is in production use at many sites, it is also under heavy development in an effort to expand and improve the module.
%prep
%setup -q -c -T -n %{?_snap:%{_hordeapp}-%{_snap}}%{!?_snap:%{_hordeapp}-%{version}%{?_rc:-%{_rc}}}
tar zxf %{SOURCE0} --strip-components=1
rm -f scripts/.htaccess
# considered harmful (horde/docs/SECURITY)
rm -f test.php
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{_hordeapp} \
$RPM_BUILD_ROOT%{_appdir}/{docs,graphics,lib,locale,scripts,templates}
cp -pR *.php $RPM_BUILD_ROOT%{_appdir}
for i in config/*.dist; do
cp -p $i $RPM_BUILD_ROOT%{_sysconfdir}/%{_hordeapp}/$(basename $i .dist)
done
echo '<?php ?>' > $RPM_BUILD_ROOT%{_sysconfdir}/%{_hordeapp}/conf.php
touch $RPM_BUILD_ROOT%{_sysconfdir}/%{_hordeapp}/conf.php.bak
cp -pR graphics/* $RPM_BUILD_ROOT%{_appdir}/graphics
cp -pR lib/* $RPM_BUILD_ROOT%{_appdir}/lib
cp -pR locale/* $RPM_BUILD_ROOT%{_appdir}/locale
cp -pR templates/* $RPM_BUILD_ROOT%{_appdir}/templates
ln -s %{_sysconfdir}/%{_hordeapp} $RPM_BUILD_ROOT%{_appdir}/config
ln -s %{_docdir}/%{name}-%{version}/CREDITS $RPM_BUILD_ROOT%{_appdir}/docs
install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache-%{_hordeapp}.conf
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ ! -f %{_sysconfdir}/%{_hordeapp}/conf.php.bak ]; then
install /dev/null -o root -g http -m660 %{_sysconfdir}/%{_hordeapp}/conf.php.bak
fi
%triggerin -- apache1 >= 1.3.33-2
%apache_config_install -v 1 -c %{_sysconfdir}/apache-%{_hordeapp}.conf
%triggerun -- apache1 >= 1.3.33-2
%apache_config_uninstall -v 1
%triggerin -- apache >= 2.0.0
%apache_config_install -v 2 -c %{_sysconfdir}/apache-%{_hordeapp}.conf
%triggerun -- apache >= 2.0.0
%apache_config_uninstall -v 2
%files
%defattr(644,root,root,755)
%doc README docs/* scripts
%attr(750,root,http) %dir %{_sysconfdir}/%{_hordeapp}
%attr(640,root,root) %config(noreplace) %{_sysconfdir}/apache-%{_hordeapp}.conf
%attr(660,root,http) %config(noreplace) %{_sysconfdir}/%{_hordeapp}/conf.php
%attr(660,root,http) %config(noreplace) %ghost %{_sysconfdir}/%{_hordeapp}/conf.php.bak
##%attr(640,root,http) %config(noreplace) %{_sysconfdir}/%{_hordeapp}/[!c]*.php
%dir %{_appdir}
%{_appdir}/*.php
%{_appdir}/config
%{_appdir}/docs
%{_appdir}/graphics
%{_appdir}/lib
%{_appdir}/locale
%{_appdir}/templates
|