159 lines
4.5 KiB
RPMSpec
159 lines
4.5 KiB
RPMSpec
![]() |
%define name madsonic
|
||
|
%define version 6.2.9092
|
||
|
%define release 3
|
||
|
%define __os_install_post \
|
||
|
/usr/lib/rpm/brp-compress \
|
||
|
/usr/lib/rpm/brp-strip \
|
||
|
/usr/lib/rpm/brp-strip-static-archive \
|
||
|
echo "not /usr/lib/rpm/brp-strip-comment-note" \
|
||
|
%{nil}
|
||
|
Name: %{name}
|
||
|
Version: %{version}
|
||
|
Release: %{release}%{?dist}
|
||
|
Summary: A web-based music streamer, jukebox and Podcast receiver
|
||
|
Source: %{name}-%{version}.tar.gz
|
||
|
Source1: madsonic.service
|
||
|
Patch0: madsonic-6.2.9084-test.patch
|
||
|
Patch1: madsonic-6.2.9084-sysconfig.patch
|
||
|
Patch2: madsonic-6.2.9092-bz12305-failing.patch
|
||
|
BuildRoot: /var/tmp/%{name}-%{version}-buildroot
|
||
|
BuildArch: noarch
|
||
|
BuildRequires: e-smith-devtools
|
||
|
AutoReqProv: no
|
||
|
Group: Applications/Multimedia
|
||
|
License: GPLv3
|
||
|
URL: http://madsonic.org
|
||
|
|
||
|
%changelog
|
||
|
* Thu Oct 09 2025 BogusDateBot
|
||
|
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
|
||
|
by assuming the date is correct and changing the weekday.
|
||
|
|
||
|
* Sat Jan 21 2023 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9092-3.sme
|
||
|
- fix failing service on update and few occasions [SME: 12305]
|
||
|
|
||
|
* Fri Dec 30 2022 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9092-2.sme
|
||
|
- fix madsonic fails as starting before network
|
||
|
|
||
|
* Fri Jul 22 2022 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9092-1.sme
|
||
|
- update with log4j fixes and more
|
||
|
- systemd capable
|
||
|
- add mediasonic.test
|
||
|
|
||
|
* Fri Jun 04 2021 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9084-2.sme
|
||
|
- fix permissions [SME: 10699]
|
||
|
- fix noise on start with initial install [SME: 8016]
|
||
|
|
||
|
* Thu Jun 03 2021 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9084-1.sme
|
||
|
- update to 6.2.9084
|
||
|
- first build for SME10
|
||
|
|
||
|
* Sun Nov 17 2013 JP Pialasse <tests@pialasse.com> 5.0.3760-1.sme
|
||
|
- first build for sme
|
||
|
- adding noarch
|
||
|
- adding e-smith-devtools
|
||
|
|
||
|
%description
|
||
|
Madsonic is a web-based music streamer, fork of Subsonic, jukebox and Podcast receiver,
|
||
|
providing access to your music collection wherever you are. Use it
|
||
|
to share your music with friends, or to listen to your music while away
|
||
|
from home.
|
||
|
|
||
|
Apps for Android, iPhone and Windows Phone are also available.
|
||
|
|
||
|
Java 1.8 or higher is required to run Madsonic.>= 6.2
|
||
|
|
||
|
%prep
|
||
|
%setup
|
||
|
%patch0 -p1
|
||
|
%patch1 -p1
|
||
|
%patch2 -p1
|
||
|
mkdir -p root/usr/lib/systemd/system
|
||
|
cp %{SOURCE1} root/usr/lib/systemd/system
|
||
|
mkdir -p root/run/madsonic
|
||
|
mkdir -p root/usr/lib/tmpfiles.d/
|
||
|
mkdir -p root/usr/bin
|
||
|
echo "d /run/madsonic 0755 madsonic madsonic" > root/usr/lib/tmpfiles.d/madsonic.conf
|
||
|
rm root/etc/init.d/madsonic
|
||
|
|
||
|
pushd root/usr/bin/
|
||
|
ln -sf /usr/share/madsonic/madsonic.sh madsonic
|
||
|
popd
|
||
|
|
||
|
|
||
|
%install
|
||
|
rm -rf $RPM_BUILD_ROOT
|
||
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
|
||
|
rm -f %{name}-%{version}-filelist
|
||
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
|
||
|
--dir /usr/share/madsonic 'attr(0750,madsonic,madsonic)' \
|
||
|
--dir /var/madsonic 'attr(0750,madsonic,madsonic)' \
|
||
|
--file /usr/lib/tmpfiles.d/madsonic.conf 'attr(0750,root,root)' \
|
||
|
--file /usr/lib/systemd/system/madsonic.service 'attr(0644,root,root)' \
|
||
|
--dir /run/madsonic 'attr(0755,madsonic,madsonic)' \
|
||
|
--ignoredir /run \
|
||
|
--ignoredir "/etc/sysconfig/madsonic" \
|
||
|
--ignoredir "/etc/init.d" \
|
||
|
--ignoredir "/etc/sysconfig"\
|
||
|
> %{name}-%{version}-filelist
|
||
|
|
||
|
%clean
|
||
|
rm -rf $RPM_BUILD_ROOT
|
||
|
|
||
|
%files -f %{name}-%{version}-filelist
|
||
|
%defattr(-,root,root)
|
||
|
%config(noreplace) /etc/sysconfig/madsonic
|
||
|
|
||
|
%pre
|
||
|
grep '^madsonic:' /etc/passwd > /dev/null || \
|
||
|
/usr/sbin/useradd -c "madsonic" -M -d /usr/share/madsonic -s /bin/bash madsonic
|
||
|
/usr/sbin/usermod -aG audio madsonic
|
||
|
|
||
|
# Stop Madsonic service.
|
||
|
if [ -e /etc/init.d/madsonic ]; then
|
||
|
service madsonic stop
|
||
|
fi
|
||
|
[ -e /usr/lib/systemd/system/madsonic.service ] && systemctl stop madsonic
|
||
|
|
||
|
# Backup database.
|
||
|
if [ -e /var/madsonic/db ]; then
|
||
|
rm -rf /var/madsonic/db.backup
|
||
|
cp -R /var/madsonic/db /var/madsonic/db.backup
|
||
|
fi
|
||
|
|
||
|
exit 0
|
||
|
|
||
|
%post
|
||
|
#ln -sf /usr/share/madsonic/madsonic.sh /usr/bin/madsonic
|
||
|
#chmod 750 /var/madsonic
|
||
|
|
||
|
# Clear jetty cache.
|
||
|
rm -rf /var/madsonic/jetty
|
||
|
|
||
|
# For SELinux: Set security context
|
||
|
chcon -t java_exec_t /etc/init.d/madsonic 2>/dev/null
|
||
|
|
||
|
# Configure and start Madsonic service.
|
||
|
#chkconfig --add madsonic
|
||
|
#service madsonic start
|
||
|
|
||
|
exit 0
|
||
|
%preun
|
||
|
# Only do it if uninstalling, not upgrading.
|
||
|
if [ $1 = 0 ] ; then
|
||
|
|
||
|
# Stop the service.
|
||
|
[ -e /etc/init.d/madsonic ] && service madsonic stop
|
||
|
[ -e /usr/lib/systemd/system/madsonic.service ] && systemctl stop madsonic
|
||
|
|
||
|
# Remove symlink.
|
||
|
rm -f /usr/bin/madsonic
|
||
|
|
||
|
# Remove startup scripts.
|
||
|
chkconfig --del madsonic
|
||
|
|
||
|
fi
|
||
|
|
||
|
exit 0
|
||
|
|