spec anacron

Arkadiusz Miśkiewicz misiek w debian.eu.org
Wto, 22 Wrz 1998, 12:00:04 CEST


No więc zgodnie z zapowiedzią podsyłam speca.
Aaa.. - jak zrobic by katalog
/usr/src/redhat/BUILD/nazwa_pakietu byl usuwany po rpm -ba ?
(hmm dziwne, że nie wiem ;)
To tyle.
PS. Komentarze zostaną oczywiście wyrzucone
PS1. Teraz zabiorę sie za rpma z epic-3.004 (+bajery SrFroGa i inne)

%define program_name	anacron
%define program_version	2.0.1

Summary:	Periodic command scheduler
Summary(pl):	tu powinno być podobnie jak w cron*.{i386,src}.rpm
# A jest wogole w pakiecie cron ?
Name:		%{program_name}
Version:	%{program_version}
Release:	1
Copyright:	GPL
Source0:	ftp://sunsite.icm.edu.pl/pub/Linux/sunsite/system/daemons/cron/%{program_name}-%{program_version}.tar.gz
Patch0:		anacron-2.0.1.pld.patch
Group:		Daemons
BuildRoot:	/var/tmp/%{program_name}-%{program_version}-buildroot

%description
Anacron executes commands at intervals specified in days.  Unlike
cron, it does not assume that the system is running continuously.  It
can therefore be used to control the execution of daily, weekly and
monthly jobs (or anything with a period of n days), on systems that
don't run 24 hours a day.  When installed and configured properly,
Anacron will make sure that the commands are run at the specified
intervals as closely as machine-uptime permits.

%description -l pl
Anacron wykonuje komendy w odstępach czasowych podanych w dniach.
W przeciwieństwie do cron'a nie zakłada, że system pracuje w sposób
ciągły. Dlatego też może być używany do wykonywania codziennych,
cotygodniowych i comiesięcznych prac (lub innych z odstępem "n" dni)
w systemie, który nie działa 24 godziny na dobę. Poprawnie zainstalowany
i skonfigurowany Anacron da nam pewność, że komendy są uruchamiane
w sprecyzowanych przedziałach czasu tak dokładnie jak na to pozwala
czas pracy systemu.

%prep
[ -z "${RPM_BUILD_ROOT}" ] && exit 1
rm -rf ${RPM_BUILD_ROOT}

%setup -q
%patch0 -p1

%build
make

%install
install -d $RPM_BUILD_ROOT/{usr/sbin,usr/man/man5,usr/man/man8}
install -d $RPM_BUILD_ROOT/{etc/rc.d/init.d,var/spool/anacron}
install -d $RPM_BUILD_ROOT/etc/cron.{daily,monthly,weekly}
install anacron $RPM_BUILD_ROOT/usr/sbin/anacron
install anacrontab.5 $RPM_BUILD_ROOT/usr/man/man5
install anacron.8 $RPM_BUILD_ROOT/usr/man/man8
install anacron.init $RPM_BUILD_ROOT/etc/rc.d/init.d/anacron
install 0anacron.daily $RPM_BUILD_ROOT/etc/cron.daily/0anacron
install 0anacron.monthly $RPM_BUILD_ROOT/etc/cron.monthly/0anacron
install 0anacron.weekly $RPM_BUILD_ROOT/etc/cron.weekly/0anacron
install anacrontab $RPM_BUILD_ROOT/etc
#IMHO doce w /usr/doc/ powinny być kompresowane (i to koniecznie)
# chciałem bzip2'em ale potem nie mogłem zaglądać do nich jeśli były nadal w
# rpmie (korzystając z mc)
gzip README NEWS

%clean
[ -z "${RPM_BUILD_ROOT}" ] && exit 1
rm -rf ${RPM_BUILD_ROOT}

%files
%attr(0644, root, root) %doc README.gz NEWS.gz
%attr(0755, root, root)	/etc/rc.d/init.d/anacron
%attr(0700, root, root)	/usr/sbin/anacron
%attr(0600, root, root) %config /etc/anacrontab
%attr(0644, root, man)	/usr/man/man5/anacrontab.5
%attr(0644, root, man)	/usr/man/man8/anacron.8
%attr(0700, root, root)	%dir /var/spool/anacron
%attr(0711, root, root) /etc/cron.daily/0anacron
%attr(0711, root, root) /etc/cron.monthly/0anacron
%attr(0711, root, root) /etc/cron.weekly/0anacron

