bd38e4
%bcond_without pam
bd38e4
bd38e4
Summary:	Job spooling tools
bd38e4
Name:		at
bd38e4
Version:	3.1.13
bd38e4
Release:	18%{?dist}
bd38e4
# http://packages.debian.org/changelogs/pool/main/a/at/current/copyright
bd38e4
# + install-sh is MIT license with changes under Public Domain
bd38e4
License:	GPLv3+ and GPLv2+ and ISC and MIT and Public Domain
bd38e4
Group:		System Environment/Daemons
bd38e4
URL:		http://ftp.debian.org/debian/pool/main/a/at
bd38e4
bd38e4
Source:		http://ftp.debian.org/debian/pool/main/a/at/at_%{version}.orig.tar.gz
bd38e4
# git upstream source git://git.debian.org/git/collab-maint/at.git
bd38e4
Source1:	pam_atd
bd38e4
Source2:	atd.init
bd38e4
Source3:	atd.sysconf
bd38e4
Source5:	atd.systemd
bd38e4
bd38e4
Patch1:		at-3.1.13-makefile.patch
bd38e4
Patch2:		at-3.1.12-opt_V.patch
bd38e4
Patch3:		at-3.1.12-shell.patch
bd38e4
Patch4:		at-3.1.13-nitpicks.patch
bd38e4
Patch5:		at-3.1.13-pam.patch
bd38e4
Patch6:		at-3.1.13-selinux.patch
bd38e4
Patch7:		at-3.1.12-nowrap.patch
bd38e4
Patch8:		at-3.1.12-fix_no_export.patch 
bd38e4
Patch9:         at-3.1.13-mailwithhostname.patch
bd38e4
Patch10:        at-3.1.13-usePOSIXtimers.patch
bd38e4
Patch11:        at-3.1.13-help.patch
bd38e4
Patch12:        at-3.1.10-filter-environment.patch
bd38e4
bd38e4
BuildRequires: fileutils /etc/init.d
bd38e4
BuildRequires: flex flex-static bison autoconf
bd38e4
BuildRequires: libselinux-devel >= 1.27.9
bd38e4
BuildRequires: perl(Test::Harness)
bd38e4
BuildRequires: perl(Test::More)
bd38e4
bd38e4
%if %{with pam}
bd38e4
BuildRequires: pam-devel
bd38e4
%endif
bd38e4
Conflicts: crontabs <= 1.5
bd38e4
# No, I'm not kidding
bd38e4
BuildRequires: smtpdaemon
bd38e4
bd38e4
Requires(post): systemd-units
bd38e4
Requires(preun): systemd-units
bd38e4
Requires(postun): systemd-units
bd38e4
bd38e4
%description
bd38e4
At and batch read commands from standard input or from a specified
bd38e4
file. At allows you to specify that a command will be run at a
bd38e4
particular time. Batch will execute commands when the system load
bd38e4
levels drop to a particular level. Both commands use user's shell.
bd38e4
bd38e4
You should install the at package if you need a utility for
bd38e4
time-oriented job control. Note: If it is a recurring job that will
bd38e4
need to be repeated at the same time every day/week, etc. you should
bd38e4
use crontab instead.
bd38e4
bd38e4
%package sysvinit
bd38e4
Summary:	SysV init script for at
bd38e4
Group:		System Environment/Base
bd38e4
Requires:	%{name} = %{version}-%{release}
bd38e4
Requires(post): /sbin/chkconfig
bd38e4
bd38e4
%description sysvinit
bd38e4
SysV style init script for at. It needs to be installed only if systemd
bd38e4
is not used as the system init process.
bd38e4
bd38e4
%prep
bd38e4
%setup -q
bd38e4
cp %{SOURCE1} .
bd38e4
%patch1 -p1 -b .make
bd38e4
%patch2 -p1 -b .opt_V
bd38e4
%patch3 -p1 -b .shell
bd38e4
%patch4 -p1 -b .nit
bd38e4
%patch5 -p1 -b .pam
bd38e4
%patch6 -p1 -b .selinux
bd38e4
%patch7 -p1 -b .nowrap
bd38e4
%patch8 -p1 -b .export
bd38e4
%patch9 -p1 -b .mail
bd38e4
%patch10 -p1 -b .posix
bd38e4
%patch11 -p1 -b .help
bd38e4
%patch12 -p1 -b .filter-environment
bd38e4
bd38e4
%build
bd38e4
# patch9 touches configure.in
bd38e4
autoconf
bd38e4
# clean old pregenerated files
bd38e4
rm -f lex.yy.* y.tab.*
bd38e4
%configure --with-atspool=%{_localstatedir}/spool/at/spool \
bd38e4
	--with-jobdir=%{_localstatedir}/spool/at \
