1 |
unnilennium |
1.1 |
%define name subsonic |
2 |
|
|
%define version 4.8 |
3 |
unnilennium |
1.2 |
%define release 2 |
4 |
unnilennium |
1.1 |
Name: %{name} |
5 |
|
|
Version: %{version} |
6 |
|
|
Release: %{release}%{?dist} |
7 |
|
|
Summary: A web-based music streamer, jukebox and Podcast receiver |
8 |
|
|
Source: %{name}-%{version}.tar.gz |
9 |
|
|
BuildRoot: /var/tmp/%{name}-%{version}-buildroot |
10 |
unnilennium |
1.2 |
BuildArch: noarch |
11 |
unnilennium |
1.1 |
#BuildRequires: e-smith-devtools |
12 |
|
|
Group: Applications/Multimedia |
13 |
|
|
License: GPLv3 |
14 |
|
|
URL: http://subsonic.org |
15 |
|
|
|
16 |
unnilennium |
1.2 |
%changelog |
17 |
unnilennium |
1.3 |
* Sun Oct 27 2013 JP Pialasse <tests@pialasse.com> 4.8-2.sme |
18 |
unnilennium |
1.2 |
- first build for sme |
19 |
|
|
- adding noarch |
20 |
|
|
|
21 |
unnilennium |
1.1 |
%description |
22 |
|
|
Subsonic is a web-based music streamer, jukebox and Podcast receiver, |
23 |
|
|
providing access to your music collection wherever you are. Use it |
24 |
|
|
to share your music with friends, or to listen to your music while away |
25 |
|
|
from home. |
26 |
|
|
|
27 |
|
|
Apps for Android, iPhone and Windows Phone are also available. |
28 |
|
|
|
29 |
|
|
Java 1.6 or higher is required to run Subsonic. |
30 |
|
|
|
31 |
|
|
Subsonic can be found at http://subsonic.org |
32 |
|
|
%prep |
33 |
|
|
%setup |
34 |
|
|
|
35 |
|
|
|
36 |
|
|
%install |
37 |
|
|
rm -rf $RPM_BUILD_ROOT |
38 |
|
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
39 |
|
|
rm -f %{name}-%{version}-filelist |
40 |
|
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
41 |
|
|
| grep -v "/etc/sysconfig/subsonic" \ |
42 |
|
|
> %{name}-%{version}-filelist |
43 |
|
|
|
44 |
|
|
%clean |
45 |
|
|
rm -rf $RPM_BUILD_ROOT |
46 |
|
|
|
47 |
|
|
%files -f %{name}-%{version}-filelist |
48 |
|
|
%defattr(-,root,root) |
49 |
|
|
%config(noreplace) /etc/sysconfig/subsonic |
50 |
|
|
#%files |
51 |
|
|
#%defattr(644,root,root,755) |
52 |
|
|
#/usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar |
53 |
|
|
#/usr/share/subsonic/subsonic.war |
54 |
|
|
#%attr(755,root,root) /usr/share/subsonic/subsonic.sh |
55 |
|
|
#%attr(755,root,root) /etc/init.d/subsonic |
56 |
|
|
#%attr(755,root,root) /var/subsonic/transcode/ffmpeg |
57 |
|
|
#%attr(755,root,root) /var/subsonic/transcode/lame |
58 |
|
|
#%config(noreplace) /etc/sysconfig/subsonic |
59 |
|
|
|
60 |
|
|
%pre |
61 |
|
|
# Stop Subsonic service. |
62 |
|
|
if [ -e /etc/init.d/subsonic ]; then |
63 |
|
|
service subsonic stop |
64 |
|
|
fi |
65 |
|
|
|
66 |
|
|
# Backup database. |
67 |
|
|
if [ -e /var/subsonic/db ]; then |
68 |
|
|
rm -rf /var/subsonic/db.backup |
69 |
|
|
cp -R /var/subsonic/db /var/subsonic/db.backup |
70 |
|
|
fi |
71 |
|
|
|
72 |
|
|
exit 0 |
73 |
|
|
|
74 |
|
|
%post |
75 |
|
|
ln -sf /usr/share/subsonic/subsonic.sh /usr/bin/subsonic |
76 |
|
|
chmod 750 /var/subsonic |
77 |
|
|
|
78 |
|
|
# Clear jetty cache. |
79 |
|
|
rm -rf /var/subsonic/jetty |
80 |
|
|
|
81 |
|
|
# For SELinux: Set security context |
82 |
|
|
chcon -t java_exec_t /etc/init.d/subsonic 2>/dev/null |
83 |
|
|
|
84 |
|
|
# Configure and start Subsonic service. |
85 |
|
|
chkconfig --add subsonic |
86 |
|
|
service subsonic start |
87 |
|
|
|
88 |
|
|
exit 0 |
89 |
|
|
|
90 |
|
|
%preun |
91 |
|
|
# Only do it if uninstalling, not upgrading. |
92 |
|
|
if [ $1 = 0 ] ; then |
93 |
|
|
|
94 |
|
|
# Stop the service. |
95 |
|
|
[ -e /etc/init.d/subsonic ] && service subsonic stop |
96 |
|
|
|
97 |
|
|
# Remove symlink. |
98 |
|
|
rm -f /usr/bin/subsonic |
99 |
|
|
|
100 |
|
|
# Remove startup scripts. |
101 |
|
|
chkconfig --del subsonic |
102 |
|
|
|
103 |
|
|
fi |
104 |
|
|
|
105 |
|
|
exit 0 |
106 |
|
|
|