forked from ports/contrib
lirc: misc fixes
- use start-stop-daemon in startup script - remove bogus symlink - /usr/man -> /usr/share/man
This commit is contained in:
parent
6792e29d11
commit
10e267418b
@ -20,7 +20,6 @@ drwxr-xr-x root/root usr/bin/
|
||||
-rwxr-xr-x root/root usr/bin/irw
|
||||
-rwxr-xr-x root/root usr/bin/lirc-config-tool
|
||||
-rwxr-xr-x root/root usr/bin/lirc-lsremotes
|
||||
lrwxrwxrwx root/root usr/bin/lirc-setup -> ../../lirc-setup
|
||||
-rwxr-xr-x root/root usr/bin/lircrcd
|
||||
-rwxr-xr-x root/root usr/bin/mode2
|
||||
-rwxr-xr-x root/root usr/bin/pronto2lirc
|
||||
@ -71,6 +70,7 @@ drwxr-xr-x root/root usr/lib/lirc/plugins/
|
||||
-rwxr-xr-x root/root usr/lib/lirc/plugins/alsa_usb.so
|
||||
-rwxr-xr-x root/root usr/lib/lirc/plugins/atilibusb.so
|
||||
-rwxr-xr-x root/root usr/lib/lirc/plugins/atwf83.so
|
||||
-rwxr-xr-x root/root usr/lib/lirc/plugins/audio.so
|
||||
-rwxr-xr-x root/root usr/lib/lirc/plugins/audio_alsa.so
|
||||
-rwxr-xr-x root/root usr/lib/lirc/plugins/awlibusb.so
|
||||
-rwxr-xr-x root/root usr/lib/lirc/plugins/bte.so
|
||||
@ -111,30 +111,31 @@ drwxr-xr-x root/root usr/lib/lirc/plugins/
|
||||
drwxr-xr-x root/root usr/lib/pkgconfig/
|
||||
-rw-r--r-- root/root usr/lib/pkgconfig/lirc-driver.pc
|
||||
-rw-r--r-- root/root usr/lib/pkgconfig/lirc.pc
|
||||
drwxr-xr-x root/root usr/man/
|
||||
drwxr-xr-x root/root usr/man/man1/
|
||||
-rw-r--r-- root/root usr/man/man1/ircat.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/irdb-get.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/irexec.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/irpty.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/irrecord.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/irsend.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/irsimreceive.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/irsimsend.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/irtestcase.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/irw.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/lirc-config-tool.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/lirc-lsplugins.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/lirc-lsremotes.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/lirc-setup.1.gz
|
||||
-rw-r--r-- root/root usr/man/man1/mode2.1.gz
|
||||
drwxr-xr-x root/root usr/man/man5/
|
||||
-rw-r--r-- root/root usr/man/man5/lircd.conf.5.gz
|
||||
drwxr-xr-x root/root usr/man/man8/
|
||||
-rw-r--r-- root/root usr/man/man8/lircd.8.gz
|
||||
-rw-r--r-- root/root usr/man/man8/lircmd.8.gz
|
||||
-rw-r--r-- root/root usr/man/man8/lircrcd.8.gz
|
||||
drwxr-xr-x root/root usr/sbin/
|
||||
-rwxr-xr-x root/root usr/sbin/lirc-lsplugins
|
||||
-rwxr-xr-x root/root usr/sbin/lircd
|
||||
-rwxr-xr-x root/root usr/sbin/lircmd
|
||||
drwxr-xr-x root/root usr/share/
|
||||
drwxr-xr-x root/root usr/share/man/
|
||||
drwxr-xr-x root/root usr/share/man/man1/
|
||||
-rw-r--r-- root/root usr/share/man/man1/ircat.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/irdb-get.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/irexec.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/irpty.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/irrecord.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/irsend.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/irsimreceive.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/irsimsend.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/irtestcase.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/irw.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/lirc-config-tool.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/lirc-lsplugins.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/lirc-lsremotes.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/mode2.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/xmode2.1.gz
|
||||
drwxr-xr-x root/root usr/share/man/man5/
|
||||
-rw-r--r-- root/root usr/share/man/man5/lircd.conf.5.gz
|
||||
drwxr-xr-x root/root usr/share/man/man8/
|
||||
-rw-r--r-- root/root usr/share/man/man8/lircd.8.gz
|
||||
-rw-r--r-- root/root usr/share/man/man8/lircmd.8.gz
|
||||
-rw-r--r-- root/root usr/share/man/man8/lircrcd.8.gz
|
||||
|
@ -6,4 +6,4 @@ aaa20d592294530b429f2c6ffae3805a 20150115020157-b7758ca-user-config.patch
|
||||
c2252bb3008abdf4dbe0373b829b959d 20150123231142-97282f2-help-message.patch
|
||||
3d8af8eb3b4b1c008c2b6f4eb3cde625 lirc-0.9.2-noextras.diff
|
||||
3afc84e79c0839823cc20e7a710dd06d lirc-0.9.2.tar.bz2
|
||||
38b9832e42a80d3fb45fd02c23938b36 lircd.rc
|
||||
0454e18d0457d24e8eb701151e39d239 lircd.rc
|
||||
|
@ -1,9 +1,9 @@
|
||||
untrusted comment: verify with /etc/ports/contrib.pub
|
||||
RWSagIOpLGJF3yR6t83JuIEB0mh+f84WUa1gRF+brExEtEMBZj395nc4mjkQFOuWAA9jWxsaJP06iJvsBIsali7aCnwEDFttWgk=
|
||||
SHA256 (Pkgfile) = 3e8b8ef306b051b0e4056d8055e39b8238c68ff9a0a8720f8aa91c4e4bff1f99
|
||||
SHA256 (.footprint) = f44f745a68e433e889a175f6cb94b3e6e66363ed04dc58c0610be8bfb8cf0824
|
||||
untrusted comment: verify with /etc/ports/alan.pub
|
||||
RWSHHtGdlW9unArEa+zZ/HOLPmokjvr04RYnwVc92HrmJ1tzE+C5A+QLXN0BE4M9vB9vHhpnZ1bxiKHDz3w0SMEqTfnRW4vVDwo=
|
||||
SHA256 (Pkgfile) = 72e63855383ff0a43a87c3dbd77ddcf698d67e4bb3d71173f08aeb1d7a689109
|
||||
SHA256 (.footprint) = 6575c7b1c8e926e900237549a0392377f7a67fff4c13b9fe33c61d7e3c9a433d
|
||||
SHA256 (lirc-0.9.2.tar.bz2) = 4e3f948fcdee6dce009171143f0cb7cd7be48593dd58138db4101a41f651a1dd
|
||||
SHA256 (lircd.rc) = 88139fa9b065fd593409aff8fd8f2ba7d6edb52f2c9718c0d6f1ac8209aec341
|
||||
SHA256 (lircd.rc) = 834b125d71f073df370cf1b986e6f76304b77c354325cdc9e51936fbe0569fa5
|
||||
SHA256 (20141211102847-eb44af1-add-euid-to-template.patch) = b80ba1328939c1a68e5f77b526b7e73c67ae950d9d2632235b2fcba7be5e41c7
|
||||
SHA256 (20141229144508-034dcf8-lirc.pc-variable-order.patch) = 5c7df2f1a2035d1ce1e1ce61705a4ffc5f79c6c6550ef3c48020edf2dd1e31d1
|
||||
SHA256 (20150109124636-35d9b9a-lirc-lsplugins-bugfixes.patch) = 693ef2528c131c067a6a009b6536a91be60dfde437ed2f157ef4ee270ac57436
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
name=lirc
|
||||
version=0.9.2
|
||||
release=4
|
||||
release=5
|
||||
source=(
|
||||
http://download.sourceforge.net/$name/$name-$version.tar.bz2
|
||||
lircd.rc
|
||||
@ -32,14 +32,17 @@ build() {
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--mandir=/usr/man \
|
||||
--mandir=/usr/share/man \
|
||||
--localstatedir=/var
|
||||
make
|
||||
make DESTDIR=$PKG install
|
||||
|
||||
# bogus symlink
|
||||
rm -f $PKG/usr/bin/lirc-setup $PKG/usr/share/man/man1/lirc-setup.1
|
||||
|
||||
# init script
|
||||
install -D -m 755 $SRC/lircd.rc $PKG/etc/rc.d/lircd
|
||||
|
||||
# remove cruft
|
||||
rm -rf $PKG/configs $PKG/usr/share $PKG/var $PKG/etc/lirc/lircd.conf.d/README.conf.d $PKG/usr/lib/lirc/plugins/*.la
|
||||
rm -rf $PKG/configs $PKG/usr/share/doc $PKG/var $PKG/etc/lirc/lircd.conf.d/README.conf.d $PKG/usr/lib/lirc/plugins/*.la
|
||||
}
|
||||
|
@ -1,73 +1,33 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
|
||||
|
||||
NAME=lirc
|
||||
USER=lirc
|
||||
RUNDIR=/var/run/lirc
|
||||
USER="lirc"
|
||||
GROUP="lirc"
|
||||
RUNDIR="/var/run/lirc"
|
||||
PIDFILE="$RUNDIR/lircd.pid"
|
||||
STARTCMD="/usr/bin/sudo -b -H -u $USER /usr/sbin/lircd"
|
||||
STOPCMD=""
|
||||
STOPTIMEOUT=120
|
||||
|
||||
function getpid() {
|
||||
if [ -z "$PIDFILE" ]; then
|
||||
pid="$(pgrep -xfn "$STARTCMD")"
|
||||
else
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
pid=$(< $PIDFILE)
|
||||
if [ ! -d /proc/"$pid" ]; then
|
||||
echo "$NAME: removing stale pidfile $PIDFILE" >&2
|
||||
rm -f "$PIDFILE"
|
||||
unset pid
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo "$pid"
|
||||
}
|
||||
PROG="/usr/sbin/lircd"
|
||||
ARGS=""
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
pid=$(getpid)
|
||||
install -d -m 755 -o $USER $RUNDIR || exit 1
|
||||
if [ -n "$pid" ]; then
|
||||
echo "$NAME already running with pid $pid" >&2
|
||||
exit 1
|
||||
fi
|
||||
eval "$STARTCMD"
|
||||
install -d -m 755 -o $USER -g $GROUP $RUNDIR || exit 1
|
||||
start-stop-daemon --start --pidfile $PIDFILE --chuid $USER --group $GROUP --exec $PROG -- $ARGS
|
||||
;;
|
||||
stop)
|
||||
pid=$(getpid)
|
||||
if [ -n "$pid" ]; then
|
||||
if [ -n "$STOPCMD" ]; then
|
||||
eval "$STOPCMD"
|
||||
else
|
||||
kill "$pid"
|
||||
fi
|
||||
t=$(printf '%(%s)T' -1)
|
||||
tend=$((t+STOPTIMEOUT))
|
||||
while [ -d /proc/$pid -a $t -lt $tend ]; do
|
||||
sleep 0.5
|
||||
t=$(printf '%(%s)T' -1)
|
||||
done
|
||||
if [ -d /proc/"$pid" ]; then
|
||||
echo "$NAME still running with pid $pid" >&2
|
||||
else
|
||||
[ -n "$PIDFILE" ] && rm -f "$PIDFILE"
|
||||
fi
|
||||
else
|
||||
echo "$NAME is not running" >&2
|
||||
fi
|
||||
start-stop-daemon --stop --retry 60 --pidfile $PIDFILE --user $USER
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
pid=$(getpid)
|
||||
if [ -n "$pid" ]; then
|
||||
echo "$NAME is running with pid $pid"
|
||||
else
|
||||
echo "$NAME is not running"
|
||||
fi
|
||||
start-stop-daemon --status --pidfile $PIDFILE
|
||||
case $? in
|
||||
0) echo "$PROG running with pid: $(cat $PIDFILE)" ;;
|
||||
1) echo "$PROG not running, stale pidfile: $PIDFILE" ;;
|
||||
3) echo "$PROG not running" ;;
|
||||
4) echo "Unable to determine program status" ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 [start|stop|restart|status]"
|
||||
|
Loading…
x
Reference in New Issue
Block a user