]>
Commit | Line | Data |
---|---|---|
36424755 TO |
1 | Summary: DaveDAP's A Very Easy Directory Administration Program |
2 | Name: davedap | |
3 | Version: 0.8.1 | |
4 | Release: 1 | |
5 | License: GPL v2 | |
6 | Group: Applications/Databases | |
7 | Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz | |
8 | # Source0-md5: f7756e7a8201725ed7dff72968078a8e | |
9 | Source1: %{name}.conf | |
10 | URL: http://davedap.sourceforge.net/ | |
11 | Requires: apache | |
12 | Requires: php-ldap | |
13 | Requires: php-xml | |
14 | Requires(post,preun): grep | |
15 | Requires(preun): fileutils | |
16 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
17 | ||
18 | %define davedapdir %{_datadir}/%{name} | |
19 | ||
20 | %description | |
21 | DaveDAP is a web-based LDAP admin tool written in PHP. You can browse | |
22 | your LDAP tree, create, delete, edit, and copy objects, perform | |
23 | searches, and view your server's schema. You can even copy objects | |
24 | between two LDAP servers and recursively delete or copy entire trees. | |
25 | ||
26 | %prep | |
27 | %setup -q | |
28 | ||
29 | %install | |
30 | rm -rf $RPM_BUILD_ROOT | |
31 | install -d $RPM_BUILD_ROOT{/etc/httpd,%{davedapdir}/{images,include}} | |
32 | ||
f8d492e8 | 33 | install *.php *.css *.txt $RPM_BUILD_ROOT%{davedapdir}/ |
36424755 TO |
34 | install images/* $RPM_BUILD_ROOT%{davedapdir}/images/ |
35 | ||
36 | install %SOURCE1 $RPM_BUILD_ROOT/etc/httpd/ | |
f8d492e8 TO |
37 | install config.php.example $RPM_BUILD_ROOT/etc/davedap.conf |
38 | ln -s /etc/davedap.conf $RPM_BUILD_ROOT%{davedapdir}/config.php | |
36424755 TO |
39 | |
40 | %clean | |
41 | rm -rf $RPM_BUILD_ROOT | |
42 | ||
43 | %post | |
44 | if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*davedap.conf" /etc/httpd/httpd.conf; then | |
45 | echo "Include /etc/httpd/davedap.conf" >> /etc/httpd/httpd.conf | |
46 | fi | |
47 | if [ -f /var/lock/subsys/httpd ]; then | |
48 | /usr/sbin/apachectl restart 1>&2 | |
49 | fi | |
50 | ||
51 | %preun | |
52 | if [ "$1" = "0" ]; then | |
53 | umask 027 | |
54 | grep -v "^Include.*davedap.conf" /etc/httpd/httpd.conf > \ | |
55 | /etc/httpd/httpd.conf.tmp | |
56 | mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf | |
57 | if [ -f /var/lock/subsys/httpd ]; then | |
58 | /usr/sbin/apachectl restart 1>&2 | |
59 | fi | |
60 | fi | |
61 | ||
62 | %files | |
63 | %defattr(644,root,root,755) | |
64 | # there's no README, INSTALL may contain usefull info | |
65 | %doc INSTALL TODO | |
66 | %dir %{davedapdir} | |
67 | %{davedapdir}/images | |
68 | %{davedapdir}/*.php | |
69 | %{davedapdir}/*.css | |
70 | %{davedapdir}/*.txt | |
36424755 | 71 | %config(noreplace) %verify(not mtime size md5) /etc/httpd/%{name}.conf |
f8d492e8 | 72 | %config(noreplace) %verify(not mtime size md5) /etc/%{name}.conf |