[mpdscribble] Spec-file cleanup

Peter Lemenkov peter at fedoraproject.org
Fri Sep 6 14:07:45 UTC 2013


commit 70ecb970470cc1460fc132ce84d900aabc030dcb
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Fri Sep 6 18:07:20 2013 +0400

    Spec-file cleanup
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 mpdscribble.init.d |   61 -----------------------------------
 mpdscribble.spec   |   91 ++++++++++++---------------------------------------
 2 files changed, 22 insertions(+), 130 deletions(-)
---
diff --git a/mpdscribble.spec b/mpdscribble.spec
index 0a2c074..70449fa 100644
--- a/mpdscribble.spec
+++ b/mpdscribble.spec
@@ -1,37 +1,22 @@
-%if 0%{?fedora} > 17
-%global mpdscribble_user mpdscribble
-%global mpdscribble_group mpdscribble
-%else
-%global mpdscribble_user root
-%global mpdscribble_group root
-%endif
-
-
 Name:           mpdscribble
 Version:        0.22
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        A mpd client which submits information about tracks being played to Last.fm
 Group:          Applications/Multimedia
 License:        GPLv2+
 URL:            http://mpd.wikia.com/wiki/Client:Mpdscribble
 Source0:        http://downloads.sourceforge.net/musicpd/%{name}-%{version}.tar.bz2
-Source1:        %{name}.init.d
-Source2:        %{name}.service
-Source3:        %{name}.tmpfiles.conf
+Source1:        %{name}.service
+Source2:        %{name}.tmpfiles.conf
 BuildRequires:  glib2-devel libsoup-devel
 BuildRequires:  libmpdclient-devel >= 2.2
-#Initscripts
-%if 0%{?fedora} > 17
-# Users and groups
+BuildRequires:	autoconf
+BuildRequires:	automake
+BuildRequires:	libtool
 Requires(pre): shadow-utils
 Requires(post): systemd
 Requires(preun): systemd
 Requires(postun): systemd
-%else
-Requires(post): chkconfig
-Requires(preun):chkconfig
-Requires(preun):initscripts
-%endif
 
 
 %description
@@ -44,87 +29,55 @@ about tracks being played to Last.fm (formerly audioscrobbler)
 
 
 %build
+autoreconf -ivf
 %configure
 make %{?_smp_mflags}
 
 
 %install
-make install DESTDIR=$RPM_BUILD_ROOT
+make install DESTDIR=%{buildroot}
 
-%if 0%{?fedora} > 17
-install -D -m 0644 -p %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
-install -D -m 0644 -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf
-install -d $RPM_BUILD_ROOT%{_localstatedir}/run/%{name}
-%else
-#init scripts
-install -D -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}
-%endif
+install -D -m 0644 -p %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
+install -D -m 0644 -p %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf
+install -d %{buildroot}%{_localstatedir}/run/%{name}
 
 # Make room for logs
-install -d $RPM_BUILD_ROOT%{_localstatedir}/cache/%{name}
+install -d %{buildroot}%{_localstatedir}/cache/%{name}
+
+# Remove installed docs (this will mess with versione/unversioned docdirs)
+rm -rf %{buildroot}%{_defaultdocdir}
 
 
 %pre
-%if 0%{?fedora} > 17
 getent group %{name} >/dev/null || groupadd -r %{name}
 getent passwd %{name} >/dev/null || \
 useradd -r -g %{name} -d %{_localstatedir}/cache/%{name} -s /sbin/nologin \
 -c "Mpdscribble" %{name} 2>/dev/null || :
-%endif
 
 
 %post
-%if 0%{?fedora} > 17
 %systemd_post %{name}.service
-%else
-/sbin/chkconfig --add %{name}
-%endif
 
 
 %preun
-%if 0%{?fedora} > 17
 %systemd_preun %{name}.service
-%else
-if [ $1 = 0 ]; then
- /sbin/service %{name} stop > /dev/null 2>&1
- /sbin/chkconfig --del %{name}
-fi
-%endif
-
-
-%if 0%{?fedora} > 17
-%triggerun -- %{name} < 0.22
-# Save the current service runlevel info
-# User must manually run systemd-sysv-convert --apply opensips
-# to migrate them to systemd targets
-/usr/bin/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||:
-
-# Run these because the SysV package being removed won't do them
-/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
-/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
-
-chown -R %{mpdscribble_user}:%{mpdscribble_group} %{_localstatedir}/cache/%{name}
-chown -R %{mpdscribble_user}:%{mpdscribble_group} %{_sysconfdir}/%{name}.conf
-%endif
 
 
 %files
 %doc AUTHORS COPYING NEWS README
-%attr(0644,%{mpdscribble_user},%{mpdscribble_group}) %config(noreplace) %{_sysconfdir}/mpdscribble.conf
+%attr(0644,%{name},%{name}) %config(noreplace) %{_sysconfdir}/mpdscribble.conf
 %{_bindir}/mpdscribble
 %{_mandir}/man1/mpdscribble.1.gz
-%if 0%{?fedora} > 17
 %{_unitdir}/%{name}.service
-%{_sysconfdir}/tmpfiles.d/%{name}.conf
-%attr(0755, %{mpdscribble_user},%{mpdscribble_group}) %dir %{_localstatedir}/run/%{name}
-%else
-%{_sysconfdir}/rc.d/init.d/%{name}
-%endif
-%exclude %{_datadir}/doc/*
-%attr(0755,%{mpdscribble_user},%{mpdscribble_group}) %dir %{_localstatedir}/cache/%{name}
+%{_tmpfilesdir}/%{name}.conf
+%attr(0755,%{name},%{name}) %dir %{_localstatedir}/run/%{name}
+%attr(0755,%{name},%{name}) %dir %{_localstatedir}/cache/%{name}
 
 
 %changelog
+* Fri Sep 06 2013 Peter Lemenkov <lemenkov at gmail.com> - 0.22-6
+- Spec-file cleanup
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.22-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list