From 771d06b9af85aceb0bfa9942d3b9bcb41fd557fe Mon Sep 17 00:00:00 2001 From: jcorporation Date: Thu, 30 Aug 2018 21:50:02 +0100 Subject: [PATCH] Fix: remove systemd dependency --- CMakeLists.txt | 1 + contrib/myMPD.spec | 34 +------------------------------ {debian => contrib}/mympd.service | 0 mkrelease.sh | 4 ++-- 4 files changed, 4 insertions(+), 35 deletions(-) rename {debian => contrib}/mympd.service (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index cccb4dc..bd78029 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ target_link_libraries(mympd ${LIBMPDCLIENT_LIBRARY} ${OPENSSL_LIBRARIES}) install(TARGETS mympd DESTINATION bin) install(FILES contrib/mympd.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1) install(FILES contrib/crcert.sh DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/) +install(FILES contrib/mympd.service DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/) install(FILES contrib/mympd.conf DESTINATION /etc/${PROJECT_NAME}/) install(FILES htdocs/mympd.webmanifest DESTINATION share/${PROJECT_NAME}/htdocs/) install(FILES dist/htdocs/index.html DESTINATION share/${PROJECT_NAME}/htdocs/) diff --git a/contrib/myMPD.spec b/contrib/myMPD.spec index 4c0c7a0..dd97d28 100644 --- a/contrib/myMPD.spec +++ b/contrib/myMPD.spec @@ -18,21 +18,12 @@ BuildRequires: libmpdclient-devel BuildRequires: libmpdclient2 BuildRequires: pkgconfig BuildRequires: openssl-devel -BuildRequires: systemd -%if 0%{?suse_version} >= 1210 -BuildRequires: systemd-rpm-macros -%endif BuildRoot: %{_tmppath}/%{name}-%{version}-build -%{?systemd_requires} + %description myMPD is a standalone and mobile friendly web mpdclient. -%pre -%if 0%{?suse_version} -%service_add_pre mympd.service -%endif - %prep %setup -q -n %{name}-%{version} @@ -46,28 +37,6 @@ make cd release make install DESTDIR=%{buildroot} chmod 755 %{buildroot}/usr/share/mympd/crcert.sh -install -D -m 644 %{buildroot}/debian/mympd.service %{buildroot}%{_unitdir}/mympd.service - -%post -%if 0%{?rhel_version} || 0%{?centos_version} -%systemd_post mympd.service -%else -%service_add_post mympd.service -%endif - -%preun -%if 0%{?rhel_version} || 0%{?centos_version} -%systemd_preun mympd.service -%else -%service_del_preun mympd.service -%endif - -%postun -%if 0%{?rhel_version} || 0%{?centos_version} -%systemd_postun mympd.service -%else -%service_del_postun mympd.service -%endif %files %defattr(-,root,root,-) @@ -77,7 +46,6 @@ install -D -m 644 %{buildroot}/debian/mympd.service %{buildroot}%{_unitdir}/mymp %config /etc/mympd /usr/share/man/man1/mympd.1.gz /var/lib/mympd -%{_unitdir}/mympd.service %changelog * Tue Aug 28 2018 Juergen Mang - master diff --git a/debian/mympd.service b/contrib/mympd.service similarity index 100% rename from debian/mympd.service rename to contrib/mympd.service diff --git a/mkrelease.sh b/mkrelease.sh index 0034abf..48d8202 100755 --- a/mkrelease.sh +++ b/mkrelease.sh @@ -64,9 +64,9 @@ fi echo "Installing systemd service" if [ -d /etc/systemd/system ] then - if [ debian/mympd.service -nt /etc/systemd/system/mympd.service ] + if [ contrib/mympd.service -nt /etc/systemd/system/mympd.service ] then - sudo cp debian/mympd.service /etc/systemd/system/ + sudo cp contrib/mympd.service /etc/systemd/system/ sudo systemctl daemon-reload fi sudo systemctl enable mympd