/[smecontribs]/rpms/madsonic/contribs10/madsonic.spec
ViewVC logotype

Annotation of /rpms/madsonic/contribs10/madsonic.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.12 - (hide annotations) (download)
Sat Jan 21 19:53:35 2023 UTC (21 months, 2 weeks ago) by jpp
Branch: MAIN
CVS Tags: madsonic-6_2_9092-3_el7_sme, HEAD
Changes since 1.11: +6 -1 lines
* 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]

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

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed