View | Details | Raw Unified | Return to bug 133533 | Differences between
and this patch

Collapse All | Expand All

(-)musicpd/Makefile (-2 / +30 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	musicpd
8
PORTNAME=	musicpd
9
PORTVERSION=	0.15
9
PORTVERSION=	0.15
10
PORTREVISION=	1
10
CATEGORIES=	audio ipv6
11
CATEGORIES=	audio ipv6
11
MASTER_SITES=	SF
12
MASTER_SITES=	SF
12
DISTNAME=	mpd-${PORTVERSION}
13
DISTNAME=	mpd-${PORTVERSION}
Lines 60-65 Link Here
60
		HTTPD		"Support for httpd output streaming"	off \
61
		HTTPD		"Support for httpd output streaming"	off \
61
		SAMPLERATE	"Support sample rate conversion"	off
62
		SAMPLERATE	"Support sample rate conversion"	off
62
63
64
MPDUSER?=	mpd
65
MPDGROUP?=	mpd
66
MPDDIR?=	var/mpd
67
68
MPDUID=	137
69
MPDGID=	${MPDUID}
70
71
PLIST_SUB=	MPDUSER=${MPDUSER} \
72
		MPDGROUP=${MPDGROUP}
73
74
PLIST_DIRS=	${MPDDIR}
75
76
SUB_LIST+=	MPDUSER=${MPDUSER} \
77
		MPDGROUP=${MPDGROUP} \
78
		MPDDIR=${PREFIX}/${MPDDIR} \
79
		MPDUID=${MPDUID} \
80
		MPDGID=${MPDGID}
81
82
SUB_FILES+=	pkg-install pkg-deinstall
83
63
.include <bsd.port.pre.mk>
84
.include <bsd.port.pre.mk>
64
85
65
.if defined(WITHOUT_FLAC)
86
.if defined(WITHOUT_FLAC)
Lines 150-156 Link Here
150
171
151
.if defined(WITH_MMS)
172
.if defined(WITH_MMS)
152
CONFIGURE_ARGS+=--enable-mms
173
CONFIGURE_ARGS+=--enable-mms
153
LIBDEPENDS+=	libmms.0:${PORTSDIR}/net/libmms
174
LIB_DEPENDS+=	mms.0:${PORTSDIR}/net/libmms
154
.else
175
.else
155
CONFIGURE_ARGS+=--disable-mms
176
CONFIGURE_ARGS+=--disable-mms
156
.endif
177
.endif
Lines 201-213 Link Here
201
CONFIGURE_ARGS+=--enable-lsr
222
CONFIGURE_ARGS+=--enable-lsr
202
.endif
223
.endif
203
224
204
.if defined(NOPORTDOCS)
205
post-patch:
225
post-patch:
226
	@${REINPLACE_CMD} -e "s/%%MPDDIR%%/${PREFIX:C/\//\\\//g}\/${MPDDIR:C/\//\\\//g}/g" -e "s/%%MPDUSER%%/${MPDUSER}/g" \
227
		${WRKSRC}/doc/mpdconf.example
228
.if defined(NOPORTDOCS)
206
	@${REINPLACE_CMD} -e 's|install-docDATA ||' \
229
	@${REINPLACE_CMD} -e 's|install-docDATA ||' \
207
		${WRKSRC}/Makefile.in
230
		${WRKSRC}/Makefile.in
208
.endif
231
.endif
209
232
233
pre-install:
234
	@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
235
210
post-install:
236
post-install:
237
	@${MKDIR} ${PREFIX}/${MPDDIR}
238
	@${CHOWN} -R ${MPDUSER}:${MPDGROUP} ${PREFIX}/${MPDDIR}
211
	@${ECHO_MSG}
239
	@${ECHO_MSG}
212
	@${CAT} ${PKGMESSAGE}
240
	@${CAT} ${PKGMESSAGE}
213
	@${ECHO_MSG}
241
	@${ECHO_MSG}
(-)musicpd/files/musicpd.in (+7 lines)
Lines 13-23 Link Here
13
13
14
name=musicpd
14
name=musicpd
15
rcvar=`set_rcvar`
15
rcvar=`set_rcvar`
16
stop_cmd="${name}_stop"
16
17
17
config=%%PREFIX%%/etc/mpd.conf
18
config=%%PREFIX%%/etc/mpd.conf
18
command=%%PREFIX%%/bin/mpd
19
command=%%PREFIX%%/bin/mpd
19
required_files=$config
20
required_files=$config
20
21
22
musicpd_stop()
23
{
24
	echo -n "Stopping musicpd: ";
25
	${command} --kill ${config} && echo "stopped.";
26
}
27
21
load_rc_config $name
28
load_rc_config $name
22
29
23
: ${musicpd_enable="NO"}
30
: ${musicpd_enable="NO"}
(-)musicpd/files/patch-doc_mpdconf.example (+93 lines)
Line 0 Link Here
1
2
$FreeBSD$
3
4
--- doc/mpdconf.example.orig
5
+++ doc/mpdconf.example
6
@@ -10,14 +10,14 @@
7
 # be disabled and audio files will only be accepted over ipc socket (using
8
 # file:// protocol) or streaming files over an accepted protocol.
9
 #
10
-#music_directory		"~/music"
11
+music_directory		"%%MPDDIR%%/music"
12
 #
13
 # This setting sets the MPD internal playlist directory. The purpose of this
14
 # directory is storage for playlists created by MPD. The server will use 
15
 # playlist files not created by the server but only if they are in the MPD
16
 # format. This setting defaults to playlist saving being disabled.
17
 #
18
-#playlist_directory		"~/.mpd/playlists"
19
+playlist_directory		"%%MPDDIR%%/playlists"
20
 #
21
 # This setting sets the location of the MPD database. This file is used to
22
 # load the database at server start up and store the database while the 
23
@@ -25,7 +25,7 @@
24
 # MPD to accept files over ipc socket (using file:// protocol) or streaming
25
 # files over an accepted protocol.
26
 #
27
-#db_file			"~/.mpd/database"
28
+db_file			"%%MPDDIR%%/database"
29
 # 
30
 # These settings are the locations for the daemon log files for the daemon.
31
 # These logs are great for troubleshooting, depending on your log_level
32
@@ -34,20 +34,21 @@
33
 # The special value "syslog" makes MPD use the local syslog daemon. This
34
 # setting defaults to logging to syslog, otherwise logging is disabled.
35
 #
36
-#log_file			"~/.mpd/log"
37
+log_file			"%%MPDDIR%%/log"
38
+error_file		"%%MPDDIR%%/error-log"
39
 #
40
 # This setting sets the location of the file which stores the process ID
41
 # for use of mpd --kill and some init scripts. This setting is disabled by
42
 # default and the pid file will not be stored.
43
 #
44
-#pid_file			"~/.mpd/pid"
45
+pid_file			"%%MPDDIR%%/pid"
46
 #
47
 # This setting sets the location of the file which contains information about
48
 # most variables to get MPD back into the same general shape it was in before
49
 # it was brought down. This setting is disabled by default and the server 
50
 # state will be reset on server start up.
51
 #
52
-#state_file			"~/.mpd/state"
53
+state_file			"%%MPDDIR%%/state"
54
 #
55
 ###############################################################################
56
 
57
@@ -59,7 +60,7 @@
58
 # initialization. This setting is disabled by default and MPD is run as the
59
 # current user.
60
 #
61
-#user				"nobody"
62
+user				"mpd"
63
 #
64
 # This setting sets the address for the daemon to listen on. Careful attention
65
 # should be paid if this is assigned to anything other then the default, any.
66
@@ -69,7 +70,7 @@
67
 #bind_to_address		"any"
68
 #
69
 # And for Unix Socket
70
-#bind_to_address		"~/.mpd/socket"
71
+#bind_to_address		"%%MPDDIR%%/socket"
72
 #
73
 # This setting is the TCP port that is desired for the daemon to get assigned
74
 # to.
75
@@ -172,18 +173,6 @@
76
 # See <http://mpd.wikia.com/wiki/Configuration#Audio_Outputs> for examples of 
77
 # other audio outputs.
78
 #
79
-# An example of an ALSA output:
80
-#
81
-#audio_output {
82
-#	type		"alsa"
83
-#	name		"My ALSA Device"
84
-#	device		"hw:0,0"	# optional
85
-#	format		"44100:16:2"	# optional
86
-#	mixer_device	"default"	# optional
87
-#	mixer_control	"PCM"		# optional
88
-#	mixer_index	"0"		# optional
89
-#}
90
-#
91
 # An example of an OSS output:
92
 #
93
 #audio_output {
(-)musicpd/files/pkg-deinstall.in (+17 lines)
Line 0 Link Here
1
#!/bin/sh -
2
#
3
# $FreeBSD$
4
#
5
6
MPDUSER=%%MPDUSER%%
7
MPDGROUP=%%MPDGROUP%%
8
9
if [ "$2" = "POST-DEINSTALL" ]; then
10
  if /usr/sbin/pw group show "${MPDGROUP}" 2>&1 >/dev/null; then
11
    echo "You should manually remove the \"${MPDGROUP}\" group."
12
  fi
13
14
  if /usr/sbin/pw user show "${MPDUSER}" 2>&1 >/dev/null; then
15
    echo "You should manually remove the \"${MPDUSER}\" user."
16
  fi
17
fi
(-)musicpd/files/pkg-install.in (+76 lines)
Line 0 Link Here
1
#!/bin/sh -
2
#
3
# $FreeBSD$
4
#
5
6
MPDDIR=%%MPDDIR%%
7
MPDUSER=%%MPDUSER%%
8
MPDGROUP=%%MPDGROUP%%
9
MPDUID=%%MPDUID%%
10
MPDGID=%%MPDGID%%
11
12
ask() {
13
  local question default answer
14
15
  question=$1
16
  default=$2
17
  if [ -z "${PACKAGE_BUILDING}" ]; then
18
    read -p "${question} [${default}]? " answer
19
  fi
20
  if [ "x${answer}" = "x" ]; then
21
    answer=${default}
22
  fi
23
  echo ${answer}
24
}
25
26
yesno() {
27
  local default question answer
28
29
  question=$1
30
  default=$2
31
  while :; do
32
    answer=$(ask "${question}" "${default}")
33
    case "${answer}" in
34
      [Yy][Ee][Ss]|[Yy])
35
        return 0
36
        ;;
37
      [Nn][Oo]|[Nn])
