Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Feb 2014 12:04:34 +0000 (UTC)
From:      Thomas Zander <riggs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r342125 - in head/multimedia/motion: . files
Message-ID:  <201402011204.s11C4YH2048447@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: riggs
Date: Sat Feb  1 12:04:33 2014
New Revision: 342125
URL: http://svnweb.freebsd.org/changeset/ports/342125
QAT: https://qat.redports.org/buildarchive/r342125/

Log:
  - 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

Added:
  head/multimedia/motion/files/motion.in   (contents, props changed)
  head/multimedia/motion/files/pkg-message.in   (contents, props changed)
Modified:
  head/multimedia/motion/Makefile
  head/multimedia/motion/pkg-plist

Modified: head/multimedia/motion/Makefile
==============================================================================
--- head/multimedia/motion/Makefile	Sat Feb  1 11:54:13 2014	(r342124)
+++ head/multimedia/motion/Makefile	Sat Feb  1 12:04:33 2014	(r342125)
@@ -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)

Added: head/multimedia/motion/files/motion.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/motion/files/motion.in	Sat Feb  1 12:04:33 2014	(r342125)
@@ -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"

Added: head/multimedia/motion/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/motion/files/pkg-message.in	Sat Feb  1 12:04:33 2014	(r342125)
@@ -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
+****************************************************************

Modified: head/multimedia/motion/pkg-plist
==============================================================================
--- head/multimedia/motion/pkg-plist	Sat Feb  1 11:54:13 2014	(r342124)
+++ head/multimedia/motion/pkg-plist	Sat Feb  1 12:04:33 2014	(r342125)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402011204.s11C4YH2048447>