bd38e4
	--with-daemon_username=root  \
bd38e4
	--with-daemon_groupname=root \
bd38e4
	--with-selinux \
bd38e4
%if %{with pam}
bd38e4
	--with-pam
bd38e4
%endif
bd38e4
bd38e4
make
bd38e4
bd38e4
%install
bd38e4
make install \
bd38e4
	DAEMON_USERNAME=`id -nu`\
bd38e4
	DAEMON_GROUPNAME=`id -ng` \
bd38e4
	DESTDIR=%{buildroot}\
bd38e4
	sbindir=%{buildroot}%{_prefix}/sbin\
bd38e4
	bindir=%{buildroot}%{_bindir}\
bd38e4
	prefix=%{buildroot}%{_prefix}\
bd38e4
	exec_prefix=%{buildroot}%{_prefix}\
bd38e4
	docdir=%{buildroot}/usr/doc\
bd38e4
	mandir=%{buildroot}%{_mandir}\
bd38e4
	etcdir=%{buildroot}%{_sysconfdir} \
bd38e4
	ATJOB_DIR=%{buildroot}%{_localstatedir}/spool/at \
bd38e4
	ATSPOOL_DIR=%{buildroot}%{_localstatedir}/spool/at/spool \
bd38e4
	INSTALL_ROOT_USER=`id -nu` \
bd38e4
	INSTALL_ROOT_GROUP=`id -nu`;
