]> git.pld-linux.org Git - packages/horde-passwd.git/blob - horde-passwd.spec
- update noautoreq for rpm5
[packages/horde-passwd.git] / horde-passwd.spec
1 %define         _hordeapp       passwd
2 #
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}
7 Version:        3.1.3
8 Release:        4
9 License:        ASL
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
21 Requires:       php(ctype)
22 Requires:       php(xml)
23 Requires:       webapps
24 Suggests:       php(ldap)
25 Suggests:       php(mhash)
26 Suggests:       php-pear-Crypt_CHAP
27 Obsoletes:      horde-addons-passwd
28 Conflicts:      apache-base < 2.4.0-1
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %define         _noautoreq_pear Horde.*
33
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}
39
40 %description
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.
44
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
49 moduł.
50
51 %prep
52 %setup -q -n %{_hordeapp}-h3-%{version}
53
54 rm -f {,*/}.htaccess
55 for i in config/*.dist; do
56         mv $i config/$(basename $i .dist)
57 done
58 # considered harmful (horde/docs/SECURITY)
59 rm -f test.php
60
61 %install
62 rm -rf $RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}/docs}
64
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
71
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
75
76 %clean
77 rm -rf $RPM_BUILD_ROOT
78
79 %post
80 if [ ! -f %{_sysconfdir}/conf.php.bak ]; then
81         install /dev/null -o root -g http -m660 %{_sysconfdir}/conf.php.bak
82 fi
83
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
87         sed -i -e "
88         # primitive xml parser ;)
89         /configlist name=\"refused\"/s/>.*</>$USERLIST</
90         " %{_sysconfdir}/conf.xml
91 fi
92
93 %triggerin -- apache1 < 1.3.37-3, apache1-base
94 %webapp_register apache %{_webapp}
95
96 %triggerun -- apache1 < 1.3.37-3, apache1-base
97 %webapp_unregister apache %{_webapp}
98
99 %triggerin -- apache-base
100 %webapp_register httpd %{_webapp}
101
102 %triggerun -- apache-base
103 %webapp_unregister httpd %{_webapp}
104
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
110         fi
111 done
112
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
117         fi
118 done
119
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
125 fi
126
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
131 fi
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
136 fi
137
138 %files
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
148
149 %dir %{_appdir}
150 %{_appdir}/*.php
151 %{_appdir}/config
152 %{_appdir}/docs
153 %{_appdir}/lib
154 %{_appdir}/locale
155 %{_appdir}/templates
156 %{_appdir}/themes
This page took 0.177883 seconds and 3 git commands to generate.