]>
Commit | Line | Data |
---|---|---|
22d512bb ER |
1 | # TODO |
2 | # - webapps | |
3 | %define _rc rc1 | |
295d819e | 4 | Summary: A Web frontend for the Direct Connect Text Client |
42c31bd4 | 5 | Summary(pl.UTF-8): Interfejs WWW do Direct Connect Text Client |
295d819e PG |
6 | Name: phpdc |
7 | Version: 1.0 | |
295d819e PG |
8 | Release: 0.%{_rc}.1 |
9 | License: GPL v2 | |
10 | Group: Applications/Databases/Interfaces | |
d0fcee60 | 11 | Source0: http://dl.sourceforge.net/phpdc/%{name}-%{version}%{_rc}.tar.gz |
823bb986 | 12 | # Source0-md5: 035a6a0dbedd55f724237aa0b9cebff9 |
ae9d189c | 13 | Source1: %{name}.conf |
6b05ea84 | 14 | Patch0: %{name}-config.patch |
2243c78c | 15 | # http://phpdc.sourceforge.net/release/phpdc-1.0rc1-hublist_bug.patch |
16 | Patch1: %{name}-1.0rc1-hublist_bug.patch | |
295d819e PG |
17 | URL: http://phpdc.sourceforge.net/ |
18 | Requires: dctc | |
22d512bb ER |
19 | Requires: php(gd) |
20 | Requires: php(sockets) | |
295d819e | 21 | Requires: webserver |
22d512bb | 22 | Requires: webserver(php) >= 4.3.0 |
295d819e PG |
23 | BuildArch: noarch |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
25 | ||
504d7cd8 | 26 | %define _phpdcdir %{_datadir}/%{name} |
ae9d189c | 27 | %define _sysconfdir /etc/%{name} |
295d819e PG |
28 | |
29 | %description | |
30 | PHPDC Web is a server-side Web frontend for the Direct Connect Text | |
31 | Client (dctc). | |
32 | ||
b9cb4adc JR |
33 | %description -l pl.UTF-8 |
34 | PHPDC Web to działający po stronie serwera frontend WWW do tekstowego | |
dd9ba7c6 JB |
35 | klienta Direct Connect (dctc - Direct Connect Text Client). |
36 | ||
295d819e PG |
37 | %prep |
38 | %setup -q -n %{name} | |
6b05ea84 | 39 | %patch0 -p1 |
2243c78c | 40 | %patch1 -p0 |
295d819e PG |
41 | |
42 | %install | |
43 | rm -rf $RPM_BUILD_ROOT | |
504d7cd8 | 44 | install -d $RPM_BUILD_ROOT%{_phpdcdir}/{layout,private,styles,Downloads} \ |
ae9d189c | 45 | $RPM_BUILD_ROOT{%{_sysconfdir},/etc/httpd} |
504d7cd8 | 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 | |
295d819e | 55 | |
504d7cd8 | 56 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf |
295d819e PG |
57 | |
58 | %clean | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | ||
504d7cd8 | 61 | %post |
62 | if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then | |
ae9d189c | 63 | echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf |
504d7cd8 | 64 | elif [ -d /etc/httpd/httpd.conf ]; then |
ae9d189c | 65 | ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf |
504d7cd8 | 66 | fi |
67 | if [ -f /var/lock/subsys/httpd ]; then | |
ae9d189c | 68 | /usr/sbin/apachectl restart 1>&2 |
504d7cd8 | 69 | fi |
70 | ||
71 | %preun | |
72 | if [ "$1" = "0" ]; then | |
ae9d189c | 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 | |
504d7cd8 | 84 | fi |
85 | ||
295d819e PG |
86 | %files |
87 | %defattr(644,root,root,755) | |
504d7cd8 | 88 | %dir %{_sysconfdir} |
d0fcee60 ER |
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 | |
504d7cd8 | 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/* | |
d0fcee60 | 102 | %attr(664,root,http) %config(noreplace) %verify(not md5 mtime size) %{_phpdcdir}/private/phpdc.ini |