From owner-svn-ports-all@FreeBSD.ORG Mon May 26 10:10:56 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEA41556; Mon, 26 May 2014 10:10:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE459207E; Mon, 26 May 2014 10:10:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4QAAu1t021893; Mon, 26 May 2014 10:10:56 GMT (envelope-from grembo@svn.freebsd.org) Received: (from grembo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QAAuqH021890; Mon, 26 May 2014 10:10:56 GMT (envelope-from grembo@svn.freebsd.org) Message-Id: <201405261010.s4QAAuqH021890@svn.freebsd.org> From: Michael Gmelin Date: Mon, 26 May 2014 10:10:56 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r355296 - in head/audio/xmcd: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 10:10:57 -0000 Author: grembo Date: Mon May 26 10:10:55 2014 New Revision: 355296 URL: http://svnweb.freebsd.org/changeset/ports/355296 QAT: https://qat.redports.org/buildarchive/r355296/ Log: Staging support for audio/xmcd, as part of this the setuid bit has been removed and instructions on how to configure devfs.conf to allow access by non-root added to pkg-message. This way the package can be built without root access, plus avoiding setuid root executables are a good thing in general. Reviewed by: bapt (mentor) Approved by: bapt (mentor) Modified: head/audio/xmcd/Makefile head/audio/xmcd/files/pkg-message.in head/audio/xmcd/pkg-plist Modified: head/audio/xmcd/Makefile ============================================================================== --- head/audio/xmcd/Makefile Mon May 26 10:03:36 2014 (r355295) +++ head/audio/xmcd/Makefile Mon May 26 10:10:55 2014 (r355296) @@ -15,15 +15,12 @@ LIB_DEPENDS+= libvorbis.so:${PORTSDIR}/a RUN_DEPENDS+= lame:${PORTSDIR}/audio/lame USES= imake motif -NO_STAGE= yes USE_XORG= x11 xext xaw xmu xp xpm xt sm ice -MAN1= cda.1 xmcd.1 -MANCOMPRESSED= no PLIST_SUB+= RELEASE=${OSREL:R:R} ARCH=${ARCH} SUB_FILES= pkg-message PKGMESSAGE= ${WRKDIR}/pkg-message -LIBBINDIR= ${PREFIX}/lib/X11/xmcd/bin-FreeBSD_${OSREL:R:R}-${ARCH} +LIBBINDIR= ${STAGEDIR}${PREFIX}/lib/X11/xmcd/bin-FreeBSD_${OSREL:R:R}-${ARCH} post-extract: @${CHMOD} -R u+w ${WRKSRC} @@ -32,19 +29,48 @@ pre-patch: @${CP} ${WRKSRC}/xmcd_d/XMcd.ad ${WRKSRC}/xmcd_d/XMcd.ad.in post-patch: - @${SED} -e "s;@PREFIX@;${PREFIX};g" ${WRKSRC}/xmcd_d/XMcd.ad.in \ + @${SED} -e "s;@PREFIX@;${STAGDIR}${PREFIX};g" ${WRKSRC}/xmcd_d/XMcd.ad.in \ > ${WRKSRC}/xmcd_d/XMcd.ad @${FIND} ${WRKSRC} -name Makefile -o -name Imakefile | \ ${XARGS} ${REINPLACE_CMD} \ -e 's|_CFLAGS= -pthread|_CFLAGS= ${PTHREAD_CFLAGS}|g; \ s|_LDFLAGS= -pthread|_LDFLAGS= ${PTHREAD_LIBS}|g' +post-configure: + @${REINPLACE_CMD} \ + -e 's: BINDIR .*:BINDIR=${STAGEDIR}${PREFIX}/bin:' \ + -e 's: LIBDIR .*:LIBDIR=${STAGEDIR}${PREFIX}/lib/X11:' \ + -e 's: MANDIR .*:MANDIR=${STAGEDIR}${PREFIX}/man/man1:' \ + -e 's: MANSUFFIX .*:MANSUFFIX=1:' \ + -e 's/^Makefile::/^Makefile:/' \ + ${WRKSRC}/Makefile + @${REINPLACE_CMD} \ + -e 's/^XBINPERM=4711/XBINPERM=711/' \ + -e "s/^(id \| fgrep 'uid=0(root)')/true/" >/dev/null 2>&1 \ + ${WRKSRC}/install.sh + post-install: @${STRIP_CMD} ${LIBBINDIR}/cda @${STRIP_CMD} ${LIBBINDIR}/gobrowser @${STRIP_CMD} ${LIBBINDIR}/has_alsa @${STRIP_CMD} ${LIBBINDIR}/xmcd - @${CAT} ${PKGMESSAGE} - @${CP} ${WRKSRC}/xmcd_d/XMcd.ad ${PREFIX}/lib/X11/app-defaults/XMcd + @${CP} ${WRKSRC}/xmcd_d/XMcd.ad ${STAGEDIR}${PREFIX}/lib/X11/app-defaults/XMcd + @${RM} ${STAGEDIR}${PREFIX}/bin/xmcd + @${RM} ${STAGEDIR}${PREFIX}/bin/cda + @${LN} -sf .xmcd_start ${STAGEDIR}${PREFIX}/bin/xmcd + @${LN} -sf .xmcd_start ${STAGEDIR}${PREFIX}/bin/cda + @${REINPLACE_CMD} \ + -e 's:^BINDIR=.*:XMCDLIB=${PREFIX}/bin:' \ + -e 's:^XMCDLIB=.*:XMCDLIB=${PREFIX}/lib/X11/xmcd:' \ + -e 's:^DISCOGDIR=.*:DISCOGDIR=${PREFIX}/lib/X11/xmcd/discog:' \ + -e 's:XMCD_LIBDIR=.*:XMCD_LIBDIR=${PREFIX}/lib/X11/xmcd:' \ + ${STAGEDIR}${PREFIX}/lib/X11/xmcd/scripts/genidx \ + ${STAGEDIR}${PREFIX}/bin/.xmcd_start + @${REINPLACE_CMD} \ + -e 's:${STAGEDIR}::' \ + ${STAGEDIR}${PREFIX}/lib/X11/xmcd/discog/discog.html \ + ${STAGEDIR}${PREFIX}/lib/X11/xmcd/config/config.sh \ + ${STAGEDIR}${PREFIX}/lib/X11/xmcd/bin-FreeBSD_9-amd64/README + @${FIND} ${STAGEDIR} -name \*.bak -delete .include Modified: head/audio/xmcd/files/pkg-message.in ============================================================================== --- head/audio/xmcd/files/pkg-message.in Mon May 26 10:03:36 2014 (r355295) +++ head/audio/xmcd/files/pkg-message.in Mon May 26 10:10:55 2014 (r355296) @@ -7,4 +7,12 @@ If you would like to submit data to CDDB to install mail/mailx or add something similar to the following line in your Xdefaults: XMcd.cddbMailCmd: mail -s '%S' %A <%F >/dev/null 2>&1 + +xmcd and cda are not suid anymore, so if you want +to allow non-root users to use xmcd or cda, either +set the suid bit yourself, or even better, allow +access to /dev/cd0 in /etc/devfs.conf, e.g. + +perm /dev/cd0 0664 + ******************************************************* Modified: head/audio/xmcd/pkg-plist ============================================================================== --- head/audio/xmcd/pkg-plist Mon May 26 10:03:36 2014 (r355295) +++ head/audio/xmcd/pkg-plist Mon May 26 10:10:55 2014 (r355296) @@ -287,9 +287,11 @@ lib/X11/xmcd/pixmaps/xmcd_a.px lib/X11/xmcd/pixmaps/xmcd_b.px lib/X11/xmcd/pixmaps/xmcd.xpm lib/X11/xmcd/scripts/genidx +man/man1/cda.1.gz +man/man1/xmcd.1.gz @dirrm lib/X11/xmcd/app-defaults @dirrm lib/X11/xmcd/bin-FreeBSD_%%RELEASE%%-%%ARCH%% -@unexec rm -rf %D/lib/X11/xmcd/lib-FreeBSD_%%RELEASE%%-%%ARCH%% 2>&1 >/dev/null || true +@dirrmtry lib/X11/xmcd/lib-FreeBSD_%%RELEASE%%-%%ARCH%% @dirrm lib/X11/xmcd/config/.tbl @dirrm lib/X11/xmcd/config @dirrm lib/X11/xmcd/discog/Blues/General_Blues