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