git: a14b73ada846 - main - New port: multimedia/lms: Lightweight Music Server
Yuri Victorovich
yuri at FreeBSD.org
Sun Apr 25 20:24:36 UTC 2021
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=a14b73ada846c44a3d0a87588b818d544f960dcd
commit a14b73ada846c44a3d0a87588b818d544f960dcd
Author: Yuri Victorovich <yuri at FreeBSD.org>
AuthorDate: 2021-04-25 20:23:08 +0000
Commit: Yuri Victorovich <yuri at FreeBSD.org>
CommitDate: 2021-04-25 20:24:34 +0000
New port: multimedia/lms: Lightweight Music Server
---
multimedia/Makefile | 1 +
multimedia/lms/Makefile | 43 ++++++++++++++++
multimedia/lms/distinfo | 5 ++
multimedia/lms/files/lms.in | 25 +++++++++
.../patch-src_libs_utils_impl_ChildProcess.cpp | 18 +++++++
multimedia/lms/pkg-descr | 4 ++
multimedia/lms/pkg-message | 11 ++++
multimedia/lms/pkg-plist | 60 ++++++++++++++++++++++
8 files changed, 167 insertions(+)
diff --git a/multimedia/Makefile b/multimedia/Makefile
index 768f4da7d412..7de10a014776 100644
--- a/multimedia/Makefile
+++ b/multimedia/Makefile
@@ -219,6 +219,7 @@
SUBDIR += livego
SUBDIR += lives
SUBDIR += livestreamer
+ SUBDIR += lms
SUBDIR += lsdvd
SUBDIR += m2tstoavi
SUBDIR += m2vrequantiser
diff --git a/multimedia/lms/Makefile b/multimedia/lms/Makefile
new file mode 100644
index 000000000000..5bbc4345c321
--- /dev/null
+++ b/multimedia/lms/Makefile
@@ -0,0 +1,43 @@
+PORTNAME= lms
+DISTVERSION= 3.25.0
+MASTER_SITES= https://github.com/epoupon/lms/archive/refs/tags/v${DISTVERSION}${EXTRACT_SUFX}?dummy=/
+CATEGORIES= multimedia
+
+PATCH_SITES= https://github.com/epoupon/lms/commit/
+PATCHFILES+= b45b30ded44bb49865bbce7b43612f36043126ea.patch:-p1 # backport of fix of missing includes: https://github.com/epoupon/lms/commit/b45b30ded44bb49865bbce7b43612f36043126ea
+
+MAINTAINER= yuri at FreeBSD.org
+COMMENT= Lightweight Music Server
+
+LICENSE= GPLv3
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+LIB_DEPENDS= libavformat.so:multimedia/ffmpeg \
+ libboost_system.so:devel/boost-libs \
+ libconfig++.so:devel/libconfig \
+ libtag.so:audio/taglib \
+ libwthttp.so:www/wt
+RUN_DEPENDS= ffmpeg:multimedia/ffmpeg
+
+USES= cmake compiler:c++17-lang pkgconfig
+
+USER= nobody
+GROUP= nobody
+SUB_LIST= USER=${USER}
+USE_RC_SUBR= ${PORTNAME}
+
+PLIST_SUB= USER="${USER}" GROUP="${GROUP}"
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|"/etc/lms.conf"|"${PREFIX}/etc/lms.conf"|' \
+ ${WRKSRC}/src/lms/main.cpp \
+ ${WRKSRC}/src/tools/cover/LmsCover.cpp \
+ ${WRKSRC}/src/tools/recommendation/LmsRecommendation.cpp
+ @${REINPLACE_CMD} -e 's|"/usr/|"${PREFIX}/|; s|"/var/lms/"|"/var/db/lms/"|' \
+ ${WRKSRC}/conf/lms.conf
+
+post-install:
+ ${RLN} ${STAGEDIR}${DATADIR}/lms.conf ${STAGEDIR}${PREFIX}/etc/lms.conf.sample
+ ${MKDIR} ${STAGEDIR}/var/db/lms
+
+.include <bsd.port.mk>
diff --git a/multimedia/lms/distinfo b/multimedia/lms/distinfo
new file mode 100644
index 000000000000..1490583a7664
--- /dev/null
+++ b/multimedia/lms/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1619374810
+SHA256 (lms-3.25.0.tar.gz) = c27bf7d7fa994b3422c9773c2303df8fa078f35343326471ea4803cb0f5f872e
+SIZE (lms-3.25.0.tar.gz) = 431516
+SHA256 (b45b30ded44bb49865bbce7b43612f36043126ea.patch) = a792b3cbd7ccb366ffeed8e85c616cd6f96dc55781bb00867aeda61018737f98
+SIZE (b45b30ded44bb49865bbce7b43612f36043126ea.patch) = 1751
diff --git a/multimedia/lms/files/lms.in b/multimedia/lms/files/lms.in
new file mode 100644
index 000000000000..d00453820264
--- /dev/null
+++ b/multimedia/lms/files/lms.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# PROVIDE: lms
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable lms:
+# lms_enable : set to "YES" to enable the daemon, default is "NO"
+
+. /etc/rc.subr
+
+name=lms
+rcvar=lms_enable
+
+load_rc_config $name
+
+lms_enable=${lms_enable:-"NO"}
+
+logfile="/var/log/${name}.log"
+
+procname=%%PREFIX%%/bin/lms
+command="/usr/sbin/daemon"
+command_args="-u %%USER%% -o ${logfile} -t ${name} %%PREFIX%%/bin/lms"
+
+run_rc_command "$1"
diff --git a/multimedia/lms/files/patch-src_libs_utils_impl_ChildProcess.cpp b/multimedia/lms/files/patch-src_libs_utils_impl_ChildProcess.cpp
new file mode 100644
index 000000000000..52046a1b918a
--- /dev/null
+++ b/multimedia/lms/files/patch-src_libs_utils_impl_ChildProcess.cpp
@@ -0,0 +1,18 @@
+--- src/libs/utils/impl/ChildProcess.cpp.orig 2021-04-25 18:33:13 UTC
++++ src/libs/utils/impl/ChildProcess.cpp
+@@ -68,6 +68,7 @@ ChildProcess::ChildProcess(boost::asio::io_context& io
+ if (res < 0)
+ throw SystemException {errno, "pipe2 failed!"};
+
++#if !defined(__FreeBSD__) // see https://github.com/epoupon/lms/issues/144
+ {
+ const std::size_t pipeSize {65536*8};
+
+@@ -77,6 +78,7 @@ ChildProcess::ChildProcess(boost::asio::io_context& io
+ if (fcntl(pipe[1], F_SETPIPE_SZ, pipeSize) == -1)
+ throw SystemException {errno, "fcntl failed!"};
+ }
++#endif
+
+ res = fork();
+ if (res == -1)
diff --git a/multimedia/lms/pkg-descr b/multimedia/lms/pkg-descr
new file mode 100644
index 000000000000..626c00c006b6
--- /dev/null
+++ b/multimedia/lms/pkg-descr
@@ -0,0 +1,4 @@
+LMS is a self-hosted music streaming software: it allows users to access their
+music collections from anywhere using a web interface.
+
+WWW: https://github.com/epoupon/lms
diff --git a/multimedia/lms/pkg-message b/multimedia/lms/pkg-message
new file mode 100644
index 000000000000..49fd5d65b1d8
--- /dev/null
+++ b/multimedia/lms/pkg-message
@@ -0,0 +1,11 @@
+[
+{ type: install
+ message: <<EOM
+You installed LMS: Lightweight Music Server.
+
+In order to use it please start the service 'lms' and
+then access the URL http://0.0.0.0:5082 in your favorite browser.
+
+EOM
+}
+]
diff --git a/multimedia/lms/pkg-plist b/multimedia/lms/pkg-plist
new file mode 100644
index 000000000000..c2affbb66c49
--- /dev/null
+++ b/multimedia/lms/pkg-plist
@@ -0,0 +1,60 @@
+bin/lms
+bin/lms-metadata
+bin/lms-recommendation
+lib/liblmsauth.so
+lib/liblmsav.so
+lib/liblmscover.so
+lib/liblmsdatabase.so
+lib/liblmsmetadata.so
+lib/liblmsrecommendation.so
+lib/liblmsscanner.so
+lib/liblmsscrobbling.so
+lib/liblmssubsonic.so
+lib/liblmsutils.so
+ at sample etc/lms.conf.sample
+%%DATADIR%%/approot/admin-database.xml
+%%DATADIR%%/approot/admin-initwizard.xml
+%%DATADIR%%/approot/admin-scannercontroller.xml
+%%DATADIR%%/approot/admin-user.xml
+%%DATADIR%%/approot/admin-users.xml
+%%DATADIR%%/approot/artist.xml
+%%DATADIR%%/approot/artists.xml
+%%DATADIR%%/approot/error.xml
+%%DATADIR%%/approot/explore.xml
+%%DATADIR%%/approot/images/unknown-artist.jpg
+%%DATADIR%%/approot/images/unknown-cover.jpg
+%%DATADIR%%/approot/login.xml
+%%DATADIR%%/approot/mediaplayer.xml
+%%DATADIR%%/approot/messages.xml
+%%DATADIR%%/approot/messages_fr.xml
+%%DATADIR%%/approot/messages_it.xml
+%%DATADIR%%/approot/messages_zh.xml
+%%DATADIR%%/approot/playqueue.xml
+%%DATADIR%%/approot/%%CMAKE_BUILD_TYPE%%.xml
+%%DATADIR%%/approot/%%CMAKE_BUILD_TYPE%%s.xml
+%%DATADIR%%/approot/search.xml
+%%DATADIR%%/approot/settings.xml
+%%DATADIR%%/approot/templates.xml
+%%DATADIR%%/approot/tracks.xml
+%%DATADIR%%/default.service
+%%DATADIR%%/docroot/css/S6u8w4BMUTPHjxsAUi-qJCY.woff2
+%%DATADIR%%/docroot/css/S6u8w4BMUTPHjxsAXC-q.woff2
+%%DATADIR%%/docroot/css/S6u9w4BMUTPHh6UVSwaPGR_p.woff2
+%%DATADIR%%/docroot/css/S6u9w4BMUTPHh6UVSwiPGQ.woff2
+%%DATADIR%%/docroot/css/S6uyw4BMUTPHjx4wXg.woff2
+%%DATADIR%%/docroot/css/S6uyw4BMUTPHjxAwXjeu.woff2
+%%DATADIR%%/docroot/css/bootstrap-darkly.min.css
+%%DATADIR%%/docroot/css/bootstrap-flatly.min.css
+%%DATADIR%%/docroot/css/fonts.css
+%%DATADIR%%/docroot/css/lms-darkly.css
+%%DATADIR%%/docroot/css/lms-flatly.css
+%%DATADIR%%/docroot/css/lms.css
+%%DATADIR%%/docroot/js/bootstrap-notify.js
+%%DATADIR%%/docroot/js/bootstrap.min.js
+%%DATADIR%%/docroot/js/jquery-1.10.2.min.js
+%%DATADIR%%/docroot/js/mediaplayer.js
+%%DATADIR%%/lms
+%%DATADIR%%/lms.conf
+ at owner %%USER%%
+ at group %%GROUP%%
+ at dir /var/db/lms
More information about the dev-commits-ports-all
mailing list