diff options
author | Thomas Zander <riggs@FreeBSD.org> | 2014-02-01 20:04:33 +0800 |
---|---|---|
committer | Thomas Zander <riggs@FreeBSD.org> | 2014-02-01 20:04:33 +0800 |
commit | 3869d095645a2d803ed7ee59d9febc17517f8ea7 (patch) | |
tree | 9e0181e078ffa699245a15c08726f31f61781b66 /multimedia | |
parent | 9caa79b21fb4d724c6f17af958aa64ab84fe3ddb (diff) | |
download | freebsd-ports-gnome-3869d095645a2d803ed7ee59d9febc17517f8ea7.tar.gz freebsd-ports-gnome-3869d095645a2d803ed7ee59d9febc17517f8ea7.tar.zst freebsd-ports-gnome-3869d095645a2d803ed7ee59d9febc17517f8ea7.zip |
- Bump PORTREVISION
- Use startup script via USE_RC_SUBR
- Add pkg-message to inform about startup script
- Fix a runtime error using wrong pid file in
daemonised process
Approved by: thierry (mentor)
MFH: 2014Q1
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/motion/Makefile | 10 | ||||
-rw-r--r-- | multimedia/motion/files/motion.in | 26 | ||||
-rw-r--r-- | multimedia/motion/files/pkg-message.in | 15 | ||||
-rw-r--r-- | multimedia/motion/pkg-plist | 1 |
4 files changed, 48 insertions, 4 deletions
diff --git a/multimedia/motion/Makefile b/multimedia/motion/Makefile index 7e48b2e7c5e5..18b0b543c213 100644 --- a/multimedia/motion/Makefile +++ b/multimedia/motion/Makefile @@ -3,7 +3,7 @@ PORTNAME= motion PORTVERSION= 3.2.12 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= multimedia MASTER_SITES= SF/${PORTNAME}/${PORTNAME}%20-%20${PORTVERSION:R}/${PORTVERSION} @@ -25,6 +25,9 @@ PWCBSD_DESC= PWCBSD based Webcams USES= gmake USE_AUTOTOOLS= autoconf +USE_RC_SUBR= ${PORTNAME} +SUB_FILES= pkg-message + CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib @@ -89,12 +92,13 @@ post-patch: # Resolve name collision with jpeg-8 @${REINPLACE_CMD} -e \ 's|jpeg_mem_dest|local_jpeg_mem_dest|' ${WRKSRC}/picture.c +# Fix pidfile path + @${REINPLACE_CMD} -e \ + 's|/run/motion|/run|' ${WRKSRC}/motion-dist.conf.in do-install: ${INSTALL_PROGRAM} ${WRKSRC}/motion ${STAGEDIR}${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/motion.1 ${STAGEDIR}${MANPREFIX}/man/man1 - ${INSTALL_SCRIPT} ${WRKSRC}/motion.init-FreeBSD.sh \ - ${STAGEDIR}${PREFIX}/etc/rc.d/motion ${INSTALL_DATA} ${WRKSRC}/motion-dist.conf \ ${STAGEDIR}${PREFIX}/etc/motion.conf.sample .if !exists(${STAGEDIR}${PREFIX}/etc/motion.conf) diff --git a/multimedia/motion/files/motion.in b/multimedia/motion/files/motion.in new file mode 100644 index 000000000000..84288a5fb0c3 --- /dev/null +++ b/multimedia/motion/files/motion.in @@ -0,0 +1,26 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: motion +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following line in /etc/rc.conf to enable motion at startup +# +# motion_enable="YES" + +. /etc/rc.subr + +name=motion +rcvar=motion_enable + +load_rc_config $name + +: ${motion_enable:=NO} + +command=%%PREFIX%%/bin/${name} +pidfile="/var/run/${name}.pid" +required_files=%%PREFIX%%/etc/${name}.conf + +run_rc_command "$1" diff --git a/multimedia/motion/files/pkg-message.in b/multimedia/motion/files/pkg-message.in new file mode 100644 index 000000000000..778e01e35132 --- /dev/null +++ b/multimedia/motion/files/pkg-message.in @@ -0,0 +1,15 @@ +**************************************************************** +To use the motion service properly, you should edit + + %%PREFIX%%/etc/motion.conf + +according to your needs. +To automatically start the service at boot time, +add the following line to /etc/rc.conf: + + motion_enable="YES" + +Then, to start the service right now without reboot, execute + + service motion start +**************************************************************** diff --git a/multimedia/motion/pkg-plist b/multimedia/motion/pkg-plist index 72c517efd411..8ce3d341f600 100644 --- a/multimedia/motion/pkg-plist +++ b/multimedia/motion/pkg-plist @@ -3,4 +3,3 @@ man/man1/motion.1.gz @unexec if cmp -s %D/etc/motion.conf %D/etc/motion.conf.sample; then rm -f %D/etc/motion.conf; fi etc/motion.conf.sample @exec [ -f %B/motion.conf ] || cp %B/%f %B/motion.conf -etc/rc.d/motion |