bd38e4
bd38e4
echo > %{buildroot}%{_sysconfdir}/at.deny
bd38e4
mkdir docs
bd38e4
cp  %{buildroot}/%{_prefix}/doc/at/* docs/
bd38e4
bd38e4
mkdir -p %{buildroot}%{_sysconfdir}/pam.d
bd38e4
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pam.d/atd
bd38e4
bd38e4
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
bd38e4
install -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/rc.d/init.d/atd
bd38e4
bd38e4
mkdir -p %{buildroot}/etc/sysconfig
bd38e4
install -m 644 %{SOURCE3} %{buildroot}/etc/sysconfig/atd
bd38e4
bd38e4
# install systemd initscript
bd38e4
mkdir -p %{buildroot}/%{_unitdir}/
bd38e4
install -m 644 %{SOURCE5} %{buildroot}/%{_unitdir}/atd.service
bd38e4
bd38e4
# remove unpackaged files from the buildroot
bd38e4
rm -r  %{buildroot}%{_prefix}/doc
bd38e4
bd38e4
%check
bd38e4
make test
bd38e4
bd38e4
%post
bd38e4
touch %{_localstatedir}/spool/at/.SEQ
bd38e4
chmod 600 %{_localstatedir}/spool/at/.SEQ
bd38e4
chown daemon:daemon %{_localstatedir}/spool/at/.SEQ
bd38e4
%systemd_post atd.service
bd38e4
bd38e4
%preun
bd38e4
%systemd_preun atd.service
bd38e4
bd38e4
%postun
bd38e4
%systemd_postun_with_restart atd.service
bd38e4
bd38e4
%triggerun -- at < 3.1.12-6
bd38e4
# Save the current service runlevel info
bd38e4
# User must manually run systemd-sysv-convert --apply atd
bd38e4
# to migrate them to systemd targets
bd38e4
/usr/bin/systemd-sysv-convert --save atd
bd38e4
bd38e4
# The package is allowed to autostart:
bd38e4
/bin/systemctl enable atd.service >/dev/null 2>&1
bd38e4
bd38e4
/sbin/chkconfig --del atd >/dev/null 2>&1 || :
bd38e4
/bin/systemctl try-restart atd.service >/dev/null 2>&1 || :
bd38e4
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
bd38e4
bd38e4
%triggerpostun -n at-sysvinit -- at < 3.1.12-9
bd38e4
/sbin/chkconfig --add atd >/dev/null 2>&1 || :
bd38e4
bd38e4
%files
bd38e4
%doc docs/*
bd38e4
%attr(0644,root,root)		%config(noreplace) %{_sysconfdir}/at.deny
bd38e4
%attr(0644,root,root)		%config(noreplace) %{_sysconfdir}/sysconfig/atd
bd38e4
%attr(0700,daemon,daemon)	%dir %{_localstatedir}/spool/at
bd38e4
%attr(0600,daemon,daemon)	%verify(not md5 size mtime) %ghost %{_localstatedir}/spool/at/.SEQ
bd38e4
%attr(0700,daemon,daemon)	%dir %{_localstatedir}/spool/at/spool
bd38e4
%attr(0644,root,root)		%config(noreplace) %{_sysconfdir}/pam.d/atd
bd38e4
%{_sbindir}/atrun
bd38e4
%attr(0755,root,root)		%{_sbindir}/atd
bd38e4
%{_mandir}/man*/*
bd38e4
%{_bindir}/batch
bd38e4
%{_bindir}/atrm
bd38e4
%{_bindir}/atq
bd38e4
%attr(4755,root,root)		%{_bindir}/at
bd38e4
%attr(0644,root,root)		/%{_unitdir}/atd.service
bd38e4
bd38e4
%files sysvinit
bd38e4
%attr(0755,root,root)		%{_initrddir}/atd
bd38e4
bd38e4
%changelog
bd38e4
* Fri Oct  3 2014 Tomáš Mráz <tmraz@redhat.com> - 3.1.13-18
bd38e4
- filter environment variables not acceptable in bash input
bd38e4
bd38e4
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 3.1.13-17
bd38e4
- Mass rebuild 2014-01-24
bd38e4
bd38e4
* Thu Jan 09 2014 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-16
bd38e4
- the correct solution is remove smp_flags, they don't work properly on ppc with
bd38e4
  the option mpower7
bd38e4
- Related: rhbz#1048745
bd38e4
bd38e4
* Mon Jan 06 2014 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-15
bd38e4
- remove old changelogs
bd38e4
- ppc fail to rebuild package
bd38e4
- Resolves: rhbz#1048745
bd38e4
bd38e4
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 3.1.13-14
bd38e4
- Mass rebuild 2013-12-27
bd38e4
bd38e4
* Thu Jul 11 2013 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-13
bd38e4
- rebuild with ? in dist
bd38e4
- Resolves: rhbz#983255
bd38e4
bd38e4
* Mon Feb 11 2013 Peter Robinson <pbrobinson@fedoraproject.org> 3.1.13-12
bd38e4
- Fix patch to fix FTBFS with gcc 4.8
bd38e4
bd38e4
* Wed Nov 14 2012 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-11
bd38e4
- fix license field again
bd38e4
bd38e4
* Thu Nov  1 2012 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-10
bd38e4
- fix license field
bd38e4
- fix systemd macros in scriptlets part of the specfile
bd38e4
- fix selinux patch to apply without fuzz=2
bd38e4
bd38e4
* Fri Jul 27 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.13-9
bd38e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
bd38e4
bd38e4
* Tue Apr 17 2012 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-8
bd38e4
- at-3.1.13-mailwithhostname.patch in email mention also hostname address
bd38e4
- at-3.1.13-usePOSIXtimers.patch use POSIX timers, so we won't need
bd38e4
  pm-utils hack anymore
bd38e4
- at-3.1.13-help.patch update usage
bd38e4
- systemd-user-sessions.service is used in unit file, so the atd should be
bd38e4
  started after almost all services are up and running
bd38e4
- 812682 pam support work with new systemd defaults
bd38e4
bd38e4
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.13-7
bd38e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild