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