Summary: The GNU Streaming MP3 / OGG Vorbis Server Name: gnump3d Version: 3.0 Release: 5%{?dist} License: GPLv2+ Group: Applications/Multimedia URL: http://www.gnu.org/software/gnump3d/ Source0: http://savannah.gnu.org/download/gnump3d/%{name}-%{version}.tar.bz2 Source1: gnump3d.service Source2: gnump3d.logrotate Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Provides: perl(gnump3d::readtags) Requires(pre): shadow-utils Requires(post): chkconfig, systemd-units Requires(postun): systemd-units Requires(preun): chkconfig, systemd-units %description GNUMP3d is a streaming server for MP3's, OGG vorbis, and other streamable audio files. It is designed to be: * Small, stable, self-contained, and secure. * Simple to install, configure, and use. * Portable across different varieties of Unix. %prep %setup -q cat %{SOURCE1} > %{name}.service cat %{SOURCE2} > %{name}.logrotate # fix locations... perl -pi \ -e 's|PLUGINDIR|%{perl_vendorlib}|;' \ -e 's|nobody|gnump3d|;' \ etc/gnump3d.conf %build %install rm -rf %{buildroot} make install PREFIX=%{buildroot} MANDIR=%{_mandir}/man1 LIBDIR=%{perl_vendorlib} pushd %{buildroot}%{_bindir} ln -sf gnump3d2 gnump3d popd install -D -m 755 %{name}.service %{buildroot}%{_unitdir}/%{name}.service install -D -m 644 %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} chmod 644 %{buildroot}%{perl_vendorlib}/gnump3d/mp4info.pm # create log files touch %{buildroot}%{_localstatedir}/cache/gnump3d/song.tags touch %{buildroot}%{_localstatedir}/log/gnump3d/access.log touch %{buildroot}%{_localstatedir}/log/gnump3d/error.log %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || \ /usr/sbin/useradd -r -g %{name} -d / -s /sbin/nologin \ -c "gnump3d Streaming Server" %{name} exit 0 %post if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %triggerun -- gnump3d < 3.0-5 # Save the current service runlevel info # User must manually run systemd-sysv-convert --apply gnump3d # to migrate them to systemd targets /usr/bin/systemd-sysv-convert --save gnump3d >/dev/null 2>&1 ||: # If the package is allowed to autostart: /bin/systemctl --no-reload enable gnump3d.service >/dev/null 2>&1 ||: # Run these because the SysV package being removed won't do them /sbin/chkconfig --del gnump3d >/dev/null 2>&1 || : /bin/systemctl try-restart gnump3d.service >/dev/null 2>&1 || : %preun # removing rpm - stop and remove service if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable gnump3d.service > /dev/null 2>&1 || : /bin/systemctl stop gnump3d.service > /dev/null 2>&1 || : fi %postun /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart gnump3d.service >/dev/null 2>&1 || : fi %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc AUTHORS DOWNSAMPLING README SUPPORT COPYING TODO ChangeLog %{_bindir}/%{name}* %{perl_vendorlib}/%{name} %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/gnump3d %{_unitdir}/gnump3d.service %config(noreplace) %{_sysconfdir}/%{name}/* %{_mandir}/man1/* %{_datadir}/gnump3d %dir %attr(755,gnump3d,gnump3d) %{_localstatedir}/log/gnump3d %dir %attr(755,gnump3d,gnump3d) %{_localstatedir}/cache/gnump3d %dir %attr(755,gnump3d,gnump3d) %{_localstatedir}/cache/gnump3d/serving %attr (644, gnump3d, gnump3d) %ghost %{_localstatedir}/cache/gnump3d/song.tags %attr (640, gnump3d, gnump3d) %ghost %{_localstatedir}/log/gnump3d/access.log %attr (640, gnump3d, gnump3d) %ghost %{_localstatedir}/log/gnump3d/error.log %changelog * Sun Sep 30 2012 Paulo Roma 3.0-5 - using systemd. * Sat Nov 20 2010 Paulo Roma 3.0-4 - fixed user and group creation. - removed Req perl and made logrotate.d/gnump3d config(noreplace). - changed license to GPLv2+. * Sat Apr 24 2010 Paulo Roma 3.0-3 - simplified spec. - fixed service-default-enabled warning. * Sun Feb 10 2008 Paulo Roma 3.0-2 - updated to 3.0 - added Provides perl(gnump3d::readtags). - Touching log files and installing them as ghost. * Mon Jan 15 2007 Paulo Roma 2.9.9.9-1 - updated to 2.9.9.9 - rebuilt for Fedora 6. * Wed May 19 2004 Guillaume Rousse 2.8-3mdk - fixed url (Eskild Hustvedt (Zero_Dogg) ) * Tue May 18 2004 Guillaume Rousse 2.8-2mdk - remove mpg321 dependency - create various files at install * Tue May 18 2004 Guillaume Rousse 2.8-1mdk - new release - spec cleanup * Sun May 16 2004 Oden Eriksson 1.0-3mdk - build release - fix deps * Thu Jan 16 2003 Oden Eriksson 1.0-2mdk - build release * Sun Dec 01 2002 Oden Eriksson 1.0-1mdk - initial cooker contrib, first attempt...