at/at.spec

192 lines
5.6 KiB
RPMSpec
Raw Permalink Normal View History

%define atdaemon_groupid 65022
%define atdaemon_userid 65022
Name: at
Version: 3.1.14
Release: 1mamba
Summary: Job spooling tools
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://ftp.debian.org/debian/pool/main/a/at/
Source0: http://ftp.debian.org/debian/pool/main/a/at/at_%{version}.orig.tar.gz
Source1: atd-initscript
Source2: atd-pam
# patches stolen from fedora
Patch0: %{name}-3.1.7-lockfile.patch
Patch1: %{name}-3.1.10-man-timespec-path.patch
Patch2: %{name}-3.1.7-sigchld.patch
Patch3: %{name}-3.1.10-typo.patch
Patch4: %{name}-3.1.10-lexer-parser.patch
Patch5: %{name}-3.1.8-test.patch
Patch6: %{name}-3.1.8-perr.patch
Patch7: %{name}-3.1.10-instinet.patch
Patch8: %{name}-3.1.12-shell.patch
Patch9: %{name}-3.1.10-pie.patch
Patch10: %{name}-3.1.8-t_option.patch
Patch11: %{name}-3.1.10-usage.patch
Patch12: %{name}-3.1.10-fix_no_export.patch
Patch13: %{name}-3.1.10-dont_fork.patch
Patch14: %{name}-3.1.13-pam.patch
Patch15: %{name}-3.1.13-makefile.patch
Patch16: %{name}-3.1.10-daylight.patch
Patch17: %{name}-3.1.10-perm.patch
Patch18: %{name}-3.1.12-opt_V.patch
Patch19: %{name}-3.1.12-selinux.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: pam-devel
## AUTOBUILDREQ-END
BuildRequires: libselinux-devel
BuildRequires: systemd-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
At and batch read commands from standard input or from a specified file.
At allows you to specify that a command will be run at a particular time (now or a specified time in the future).
Batch will execute commands when the system load levels drop to a particular level.
Both commands use /bin/sh to run the commands.
%prep
%setup -q
#%patch0 -p1 -b .lockfile
#%patch1 -p1 -b .paths
%patch2 -p1 -b .sigchld
#%patch3 -p1 -b .typo
%patch4 -p1 -b .lexer
%patch5 -p1 -b .test
%patch6 -p1 -b .perr
#%patch7 -p1 -b .instinet
%patch8 -p1 -b .shell
#%patch9 -p1 -b .pie
%patch10 -p1 -b .t_option
#%patch11 -p1 -b .usage
%patch12 -p1 -b .fix_no_export
#%patch13 -p1 -b .dont_fork
%patch14 -p1 -b .pam
#%patch15 -p1 -b .makefile
%patch16 -p1 -b .daylight
#%patch17 -p1 -b .perm
%patch18 -p1 -b .opt_V
#%patch19 -p1 -b .selinux
install %{SOURCE2} pam_atd
sed -i "s|-g root||g" Makefile.in
sed -i "s|-o root||g" Makefile.in
%build
# for patch2
rm -f lex.yy.* y.tab.*
sed -i "s|/var/run|/run|g" configure
%configure \
--with-atspool=%{_localstatedir}/spool/at/spool \
--with-jobdir=%{_localstatedir}/spool/at \
--with-daemon_username=atdaemon \
--with-daemon_groupname=atdaemon \
--with-systemdsystemunitdir=%_unitdir
%make -j1
#LANG=C make test >/dev/null
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall \
IROOT=%{buildroot} \
DAEMON_USERNAME=`id -nu` \
DAEMON_GROUPNAME=`id -ng` \
INSTALL_ROOT_USER=`id -nu` \
INSTALL_ROOT_GROUP=`id -nu` \
docdir=%{_docdir}
# prefix=%{buildroot}%{_prefix} \
# bindir=%{buildroot}%{_bindir} \
# sbindir=%{buildroot}%{_sbindir} \
# etcdir=%{buildroot}%{_sysconfdir} \
# mandir=%{buildroot}%{_mandir} \
# ATJOB_DIR=%{buildroot}%{_localstatedir}/spool/at \
# ATSPOOL_DIR=%{buildroot}%{_localstatedir}/spool/at/spool \
#install -D -m 0755 %{S:1} %{buildroot}%{_initrddir}/atd
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre
groupadd -g %{atdaemon_groupid} atdaemon 2>/dev/null
useradd -u %{atdaemon_userid} -g atdaemon -c "at daemon" \
-d /var/empty -s /bin/false atdaemon 2>/dev/null
exit 0
%post
touch %{_localstatedir}/spool/at/.SEQ
chmod 600 %{_localstatedir}/spool/at/.SEQ
chown atdaemon:atdaemon %{_localstatedir}/spool/at/.SEQ
#/sbin/chkconfig --add atd
exit 0
%preun
if [ $1 -eq 0 ]; then
service atd stop >/dev/null 2>&1
/sbin/chkconfig --del atd
userdel atdaemon >/dev/null 2>&1
fi
exit 0
%postun
if [ $1 -eq 1 ]; then
service atd condrestart >/dev/null 2>&1
fi
exit 0
%files
%defattr(-,root,root)
%attr(4755,root,root) %{_bindir}/at
%config(noreplace) %{_sysconfdir}/at.deny
#%attr(0640,root,atdaemon) %config(noreplace) /etc/pam.d/atd
%{_bindir}/batch
%{_bindir}/atrm
%{_bindir}/atq
%{_sbindir}/atrun
%{_sbindir}/atd
/lib/systemd/system/atd.service
%attr(0700,atdaemon,atdaemon) %dir %{_localstatedir}/spool/at
%attr(0700,atdaemon,atdaemon) %dir %{_localstatedir}/spool/at/spool
%ghost %{_localstatedir}/spool/at/.SEQ
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
%dir %{_docdir}/at
%{_docdir}/at
%changelog
* Thu Oct 10 2013 Automatic Build System <autodist@mambasoft.it> 3.1.14-1mamba
- automatic update by autodist
* Sat Sep 10 2011 Automatic Build System <autodist@mambasoft.it> 3.1.13-1mamba
- automatic version update by autodist
* Sun Dec 27 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 3.1.12-1mamba
- update to 3.1.12
* Mon Aug 25 2008 Aleph0 <aleph0@openmamba.org> 3.1.10-3mamba
- remove broken symlink to debian copyright
* Mon Jul 02 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 3.1.10-2mamba
- fix pam file for new release
* Wed Jan 17 2007 Davide Madrisan <davide.madrisan@qilinux.it> 3.1.10-1qilnx
- update to version 3.1.10 by autospec
- added missing build requirements
- fixed permissions of at binary
- enabled support for pam
- use the service script to start/restart/stop the atd service
- fixed owner and group for /var/spool/at/.SEQ
- modified homedir for atd daemon: now is /var/empty
* Thu Apr 29 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 3.1.8-1qilnx
- first build