File seccheck.spec of Package seccheck

#
# spec file for package seccheck
#
# 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 http://bugs.opensuse.org/
#


#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
  %define _fillupdir /var/adm/fillup-templates
%endif

Name:           seccheck
Version:        3.0
Release:        0
Summary:        Security-Check Scripts
License:        GPL-2.0+
Group:          Productivity/Security
Source0:        https://github.com/vpereira/seccheck/archive/master.zip
Source1:        cron_entries
Source2:        sysconfig.seccheck
BuildRequires:  unzip
Requires:       bash
Requires:       cron
# FIXME: use proper Requires(pre/post/preun/...)
PreReq:         %fillup_prereq
Provides:       suse-security-check-3.0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Regularly executable scripts (via cron) for checking the security of
your system.

%prep
%setup -q -n seccheck-master

%install
install -d -m 700 %{buildroot}%{_localstatedir}/lib/secchk
install -d -m 700 %{buildroot}%{_localstatedir}/lib/secchk/data
install -d -m 750 %{buildroot}%{_libexecdir}/secchk
install -d -m 755 %{buildroot}%{_libexecdir}/secchk/blurbs
install -d -m 755 %{buildroot}%{_prefix}/doc/packages/secchk
install -d -m 755 %{buildroot}%{_sysconfdir}/cron.d
install -m 600 crontab.security %{buildroot}%{_sysconfdir}/cron.d/seccheck
install -m 600 crontab.autologout %{buildroot}%{_sysconfdir}/cron.d/autologout
install -m 740 *.sh %{buildroot}%{_libexecdir}/secchk/
install -m 640 *.inc %{buildroot}%{_libexecdir}/secchk/
install -m 640 blurbs/*.txt %{buildroot}%{_libexecdir}/secchk/blurbs
install -m 740 checkneverlogin %{buildroot}%{_libexecdir}/secchk/
install -d %{buildroot}%{_fillupdir}
install -m 644 $RPM_SOURCE_DIR/sysconfig.seccheck %{buildroot}%{_fillupdir}/
install -d -m 755 %{buildroot}%{_sysconfdir}/security
install -m 644 autologout.conf %{buildroot}%{_sysconfdir}/security/

%files
%defattr(-,root,root)
%doc TODO CHANGES README LICENCE
%{_libexecdir}/secchk
%config %{_sysconfdir}/cron.d/seccheck
%config %{_sysconfdir}/cron.d/autologout
#%config /etc/cron.daily/seccheck
#%config /etc/cron.weekly/seccheck
#%config /etc/cron.monthly/seccheck
%dir %{_localstatedir}/lib/secchk
%dir %{_localstatedir}/lib/secchk/data
%{_fillupdir}/sysconfig.seccheck
%config %{_sysconfdir}/security/autologout.conf

%post
%fillup_only

%changelog
openSUSE Build Service is sponsored by