]> git.pld-linux.org Git - packages/WebChess.git/commitdiff
- added URL
authorspeedo <speedo@pld-linux.org>
Sun, 26 Sep 2004 10:05:25 +0000 (10:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- added Source1
- changed Group
- moved webchessdir to _datadir
- moved config file to _sysconfdir

Changed files:
    WebChess.spec -> 1.2

WebChess.spec

index 14b63dd9ec371b0090441a260fb9f0551ce2f7af..be81126fad63ebcc3a7d681780614952888db5ad 100644 (file)
@@ -4,17 +4,19 @@ Name:         WebChess
 Version:       0.9.0
 Release:       1
 License:       GNU General Public License (GPL)
-Group:         Webaplications
-######         Unknown group!
-Source0:       http://voxel.dl.sourceforge.net/sourceforge/webchess/%{name}_%{version}.zip
+Group:         Applications/WWW
+Source0:       http://dl.sourceforge.net/webchess/%{name}_%{version}.zip
 # Source0-md5: e1a0dc90959a4e8475854a6e7fb4f0b9
+Source1:       %{name}.conf
+URL:           http://webchess.sourceforge.net
 Requires:      php-mysql
 Requires:      php-pcre
 Requires:      webserver
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _webchessdir    /home/services/httpd/html/WebChess
+%define                _webchessdir    %{_datadir}/%{name}
+%define         _sysconfdir     /etc/%{name}
 
 %description
 A great persistant online chess game using PHP/MySQL on the backend
@@ -32,15 +34,51 @@ logowania, kt
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_webchessdir}
+install -d $RPM_BUILD_ROOT%{_webchessdir} \
+          $RPM_BUILD_ROOT{%{_sysconfdir},/etc/httpd}
 
 cp -af images javascript *.php *.css chess.inc   $RPM_BUILD_ROOT%{_webchessdir}
+rm -f $RPM_BUILD_ROOT%{_webchessdir}/config.php
+
+install config.php $RPM_BUILD_ROOT%{_sysconfdir}
+ln -sf %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_webchessdir}/config.php
+
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
+        echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
+elif [ -d /etc/httpd/httpd.conf ]; then
+        ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
+fi
+if [ -f /var/lock/subsys/httpd ]; then
+        /usr/sbin/apachectl restart 1>&2
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+        umask 027
+        if [ -d /etc/httpd/httpd.conf ]; then
+            rm -f /etc/httpd/httpd.conf/99_%{name}.conf
+        else
+                grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
+                        /etc/httpd/httpd.conf.tmp
+                mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
+                if [ -f /var/lock/subsys/httpd ]; then
+                    /usr/sbin/apachectl restart 1>&2
+                fi
+        fi
+fi
+
+
 %files
 %defattr(644,root,root,755)
+%dir %{_sysconfdir}
+%attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*
+%config(noreplace) %verify(not size mtime md5) /etc/httpd/%{name}.conf
 %doc docs/*
 %dir %{_webchessdir}
 %{_webchessdir}/images/
This page took 0.190842 seconds and 4 git commands to generate.