From e6928a7e3f76e1ea63f84f71cf5854cbb8313a69 Mon Sep 17 00:00:00 2001 From: Mariusz Mazur Date: Sat, 6 Jan 2007 00:26:38 +0000 Subject: [PATCH] - rel 1 with init script, dropping privs and logging Changed files: darkice.spec -> 1.26 --- darkice.spec | 57 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/darkice.spec b/darkice.spec index ae8f4bb..786e724 100644 --- a/darkice.spec +++ b/darkice.spec @@ -1,12 +1,18 @@ +# TODO: +# - logrotate support? +# - add /etc/sysconfig/darkice with log level selection and maybe not dropping +# privs (so that realtime=yes could work) +# - or some other way to keep realtime scheduling while not running as root Summary: DarkIce live IceCast / ShoutCast streamer Summary(pl): DarkIce - dostarczyciel strumieni IceCast/ShoutCast Name: darkice Version: 0.17.1 -Release: 0.1 +Release: 1 License: GPL Group: Networking/Daemons Source0: http://dl.sourceforge.net/darkice/%{name}-%{version}.tar.gz # Source0-md5: 91221134cec3d52af842a9d50c06ee7d +Source1: %{name}.init Patch0: %{name}-shared.patch Patch1: %{name}-no_libnsl.patch Patch2: %{name}-amd64.patch @@ -19,6 +25,20 @@ BuildRequires: libstdc++-devel BuildRequires: libvorbis-devel >= 1:1.0 BuildRequires: pkgconfig BuildRequires: readline-devel +BuildRequires: rpmbuild(macros) >= 1.165 +Requires(post,preun): /sbin/chkconfig +Requires(postun): /usr/sbin/groupdel +Requires(postun): /usr/sbin/userdel +Requires(pre): /bin/id +Requires(pre): /usr/bin/getgid +Requires(pre): /usr/lib/rpm/user_group.sh +Requires(pre): /usr/sbin/groupadd +Requires(pre): /usr/sbin/useradd +Requires(pre): /usr/sbin/usermod +Requires: daemon +Requires: rc-scripts +Provides: group(darkice) +Provides: user(darkice) BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -47,22 +67,53 @@ serwer %{__automake} %configure \ --with-lame \ - --with-vorbis + --with-vorbis \ + --with-alsa \ + --without-twolame \ + --without-faac %{__make} %install rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/var/run/darkice,/var/log} %{__make} install \ DESTDIR=$RPM_BUILD_ROOT +install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/darkice +touch $RPM_BUILD_ROOT/var/log/darkice.log + %clean rm -rf $RPM_BUILD_ROOT +%pre +%groupadd -g 85 darkice +%useradd -u 59 -r -d /usr/share/empty -s /bin/false -c "Darkice" -g darkice darkice +%addusertogroup darkice audio + +%post +/sbin/chkconfig --add darkice +%service darkice restart "darkice daemon" + +%preun +if [ "$1" = "0" ] ; then + %service darkice stop + /sbin/chkconfig --del darkice >&2 +fi + +%postun +if [ "$1" = "0" ]; then + %userremove darkice + %groupremove darkice +fi + %files %defattr(644,root,root,755) %doc AUTHORS ChangeLog NEWS README TODO -%config(noreplace) %attr(600,root,root) %{_sysconfdir}/*.cfg +%config(noreplace) %attr(640,root,darkice) %{_sysconfdir}/*.cfg +%attr(754,root,root) /etc/rc.d/init.d/darkice %attr(755,root,root) %{_bindir}/* %{_mandir}/man?/* +%dir %attr(775,root,darkice) /var/run/darkice +%attr(660,root,darkice) /var/log/darkice.log -- 2.44.0