/[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.11 - (hide annotations) (download)
Fri Dec 30 05:35:57 2022 UTC (23 months ago) by jpp
Branch: MAIN
CVS Tags: madsonic-6_2_9092-2_el7_sme
Changes since 1.10: +5 -2 lines
* Fri Dec 30 2022 Jean-Philippe Pialasse <tests@pialasse.com> 6.2.9092-2.sme
- fix madsonic fails as starting before network

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

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