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