]> git.pld-linux.org Git - packages/phpdc.git/blob - phpdc.spec
- tabs in preamble
[packages/phpdc.git] / phpdc.spec
1 # TODO
2 # - webapps
3 %define _rc     rc1
4 Summary:        A Web frontend for the Direct Connect Text Client
5 Summary(pl.UTF-8):      Interfejs WWW do Direct Connect Text Client
6 Name:           phpdc
7 Version:        1.0
8 Release:        0.%{_rc}.1
9 License:        GPL v2
10 Group:          Applications/Databases/Interfaces
11 Source0:        http://dl.sourceforge.net/phpdc/%{name}-%{version}%{_rc}.tar.gz
12 # Source0-md5:  035a6a0dbedd55f724237aa0b9cebff9
13 Source1:        %{name}.conf
14 Patch0:         %{name}-config.patch
15 #               http://phpdc.sourceforge.net/release/phpdc-1.0rc1-hublist_bug.patch
16 Patch1:         %{name}-1.0rc1-hublist_bug.patch
17 URL:            http://phpdc.sourceforge.net/
18 Requires:       dctc
19 Requires:       php(gd)
20 Requires:       php(sockets)
21 Requires:       webserver
22 Requires:       webserver(php) >= 4.3.0
23 BuildArch:      noarch
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %define         _phpdcdir       %{_datadir}/%{name}
27 %define         _sysconfdir     /etc/%{name}
28
29 %description
30 PHPDC Web is a server-side Web frontend for the Direct Connect Text
31 Client (dctc).
32
33 %description -l pl.UTF-8
34 PHPDC Web to działający po stronie serwera frontend WWW do tekstowego
35 klienta Direct Connect (dctc - Direct Connect Text Client).
36
37 %prep
38 %setup -q -n %{name}
39 %patch0 -p1
40 %patch1 -p0
41
42 %install
43 rm -rf $RPM_BUILD_ROOT
44 install -d $RPM_BUILD_ROOT%{_phpdcdir}/{layout,private,styles,Downloads} \
45         $RPM_BUILD_ROOT{%{_sysconfdir},/etc/httpd}
46
47 install *.php $RPM_BUILD_ROOT%{_phpdcdir}
48 install *.{html,png,ini} $RPM_BUILD_ROOT%{_phpdcdir}
49 install layout/* $RPM_BUILD_ROOT%{_phpdcdir}/layout
50 install private/* $RPM_BUILD_ROOT%{_phpdcdir}/private
51 install styles/* $RPM_BUILD_ROOT%{_phpdcdir}/styles
52
53 install phpdc.ini $RPM_BUILD_ROOT%{_sysconfdir}
54 ln -sf %{_sysconfdir}/phpdc.ini $RPM_BUILD_ROOT%{_phpdcdir}/phpdc.ini
55
56 install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
57
58 %clean
59 rm -rf $RPM_BUILD_ROOT
60
61 %post
62 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
63         echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
64 elif [ -d /etc/httpd/httpd.conf ]; then
65         ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
66 fi
67 if [ -f /var/lock/subsys/httpd ]; then
68         /usr/sbin/apachectl restart 1>&2
69 fi
70
71 %preun
72 if [ "$1" = "0" ]; then
73         umask 027
74         if [ -d /etc/httpd/httpd.conf ]; then
75                 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
76         else
77                 grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
78                         /etc/httpd/httpd.conf.tmp
79                 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
80                 if [ -f /var/lock/subsys/httpd ]; then
81                         /usr/sbin/apachectl restart 1>&2
82                 fi
83         fi
84 fi
85
86 %files
87 %defattr(644,root,root,755)
88 %dir %{_sysconfdir}
89 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
90 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd/%{name}.conf
91 %dir %{_phpdcdir}
92 %dir %{_phpdcdir}/layout
93 %dir %{_phpdcdir}/private
94 %dir %{_phpdcdir}/styles
95 %attr(664,http,http) %dir %{_phpdcdir}/Downloads
96 %{_phpdcdir}/*.html
97 %{_phpdcdir}/*.php
98 %{_phpdcdir}/*.png
99 %{_phpdcdir}/layout/*
100 %{_phpdcdir}/private/*.php
101 %{_phpdcdir}/styles/*
102 %attr(664,root,http) %config(noreplace) %verify(not md5 mtime size) %{_phpdcdir}/private/phpdc.ini
This page took 0.02939 seconds and 3 git commands to generate.