38
        return 1
39
        ;;
40
    esac
41
    echo "Please answer yes or no."
42
   done
43
}
44
45
if [ "$2" = "PRE-INSTALL" ]; then
46
  if /usr/sbin/pw group show "${MPDGROUP}" 2>&1 >/dev/null; then
47
    echo "You already have a \"${MPDGROUP}\" group, so I will use it."
48
  else
49
    echo "You need a \"${MPDGROUP}\" group."
50
    if yesno "Would you like me to create it" "YES"; then
51
      /usr/sbin/pw groupadd "${MPDGROUP}" -g "${MPDGID}" -h - || \
52
        /usr/sbin/pw groupadd "${MPDGROUP}" -h - || exit
53
      echo "Done."
54
    else
55
      echo "Please create the \"${MPDGROUP}\" group manually and try again."
56
      exit 1
57
    fi
58
  fi
59
60
  if /usr/sbin/pw user show "${MPDUSER}" 2>&1 >/dev/null; then
61
    echo "You already have a \"${MPDUSER}\" user, so I will use it."
62
  else
63
    echo "You need a \"${MPDUSER}\" user."
64
    if yesno "Would you like me to create it" "YES"; then
65
      /usr/sbin/pw useradd "${MPDUSER}" -u "${MPDUID}" -g "${MPDGROUP}" -h - -d "${MPDDIR}" \
66
        -s /sbin/nologin -c "MusicPD pseudo-user" || \
67
					/usr/sbin/pw useradd "${MPDUSER}" -g "${MPDGROUP}" -h - -d "${MPDDIR}" \
68
        -s /sbin/nologin -c "MusicPD pseudo-user" || exit
69
    else
70
      echo "Please create the \"${MPDUSER}\" user manually and try again."
71
      exit 1
72
    fi
73
  fi
74
  [ -d ${MPDDIR} ] || mkdir -p ${MPDDIR}
75
  chown -R ${MPDUSER}:${MPDGROUP} ${MPDDIR}
76
fi
(-)musicpd/files/pkg-message.in (+3 lines)
Lines 17-22 Link Here
17
17
18
or reboot.
18
or reboot.
19
19
20
The example configuration of MPD server requires music files to
21
be stored at %%MPDDIR%%/music .
22
20
NOTE: The musicpd server is pretty useless without a client.
23
NOTE: The musicpd server is pretty useless without a client.
21
      You might want to install one of the following ports too:
24
      You might want to install one of the following ports too:
22
      mpc, ncmpc, glurp, gmpc, kmp, or phpmp.
25
      mpc, ncmpc, glurp, gmpc, kmp, or phpmp.

Return to bug 133533