File acct.spec of Package acct

# spec file for package acct
# Copyright (c) 2017 SUSE LINUX 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

Name:           acct
Version:        6.6.2
Release:        0
Summary:        User-Specific Process Accounting
License:        GPL-2.0+
Group:          System/Base
Source1:        acct.service
Source2:        logrotate.acct
Source4:        %{name}.keyring
Patch0:         %{name}-%{version}-hz.patch
Patch2:         %{name}-info.patch
Patch3:         %{name}-ac.patch
BuildRequires:  libtool
BuildRequires:  makeinfo
BuildRequires:  systemd-rpm-macros
Requires:       logrotate
Requires(post): %{install_info_prereq}
Requires(postun): %{install_info_prereq}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This package contains the programs necessary for user-specific process
accounting: sa, accton, and lastcomm.

%setup -q
%patch0 -p1
%patch2 -p1
%patch3 -p1

autoreconf -ivf
make %{?_smp_mflags}

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}

install -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}/acct.service
ln -sf service %{buildroot}%{_sbindir}/rcacct

install -m 644 %{SOURCE2}  %{buildroot}%{_sysconfdir}/logrotate.d/acct
mkdir -p %{buildroot}%{_localstatedir}/log/account
touch %{buildroot}%{_localstatedir}/log/account/pacct

rm -f %{buildroot}%{_bindir}/last
rm -f %{buildroot}/%{_mandir}/man1/last.1*

%service_add_pre acct.service

%install_info --info-dir=%{_infodir} %{_infodir}/
%service_add_post acct.service

%install_info_delete --info-dir=%{_infodir} %{_infodir}/
%service_del_preun acct.service

%service_del_postun acct.service

%defattr(-, root, root)
%config %{_sysconfdir}/logrotate.d/acct
%dir %{_localstatedir}/log/account

openSUSE Build Service is sponsored by