[packages/ympd] new

atler atler at pld-linux.org
Thu Dec 29 18:06:03 CET 2022


commit b86eb4387f8f7ea5b3d069e1fb0caa22d23db16f
Author: Jan Palus <atler at pld-linux.org>
Date:   Thu Dec 29 18:04:57 2022 +0100

    new

 ympd-link.patch | 26 +++++++++++++++++++++++++
 ympd.service    | 11 +++++++++++
 ympd.spec       | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ympd.sysconfig  |  1 +
 4 files changed, 98 insertions(+)
---
diff --git a/ympd.spec b/ympd.spec
new file mode 100644
index 0000000..0e068aa
--- /dev/null
+++ b/ympd.spec
@@ -0,0 +1,60 @@
+Summary:	Standalone MPD Web GUI written in C
+Name:		ympd
+Version:	1.3.0
+Release:	1
+License:	GPL v2+
+Group:		Applications
+Source0:	https://github.com/notandy/ympd/archive/v%{version}/%{name}-%{version}.zip
+# Source0-md5:	89d339ee9b243bc02aef38baa8f5a823
+Source1:	%{name}.service
+Source2:	%{name}.sysconfig
+Patch0:		%{name}-link.patch
+URL:		http://www.ympd.org
+BuildRequires:	cmake
+BuildRequires:	libmpdclient-devel
+BuildRequires:	openssl-devel
+BuildRequires:	rpmbuild(macros) >= 2.011
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Standalone MPD Web GUI written in C, utilizing Websockets and
+Bootstrap/JS.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%build
+install -d build
+cd build
+%cmake ..
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+install -D %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%systemd_post %{name}.service
+
+%preun
+%systemd_preun %{name}.service
+
+%postun
+%systemd_reload
+
+%files
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
+%attr(755,root,root) %{_bindir}/ympd
+%{systemdunitdir}/%{name}.service
+%{_mandir}/man1/ympd.1*
diff --git a/ympd-link.patch b/ympd-link.patch
new file mode 100644
index 0000000..aaaf415
--- /dev/null
+++ b/ympd-link.patch
@@ -0,0 +1,26 @@
+diff --color -ur ympd-1.3.0.orig/src/mpd_client.c ympd-1.3.0/src/mpd_client.c
+--- ympd-1.3.0.orig/src/mpd_client.c	2016-02-13 22:01:52.000000000 +0100
++++ ympd-1.3.0/src/mpd_client.c	2022-12-29 16:25:42.882837523 +0100
+@@ -27,6 +27,8 @@
+ #include "config.h"
+ #include "json_encode.h"
+ 
++struct t_mpd mpd;
++
+ /* forward declaration */
+ static int mpd_notify_callback(struct mg_connection *c, enum mg_event ev);
+ 
+diff --color -ur ympd-1.3.0.orig/src/mpd_client.h ympd-1.3.0/src/mpd_client.h
+--- ympd-1.3.0.orig/src/mpd_client.h	2016-02-13 22:01:52.000000000 +0100
++++ ympd-1.3.0/src/mpd_client.h	2022-12-29 16:25:27.793305437 +0100
+@@ -92,7 +92,9 @@
+ 
+     int song_id;
+     unsigned queue_version;
+-} mpd;
++};
++
++extern struct t_mpd mpd;
+ 
+ struct t_mpd_client_session {
+     int song_id;
diff --git a/ympd.service b/ympd.service
new file mode 100644
index 0000000..fe33c87
--- /dev/null
+++ b/ympd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=ympd server daemon
+Requires=network.target local-fs.target
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/ympd
+ExecStart=/usr/bin/ympd $YMPD_OPTIONS
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
diff --git a/ympd.sysconfig b/ympd.sysconfig
new file mode 100644
index 0000000..b21cc4d
--- /dev/null
+++ b/ympd.sysconfig
@@ -0,0 +1 @@
+YMPD_OPTIONS="--user nobody --webport 8080 --host localhost"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ympd.git/commitdiff/b86eb4387f8f7ea5b3d069e1fb0caa22d23db16f



More information about the pld-cvs-commit mailing list