1 |
jpp |
1.1 |
%define name madsonic |
2 |
jpp |
1.4 |
%define version 6.2.9092 |
3 |
|
|
%define release 1 |
4 |
jpp |
1.1 |
%define __os_install_post \ |
5 |
|
|
/usr/lib/rpm/brp-compress \ |
6 |
|
|
/usr/lib/rpm/brp-strip \ |
7 |
|
|
/usr/lib/rpm/brp-strip-static-archive \ |
8 |
|
|
echo "not /usr/lib/rpm/brp-strip-comment-note" \ |
9 |
|
|
%{nil} |
10 |
|
|
Name: %{name} |
11 |
|
|
Version: %{version} |
12 |
|
|
Release: %{release}%{?dist} |
13 |
|
|
Summary: A web-based music streamer, jukebox and Podcast receiver |
14 |
|
|
Source: %{name}-%{version}.tar.gz |
15 |
jpp |
1.5 |
Patch0: madsonic-6.2.9084-test.patch |
16 |
jpp |
1.1 |
BuildRoot: /var/tmp/%{name}-%{version}-buildroot |
17 |
|
|
BuildArch: noarch |
18 |
|
|
BuildRequires: e-smith-devtools |
19 |
|
|
AutoReqProv: no |
20 |
|
|
Group: Applications/Multimedia |
21 |
|
|
License: GPLv3 |
22 |
|
|
URL: http://madsonic.org |
23 |
|
|
|
24 |
|
|
%changelog |
25 |
jpp |
1.4 |
* Fri Jul 22 2022 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9092-1.sme |
26 |
|
|
- update with log4j fixes and more |
27 |
jpp |
1.5 |
- systemd capable |
28 |
|
|
- enable mediasonic.test by default |
29 |
jpp |
1.4 |
|
30 |
jpp |
1.3 |
* Fri Jun 04 2021 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9084-2.sme |
31 |
|
|
- fix permissions [SME: 10699] |
32 |
|
|
- fix noise on start with initial install [SME: 8016] |
33 |
|
|
|
34 |
jpp |
1.2 |
* Thu Jun 03 2021 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9084-1.sme |
35 |
|
|
- update to 6.2.9084 |
36 |
|
|
- first build for SME10 |
37 |
|
|
|
38 |
jpp |
1.1 |
* Sun Nov 17 2013 JP Pialasse <tests@pialasse.com> 5.0.3760-1.sme |
39 |
|
|
- first build for sme |
40 |
|
|
- adding noarch |
41 |
|
|
- adding e-smith-devtools |
42 |
|
|
|
43 |
|
|
%description |
44 |
|
|
Madsonic is a web-based music streamer, fork of Subsonic, jukebox and Podcast receiver, |
45 |
|
|
providing access to your music collection wherever you are. Use it |
46 |
|
|
to share your music with friends, or to listen to your music while away |
47 |
|
|
from home. |
48 |
|
|
|
49 |
|
|
Apps for Android, iPhone and Windows Phone are also available. |
50 |
|
|
|
51 |
jpp |
1.5 |
Java 1.8 or higher is required to run Madsonic.>= 6.2 |
52 |
jpp |
1.1 |
|
53 |
|
|
%prep |
54 |
|
|
%setup |
55 |
jpp |
1.6 |
%patch0 -p1 |
56 |
|
|
|
57 |
jpp |
1.5 |
mkdir -p root/run/madsonic |
58 |
|
|
mkdir -p root/usr/lib/tmpfiles.d/ |
59 |
jpp |
1.7 |
mkdir -p root/usr/bin |
60 |
jpp |
1.5 |
echo "d /run/madsonic 0755 madsonic madsonic" > root/usr/lib/tmpfiles.d/madsonic.conf |
61 |
|
|
rm root/etc/init.d/madsonic |
62 |
jpp |
1.6 |
|
63 |
|
|
pushd root/usr/bin/ |
64 |
jpp |
1.8 |
ln -sf /usr/share/madsonic/madsonic.sh madsonic |
65 |
jpp |
1.6 |
popd |
66 |
jpp |
1.1 |
|
67 |
|
|
|
68 |
|
|
%install |
69 |
|
|
rm -rf $RPM_BUILD_ROOT |
70 |
|
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
71 |
|
|
rm -f %{name}-%{version}-filelist |
72 |
|
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
73 |
jpp |
1.3 |
--dir /usr/share/madsonic 'attr(0750,madsonic,madsonic)' \ |
74 |
|
|
--dir /var/madsonic 'attr(0750,madsonic,madsonic)' \ |
75 |
jpp |
1.5 |
--file /usr/lib/tmpfiles.d/madsonic.conf 'attr(0750,root,root)' \ |
76 |
|
|
--dir /run/madsonic 'attr(0755,madsonic,madsonic)' \ |
77 |
|
|
--ignoredir /run \ |
78 |
|
|
--ignoredir "/etc/sysconfig/madsonic" \ |
79 |
|
|
--ignoredir "/etc/init.d" \ |
80 |
|
|
--ignoredir "/etc/sysconfig"\ |
81 |
jpp |
1.1 |
> %{name}-%{version}-filelist |
82 |
|
|
|
83 |
|
|
%clean |
84 |
|
|
rm -rf $RPM_BUILD_ROOT |
85 |
|
|
|
86 |
|
|
%files -f %{name}-%{version}-filelist |
87 |
|
|
%defattr(-,root,root) |
88 |
|
|
%config(noreplace) /etc/sysconfig/madsonic |
89 |
|
|
|
90 |
|
|
%pre |
91 |
jpp |
1.3 |
grep '^madsonic:' /etc/passwd > /dev/null || \ |
92 |
|
|
/usr/sbin/useradd -c "madsonic" -M -d /usr/share/madsonic -s /bin/bash madsonic |
93 |
|
|
/usr/sbin/usermod -aG audio madsonic |
94 |
|
|
|
95 |
jpp |
1.1 |
# Stop Madsonic service. |
96 |
|
|
if [ -e /etc/init.d/madsonic ]; then |
97 |
|
|
service madsonic stop |
98 |
|
|
fi |
99 |
jpp |
1.5 |
[ -e /usr/lib/systemd/system/madsonic.service ] && systemctl stop madsonic |
100 |
jpp |
1.1 |
|
101 |
|
|
# Backup database. |
102 |
|
|
if [ -e /var/madsonic/db ]; then |
103 |
|
|
rm -rf /var/madsonic/db.backup |
104 |
|
|
cp -R /var/madsonic/db /var/madsonic/db.backup |
105 |
|
|
fi |
106 |
|
|
|
107 |
|
|
exit 0 |
108 |
|
|
|
109 |
|
|
%post |
110 |
jpp |
1.5 |
#ln -sf /usr/share/madsonic/madsonic.sh /usr/bin/madsonic |
111 |
|
|
#chmod 750 /var/madsonic |
112 |
jpp |
1.1 |
|
113 |
|
|
# Clear jetty cache. |
114 |
|
|
rm -rf /var/madsonic/jetty |
115 |
|
|
|
116 |
|
|
# For SELinux: Set security context |
117 |
|
|
chcon -t java_exec_t /etc/init.d/madsonic 2>/dev/null |
118 |
|
|
|
119 |
|
|
# Configure and start Madsonic service. |
120 |
jpp |
1.3 |
#chkconfig --add madsonic |
121 |
|
|
#service madsonic start |
122 |
jpp |
1.1 |
|
123 |
|
|
exit 0 |
124 |
|
|
%preun |
125 |
|
|
# Only do it if uninstalling, not upgrading. |
126 |
|
|
if [ $1 = 0 ] ; then |
127 |
|
|
|
128 |
|
|
# Stop the service. |
129 |
|
|
[ -e /etc/init.d/madsonic ] && service madsonic stop |
130 |
jpp |
1.5 |
[ -e /usr/lib/systemd/system/madsonic.service ] && systemctl stop madsonic |
131 |
jpp |
1.1 |
|
132 |
|
|
# Remove symlink. |
133 |
|
|
rm -f /usr/bin/madsonic |
134 |
|
|
|
135 |
|
|
# Remove startup scripts. |
136 |
|
|
chkconfig --del madsonic |
137 |
|
|
|
138 |
|
|
fi |
139 |
|
|
|
140 |
|
|
exit 0 |
141 |
|
|
|