%changelog
* Mon Sep 21 1998 Arkadiusz Miśkiewicz <misiek w misiek.eu.org>
- spec modified for PLD distribution
- added pl translations
- added -q to %setup
- added 0anacron files
- added %clean section
- removed COPYING from %doc. This is in Copyright: field.



diff -urN anacron-2.0.1.orig/0anacron.daily anacron-2.0.1/0anacron.daily
--- anacron-2.0.1.orig/0anacron.daily	Thu Jan  1 01:00:00 1970
+++ anacron-2.0.1/0anacron.daily	Thu May 14 21:52:08 1998
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# anacron's cron script
+#
+# This script updates anacron time stamps. It is called through run-parts
+# either by anacron itself or by cron.
+#
+# The script is called "0anacron" to assure that it will be executed
+# _before_ all other scripts.
+
+anacron -u cron.daily
diff -urN anacron-2.0.1.orig/0anacron.monthly anacron-2.0.1/0anacron.monthly
--- anacron-2.0.1.orig/0anacron.monthly	Thu Jan  1 01:00:00 1970
+++ anacron-2.0.1/0anacron.monthly	Thu May 14 21:52:08 1998
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# anacron's cron script
+#
+# This script updates anacron time stamps. It is called through run-parts
+# either by anacron itself or by cron.
+#
+# The script is called "0anacron" to assure that it will be executed
+# _before_ all other scripts.
+
+anacron -u cron.monthly
diff -urN anacron-2.0.1.orig/0anacron.weekly anacron-2.0.1/0anacron.weekly
--- anacron-2.0.1.orig/0anacron.weekly	Thu Jan  1 01:00:00 1970
+++ anacron-2.0.1/0anacron.weekly	Thu May 14 21:52:08 1998
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# anacron's cron script
+#
+# This script updates anacron time stamps. It is called through run-parts
+# either by anacron itself or by cron.
+#
+# The script is called "0anacron" to assure that it will be executed
+# _before_ all other scripts.
+
+anacron -u cron.weekly
diff -urN anacron-2.0.1.orig/anacron.init anacron-2.0.1/anacron.init
--- anacron-2.0.1.orig/anacron.init	Thu Jan  1 01:00:00 1970
+++ anacron-2.0.1/anacron.init	Mon Sep 21 22:38:25 1998
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# chkconfig: 2345 61 39
+# description: anacron executes commands at intervals specified in days.
+
+# Modified for PLD by Arkadiusz Miśkiewicz <misiek w misiek.eu.org>
+# source function library
+. /etc/rc.d/init.d/functions
+
+case "$1" in
+  start)
+	echo "Uruchamiam Anacron ..."
+	/usr/sbin/anacron -s
+	;;
+  stop)
+	echo "Zatrzymuję Anacron ..."
+	/usr/bin/killall -q -USR1 anacron
+	;;
+  restart)
+	$0 stop
+	$0 start
+	;;
+  status)
+	status anacron
+	;;
+  *)
+	echo "Użycie: anacron {start|stop|status|restart}"
+	exit 1
+esac
+
+exit 0
+
diff -urN anacron-2.0.1.orig/anacrontab anacron-2.0.1/anacrontab
--- anacron-2.0.1.orig/anacrontab	Thu Jan  1 01:00:00 1970
+++ anacron-2.0.1/anacrontab	Mon Sep 21 22:47:03 1998
@@ -0,0 +1,12 @@
+# /etc/anacrontab: configuration file for anacron
+
+# See anacron(8) and anacrontab(5) for details.
+
+SHELL=/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
+
+# These entries are useful for a Debian system.
+1	5	cron.daily	run-parts /etc/cron.daily
+7	10	cron.weekly	run-parts /etc/cron.weekly
+30	15	cron.monthly	run-parts /etc/cron.monthly
+

-- 
 -< Arkadiusz Miśkiewicz >------------------------< Cron on IRC >-
  http://www.misiek.eu.org            mailto:misiek w debian.eu.org
  Webmaster ZSZ2                  http://www.zsz2.starachowice.pl
 -< Linux micq UIN: 13798733 >-----------< Starachowice, POLAND >-



Więcej informacji o liście dyskusyjnej pld-devel-pl