1 |
%define name madsonic |
%define name madsonic |
2 |
%define version 5.0.3760 |
%define version 6.2.9092 |
3 |
%define release 1 |
%define release 2 |
4 |
%define __os_install_post \ |
%define __os_install_post \ |
5 |
/usr/lib/rpm/brp-compress \ |
/usr/lib/rpm/brp-compress \ |
6 |
/usr/lib/rpm/brp-strip \ |
/usr/lib/rpm/brp-strip \ |
12 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
13 |
Summary: A web-based music streamer, jukebox and Podcast receiver |
Summary: A web-based music streamer, jukebox and Podcast receiver |
14 |
Source: %{name}-%{version}.tar.gz |
Source: %{name}-%{version}.tar.gz |
15 |
|
Source1: madsonic.service |
16 |
|
Patch0: madsonic-6.2.9084-test.patch |
17 |
|
Patch1: madsonic-6.2.9084-sysconfig.patch |
18 |
BuildRoot: /var/tmp/%{name}-%{version}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-buildroot |
19 |
BuildArch: noarch |
BuildArch: noarch |
20 |
BuildRequires: e-smith-devtools |
BuildRequires: e-smith-devtools |
24 |
URL: http://madsonic.org |
URL: http://madsonic.org |
25 |
|
|
26 |
%changelog |
%changelog |
27 |
|
* Fri Dec 30 2022 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9092-2.sme |
28 |
|
- fix madsonic fails as starting before network |
29 |
|
|
30 |
|
* Fri Jul 22 2022 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9092-1.sme |
31 |
|
- update with log4j fixes and more |
32 |
|
- systemd capable |
33 |
|
- add mediasonic.test |
34 |
|
|
35 |
|
* Fri Jun 04 2021 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9084-2.sme |
36 |
|
- fix permissions [SME: 10699] |
37 |
|
- fix noise on start with initial install [SME: 8016] |
38 |
|
|
39 |
|
* Thu Jun 03 2021 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9084-1.sme |
40 |
|
- update to 6.2.9084 |
41 |
|
- first build for SME10 |
42 |
|
|
43 |
* Sun Nov 17 2013 JP Pialasse <tests@pialasse.com> 5.0.3760-1.sme |
* Sun Nov 17 2013 JP Pialasse <tests@pialasse.com> 5.0.3760-1.sme |
44 |
- first build for sme |
- first build for sme |
45 |
- adding noarch |
- adding noarch |
53 |
|
|
54 |
Apps for Android, iPhone and Windows Phone are also available. |
Apps for Android, iPhone and Windows Phone are also available. |
55 |
|
|
56 |
Java 1.6 or higher is required to run Madsonic. |
Java 1.8 or higher is required to run Madsonic.>= 6.2 |
57 |
|
|
58 |
%prep |
%prep |
59 |
%setup |
%setup |
60 |
|
%patch0 -p1 |
61 |
|
%patch1 -p1 |
62 |
|
mkdir -p root/usr/lib/systemd/system |
63 |
|
cp %{SOURCE1} root/usr/lib/systemd/system |
64 |
|
mkdir -p root/run/madsonic |
65 |
|
mkdir -p root/usr/lib/tmpfiles.d/ |
66 |
|
mkdir -p root/usr/bin |
67 |
|
echo "d /run/madsonic 0755 madsonic madsonic" > root/usr/lib/tmpfiles.d/madsonic.conf |
68 |
|
rm root/etc/init.d/madsonic |
69 |
|
|
70 |
|
pushd root/usr/bin/ |
71 |
|
ln -sf /usr/share/madsonic/madsonic.sh madsonic |
72 |
|
popd |
73 |
|
|
74 |
|
|
75 |
%install |
%install |
77 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
78 |
rm -f %{name}-%{version}-filelist |
rm -f %{name}-%{version}-filelist |
79 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
80 |
| grep -v "/etc/sysconfig/madsonic" \ |
--dir /usr/share/madsonic 'attr(0750,madsonic,madsonic)' \ |
81 |
| grep -v "/etc/init.d$" \ |
--dir /var/madsonic 'attr(0750,madsonic,madsonic)' \ |
82 |
| grep -v "/etc/sysconfig$"\ |
--file /usr/lib/tmpfiles.d/madsonic.conf 'attr(0750,root,root)' \ |
83 |
|
--file /usr/lib/systemd/system/madsonic.service 'attr(0644,root,root)' \ |
84 |
|
--dir /run/madsonic 'attr(0755,madsonic,madsonic)' \ |
85 |
|
--ignoredir /run \ |
86 |
|
--ignoredir "/etc/sysconfig/madsonic" \ |
87 |
|
--ignoredir "/etc/init.d" \ |
88 |
|
--ignoredir "/etc/sysconfig"\ |
89 |
> %{name}-%{version}-filelist |
> %{name}-%{version}-filelist |
90 |
|
|
91 |
%clean |
%clean |
96 |
%config(noreplace) /etc/sysconfig/madsonic |
%config(noreplace) /etc/sysconfig/madsonic |
97 |
|
|
98 |
%pre |
%pre |
99 |
|
grep '^madsonic:' /etc/passwd > /dev/null || \ |
100 |
|
/usr/sbin/useradd -c "madsonic" -M -d /usr/share/madsonic -s /bin/bash madsonic |
101 |
|
/usr/sbin/usermod -aG audio madsonic |
102 |
|
|
103 |
# Stop Madsonic service. |
# Stop Madsonic service. |
104 |
if [ -e /etc/init.d/madsonic ]; then |
if [ -e /etc/init.d/madsonic ]; then |
105 |
service madsonic stop |
service madsonic stop |
106 |
fi |
fi |
107 |
|
[ -e /usr/lib/systemd/system/madsonic.service ] && systemctl stop madsonic |
108 |
|
|
109 |
# Backup database. |
# Backup database. |
110 |
if [ -e /var/madsonic/db ]; then |
if [ -e /var/madsonic/db ]; then |
115 |
exit 0 |
exit 0 |
116 |
|
|
117 |
%post |
%post |
118 |
ln -sf /usr/share/madsonic/madsonic.sh /usr/bin/madsonic |
#ln -sf /usr/share/madsonic/madsonic.sh /usr/bin/madsonic |
119 |
chmod 750 /var/madsonic |
#chmod 750 /var/madsonic |
120 |
|
|
121 |
# Clear jetty cache. |
# Clear jetty cache. |
122 |
rm -rf /var/madsonic/jetty |
rm -rf /var/madsonic/jetty |
125 |
chcon -t java_exec_t /etc/init.d/madsonic 2>/dev/null |
chcon -t java_exec_t /etc/init.d/madsonic 2>/dev/null |
126 |
|
|
127 |
# Configure and start Madsonic service. |
# Configure and start Madsonic service. |
128 |
chkconfig --add madsonic |
#chkconfig --add madsonic |
129 |
service madsonic start |
#service madsonic start |
130 |
|
|
131 |
exit 0 |
exit 0 |
132 |
%preun |
%preun |
135 |
|
|
136 |
# Stop the service. |
# Stop the service. |
137 |
[ -e /etc/init.d/madsonic ] && service madsonic stop |
[ -e /etc/init.d/madsonic ] && service madsonic stop |
138 |
|
[ -e /usr/lib/systemd/system/madsonic.service ] && systemctl stop madsonic |
139 |
|
|
140 |
# Remove symlink. |
# Remove symlink. |
141 |
rm -f /usr/bin/madsonic |
rm -f /usr/bin/madsonic |