1 |
commit: eeeb64cb2ebbeb770518badb51fccf44c4526565 |
2 |
Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 22 17:22:58 2019 +0000 |
4 |
Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 22 17:30:07 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eeeb64cb |
7 |
|
8 |
media-sound/mpd: revbump to improve init script |
9 |
|
10 |
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org> |
11 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
12 |
|
13 |
media-sound/mpd/files/mpd-0.21.4.init | 32 ++++ |
14 |
media-sound/mpd/mpd-0.21.4-r1.ebuild | 298 ++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 330 insertions(+) |
16 |
|
17 |
diff --git a/media-sound/mpd/files/mpd-0.21.4.init b/media-sound/mpd/files/mpd-0.21.4.init |
18 |
new file mode 100644 |
19 |
index 00000000000..7f0950c6293 |
20 |
--- /dev/null |
21 |
+++ b/media-sound/mpd/files/mpd-0.21.4.init |
22 |
@@ -0,0 +1,32 @@ |
23 |
+#!/sbin/openrc-run |
24 |
+# Copyright 1999-2019 Gentoo Authors |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+: CFGFILE=${CFGFILE:=/etc/mpd.conf} |
28 |
+ |
29 |
+depend() { |
30 |
+ need localmount |
31 |
+ use net netmount nfsmount alsasound esound pulseaudio |
32 |
+ config ${CFGFILE} |
33 |
+} |
34 |
+ |
35 |
+get_config() { |
36 |
+ x=$1 |
37 |
+ test -e ${CFGFILE} || return 1 |
38 |
+ sed -n \ |
39 |
+ -e '/^[ \t]*'${x}'/{s:^[ \t]*'${x}'[ \t]\+"\?\([^#"]\+\)[^"]*"\?$:\1: ; p }' \ |
40 |
+ ${CFGFILE} |
41 |
+} |
42 |
+ |
43 |
+extra_started_commands='reload' |
44 |
+command=/usr/bin/mpd |
45 |
+command_args=${CFGFILE} |
46 |
+required_files=${CFGFILE} |
47 |
+pidfile=$(get_config pid_file) |
48 |
+description="Music Player Daemon" |
49 |
+ |
50 |
+reload() { |
51 |
+ ebegin "Reloading ${RC_SVCNAME}" |
52 |
+ start-stop-daemon --pidfile ${pidfile} --signal HUP |
53 |
+ eend $? |
54 |
+ } |
55 |
|
56 |
diff --git a/media-sound/mpd/mpd-0.21.4-r1.ebuild b/media-sound/mpd/mpd-0.21.4-r1.ebuild |
57 |
new file mode 100644 |
58 |
index 00000000000..5a07765cd9d |
59 |
--- /dev/null |
60 |
+++ b/media-sound/mpd/mpd-0.21.4-r1.ebuild |
61 |
@@ -0,0 +1,298 @@ |
62 |
+# Copyright 1999-2019 Gentoo Authors |
63 |
+# Distributed under the terms of the GNU General Public License v2 |
64 |
+ |
65 |
+EAPI=7 |
66 |
+ |
67 |
+inherit flag-o-matic linux-info meson systemd user |
68 |
+ |
69 |
+MESON_AUTO_DEPEND="no" |
70 |
+ |
71 |
+DESCRIPTION="The Music Player Daemon (mpd)" |
72 |
+HOMEPAGE="https://www.musicpd.org https://github.com/MusicPlayerDaemon/MPD" |
73 |
+SRC_URI="https://www.musicpd.org/download/${PN}/${PV%.*}/${P}.tar.xz" |
74 |
+ |
75 |
+LICENSE="GPL-2" |
76 |
+SLOT="0" |
77 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sh ~x86 ~x86-fbsd ~x64-macos" |
78 |
+IUSE="adplug +alsa ao audiofile bzip2 cdio chromaprint +cue +curl +dbus debug |
79 |
+ +eventfd expat faad +ffmpeg +fifo flac fluidsynth gme +icu +id3tag +inotify |
80 |
+ +ipv6 jack lame libav libmpdclient libsamplerate libsoxr +mad mikmod mms |
81 |
+ modplug mpg123 musepack +network nfs openal opus oss pipe pulseaudio qobuz |
82 |
+ recorder samba selinux sid signalfd sndfile soundcloud sqlite systemd tcpd |
83 |
+ test tidal twolame udisks unicode vorbis wavpack webdav wildmidi upnp |
84 |
+ zeroconf zip zlib" |
85 |
+ |
86 |
+OUTPUT_PLUGINS="alsa ao fifo jack network openal oss pipe pulseaudio recorder" |
87 |
+DECODER_PLUGINS="adplug audiofile faad ffmpeg flac fluidsynth mad mikmod |
88 |
+ modplug mpg123 musepack flac sid vorbis wavpack wildmidi" |
89 |
+ENCODER_PLUGINS="audiofile flac lame twolame vorbis" |
90 |
+ |
91 |
+REQUIRED_USE=" |
92 |
+ || ( ${OUTPUT_PLUGINS} ) |
93 |
+ || ( ${DECODER_PLUGINS} ) |
94 |
+ network? ( || ( ${ENCODER_PLUGINS} ) ) |
95 |
+ recorder? ( || ( ${ENCODER_PLUGINS} ) ) |
96 |
+ upnp? ( expat ) |
97 |
+ webdav? ( curl expat ) |
98 |
+ " |
99 |
+ |
100 |
+RESTRICT="!test? ( test )" |
101 |
+ |
102 |
+RDEPEND=" |
103 |
+ adplug? ( media-libs/adplug:= ) |
104 |
+ alsa? ( |
105 |
+ media-libs/alsa-lib |
106 |
+ media-sound/alsa-utils |
107 |
+ ) |
108 |
+ |
109 |
+ ao? ( media-libs/libao[alsa?,pulseaudio?] ) |
110 |
+ audiofile? ( media-libs/audiofile:= ) |
111 |
+ |
112 |
+ cdio? ( |
113 |
+ dev-libs/libcdio:= |
114 |
+ dev-libs/libcdio-paranoia |
115 |
+ ) |
116 |
+ |
117 |
+ chromaprint? ( media-libs/chromaprint ) |
118 |
+ curl? ( net-misc/curl ) |
119 |
+ dbus? ( sys-apps/dbus ) |
120 |
+ expat? ( dev-libs/expat ) |
121 |
+ faad? ( media-libs/faad2 ) |
122 |
+ |
123 |
+ ffmpeg? ( |
124 |
+ libav? ( media-video/libav:0= ) |
125 |
+ !libav? ( media-video/ffmpeg:0= ) |
126 |
+ ) |
127 |
+ |
128 |
+ flac? ( media-libs/flac ) |
129 |
+ fluidsynth? ( media-sound/fluidsynth ) |
130 |
+ gme? ( >=media-libs/game-music-emu-0.6.0_pre20120802 ) |
131 |
+ icu? ( dev-libs/icu:= ) |
132 |
+ id3tag? ( media-libs/libid3tag ) |
133 |
+ jack? ( virtual/jack ) |
134 |
+ lame? ( network? ( media-sound/lame ) ) |
135 |
+ libmpdclient? ( media-libs/libmpdclient ) |
136 |
+ libsamplerate? ( media-libs/libsamplerate ) |
137 |
+ libsoxr? ( media-libs/soxr ) |
138 |
+ mad? ( media-libs/libmad ) |
139 |
+ mikmod? ( media-libs/libmikmod ) |
140 |
+ mms? ( media-libs/libmms ) |
141 |
+ modplug? ( media-libs/libmodplug ) |
142 |
+ mpg123? ( media-sound/mpg123 ) |
143 |
+ musepack? ( media-sound/musepack-tools ) |
144 |
+ network? ( media-libs/libshout ) |
145 |
+ nfs? ( net-fs/libnfs ) |
146 |
+ openal? ( media-libs/openal ) |
147 |
+ opus? ( media-libs/opus ) |
148 |
+ pulseaudio? ( media-sound/pulseaudio ) |
149 |
+ qobuz? ( dev-libs/libgcrypt:0 ) |
150 |
+ samba? ( net-fs/samba ) |
151 |
+ selinux? ( sec-policy/selinux-mpd ) |
152 |
+ sid? ( || ( |
153 |
+ media-libs/libsidplay:2 |
154 |
+ media-libs/libsidplayfp |
155 |
+ ) ) |
156 |
+ sndfile? ( media-libs/libsndfile ) |
157 |
+ soundcloud? ( >=dev-libs/yajl-2:= ) |
158 |
+ sqlite? ( dev-db/sqlite:3 ) |
159 |
+ systemd? ( sys-apps/systemd ) |
160 |
+ tcpd? ( sys-apps/tcp-wrappers ) |
161 |
+ twolame? ( media-sound/twolame ) |
162 |
+ udisks? ( sys-fs/udisks:2 ) |
163 |
+ upnp? ( net-libs/libupnp:0 ) |
164 |
+ vorbis? ( media-libs/libvorbis ) |
165 |
+ wavpack? ( media-sound/wavpack ) |
166 |
+ wildmidi? ( media-sound/wildmidi ) |
167 |
+ zeroconf? ( net-dns/avahi[dbus] ) |
168 |
+ zip? ( dev-libs/zziplib ) |
169 |
+ zlib? ( sys-libs/zlib:= )" |
170 |
+ |
171 |
+DEPEND="${RDEPEND} |
172 |
+ >=dev-libs/boost-1.58:= |
173 |
+ test? ( dev-cpp/gtest )" |
174 |
+ |
175 |
+BDEPEND=">dev-util/meson-0.47.1 |
176 |
+ virtual/pkgconfig" |
177 |
+ |
178 |
+PATCHES=( |
179 |
+ "${FILESDIR}"/${PN}-0.18.conf.patch |
180 |
+) |
181 |
+ |
182 |
+pkg_setup() { |
183 |
+ enewuser mpd "" "" "/var/lib/mpd" audio |
184 |
+ |
185 |
+ if use eventfd; then |
186 |
+ CONFIG_CHECK+=" ~EVENTFD" |
187 |
+ ERROR_EVENTFD="${P} requires eventfd in-kernel support." |
188 |
+ fi |
189 |
+ |
190 |
+ if use signalfd; then |
191 |
+ CONFIG_CHECK+=" ~SIGNALFD" |
192 |
+ ERROR_SIGNALFD="${P} requires signalfd in-kernel support." |
193 |
+ fi |
194 |
+ |
195 |
+ if use inotify; then |
196 |
+ CONFIG_CHECK+=" ~INOTIFY_USER" |
197 |
+ ERROR_INOTIFY_USER="${P} requires inotify in-kernel support." |
198 |
+ fi |
199 |
+ |
200 |
+ if use eventfd || use signalfd || use inotify; then |
201 |
+ linux-info_pkg_setup |
202 |
+ fi |
203 |
+ |
204 |
+ elog "If you will be starting mpd via /etc/init.d/mpd, please make |
205 |
+ sure that MPD's pid_file is _set_." |
206 |
+} |
207 |
+ |
208 |
+src_prepare() { |
209 |
+ cp -f doc/mpdconf.example doc/mpdconf.dist || die "cp failed" |
210 |
+ default |
211 |
+} |
212 |
+ |
213 |
+src_configure() { |
214 |
+ local emesonargs=( |
215 |
+ -Dbzip2=$(usex bzip2 enabled disabled) |
216 |
+ -Dcdio_paranoia=$(usex cdio enabled disabled) |
217 |
+ -Dchromaprint=$(usex chromaprint enabled disabled) |
218 |
+ -Dcue=$(usex cue true false) |
219 |
+ -Dcurl=$(usex curl enabled disabled) |
220 |
+ -Ddbus=$(usex dbus enabled disabled) |
221 |
+ -Ddebug=$(usex debug true false) |
222 |
+ -Deventfd=$(usex eventfd true false) |
223 |
+ -Dexpat=$(usex expat enabled disabled) |
224 |
+ -Dicu=$(usex icu enabled disabled) |
225 |
+ -Did3tag=$(usex id3tag enabled disabled) |
226 |
+ -Dinotify=$(usex inotify true false) |
227 |
+ -Dipv6=$(usex ipv6 enabled disabled) |
228 |
+ -Diso9660=$(usex cdio enabled disabled) |
229 |
+ -Dlibmpdclient=$(usex libmpdclient enabled disabled) |
230 |
+ -Dlibsamplerate=$(usex libsamplerate enabled disabled) |
231 |
+ -Dlibwrap=$(usex tcpd enabled disabled) |
232 |
+ -Dmms=$(usex mms enabled disabled) |
233 |
+ -Dnfs=$(usex nfs enabled disabled) |
234 |
+ -Dsignalfd=$(usex signalfd true false) |
235 |
+ -Dsmbclient=$(usex samba enabled disabled) |
236 |
+ -Dsoxr=$(usex libsoxr enabled disabled) |
237 |
+ -Dsqlite=$(usex sqlite enabled disabled) |
238 |
+ -Dsystemd=$(usex systemd enabled disabled) |
239 |
+ -Dtest=$(usex test true false) |
240 |
+ -Dudisks=$(usex udisks enabled disabled) |
241 |
+ -Dupnp=$(usex upnp enabled disabled) |
242 |
+ -Dwebdav=$(usex webdav enabled disabled) |
243 |
+ -Dzeroconf=$(usex zeroconf avahi disabled) |
244 |
+ -Dzlib=$(usex zlib enabled disabled) |
245 |
+ -Dzzip=$(usex zip enabled disabled) |
246 |
+ ) |
247 |
+ |
248 |
+ emesonargs+=( |
249 |
+ -Dalsa=$(usex alsa enabled disabled) |
250 |
+ -Dao=$(usex ao enabled disabled) |
251 |
+ -Dfifo=$(usex fifo true false) |
252 |
+ -Djack=$(usex jack enabled disabled) |
253 |
+ -Dopenal=$(usex openal enabled disabled) |
254 |
+ -Doss=$(usex oss enabled disabled) |
255 |
+ -Dpipe=$(usex pipe true false) |
256 |
+ -Dpulse=$(usex pulseaudio enabled disabled) |
257 |
+ -Drecorder=$(usex recorder true false) |
258 |
+ ) |
259 |
+ |
260 |
+ if use samba || use upnp; then |
261 |
+ emesonargs+=( -Dneighbor=true ) |
262 |
+ fi |
263 |
+ |
264 |
+ append-lfs-flags |
265 |
+ append-ldflags "-L/usr/$(get_libdir)/sidplay/builders" |
266 |
+ |
267 |
+ if use network; then |
268 |
+ |
269 |
+ emesonargs+=( |
270 |
+ -Dshine=disabled |
271 |
+ -Dshout=enabled |
272 |
+ -Dvorbisenc=$(usex vorbis enabled disabled) |
273 |
+ -Dhttpd=true |
274 |
+ -Dlame=$(usex lame enabled disabled) |
275 |
+ -Dtwolame=$(usex twolame enabled disabled) |
276 |
+ -Dwave_encoder=$(usex audiofile true false) |
277 |
+ ) |
278 |
+ fi |
279 |
+ |
280 |
+ emesonargs+=( |
281 |
+ -Dadplug=$(usex adplug enabled disabled) |
282 |
+ -Daudiofile=$(usex audiofile enabled disabled) |
283 |
+ -Dfaad=$(usex faad enabled disabled) |
284 |
+ -Dffmpeg=$(usex ffmpeg enabled disabled) |
285 |
+ -Dflac=$(usex flac enabled disabled) |
286 |
+ -Dfluidsynth=$(usex fluidsynth enabled disabled) |
287 |
+ -Dgme=$(usex gme enabled disabled) |
288 |
+ -Dmad=$(usex mad enabled disabled) |
289 |
+ -Dmikmod=$(usex mikmod enabled disabled) |
290 |
+ -Dmodplug=$(usex modplug enabled disabled) |
291 |
+ -Dmpcdec=$(usex musepack enabled disabled) |
292 |
+ -Dmpg123=$(usex mpg123 enabled disabled) |
293 |
+ -Dopus=$(usex opus enabled disabled) |
294 |
+ -Dsidplay=$(usex sid enabled disabled) |
295 |
+ -Dsndfile=$(usex sndfile enabled disabled) |
296 |
+ -Dvorbis=$(usex vorbis enabled disabled) |
297 |
+ -Dwavpack=$(usex wavpack enabled disabled) |
298 |
+ -Dwildmidi=$(usex wildmidi enabled disabled) |
299 |
+ |
300 |
+ ) |
301 |
+ |
302 |
+ emesonargs+=( |
303 |
+ -Dqobuz=$(usex qobuz enabled disabled) |
304 |
+ -Dsoundcloud=$(usex soundcloud enabled disabled) |
305 |
+ -Dtidal=$(usex tidal enabled disabled) |
306 |
+ ) |
307 |
+ |
308 |
+ emesonargs+=( |
309 |
+ --libdir="/usr/$(get_libdir)" |
310 |
+ -Ddocumentation=false |
311 |
+ -Dsndio=disabled #not yet in the tree |
312 |
+ -Dsolaris_output=disabled |
313 |
+ |
314 |
+ -Ddatabase=true |
315 |
+ -Ddsd=true |
316 |
+ -Dtcp=true |
317 |
+ |
318 |
+ -Dsystemd_system_unit_dir="$(systemd_get_systemunitdir)" |
319 |
+ -Dsystemd_user_unit_dir="$(systemd_get_userunitdir)" |
320 |
+ ) |
321 |
+ |
322 |
+ if use icu; then |
323 |
+ emesonargs+=( -Diconv=enabled ) |
324 |
+ else |
325 |
+ emesonargs+=( -Diconv=disabled ) |
326 |
+ fi |
327 |
+ |
328 |
+ meson_src_configure |
329 |
+} |
330 |
+ |
331 |
+src_install() { |
332 |
+ meson_src_install |
333 |
+ |
334 |
+ insinto /etc |
335 |
+ newins doc/mpdconf.dist mpd.conf |
336 |
+ |
337 |
+ insinto /etc/logrotate.d |
338 |
+ newins "${FILESDIR}"/${PN}-0.21.1.logrotate ${PN} |
339 |
+ |
340 |
+ newinitd "${FILESDIR}"/${P}.init ${PN} |
341 |
+ |
342 |
+ if use unicode; then |
343 |
+ sed -i -e 's:^#filesystem_charset.*$:filesystem_charset "UTF-8":' \ |
344 |
+ "${ED}"/etc/mpd.conf || die "sed failed" |
345 |
+ fi |
346 |
+ |
347 |
+ doman doc/mpd.1 |
348 |
+ doman doc/mpd.conf.5 |
349 |
+ |
350 |
+ keepdir /var/lib/mpd |
351 |
+ keepdir /var/lib/mpd/music |
352 |
+ keepdir /var/lib/mpd/playlists |
353 |
+ |
354 |
+} |
355 |
+ |
356 |
+pkg_postinst() { |
357 |
+ # also change the homedir if the user has existed before |
358 |
+ usermod -d "/var/lib/mpd" mpd || die "usermod failed" |
359 |
+} |