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