File gnump3d.spec of Package gnump3d

#
# spec file for package gnump3d (Version 3.0)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           gnump3d
Url:            http://www.gnump3d.org
BuildRequires:  pwdutils
License:        GPL v2 or later
Group:          Productivity/Networking/Web/Servers
AutoReqProv:    on
Version:        3.0
Release:        2
Summary:        GNU MP3 Streaming Server
Requires:       logrotate
PreReq:         /usr/sbin/useradd coreutils
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       perl >= 5.8.8
Source:         gnump3d-%{version}.tar.bz2
Source2:        gnump3d-rpmlintrc
Source1:        gnump3d.init
Source2:        gnump3d.logrotate
Patch:          gnump3d-Makefile.patch

%description
gnump3d is a simple server that allows you to stream MP3s and OGG
Vorbis files across a network.



%prep
%setup -q
%patch0

%build

%install
rm -Rf $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT
install -d -m 755 $RPM_BUILD_ROOT/etc/init.d
install -d -m 755 $RPM_BUILD_ROOT/var/log/gnump3d
install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d
install -d -m 755 $RPM_BUILD_ROOT/usr/sbin
install -d -m 755 $RPM_BUILD_ROOT/srv/mp3
install -d -m 755 $RPM_BUILD_ROOT/var/cache/gnump3d
install -d -m 755 $RPM_BUILD_ROOT/var/cache/gnump3d/serving
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/gnump3d
make PREFIX=/usr DESTDIR=$RPM_BUILD_ROOT install
# Install inetd init script
install -m 744 %SOURCE1 $RPM_BUILD_ROOT/etc/init.d/gnump3d
(cd $RPM_BUILD_ROOT && ln -sf /etc/init.d/gnump3d usr/sbin/rcgnump3d)
(cd $RPM_BUILD_ROOT/usr/bin && ln -sfn gnump3d2 gnump3d) 

%clean
rm -rf $RPM_BUILD_ROOT

%pre
/usr/sbin/useradd -r -o -g nogroup -u 63 -s /bin/false -c "GNUMP3 daemon" -d /var/lib/nobody gnump3d 2> /dev/null || :

%post
# if there is no access.log file, create one with correct permissions.
# gnump3d does not do this.
test -f /var/log/gnump3d/access.log || {
  touch /var/log/gnump3d/access.log;
  chmod 640 /var/log/gnump3d/access.log;
  chown gnump3d /var/log/gnump3d/access.log
}

%preun
%stop_on_removal gnump3d

%postun
%restart_on_update gnump3d
%insserv_cleanup

%files
%defattr(-,root,root)
%doc COPYING AUTHORS README TODO
%doc %{_mandir}/man1/gnump3d-index.1.gz
%doc %{_mandir}/man1/gnump3d-top.1.gz
%doc %{_mandir}/man1/gnump3d.1.gz
%doc %{_mandir}/man1/gnump3d.conf.1.gz
%dir %{_sysconfdir}/gnump3d
%attr(644, root, root) %config %{_sysconfdir}/gnump3d/mime.types
%attr(644, root, root) %config(noreplace) %{_sysconfdir}/gnump3d/gnump3d.conf
%attr(644, root, root) %config %{_sysconfdir}/gnump3d/file.types
%dir %{_datadir}/gnump3d
%doc %{_datadir}/gnump3d/README
%{_datadir}/gnump3d/Avalon
%{_datadir}/gnump3d/LaFrere
%{_datadir}/gnump3d/Tabular
%{_datadir}/gnump3d/Thexder
%{_datadir}/gnump3d/default
%{_datadir}/gnump3d/dotNET
%{_datadir}/gnump3d/nausicaa
%{_datadir}/gnump3d/redgrey
%{_datadir}/gnump3d/simple
%{_datadir}/gnump3d/Clean
%{_datadir}/gnump3d/SchwartzNGrau
%{_datadir}/gnump3d/BlueBox
%{_datadir}/gnump3d/Liquid
%{_datadir}/gnump3d/Musicus
%{_datadir}/gnump3d/Nomad
%{_datadir}/gnump3d/handheld
%{_prefix}/lib/perl5/*/gnump3d
%{_bindir}/gnump3d
%{_bindir}/gnump3d2
%{_bindir}/gnump3d-index
%{_bindir}/gnump3d-top
%{_sbindir}/rcgnump3d
%config %{_sysconfdir}/init.d/gnump3d
%config(noreplace) %{_sysconfdir}/logrotate.d/gnump3d
%attr(755,gnump3d,root) %dir %{_var}/log/gnump3d
%attr(755,gnump3d,root) %dir %{_var}/cache/gnump3d
%attr(755,gnump3d,root) %dir %{_var}/cache/gnump3d/serving
%attr(755,root,root) %dir /srv/mp3

%changelog
* Tue Dec 04 2007 - pth@suse.de
- Fix Makefile.
- Make installation paths relative
- Fix file list
- add a rpmlintrc file
* Mon Dec 03 2007 - pth@suse.de
- Update to 3.0:
  - Removed several perl warnings.
  - Removed password protection as being broken beyond repair.
  (This also fixes CVE-2007-6130, see #344592)
* Fri Mar 30 2007 - ro@suse.de
- added pwdutils to buildreq
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Dec 01 2005 - stark@suse.de
- Update to version 2.9.8
* Thu Sep 15 2005 - kukuk@suse.de
- Update to version 2.9.5
- Don't mark themes as config, if somebody modifies them, he
  should choose a new name.
* Wed May 19 2004 - kukuk@suse.de
- Update to version 2.8
* Tue Feb 24 2004 - hmacht@suse.de
- building as non-root
* Wed Jan 28 2004 - tsieden@suse.de
- Removed the "german umlauts" fix because it will break the
  UTF-8 compatibility
* Mon Jan 26 2004 - tsieden@suse.de
-  Update to 2.6
-  Fix handling of german umlauts in generated playlists
* Sat Dec 20 2003 - tsieden@suse.de
- added 'next unless $data;' to gnump3d2 (bug #33066)
  (originated by mls@suse.de)
* Fri Aug 29 2003 - kukuk@suse.de
- Call useradd with -r for system account [Bug #29611]
* Wed Jul 30 2003 - kukuk@suse.de
- Try to restart the server on update
* Fri Jul 25 2003 - kukuk@suse.de
- Update to 2.5b
* Mon Feb 17 2003 - kukuk@suse.de
- Update to 2.2 (reimplemented in perl)
* Fri Jan 10 2003 - kukuk@suse.de
- Update to final 1.0 release
* Fri Aug 30 2002 - kukuk@suse.de
- Add own "gnump3d" user, so that logfiles are not owned by nobody.
- Fix handling of logfiles after rotation (gnump3d creates the
  first log file as root and tries to modify it later as gnump3d).
- Add config file for logroration
* Sat Aug 24 2002 - kukuk@suse.de
- Update to final tar archive for 1.0-pre1 (includes libtool fixes)
* Mon Aug 12 2002 - kukuk@suse.de
- Update to current CVS version
* Wed Jul 24 2002 - kukuk@suse.de
- Initial version
openSUSE Build Service is sponsored by