]> git.pld-linux.org Git - packages/ympd.git/commitdiff
new
authorJan Palus <atler@pld-linux.org>
Thu, 29 Dec 2022 17:04:57 +0000 (18:04 +0100)
committerJan Palus <atler@pld-linux.org>
Thu, 29 Dec 2022 17:04:57 +0000 (18:04 +0100)
ympd-link.patch [new file with mode: 0644]
ympd.service [new file with mode: 0644]
ympd.spec [new file with mode: 0644]
ympd.sysconfig [new file with mode: 0644]

diff --git a/ympd-link.patch b/ympd-link.patch
new file mode 100644 (file)
index 0000000..aaaf415
--- /dev/null
@@ -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 (file)
index 0000000..fe33c87
--- /dev/null
@@ -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.spec b/ympd.spec
new file mode 100644 (file)
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.sysconfig b/ympd.sysconfig
new file mode 100644 (file)
index 0000000..b21cc4d
--- /dev/null
@@ -0,0 +1 @@
+YMPD_OPTIONS="--user nobody --webport 8080 --host localhost"
This page took 0.297183 seconds and 4 git commands to generate.