SHA256
1
0
forked from pool/acct
acct/acct.spec

125 lines
3.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package acct
#
# Copyright (c) 2015 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 http://bugs.opensuse.org/
#
Name: acct
Version: 6.6.2
Release: 0
Source: http://ftp.gnu.org/gnu/acct/%{name}-%{version}.tar.gz
Source4: http://ftp.gnu.org/gnu/acct/%{name}-%{version}.tar.gz.sig
Source5: %name.keyring
Source1: acct.service
Source2: logrotate.acct
Source3: accton-create
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}-%{version}-hz.patch
Patch2: %{name}-info.patch
Patch3: %{name}-ac.patch
Url: http://www.gnu.org/software/acct/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: User-Specific Process Accounting
License: GPL-2.0+
Group: System/Base
%description
This package contains the programs necessary for user-specific process
accounting: sa, accton, and lastcomm.
%prep
%setup -q
%patch -p1
%patch2 -p1
%patch3 -p1
%build
autoreconf -ivf
%configure
make %{?_smp_mflags} CC="%{__cc}" CXX="%{__cxx}"
%install
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 %{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 %{_localstatedir}/account/pacct"
%{_libexecdir}/account/create
%install_info --info-dir=%{_infodir} %{_infodir}/accounting.info.gz
%service_add_post acct.service
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/accounting.info.gz
%service_del_preun acct.service
%postun
%service_del_postun acct.service
%files
%defattr(-, root, root)
%doc README NEWS
%doc %{_infodir}/*.info.*
%doc %{_mandir}/man1/ac*
%doc %{_mandir}/man1/lastcomm*
%doc %{_mandir}/man8/*
%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