File icecast.spec of Package icecast
#
# spec file for package icecast
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: icecast
Version: 2.3.2
Release: 0
Summary: Audio Streaming Server
License: GPL-2.0+
Group: Productivity/Networking/Web/Servers
Url: http://www.icecast.org/
Source: %{name}-%{version}.tar.bz2
Source1: icecast.init
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0: icecast-2.3.1_runas_icecast_user.patch
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1: icecast-fix-no-add-needed.patch
Patch2: icecast-2.3.2-CVE-2011-4612.diff
BuildRequires: curl-devel
BuildRequires: libtheora-devel
BuildRequires: libtool
BuildRequires: libvorbis-devel
BuildRequires: libxslt-devel
BuildRequires: openssl-devel
BuildRequires: speex-devel
PreReq: %fillup_prereq
PreReq: %insserv_prereq
PreReq: /usr/sbin/groupadd
PreReq: /usr/sbin/useradd
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Icecast is a MP3 and OGG streaming server able to serve many clients
with MP3 and OGG audio.
%prep
%setup -q
%patch0
%patch1
%patch2 -p1
%build
autoreconf -fiv
%configure
make
%install
%make_install
rm -rf %{buildroot}%{_datadir}/doc/%{name}
# init script
install -d -m 0755 %{buildroot}%{_sbindir}
install -D -m 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/%{name}
ln -s -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
# create missing dirs
install -d -m 0755 %{buildroot}%{_localstatedir}/{lib,log}/%{name}
%clean
[ %{buildroot} != "/" -a -d %{buildroot} ] && rm -rf %{buildroot}
%pre
/usr/sbin/groupadd -r %{name} &>/dev/null || :
/usr/sbin/useradd -o -g %{name} -s /bin/false -r -c "Icecast streaming server" -d %{_localstatedir}/lib/%{name} %{name} &>/dev/null || :
%post
%fillup_and_insserv %{name}
%preun
%stop_on_removal %{name}
%postun
%restart_on_update %{name}
%insserv_cleanup
%files
%defattr(-,root,root)
%doc README AUTHORS COPYING NEWS TODO ChangeLog
%doc doc/*.html
%doc doc/*.jpg
%doc doc/*.css
%doc conf/*.dist
%config(noreplace) %attr(640,root,%{name}) %{_sysconfdir}/%{name}.xml
%{_bindir}/icecast
%{_datadir}/icecast
%{_sbindir}/rc%{name}
%{_sysconfdir}/init.d/%{name}
# TODO: enable chroot support in this dir
%{_localstatedir}/lib/%{name}
%attr(755,%{name},%{name}) %{_localstatedir}/log/%{name}
%changelog