summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
authorMárcio Alexandre Silva Delgado <coadde@adinet.com.uy>2012-09-01 00:29:25 -0300
committerMárcio Alexandre Silva Delgado <coadde@adinet.com.uy>2012-09-01 00:29:25 -0300
commit553b1008dd7c9a3805d30cfa8905635cb58efc26 (patch)
treeb74c0b5655601b9b900eb64e1db2915305fd2938 /pcr
parent96c4c1414481245fcbac8f25d7b5e467dedd7af7 (diff)
mednafen-server: adding package to pcr
Diffstat (limited to 'pcr')
-rw-r--r--pcr/mednafen-server/PKGBUILD39
-rw-r--r--pcr/mednafen-server/mednafen-server.service9
-rwxr-xr-xpcr/mednafen-server/mednafen-serverd41
3 files changed, 89 insertions, 0 deletions
diff --git a/pcr/mednafen-server/PKGBUILD b/pcr/mednafen-server/PKGBUILD
new file mode 100644
index 000000000..0c7057908
--- /dev/null
+++ b/pcr/mednafen-server/PKGBUILD
@@ -0,0 +1,39 @@
+# Maintainer (Parabola): Márcio Silva <coadde@lavabit.com>
+
+pkgname=mednafen-server
+pkgver=0.5.0
+pkgrel=1
+pkgdesc='A server multi-system gaming emulator'
+url=http://${pkgname%-server}.sourceforge.net/
+license=(
+ GPL
+)
+arch=(
+ i686
+ x86_64
+ mips64el
+)
+source=(
+ http://downloads.sourceforge.net/project/${pkgname%-server}/Mednafen-Server/$pkgver/$pkgname-$pkgver.tar.gz
+ ${pkgname}d
+ $pkgname.service
+)
+sha512sums=(
+ 700b2021e5085761b90bb5ee802ff9ccded3cdade76682fe9faa98ebbb0653c9b00baea5baa1c486f850bad606aae33a88e4d9486015babb210648aa0cd4542d
+ 55cba761db9c10978a5146e4f92ccce2a645e0566d0744e745b36ede56a0332d1cb1f6c8a09df6a1c01320b539f07ccd7073b2d85eca6b340449a1c3b9761407
+ cd3d19b789ec7f62c4b8f5fe0f93e7836fab5406a3416434701caf6404cce02c7223dcb8b82bd1e4b00bdcf4df623f0cd44f850a7f79a7be73e04c0804972700
+)
+
+build() {
+ cd $srcdir/$pkgname
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname
+ make DESTDIR=$pkgdir install
+ install -Dm644 standard.conf $pkgdir/etc/$pkgname/standard.conf
+ install -Dm644 $srcdir/${pkgname}d $pkgdir/etc/rc.d/$pkgname
+ install -Dm644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
+}
diff --git a/pcr/mednafen-server/mednafen-server.service b/pcr/mednafen-server/mednafen-server.service
new file mode 100644
index 000000000..9ee392432
--- /dev/null
+++ b/pcr/mednafen-server/mednafen-server.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Mednafen Server Daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/mednafen-server /etc/mednafen-server/standard.conf >/var/log/mednafen-server.log 2>/var/log/mednafen-server.log.2
+
+[Install]
+WantedBy=multi-user.target
diff --git a/pcr/mednafen-server/mednafen-serverd b/pcr/mednafen-server/mednafen-serverd
new file mode 100755
index 000000000..d6033f6af
--- /dev/null
+++ b/pcr/mednafen-server/mednafen-serverd
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# source application-specific settings
+MED_ARGS=
+[ -f /etc/mednafen-server/standard.conf ] && . /etc/mednafen-server/standard.conf
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof -o %PPID /usr/bin/mednafen-server)
+case "$1" in
+ start)
+ stat_busy "Starting Mednafen Server Daemon"
+ [ -z "$PID" ] && /usr/bin/mednafen-server ${MED_ARGS} >/var/log/mednafen-server.log 2>/var/log/mednafen-server.log.2
+ PID=$(pidof -o %PPID /usr/bin/mednafen-server)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ add_daemon mednafen-server
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Mednafen Server Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon mednafen-server
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0