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