Bug 156624 - [MAINTAINER] Fix port: audio/musicpd Add avahi OPTION & resolve CONFLICT
Summary: [MAINTAINER] Fix port: audio/musicpd Add avahi OPTION & resolve CONFLICT
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Nicola Vitale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-24 22:10 UTC by Chris Rees
Modified: 2013-03-17 04:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rees 2011-04-24 22:10:11 UTC

Fix: - Add OPTION for avahi, stop autoactivating
	- Rename binary to musicpd, removing CONFLICT

	Submitted by: Chris Rees (utisoft_at_gmail.com) (maintainer)

	Also, to fix sonata and mpdbrowser's dependencies, patches at [1] and
	[2] (maintainers CC'd)

	[3] is a patch to mpich2, which has the conflict removed (also passing
	maintainership to me)

	[1] http://www.bayofrum.net/~crees/patches/sonata-mpdname.diff
	[2] http://www.bayofrum.net/~crees/patches/mpdbrowser-mpdname.diff
	[3] http://www.bayofrum.net/~crees/patches/mpich2-conflict-remove.diff



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.--MUyOZgx740yJvNJWTOPgdtdxsHZDaymvGwbscMi82BXSDlEJ
Content-Type: text/plain; name="musicpd-avahi.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="musicpd-avahi.diff"

Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/audio/musicpd/Makefile,v
retrieving revision 1.62
diff -u -r1.62 Makefile
--- Makefile	20 Mar 2011 21:28:56 -0000	1.62
+++ Makefile	24 Apr 2011 20:52:10 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	musicpd
 PORTVERSION=	0.16.2
+PORTREVISION=	1
 CATEGORIES=	audio ipv6
 MASTER_SITES=	SF/${PORTNAME}/mpd/${PORTVERSION}
 DISTNAME=	mpd-${PORTVERSION}
@@ -19,8 +20,6 @@
 
 LICENSE=	GPLv2
 
-CONFLICTS_INSTALL=	mpich2-[1-9]*
-
 USE_GMAKE=	yes
 USE_BZIP2=	yes
 GNU_CONFIGURE=	yes
@@ -32,16 +31,17 @@
 
 CFLAGS+=	-I${PREFIX}/include
 
-MAN1=		mpd.1
-MAN5=		mpd.conf.5
+MAN1=		${PORTNAME}.1
+MAN5=		${MPDCONF}.5
 
-DOCSDIR=	${PREFIX}/share/doc/mpd
-PORTDOCS=	mpdconf.example AUTHORS README COPYING NEWS UPGRADING
+DOCSDIR?=	${PREFIX}/share/doc/mpd
+PORTDOCS=	AUTHORS README COPYING NEWS UPGRADING
 
 SUB_FILES=	pkg-message
 
 OPTIONS=	ID3TAG          "Support ID3 v1/v2 tags"                on \
 		IPV6            "Support IPv6 protocol"                 on \
+		AVAHI		"Support Zeroconf through Avahi"	off \
 		FLAC            "Support FLAC audio format"             on \
 		VORBIS          "Support OGG Vorbis audio format"       on \
 		WAV             "Support WAV audio format"              on \
@@ -188,6 +188,13 @@
 CONFIGURE_ARGS+=--disable-ipv6
 .endif
 
+.if defined(WITHOUT_AVAHI)
+CONFIGURE_ARGS+=--with-zeroconf=no
+.else
+CONFIGURE_ARGS+=--with-zeroconf=avahi
+LIB_DEPENDS+=	avahi-client.3:${PORTSDIR}/net/avahi-app
+.endif
+
 .if defined(WITH_AO)
 CONFIGURE_ARGS+=--enable-ao
 LIB_DEPENDS+=	ao.4:${PORTSDIR}/audio/libao
@@ -229,15 +236,29 @@
 	@${REINPLACE_CMD} -e 's,^#\([^"]*"\)~/,\1${MPDDIR}/,g' \
 		-e 's,^#\(user[^"]*"\)nobody,\1${MPDUSER},g' \
 		${WRKSRC}/doc/mpdconf.example
+# Fix man pages for executable names
+	@${REINPLACE_CMD} -e 's/^\(\.B m\)/\1usic/' \
+		-e 's#^\(\.BI \)/etc/mpd.conf#\1${PREFIX}/etc/${MPDCONF}#' \
+		-e 's#^mpd.conf#${MPDCONF}#' \
+		-e 's#^mpd(1)#musicpd(1)#' \
+		${WRKSRC}/doc/mpd.1 ${WRKSRC}/doc/mpd.conf.5
 .if (${OSVERSION} < 800000)
 	${REINPLACE_CMD} -e 's/nan[f]\{0,1\}(\"\")/NAN/g' \
 		${WRKSRC}/src/crossfade.c \
 		${WRKSRC}/src/player_thread.c \
 		${WRKSRC}/src/player_control.c
 .endif
-.if defined(NOPORTDOCS)
-	@${REINPLACE_CMD} -e 's|install-docDATA ||' \
-		${WRKSRC}/Makefile.in
+
+do-install:
+	@${INSTALL_PROGRAM} ${WRKSRC}/src/mpd ${PREFIX}/bin/${PORTNAME}
+	@${INSTALL_MAN} ${WRKSRC}/doc/mpd.1 ${MAN1PREFIX}/man/man1/${PORTNAME}.1
+	@${INSTALL_MAN} ${WRKSRC}/doc/mpd.conf.5 \
+		${MAN5PREFIX}/man/man5/${MPDCONF}.5
+.if !defined(NOPORTDOCS)
+	@${MKDIR} ${DOCSDIR}
+.   for doc in ${PORTDOCS}
+	@${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}/
+.   endfor
 .endif
 
 post-install:
Index: pkg-plist
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/audio/musicpd/pkg-plist,v
retrieving revision 1.8
diff -u -r1.8 pkg-plist
--- pkg-plist	25 Jul 2010 02:48:54 -0000	1.8
+++ pkg-plist	24 Apr 2011 20:52:10 -0000
@@ -1,5 +1,5 @@
-bin/mpd
-@dirrmtry var/mpd
+@stopdaemon musicpd
+bin/musicpd
 @unexec if cmp -s %D/etc/%%MPDCONF%%.sample %D/etc/%%MPDCONF%%; then rm -f %D/etc/%%MPDCONF%%; fi
 etc/%%MPDCONF%%.sample
 @exec if [ ! -f %D/etc/%%MPDCONF%% ] ; then cp -p %D/%F %B/%%MPDCONF%%; fi
Index: files/musicpd.in
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/audio/musicpd/files/musicpd.in,v
retrieving revision 1.6
diff -u -r1.6 musicpd.in
--- files/musicpd.in	3 Feb 2011 20:19:41 -0000	1.6
+++ files/musicpd.in	24 Apr 2011 20:52:10 -0000
@@ -3,7 +3,7 @@
 # $FreeBSD: ports/audio/musicpd/files/musicpd.in,v 1.6 2011/02/03 20:19:41 bapt Exp $
 #
 # PROVIDE: musicpd
-# REQUIRE: mixer LOGIN
+# REQUIRE: mixer LOGIN avahi_daemon
 # KEYWORD: shutdown
 
 # Add the following line to /etc/rc.conf to enable mpd:
@@ -17,7 +17,7 @@
 stop_cmd="${name}_stop"
 
 config=%%PREFIX%%/etc/%%MPDCONF%%
-command=%%PREFIX%%/bin/mpd
+command=%%PREFIX%%/bin/musicpd
 required_files=$config
 
 musicpd_stop()
Comment 1 Chris Rees 2011-04-24 22:16:15 UTC
Hi,

Please reply-to-all to indicate your approval to the trivial patch in
this PR to your port; sonata [1] or mpdbrowser [2].

Thanks!

Chris

[1] http://www.bayofrum.net/~crees/patches/sonata-mpdname.diff
[2] http://www.bayofrum.net/~crees/patches/mpdbrowser-mpdname.diff
Comment 2 Henrik Friedrichsen 2011-04-24 22:18:31 UTC
Approved!

On Sun, Apr 24, 2011 at 11:16 PM, Chris Rees <utisoft@gmail.com> wrote:
> Hi,
>
> Please reply-to-all to indicate your approval to the trivial patch in
> this PR to your port; sonata [1] or mpdbrowser [2].
>
> Thanks!
>
> Chris
>
> [1] http://www.bayofrum.net/~crees/patches/sonata-mpdname.diff
> [2] http://www.bayofrum.net/~crees/patches/mpdbrowser-mpdname.diff
>
Comment 3 Nicola Vitale freebsd_committer 2011-04-24 22:56:22 UTC
Responsible Changed
From-To: freebsd-ports-bugs->nivit

I will take it.
Comment 4 Pan Tsu 2011-04-24 23:04:05 UTC
Chris Rees <utisoft@gmail.com> writes:

> -.if defined(NOPORTDOCS)
> -	@${REINPLACE_CMD} -e 's|install-docDATA ||' \
> -		${WRKSRC}/Makefile.in
> +
> +do-install:
> +	@${INSTALL_PROGRAM} ${WRKSRC}/src/mpd ${PREFIX}/bin/${PORTNAME}
> +	@${INSTALL_MAN} ${WRKSRC}/doc/mpd.1 ${MAN1PREFIX}/man/man1/${PORTNAME}.1
> +	@${INSTALL_MAN} ${WRKSRC}/doc/mpd.conf.5 \
> +		${MAN5PREFIX}/man/man5/${MPDCONF}.5

Why not use generic autoconf option --program-transform-name ?

  CONFIGURE_ARGS += --program-transform-name='s/mpd/${PORTNAME}/'
Comment 5 Chris Rees 2011-04-24 23:11:26 UTC
On 24 Apr 2011 23:04, "Pan Tsu" <inyaoo@gmail.com> wrote:
>
> Chris Rees <utisoft@gmail.com> writes:
>
> > -.if defined(NOPORTDOCS)
> > -     @${REINPLACE_CMD} -e 's|install-docDATA ||' \
> > -             ${WRKSRC}/Makefile.in
> > +
> > +do-install:
> > +     @${INSTALL_PROGRAM} ${WRKSRC}/src/mpd ${PREFIX}/bin/${PORTNAME}
> > +     @${INSTALL_MAN} ${WRKSRC}/doc/mpd.1
${MAN1PREFIX}/man/man1/${PORTNAME}.1
> > +     @${INSTALL_MAN} ${WRKSRC}/doc/mpd.conf.5 \
> > +             ${MAN5PREFIX}/man/man5/${MPDCONF}.5
>
> Why not use generic autoconf option --program-transform-name ?
>
>  CONFIGURE_ARGS += --program-transform-name='s/mpd/${PORTNAME}/'

...

Why not indeed? I'll rework the patch.

Thanks!

Chris
Comment 6 Chris Rees 2011-04-25 09:15:16 UTC
On 24 April 2011 23:11, Chris Rees <utisoft@gmail.com> wrote:
> On 24 Apr 2011 23:04, "Pan Tsu" <inyaoo@gmail.com> wrote:
>> Chris Rees <utisoft@gmail.com> writes:
>>
>> Why not use generic autoconf option --program-transform-name ?
>>
>> =A0CONFIGURE_ARGS +=3D --program-transform-name=3D's/mpd/${PORTNAME}/'
>
> ...
>
> Why not indeed? I'll rework the patch.
>

Looking at it, I'm not convinced it'll play ball nicely with my knob
MPDCONF to rename the config file too...

Also, given that it messes with both manpages' names, I don't think it
does exactly what I want.

Unless there's a compelling reason to use this option, I think I'd
rather (for this port) keep the patch the way it is.

nivit, please use the new patch at [1] to rename mpd.conf by default
as well, and consider the patch at [2] for UPDATING.

Thanks for taking the PR!

Chris

[1] http://www.bayofrum.net/~crees/patches/musicpd-avahi.diff
[2] http://www.bayofrum.net/~crees/patches/musicpd-rename-updating.diff



[original but still relevant patches]:

http://www.bayofrum.net/~crees/patches/sonata-mpdname.diff
http://www.bayofrum.net/~crees/patches/mpdbrowser-mpdname.diff
http://www.bayofrum.net/~crees/patches/mpich2-conflict-remove.diff
Comment 7 dfilter service freebsd_committer 2011-05-16 14:32:50 UTC
nivit       2011-05-16 13:32:35 UTC

  FreeBSD ports repository

  Modified files:
    audio/musicpd        Makefile pkg-plist 
    audio/musicpd/files  musicpd.in 
  Log:
  - Add option WITH_AVAHI (default off) to support Zeroconf through avahi
  - Bump PORTREVISION (pkg-plist changed: binary mpd renamed musicpd)
  - Remove CONFLICTS with net/mpich2
  
  PR:             ports/156624
  Submitted by:   Chris Rees <utisoft at gmail.com> (maintainer)
  
  Revision  Changes    Path
  1.63      +31 -10    ports/audio/musicpd/Makefile
  1.7       +3 -3      ports/audio/musicpd/files/musicpd.in
  1.9       +2 -2      ports/audio/musicpd/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 8 dfilter service freebsd_committer 2011-05-16 14:46:13 UTC
nivit       2011-05-16 13:45:59 UTC

  FreeBSD ports repository

  Modified files:
    audio/mpdbrowser     Makefile 
    audio/sonata         Makefile 
  Log:
  - Fix the executable name of the run-dependency audio/musicpd
  
  PR:             ports/156624
  Submitted by:   Chris Rees <utisoft at gmail.com>
  Approved by:    Henrik Friedrichsen <hrkfdn at gmail.com (maintainer of audio/mpdbrowser), nivit (audio/sonata)
  
  Revision  Changes    Path
  1.6       +1 -1      ports/audio/mpdbrowser/Makefile
  1.27      +1 -1      ports/audio/sonata/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 9 dfilter service freebsd_committer 2011-05-16 14:49:12 UTC
nivit       2011-05-16 13:49:04 UTC

  FreeBSD ports repository

  Modified files:
    net/mpich2           Makefile 
  Log:
  - Chris Rees <utisoft at gmail.com> takes the maintainership
  - Remove CONFLICTS with audio/musicpd
  
  PR:             ports/156624
  Submitted by:   Chris Rees <utisoft at gmail.com>
  
  Revision  Changes    Path
  1.93      +2 -2      ports/net/mpich2/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 10 Nicola Vitale freebsd_committer 2011-05-16 14:49:36 UTC
State Changed
From-To: open->closed

Committed, thanks!