OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 21-May-2004 16:23:53
Branch: HEAD Handle: 2004052115235200
Added files:
openpkg-src/gift gift.sh
Modified files:
openpkg-src/gift gift.spec
Log:
add convenience control script for giftd(8)
Summary:
Revision Changes Path
1.1 +66 -0 openpkg-src/gift/gift.sh
1.3 +13 -0 openpkg-src/gift/gift.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/gift/gift.sh
============================================================================
$ cvs diff -u -r0 -r1.1 gift.sh
--- /dev/null 2004-05-21 16:23:52.000000000 +0200
+++ gift.sh 2004-05-21 16:23:53.000000000 +0200
@@ -0,0 +1,66 @@
+#!/bin/sh
+##
+## gift -- giftd(8) server control script
+##
+
+# command line check
+if [ $# -lt 1 ]; then
+ echo "** ERROR: Usage: gift {start|cui|gui|stop}" 1>&2
+ exit 1
+fi
+
+# dispatch into command
+cmd="$1"
+shift
+case "$cmd" in
+ start )
+ # make sure the giftd(8) user run-time environment exists
+ if [ ! -d $HOME/.giFT ] ; then
+ echo "++ creating giFT home directory \"$HOME/.giFT\""
+ if ! mkdir $HOME/.giFT; then
+ echo "** ERROR: creation of \"$HOME/.giFT\" failed!" 1>&2
+ exit 1
+ fi
+ fi
+
+ # run giFT server
+ echo "++ starting giFT server"
+ ( nohup @l_prefix@/bin/giftd \
+ </dev/null >/dev/null 2>&1 &
+ echo $! >$HOME/.giFT/giftd.pid
+ ) >/dev/null 2>&1
+ ;;
+ cui )
+ # run giFTcurs console user interface
+ if [ -f @l_prefix@/bin/giFTcurs ]; then
+ echo "++ entering giFT console user interface (giFTcurs)"
+ exec @l_prefix@/bin/giFTcurs ${1+"$@"}
+ fi
+ echo "** ERROR: giFT CUI not available" 1>&2
+ exit 1
+ ;;
+ gui )
+ # run giFToxic/giFTui graphical user interfaces
+ if [ -f @l_prefix@/bin/giFToxic ]; then
+ echo "++ entering giFT graphical user interface (giFTtoxic)"
+ exec @l_prefix@/bin/giFToxic ${1+"$@"}
+ elif [ -f @l_prefix@/bin/giFTui ]; then
+ echo "++ entering giFT graphical user interface (giFTui)"
+ exec @l_prefix@/bin/giFTui ${1+"$@"}
+ fi
+ echo "** ERROR: giFT GUI not available" 1>&2
+ exit 1
+ ;;
+ stop )
+ # send giFT server the kill command
+ echo "++ stopping giFT server"
+ if [ -f $HOME/.giFT/giftd.pid ]; then
+ kill -TERM `cat $HOME/.giFT/giftd.pid` >/dev/null 2>&1 || true
+ fi
+ ;;
+ * )
+ echo "** ERROR: invalid command \"$cmd\"" 1>&2
+ exit 1
+ ;;
+esac
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/gift/gift.spec
============================================================================
$ cvs diff -u -r1.2 -r1.3 gift.spec
--- openpkg-src/gift/gift.spec 21 May 2004 07:49:32 -0000 1.2
+++ openpkg-src/gift/gift.spec 21 May 2004 14:23:52 -0000 1.3
@@ -42,6 +42,7 @@
# list of sources
Source0: http://osdn.dl.sourceforge.net/gift/gift-%{version}.tar.bz2
+Source1: gift.sh
Patch0: gift.patch
# build information
@@ -81,6 +82,7 @@
%patch -p0
%build
+ # configure program
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="%{l_cppflags}" \
@@ -101,12 +103,23 @@
--disable-libvorbis \
%endif
--disable-shared
+
+ # build program
%{l_make} %{l_mflags -O}
%install
+ # install program
rm -rf $RPM_BUILD_ROOT
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
+
+ # post-adjust installation
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
+
+ # install daemon control script
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
+ %{SOURCE gift.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/gift
+
+ # determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%not %dir %{l_prefix}/lib/pkgconfig'
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]