/[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.10 - (hide annotations) (download)
Sat Jul 23 20:48:38 2022 UTC (2 years, 4 months ago) by jpp
Branch: MAIN
CVS Tags: madsonic-6_2_9092-1_el7_sme
Changes since 1.9: +1 -1 lines
* 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

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

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