2018-08-27 23:50:34 +00:00
|
|
|
#
|
|
|
|
# spec file for package myMPD
|
|
|
|
#
|
2018-09-20 22:04:35 +00:00
|
|
|
# (c) 2018 Juergen Mang <mail@jcgames.de>
|
2018-08-27 23:50:34 +00:00
|
|
|
|
|
|
|
Name: myMPD
|
2018-09-24 22:44:28 +00:00
|
|
|
Version: 4.3.0
|
2018-08-27 23:50:34 +00:00
|
|
|
Release: 0
|
|
|
|
License: GPL-2.0
|
|
|
|
Group: Productivity/Multimedia/Sound/Players
|
|
|
|
Summary: Standalone webclient for mpd
|
|
|
|
Url: https://github.com/jcorporation/myMPD
|
2018-09-24 22:44:28 +00:00
|
|
|
Source: https://github.com/jcorporation/myMPD/archive/v4.3.0.zip
|
2018-08-27 23:50:34 +00:00
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: unzip
|
|
|
|
BuildRequires: libmpdclient-devel
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: openssl-devel
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2018-08-30 20:50:02 +00:00
|
|
|
|
2018-09-05 19:23:39 +00:00
|
|
|
%global debug_package %{nil}
|
2018-08-27 23:50:34 +00:00
|
|
|
|
|
|
|
%description
|
2018-08-28 11:28:52 +00:00
|
|
|
myMPD is a standalone and mobile friendly web mpdclient.
|
2018-08-27 23:50:34 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{name}-%{version}
|
|
|
|
|
|
|
|
%build
|
|
|
|
mkdir release
|
|
|
|
cd release
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=RELEASE ..
|
|
|
|
make
|
|
|
|
|
|
|
|
%install
|
|
|
|
cd release
|
|
|
|
make install DESTDIR=%{buildroot}
|
2018-09-04 19:36:04 +00:00
|
|
|
|
|
|
|
%post
|
2018-09-17 17:31:45 +00:00
|
|
|
echo "Checking status of mympd system user and group"
|
2018-09-04 20:07:30 +00:00
|
|
|
getent group mympd > /dev/null
|
2018-09-12 20:30:24 +00:00
|
|
|
[ "$?" = "2" ] && groupadd -r mympd
|
2018-09-04 20:07:30 +00:00
|
|
|
getent passwd mympd > /dev/null
|
2018-09-12 20:30:24 +00:00
|
|
|
[ "$?" = "2" ] && useradd -r mympd -g mympd -d /var/lib/mympd -s /usr/sbin/nologin
|
2018-09-17 17:31:45 +00:00
|
|
|
|
2018-09-24 20:55:53 +00:00
|
|
|
echo "Fixing ownership of /var/lib/mympd"
|
|
|
|
chown -R mympd.mympd /var/lib/mympd
|
2018-09-17 17:31:45 +00:00
|
|
|
|
2018-09-20 20:13:04 +00:00
|
|
|
if [ -d /etc/systemd ]
|
2018-09-05 18:36:23 +00:00
|
|
|
then
|
2018-09-25 23:27:17 +00:00
|
|
|
[ -d /usr/lib/systemd/system ] || mkdir -p /usr/lib/systemd/system
|
2018-09-05 18:36:23 +00:00
|
|
|
cp /usr/share/mympd/mympd.service /usr/lib/systemd/system/
|
2018-09-17 17:53:10 +00:00
|
|
|
systemctl daemon-reload
|
|
|
|
systemctl enable mympd
|
2018-09-05 18:36:23 +00:00
|
|
|
fi
|
2018-09-17 17:53:10 +00:00
|
|
|
|
2018-09-05 18:46:40 +00:00
|
|
|
if [ -f /etc/mpd.conf ]
|
|
|
|
then
|
|
|
|
LIBRARY=$(grep ^music_directory /etc/mpd.conf | awk {'print $2'} | sed -e 's/"//g')
|
|
|
|
[ "$LIBRARY" != "" ] && [ ! -e /usr/share/mympd/htdocs/library ] && ln -s "$LIBRARY" /usr/share/mympd/htdocs/library
|
|
|
|
fi
|
2018-09-17 17:31:45 +00:00
|
|
|
|
2018-09-20 20:13:04 +00:00
|
|
|
[ -e /usr/share/mympd/htdocs/pics ] || ln -s /var/lib/mympd/pics /usr/share/mympd/htdocs/
|
|
|
|
|
2018-10-01 19:12:59 +00:00
|
|
|
# move smartpls into place unless already existing
|
|
|
|
for PLDIST in /var/lib/mympd/smartpls/*.dist
|
|
|
|
do
|
|
|
|
PLS=$(basename $PLDIST .dist)
|
|
|
|
if [ -f /var/lib/mympd/smartpls/$PLS ]
|
|
|
|
then
|
|
|
|
rm $PLDIST
|
|
|
|
else
|
|
|
|
mv $PLDIST /var/lib/mympd/smartpls/$PLS
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# move config into place unless already existing
|
2018-09-17 17:31:45 +00:00
|
|
|
if [ ! -f /etc/mympd/mympd.conf ]
|
|
|
|
then
|
|
|
|
mv /etc/mympd/mympd.conf.dist /etc/mympd/mympd.conf
|
|
|
|
else
|
|
|
|
echo "mympd.conf installed as mympd.conf.dist"
|
|
|
|
fi
|
|
|
|
|
2018-09-05 18:36:23 +00:00
|
|
|
/usr/share/mympd/crcert.sh
|
2018-08-27 23:50:34 +00:00
|
|
|
|
2018-09-17 17:31:45 +00:00
|
|
|
%postun
|
2018-09-20 20:13:04 +00:00
|
|
|
if [ "$1" = "0" ]
|
2018-09-17 17:53:10 +00:00
|
|
|
then
|
2018-09-20 20:13:04 +00:00
|
|
|
if [ -f /usr/lib/systemd/system/mympd.service ]
|
2018-09-17 17:53:10 +00:00
|
|
|
then
|
2018-09-20 20:13:04 +00:00
|
|
|
if `systemctl is-active --quiet mympd`
|
|
|
|
then
|
|
|
|
echo "stopping mympd.service" && systemctl stop mympd
|
|
|
|
fi
|
|
|
|
echo "disabling mympd.service" && systemctl disable mympd
|
|
|
|
rm -v -f /usr/lib/systemd/system/mympd.service
|
|
|
|
systemctl daemon-reload
|
2018-09-17 17:53:10 +00:00
|
|
|
fi
|
2018-09-20 20:13:04 +00:00
|
|
|
rm -v -f /usr/share/mympd/htdocs/pics
|
|
|
|
rm -v -f /usr/share/mympd/htdocs/library
|
2018-09-17 17:53:10 +00:00
|
|
|
fi
|
|
|
|
|
2018-08-27 23:50:34 +00:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc README.md LICENSE
|
|
|
|
/usr/bin/mympd
|
|
|
|
/usr/share/mympd
|
|
|
|
%config /etc/mympd
|
|
|
|
/usr/share/man/man1/mympd.1.gz
|
2018-08-28 11:28:52 +00:00
|
|
|
/var/lib/mympd
|
2018-08-27 23:50:34 +00:00
|
|
|
|
|
|
|
%changelog
|
2018-09-20 22:04:35 +00:00
|
|
|
* Fri Sep 21 2018 Juergen Mang <mail@jcgames.de> - master
|
2018-08-27 23:50:34 +00:00
|
|
|
- Version from master
|