]> git.pld-linux.org Git - packages/WebChess.git/blob - WebChess.spec
0c704c4b009900ab976cffcaa393fc431d691e5e
[packages/WebChess.git] / WebChess.spec
1 Summary:        A great persistant online chess game
2 Summary(pl):    Wspania³a internetowa gra w szachy
3 Name:           WebChess
4 Version:        0.9.0
5 Release:        1
6 License:        GPL
7 Group:          Applications/WWW
8 Source0:        http://dl.sourceforge.net/webchess/%{name}_%{version}.zip
9 # Source0-md5:  e1a0dc90959a4e8475854a6e7fb4f0b9
10 Source1:        %{name}.conf
11 URL:            http://webchess.sourceforge.net/
12 Requires:       php
13 Requires:       php-mysql
14 Requires:       php-pcre
15 Requires:       webserver
16 BuildArch:      noarch
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19 %define         _webchessdir    %{_datadir}/%{name}
20 %define         _sysconfdir     /etc/%{name}
21
22 %description
23 A great persistant online chess game using PHP/MySQL on the backend
24 and HTML/JavaScript on the front-end, which includes move validation,
25 CHECK checking, pawn promotion and undo. It also has a login system
26 which allows multiple simultaneous games.
27
28 %description -l pl
29 Wspania³a internetowa gra w szachy, u¿ywaj±ca PHP/MySQL po stronie
30 backendu i HTML/JavaScript po stronie interfejsu u¿ytkownika. Zawiera
31 kontrolê ruchów, sprawdzanie szachu, promocjê pionów oraz cofanie.
32 Ma tak¿e system logowania, który pozwala na wiele jednoczesnych gier.
33
34 %prep
35 %setup -q -c
36
37 %install
38 rm -rf $RPM_BUILD_ROOT
39 install -d $RPM_BUILD_ROOT%{_webchessdir} \
40            $RPM_BUILD_ROOT{%{_sysconfdir},/etc/httpd}
41
42 cp -af images javascript *.php *.css chess.inc $RPM_BUILD_ROOT%{_webchessdir}
43 rm -f $RPM_BUILD_ROOT%{_webchessdir}/config.php
44
45 install config.php $RPM_BUILD_ROOT%{_sysconfdir}
46 ln -sf %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_webchessdir}/config.php
47
48 install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
49
50 %clean
51 rm -rf $RPM_BUILD_ROOT
52
53 %post
54 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
55         echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
56 elif [ -d /etc/httpd/httpd.conf ]; then
57         ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
58 fi
59 if [ -f /var/lock/subsys/httpd ]; then
60         /usr/sbin/apachectl restart 1>&2
61 fi
62
63 %preun
64 if [ "$1" = "0" ]; then
65         umask 027
66         if [ -d /etc/httpd/httpd.conf ]; then
67                 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
68         else
69                 grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
70                         /etc/httpd/httpd.conf.tmp
71                 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
72                 if [ -f /var/lock/subsys/httpd ]; then
73                         /usr/sbin/apachectl restart 1>&2
74                 fi
75         fi
76 fi
77
78 %files
79 %defattr(644,root,root,755)
80 %dir %{_sysconfdir}
81 %attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*
82 %config(noreplace) %verify(not size mtime md5) /etc/httpd/%{name}.conf
83 %doc docs/*
84 %dir %{_webchessdir}
85 %{_webchessdir}/images
86 %{_webchessdir}/javascript
87 %{_webchessdir}/chess.inc
88 %{_webchessdir}/*.php
89 %{_webchessdir}/*.css
This page took 0.413607 seconds and 2 git commands to generate.