]> git.pld-linux.org Git - packages/wesnoth.git/commitdiff
- added init script for wesnothd server
authoryogib <yogib@pld-linux.org>
Sun, 13 Jun 2004 14:32:20 +0000 (14:32 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    wesnoth.spec -> 1.21

wesnoth.spec

index 737d9037451813eb457bd64c2760bef18c863899..09a5ddea917b204b499347fe980e1339ded57bb7 100644 (file)
@@ -7,13 +7,14 @@ Summary:      Strategy game with a fantasy theme
 Summary(pl):   Strategiczna gra z motywem fantasy
 Name:          wesnoth
 Version:       0.7.9
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         X11/Applications/Games/Strategy
 Icon:          wesnoth-icon.xpm
 Source0:       http://www.wesnoth.org/files/%{name}-%{version}.tar.gz
 # Source0-md5: e97bbed9767a02061c6209d73c7b00ce
 Source1:       %{name}.desktop
+Source2:       %{name}d.init
 URL:           http://www.wesnoth.org
 BuildRequires: SDL-devel >= 1.2.7
 BuildRequires: SDL_image-devel >= 1.2
@@ -41,6 +42,7 @@ zaawansowania i s
 Summary:       Network server for Wesnoth
 Summary(pl):   Sieciowy serwer dla Wesnoth
 Group:         X11/Applications/Games/Strategy
+Requires(post,preun):   /sbin/chkconfig
 
 %description server
 Server for playing networked games of Wesnoth.
@@ -73,16 +75,34 @@ Edytor map i narz
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
 install images/wesnoth-icon.png $RPM_BUILD_ROOT%{_pixmapsdir}
 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/wesnothd
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post server
+/sbin/chkconfig --add wesnothd
+if [ -f /var/lock/subsys/wesnothd ]; then
+        /etc/rc.d/init.d/wesnothd restart >&2
+else
+        echo "Run \"/etc/rc.d/init.d/wesnothd start\" to start wesnothd." >&2
+fi
+
+%preun server
+if [ "$1" = "0" ]; then
+        if [ -f /var/lock/subsys/wesnothd ]; then
+                /etc/rc.d/init.d/wesnothd stop
+        fi
+        /sbin/chkconfig --del wesnothd
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc changelog README MANUAL*
@@ -96,6 +116,7 @@ rm -rf $RPM_BUILD_ROOT
 %files server
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/wesnothd
+%attr(754,root,root) /etc/rc.d/init.d/wesnothd
 %{_mandir}/man6/wesnothd.6*
 %endif
 
This page took 0.034667 seconds and 4 git commands to generate.