File gnump3d.spec of Package gnump3d

# spec file for package gnump3d (Version 3.0)
# Copyright (c) 2009 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

# norootforbuild

Name:           gnump3d
BuildRequires:  pwdutils
License:        GPL v2 or later
Group:          Productivity/Networking/Web/Servers
AutoReqProv:    on
Version:        3.0
Release:        79
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
Source3:        gnump3d-rpmlintrc
Source1:        gnump3d.init
Source2:        gnump3d.logrotate
Patch:          gnump3d-Makefile.patch

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

%setup -q


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
# 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) 


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

# 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

%stop_on_removal gnump3d

%restart_on_update gnump3d

%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
%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

openSUSE Build Service is sponsored by