Hello community,

here is the log from the commit of package acct for openSUSE:Factory checked in 
at 2014-03-21 13:28:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/acct (Old)
 and      /work/SRC/openSUSE:Factory/.acct.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "acct"

Changes:
--------
--- /work/SRC/openSUSE:Factory/acct/acct.changes        2013-12-23 
22:23:23.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.acct.new/acct.changes   2014-03-21 
13:28:28.000000000 +0100
@@ -1,0 +2,7 @@
+Mon Mar 17 10:41:47 UTC 2014 - [email protected]
+
+- cleanup of acct
+  * Add install section in service unit (bnc#867138)
+  * Add a simple script to create pacct file
+
+-------------------------------------------------------------------

New:
----
  accton-create

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ acct.spec ++++++
--- /var/tmp/diff_new_pack.AIBhGm/_old  2014-03-21 13:28:29.000000000 +0100
+++ /var/tmp/diff_new_pack.AIBhGm/_new  2014-03-21 13:28:29.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package acct
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 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
@@ -17,22 +17,36 @@
 
 
 Name:           acct
-PreReq:         fileutils %install_info_prereq
 Version:        6.6.1
 Release:        0
 Source:         %{name}-%{version}.tar.gz
 Source1:        acct.service
 Source2:        logrotate.acct
+Source3:        accton-create
 Source10:       %{name}-%{version}.tar.gz.sig
 Source11:       %{name}.keyring
 BuildRequires:  gpg-offline
 BuildRequires:  libtool
+%if %suse_version >= 1310
+BuildRequires:  systemd-rpm-macros
+%else
 BuildRequires:  systemd
+%endif
 %{?systemd_requires}
 %if %suse_version >= 1230
 BuildRequires:  makeinfo
 %endif
 Requires:       logrotate
+Requires(pre):  fileutils
+Requires(pre):  coreutils
+Requires(preun): fileutils
+Requires(preun): coreutils
+Requires(post): %install_info_prereq
+Requires(post): fileutils
+Requires(post): coreutils
+Requires(postun): %install_info_prereq
+Requires(postun): fileutils
+Requires(postun): coreutils
 Patch:          %{name}-hz.patch
 Patch2:         %{name}-info.patch
 Patch3:         %{name}-ac.patch
@@ -54,37 +68,34 @@
 %patch3 -p1
 
 %build
-%define prefix   /usr
-%define sysconfdir /etc
 autoreconf -ivf
-CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure \
-                                                  --mandir=%{_mandir} \
-                                                  --prefix=%{prefix} \
-                                                  --infodir=%{_infodir} \
-                                                  --sysconfdir=%{sysconfdir}
+%configure
 make %{?_smp_mflags} CC="%{__cc}" CXX="%{__cxx}" 
 
 %install
-make DESTDIR=$RPM_BUILD_ROOT install CC="%{__cc}" CXX="%{__cxx}"
-install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d
-install -d -m 755 $RPM_BUILD_ROOT/%{_unitdir}
-install -m 644 %{S:1} $RPM_BUILD_ROOT/%{_unitdir}/acct.service
-install -m 644 %{S:2}  $RPM_BUILD_ROOT/etc/logrotate.d/acct
-install -d -m 755 $RPM_BUILD_ROOT/var/account/
-touch $RPM_BUILD_ROOT/var/account/pacct
-chmod 600 $RPM_BUILD_ROOT/var/account/pacct
-cd $RPM_BUILD_ROOT/usr/sbin/
+install -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d
+install -d -m 755 %{buildroot}/%{_unitdir}
+install -d -m 755 %{buildroot}%{_localstatedir}/account/
+install -d -m 755 %{buildroot}%{_libexecdir}/account
+install -d -m 755 %{buildroot}%{_sbindir}
+install -d -m 755 %{buildroot}%{_bindir}
+%make_install CC="%{__cc}" CXX="%{__cxx}"
+install -m 644 %{S:1} %{buildroot}/%{_unitdir}/acct.service
+install -m 644 %{S:2}  %{buildroot}%{_sysconfdir}/logrotate.d/acct
+> %{buildroot}%{_localstatedir}/account/pacct
+chmod 600 %{buildroot}%{_localstatedir}/account/pacct
+cd %{buildroot}/usr/sbin/
 ln -sf service rcacct
-rm -f $RPM_BUILD_ROOT/usr/bin/last
-rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/last.1*
+rm -f %{buildroot}/usr/bin/last
+rm -f %{buildroot}/%{_mandir}/man1/last.1*
+install -m 0755 %{S:3} %{buildroot}%{_libexecdir}/account/create
 
 %pre
 %service_add_pre acct.service
 
 %post
-echo "Creating /var/account/pacct"
-touch var/account/pacct
-chmod 600 var/account/pacct
+echo "Creating %{_localstatedir}/account/pacct"
+%{_libexecdir}/account/create
 %install_info --info-dir=%{_infodir} %{_infodir}/accounting.info.gz
 %service_add_post acct.service
 
@@ -102,12 +113,14 @@
 %doc %{_mandir}/man1/ac*
 %doc %{_mandir}/man1/lastcomm*
 %doc %{_mandir}/man8/*
-%dir /var/account
-%attr(600, root, root) %ghost /var/account/pacct
-%config /etc/logrotate.d/acct
-/usr/bin/ac
-/usr/bin/lastcomm
-/usr/sbin/*
+%dir %{_localstatedir}/account
+%attr(600, root, root) %ghost %{_localstatedir}/account/pacct
+%config %{_sysconfdir}/logrotate.d/acct
+%{_bindir}/ac
+%{_bindir}/lastcomm
+%{_sbindir}/*
 %{_unitdir}/acct.service
+%dir %{_libexecdir}/account
+%{_libexecdir}/account/create
 
 %changelog


++++++ acct.service ++++++
--- /var/tmp/diff_new_pack.AIBhGm/_old  2014-03-21 13:28:29.000000000 +0100
+++ /var/tmp/diff_new_pack.AIBhGm/_new  2014-03-21 13:28:29.000000000 +0100
@@ -1,11 +1,15 @@
 [Unit]
 Description=Process accounting
 Documentation=man:accton(8)
+After=syslog.target
+ConditionPathExists=/var/account
 
 [Service]
 Type=oneshot
 RemainAfterExit=true
-ExecStartPre=/bin/sh -c 'test -e /var/account/pacct || touch 
/var/account/pacct'
+ExecStartPre=/usr/libexec/account/create
 ExecStart=/usr/sbin/accton /var/account/pacct
 ExecStop=/usr/sbin/accton off
 
+[Install]
+WantedBy=multi-user.target

++++++ accton-create ++++++
#!/bin/bash
ACCTFILE=/var/account/pacct
if test ! -e $ACCTFILE
then
    umask 066
    > $ACCTFILE
fi
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to