There were messages like the following in system log after at daemon was disabled: 2014-01-03T09:19:51.172618+01:00 fmn systemd-sleep[13167]: /usr/lib/systemd/system-sleep/atd.sh exited with exit status 1. These are a result of the atd.sh script leaking the exit code of systemctl. This change to at.sleep prevents leaking systemctl exit code as well as simplifies the script. OBS-URL: https://build.opensuse.org/request/show/213467 OBS-URL: https://build.opensuse.org/package/show/Base:System/at?expand=0&rev=74
204 lines
5.7 KiB
RPMSpec
204 lines
5.7 KiB
RPMSpec
#
|
|
# spec file for package at
|
|
#
|
|
# 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
|
|
# 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: at
|
|
BuildRequires: autoconf >= 2.69
|
|
BuildRequires: automake
|
|
BuildRequires: bison
|
|
BuildRequires: flex
|
|
BuildRequires: libselinux-devel
|
|
BuildRequires: pam-devel
|
|
Url: ftp://ftp.debian.org/debian/pool/main/a/at
|
|
Version: 3.1.13
|
|
Release: 0
|
|
Summary: A Job Manager
|
|
License: GPL-2.0+
|
|
Group: System/Daemons
|
|
Source: at_3.1.13.orig.tar.gz
|
|
Source1: atd.init
|
|
Source2: atd.pamd
|
|
Source3: sysconfig.atd
|
|
Source4: at.sleep
|
|
Source5: atd.service
|
|
Patch0: %{name}-3.1.13.patch
|
|
Patch4: %{name}-3.1.13-joblist.patch
|
|
Patch5: %{name}-3.1.13-selinux.patch
|
|
Patch6: %{name}-3.1.13-pie.patch
|
|
Patch7: %{name}-3.1.8-eal3-manpages.patch
|
|
## no bugs anymore for patch8. Just paranoia checking
|
|
Patch8: %{name}-3.1.13-formatbugs.patch
|
|
Patch9: %{name}-3.1.13-pam.patch
|
|
Patch10: %{name}-3.1.13-massive_batch.patch
|
|
Patch11: %{name}-3.1.13-documentation-dir.patch
|
|
Patch12: %{name}-3.1.13-queue-nice-level.patch
|
|
# PATCH-FIX-UPSTREAM pam-session-as-root (bnc#408986, bnc#239210)
|
|
Patch14: %{name}-3.1.13-pam-session-as-root.patch
|
|
# PATCH-FIX-UPSTREAM clean-up opened descriptors (bnc#533454, bnc#523346)
|
|
Patch15: %{name}-3.1.13-leak-fix.patch
|
|
#PATCH-FIX-OPENSUSE add proper system users to the deny list
|
|
Patch16: at-3.1.8-denylist.patch
|
|
#PATCH-FIX-UPSTREAM plan jobs with past time to tomorrow (bnc#672586)
|
|
Patch17: %{name}-3.1.13-tomorrow.patch
|
|
#PATCH-FIX-UPSTREAM wrong mtime handling of jobdir (bnc#680113)
|
|
Patch19: %{name}-3.1.8-jobdir-mtime.patch
|
|
Patch20: at-parse-suse-sysconfig.patch
|
|
#PATCH-FIX-UPSTREAM fix makefile dependencies
|
|
Patch21: at-makefile-deps.patch
|
|
#PATCH-FIX-OPENSUSE Set pid dir to /run not /var/run
|
|
Patch22: at-piddir.patch
|
|
Patch23: at-secure_getenv.patch
|
|
#PATCH-FIX-OPENSUSE backport privs from 3.1.8 (bnc#849720)
|
|
Patch24: at-backport-old-privs.patch
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
PreReq: %{_sbindir}/useradd %{_sbindir}/groupadd %fillup_prereq %insserv_prereq
|
|
PreReq: permissions
|
|
Recommends: smtp_daemon
|
|
%if 0%{?suse_version} > 1140
|
|
BuildRequires: libHX-devel
|
|
BuildRequires: pkgconfig
|
|
BuildRequires: pkgconfig(systemd)
|
|
%{?systemd_requires}
|
|
%define has_systemd 1
|
|
%endif
|
|
|
|
%description
|
|
This program allows you to run jobs at specified times.
|
|
|
|
%prep
|
|
%setup -q
|
|
%patch0
|
|
%patch4
|
|
%patch5
|
|
%patch6
|
|
%patch7
|
|
%patch8
|
|
%patch9
|
|
%patch10
|
|
%patch11
|
|
%patch12
|
|
%patch14
|
|
%patch15
|
|
%patch16
|
|
%patch17 -p1
|
|
%patch19
|
|
%patch20 -p1
|
|
%patch21 -p1
|
|
%patch22
|
|
%patch23 -p1
|
|
%patch24 -p1
|
|
|
|
%build
|
|
rm -fv y.tab.c y.tab.h lex.yy.c lex.yy.o y.tab.o
|
|
autoreconf -fiv
|
|
export SENDMAIL=%{_sbindir}/sendmail
|
|
%configure \
|
|
--with-pam \
|
|
--with-selinux \
|
|
--with-daemon_username=at \
|
|
--with-daemon_groupname=at
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
%install
|
|
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
|
|
mkdir -p $RPM_BUILD_ROOT/usr/{bin,sbin,share/man/man{1,5,8}}
|
|
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
|
export CFLAGS="$RPM_OPT_FLAGS"
|
|
export SENDMAIL=%{_sbindir}/sendmail
|
|
make install IROOT=$RPM_BUILD_ROOT
|
|
# Don't install docs here in this way
|
|
mkdir docs
|
|
mv $RPM_BUILD_ROOT/%{_prefix}/doc/at/* docs/
|
|
|
|
%if ! %{has_systemd}
|
|
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
|
install %SOURCE1 $RPM_BUILD_ROOT/etc/init.d/atd
|
|
ln -sf ../../etc/init.d/atd $RPM_BUILD_ROOT%{_sbindir}/rcatd
|
|
%else
|
|
install -D -m 0644 %{S:5} %{buildroot}%{_unitdir}/atd.service
|
|
%{__install} -D -m 0755 %{S:4} %{buildroot}%{_prefix}/lib/systemd/system-sleep/atd.sh
|
|
ln -sf ../../%{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcatd
|
|
%endif
|
|
|
|
install -m644 %SOURCE2 $RPM_BUILD_ROOT/etc/pam.d/atd
|
|
install -m644 %SOURCE3 $RPM_BUILD_ROOT/var/adm/fillup-templates
|
|
|
|
%pre
|
|
%{_sbindir}/groupadd -g 25 -o -r at 2> /dev/null || :
|
|
%{_sbindir}/useradd -r -o -g at -u 25 -s /bin/bash -c "Batch jobs daemon" -d /var/spool/atjobs at 2> /dev/null || :
|
|
%if 0%{?has_systemd}
|
|
%service_add_pre atd.service
|
|
%endif
|
|
|
|
%preun
|
|
%stop_on_removal atd
|
|
%if 0%{?has_systemd}
|
|
%service_del_preun atd.service
|
|
%endif
|
|
|
|
%post
|
|
# update hack
|
|
# the rcscript used to be /etc/init.d/at
|
|
if [ -f etc/init.d/at ] ; then
|
|
rm -f etc/init.d/at
|
|
%{insserv_cleanup}
|
|
fi
|
|
%set_permissions /usr/bin/at
|
|
%if 0%{?has_systemd}
|
|
%service_add_post atd.service
|
|
%else
|
|
%{fillup_and_insserv -n atd atd }
|
|
%endif
|
|
|
|
%verifyscript
|
|
%verify_permissions -e /usr/bin/at
|
|
|
|
%postun
|
|
%insserv_cleanup
|
|
%if 0%{?has_systemd}
|
|
%service_del_postun atd.service
|
|
%else
|
|
%restart_on_update atd
|
|
%endif
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%doc Problems Copyright COPYING README ChangeLog timespec
|
|
%config(noreplace) /etc/at.deny
|
|
%{_sbindir}/rcatd
|
|
%config %attr(644,root,root) /etc/pam.d/atd
|
|
%verify(not mode) %attr(4750,root,trusted) %{_bindir}/at
|
|
%{_bindir}/atq
|
|
%{_bindir}/atrm
|
|
%{_bindir}/batch
|
|
%{_mandir}/man?/*
|
|
%{_sbindir}/atd
|
|
%{_sbindir}/atrun
|
|
%attr(700,at,at) %dir /var/spool/atspool
|
|
%attr(1770,at,at) %dir /var/spool/atjobs
|
|
%attr(600,at,at) /var/spool/atjobs/.SEQ
|
|
/var/adm/fillup-templates/sysconfig.atd
|
|
%if 0%{?has_systemd}
|
|
%{_unitdir}/atd.service
|
|
%{_prefix}/lib/systemd/system-sleep/atd.sh
|
|
%else
|
|
%config /etc/init.d/atd
|
|
%endif
|
|
|
|
%changelog
|