1 %define _hordeapp passwd
3 Summary: passwd - password change module for Horde
4 Summary(pl.UTF-8): passwd - moduł do zmieniania haseł w Horde
5 Name: horde-%{_hordeapp}
9 Group: Applications/WWW
10 Source0: ftp://ftp.horde.org/pub/passwd/%{_hordeapp}-h3-%{version}.tar.gz
11 # Source0-md5: 2094be49e14e94ff66e9304718db7cd6
12 Source1: %{name}-apache.conf
13 Source2: %{name}-httpd.conf
14 URL: http://www.horde.org/passwd/
15 BuildRequires: rpm-php-pearprov >= 4.0.2-98
16 BuildRequires: rpmbuild(macros) >= 1.264
17 Requires(post): sed >= 4.0
18 Requires: horde >= 3.0
19 Requires: php(core) >= 4.1.0
25 Suggests: php-pear-Crypt_CHAP
26 Obsoletes: horde-addons-passwd
27 Conflicts: apache-base < 2.4.0-1
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _noautoreq_pear Horde.*
33 %define hordedir /usr/share/horde
34 %define _appdir %{hordedir}/%{_hordeapp}
35 %define _webapps /etc/webapps
36 %define _webapp horde-%{_hordeapp}
37 %define _sysconfdir %{_webapps}/%{_webapp}
40 Passwd is the Horde password changing application. While it has been
41 released and is in production use at many sites, it is also under
42 heavy development in an effort to expand and improve the module.
44 %description -l pl.UTF-8
45 Passwd to aplikacja do zmieniania haseł w Horde. Chociaż została już
46 wydana i jest używana produkcyjnie w wielu serwisach, jest nadal
47 intensyjwnie rozwijana, aby rozszerzyć możliwości i udoskonalić ten
51 %setup -q -n %{_hordeapp}-h3-%{version}
54 for i in config/*.dist; do
55 mv $i config/$(basename $i .dist)
57 # considered harmful (horde/docs/SECURITY)
61 rm -rf $RPM_BUILD_ROOT
62 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}/docs}
64 cp -a *.php $RPM_BUILD_ROOT%{_appdir}
65 cp -a config/* $RPM_BUILD_ROOT%{_sysconfdir}
66 echo '<?php ?>' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.php
67 touch $RPM_BUILD_ROOT%{_sysconfdir}/conf.php.bak
68 cp -a lib locale templates themes $RPM_BUILD_ROOT%{_appdir}
69 cp -a docs/CREDITS $RPM_BUILD_ROOT%{_appdir}/docs
71 ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/config
72 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
73 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
76 rm -rf $RPM_BUILD_ROOT
79 if [ ! -f %{_sysconfdir}/conf.php.bak ]; then
80 install /dev/null -o root -g http -m660 %{_sysconfdir}/conf.php.bak
83 # take uids with < 500 and update refused logins in default conf.xml
84 USERLIST=$(awk -F: '{ if ($3 < 500) print $1 }' < /etc/passwd | xargs | tr ' ' ',')
85 if [ "$USERLIST" ]; then
87 # primitive xml parser ;)
88 /configlist name=\"refused\"/s/>.*</>$USERLIST</
89 " %{_sysconfdir}/conf.xml
92 %triggerin -- apache1 < 1.3.37-3, apache1-base
93 %webapp_register apache %{_webapp}
95 %triggerun -- apache1 < 1.3.37-3, apache1-base
96 %webapp_unregister apache %{_webapp}
98 %triggerin -- apache-base
99 %webapp_register httpd %{_webapp}
101 %triggerun -- apache-base
102 %webapp_unregister httpd %{_webapp}
104 %triggerpostun -- horde-%{_hordeapp} < 3.0-2.1
105 for i in backends.php conf.php; do
106 if [ -f /home/services/httpd/html/horde/passwd/config/$i.rpmsave ]; then
107 mv -f %{_sysconfdir}/$i{,.rpmnew}
108 mv -f /home/services/httpd/html/horde/passwd/config/$i.rpmsave %{_sysconfdir}/$i
112 for i in backends.php conf.php; do
113 if [ -f /etc/horde.org/%{_hordeapp}/$i.rpmsave ]; then
114 mv -f %{_sysconfdir}/$i{,.rpmnew}
115 mv -f /etc/horde.org/%{_hordeapp}/$i.rpmsave %{_sysconfdir}/$i
119 if [ -f /etc/horde.org/apache-%{_hordeapp}.conf.rpmsave ]; then
120 mv -f %{_sysconfdir}/apache.conf{,.rpmnew}
121 mv -f %{_sysconfdir}/httpd.conf{,.rpmnew}
122 cp -f /etc/horde.org/apache-%{_hordeapp}.conf.rpmsave %{_sysconfdir}/apache.conf
123 cp -f /etc/horde.org/apache-%{_hordeapp}.conf.rpmsave %{_sysconfdir}/httpd.conf
126 if [ -L /etc/apache/conf.d/99_horde-%{_hordeapp}.conf ]; then
127 /usr/sbin/webapp register apache %{_webapp}
128 rm -f /etc/apache/conf.d/99_horde-%{_hordeapp}.conf
129 %service -q apache reload
131 if [ -L /etc/httpd/httpd.conf/99_horde-%{_hordeapp}.conf ]; then
132 /usr/sbin/webapp register httpd %{_webapp}
133 rm -f /etc/httpd/httpd.conf/99_horde-%{_hordeapp}.conf
134 %service -q httpd reload
138 %defattr(644,root,root,755)
139 %doc README docs/* scripts
140 %dir %attr(750,root,http) %{_sysconfdir}
141 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
142 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
143 %attr(660,root,http) %config(noreplace) %{_sysconfdir}/conf.php
144 %attr(660,root,http) %config(noreplace) %ghost %{_sysconfdir}/conf.php.bak
145 %attr(640,root,http) %config(noreplace) %{_sysconfdir}/[!c]*.php
146 %attr(640,root,http) %{_sysconfdir}/conf.xml