1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00

Add useful rc.d startup script.

PR:		57693
Submitted by:	Jose R.Rey <king@v2project.com>

Also honor CFLAGS and clean-up install.
This commit is contained in:
Christian Weisgerber 2003-10-08 20:39:57 +00:00
parent b1bdd1d3ea
commit 1b312f03b2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=90663
4 changed files with 54 additions and 9 deletions

View File

@ -20,7 +20,9 @@ USE_REINPLACE= yes
post-patch:
${REINPLACE_CMD} -e 's|@@PREFIX@@|${PREFIX}|g' ${WRKSRC}/server.c
post-install:
${CP} ${WRKSRC}/xbms.conf ${PREFIX}/etc/xbms.conf.sample
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/xbms ${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/xbms.conf ${PREFIX}/etc/xbms.conf.sample
${INSTALL_DATA} ${FILESDIR}/xbms.sh.sample ${PREFIX}/etc/rc.d/xbms.sh.sample
.include <bsd.port.mk>

View File

@ -1,9 +1,15 @@
--- Makefile.orig Thu Jan 16 16:27:25 2003
+++ Makefile Thu Jan 16 16:27:36 2003
@@ -1,5 +1,5 @@
CC = gcc -Wall
-BINDIR = /usr/local/bin
+BINDIR = ${PREFIX}/bin
$FreeBSD$
--- Makefile.orig Sun Feb 23 13:11:59 2003
+++ Makefile Wed Oct 8 22:37:15 2003
@@ -1,8 +1,7 @@
-CC = gcc -Wall
BINDIR = /usr/local/bin
all: server
server:
$(CC) -O3 -pthread -o xbms server.c
- $(CC) -O3 -pthread -o xbms server.c
+ $(CC) $(CFLAGS) -pthread -o xbms server.c
install: all
rm -f $(BINDIR)/xbms
cp xbms $(BINDIR)

View File

@ -0,0 +1,35 @@
#!/bin/sh
#
# Start or stop the xbms server
#
# $FreeBSD$
pidfile="/var/run/xbms.pid"
name="xbms"
case "$1" in
start)
echo -n " xbms"
if [ -f /usr/local/etc/xbms.conf.sample ]; then
/usr/local/bin/xbms
fi
;;
stop)
if [ ! -f /var/run/xbms.pid ]; then
echo "XBMS not running"
exit 64
fi
kill `cat /var/run/xbms.pid`
;;
status)
ps -auxww | egrep ${name} | egrep -v "($0|egrep)"
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop | status}"
echo ""
exit 64
;;
esac

View File

@ -1,2 +1,4 @@
@comment $FreeBSD$
bin/xbms
etc/xbms.conf.sample
etc/rc.d/xbms.sh.sample