diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2007-05-24 07:18:55 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2007-05-24 07:18:55 +0000 |
commit | 3020c1b9f9884932e987c9bd438e17c0b15f71ae (patch) | |
tree | 3c4d9dda5911a75ca80f167718d5524edfaa7134 /media-video/noad | |
parent | Add ~sparc and ~hppa as the previous versions of this script in sg3_utils had... (diff) | |
download | gentoo-2-3020c1b9f9884932e987c9bd438e17c0b15f71ae.tar.gz gentoo-2-3020c1b9f9884932e987c9bd438e17c0b15f71ae.tar.bz2 gentoo-2-3020c1b9f9884932e987c9bd438e17c0b15f71ae.zip |
Added shutdown hook to check if there are hanging long running noad process and kill them.
(Portage version: 2.1.2.7)
Diffstat (limited to 'media-video/noad')
-rw-r--r-- | media-video/noad/ChangeLog | 9 | ||||
-rw-r--r-- | media-video/noad/files/digest-noad-0.6.0-r9 | 3 | ||||
-rw-r--r-- | media-video/noad/files/pre-shutdown-15-noad.sh | 41 | ||||
-rw-r--r-- | media-video/noad/noad-0.6.0-r9.ebuild | 92 |
4 files changed, 144 insertions, 1 deletions
diff --git a/media-video/noad/ChangeLog b/media-video/noad/ChangeLog index 659c688b0384..6cd20c5312d7 100644 --- a/media-video/noad/ChangeLog +++ b/media-video/noad/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for media-video/noad # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-video/noad/ChangeLog,v 1.24 2007/05/21 16:56:29 zzam Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-video/noad/ChangeLog,v 1.25 2007/05/24 07:18:55 zzam Exp $ + +*noad-0.6.0-r9 (24 May 2007) + + 24 May 2007; Matthias Schwarzott <zzam@gentoo.org> + +files/pre-shutdown-15-noad.sh, +noad-0.6.0-r9.ebuild: + Added shutdown hook to check if there are hanging long running noad process + and kill them. 21 May 2007; Matthias Schwarzott <zzam@gentoo.org> -files/noad-0.6.0-as-needed.diff, -files/noad-0.6.0-cflags.diff, diff --git a/media-video/noad/files/digest-noad-0.6.0-r9 b/media-video/noad/files/digest-noad-0.6.0-r9 new file mode 100644 index 000000000000..05e249e57c9d --- /dev/null +++ b/media-video/noad/files/digest-noad-0.6.0-r9 @@ -0,0 +1,3 @@ +MD5 62947d5afec56cdb9884535d9813530d noad-0.6.0.tar.bz2 151369 +RMD160 762c8efeb89d681a77d83d0df70668b62a7057dd noad-0.6.0.tar.bz2 151369 +SHA256 f473f0137fa9ba8f7a736d9ca019fe5491e1744b17b54a1bdbfc23a9c8001183 noad-0.6.0.tar.bz2 151369 diff --git a/media-video/noad/files/pre-shutdown-15-noad.sh b/media-video/noad/files/pre-shutdown-15-noad.sh new file mode 100644 index 000000000000..476741e7bac7 --- /dev/null +++ b/media-video/noad/files/pre-shutdown-15-noad.sh @@ -0,0 +1,41 @@ +# +# pre-shutdown script to abort shutdown in case noad is running + +check_runtime() { + local PID="$1" + + # Max runtime of 30m = 1800s + local NOAD_MAX_TIME=1800 + local NOW="$(date +%s)" + local START="$(stat --format "%Z" /proc/${PID}/)" + local DIFF=$(( $NOW - $START )) + if [ "${DIFF}" -ge "${NOAD_MAX_TIME}" ]; then + kill ${PID} + sleep 2 + kill -9 ${PID} + return 0 + else + # There still is a running noad process + return 1 + fi +} + +check_noad() { + local PIDOF=pidof + local NOAD=/usr/bin/noad + + local PIDS=$(${PIDOF} ${NOAD}) + local PID + local still_running=0 + for PID in $PIDS; do + check_runtime "${PID}" + [ "$?" = "1" ] && still_running=1 + done + + if [ "${still_running}" -gt "0" ]; then + # stop shutdown + shutdown_abort_can_force "noad is running" + fi +} + +check_noad diff --git a/media-video/noad/noad-0.6.0-r9.ebuild b/media-video/noad/noad-0.6.0-r9.ebuild new file mode 100644 index 000000000000..9ea80fb1c5f9 --- /dev/null +++ b/media-video/noad/noad-0.6.0-r9.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-video/noad/noad-0.6.0-r9.ebuild,v 1.1 2007/05/24 07:18:55 zzam Exp $ + +WANT_AUTOMAKE="latest" +WANT_AUTOCONF="latest" + +inherit eutils autotools + +DESCRIPTION="Mark commercial Breaks in VDR records" +HOMEPAGE="http://www.freepgs.com/noad/" +SRC_URI="http://www.freepgs.com/${PN}/${P}.tar.bz2 + mirror://vdrfiles/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ffmpeg imagemagick" + +DEPEND="media-libs/libmpeg2 + media-video/vdr + ffmpeg? ( >=media-video/ffmpeg-0.4.8 ) + imagemagick? ( >=media-gfx/imagemagick-6.2.4.2-r1 )" +RDEPEND=">=media-tv/gentoo-vdr-scripts-0.3.5" + +src_unpack() { + + unpack ${A} + cd ${S} + + epatch ${FILESDIR}/patches-${PV}/directoryfix.diff + epatch ${FILESDIR}/patches-${PV}/as-needed.diff + epatch ${FILESDIR}/patches-${PV}/cflags.diff + epatch ${FILESDIR}/patches-${PV}/framesize.diff + epatch ${FILESDIR}/patches-${PV}/delete-while-scanning.diff + epatch ${FILESDIR}/patches-${PV}/fix-osd.patch + epatch ${FILESDIR}/patches-${PV}/hangcheck.diff + + rm configure + eautoreconf +} + +src_compile() { + + econf \ + $(use_with ffmpeg) \ + $(use_with imagemagick magick) \ + --with-tools \ + --with-mpeginclude=/usr/include/mpeg2dec + + emake || die "emake faild" +} + +src_install() { + + dobin noad showindex + use imagemagick && dobin markpics + + dodoc COPYING README INSTALL + # example scripts are installed as dokumentation + dodoc allnewnoad allnoad allnoadnice clearlogos noadifnew stat2html + + CONF_SOURCE=${FILESDIR}/0.6.0-r7 + newconfd ${CONF_SOURCE}/confd_vdraddon.noad vdraddon.noad + + insinto /usr/share/vdr/record + doins ${CONF_SOURCE}/record-50-noad.sh + + insinto /usr/share/vdr/shutdown + doins ${FILESDIR}/pre-shutdown-15-noad.sh + + insinto /etc/vdr/reccmds + doins ${CONF_SOURCE}/reccmds.noad.conf + + exeinto /usr/share/vdr/bin + doexe ${CONF_SOURCE}/noad-reccmd +} + +pkg_postinst() { + + elog + elog "Congratulations, you have just installed noad!," + elog "To integrate noad in VDR you should do this:" + elog + elog "start and set Parameter in /etc/conf.d/vdraddon.noad" + elog + elog "Note: You can use here all pararmeters for noad," + elog "please look in the documentation of noad." + elog + elog "noad now contains a hangcheck timer, to kill noad" + elog "if it runs longer than 30 minutes." +} |