Mailinglist Archive: opensuse-packaging (218 mails)

< Previous Next >
[opensuse-packaging] fcron: Short Question to an /etc/init.d File
  • From: "Sascha 'saigkill' Manns" <samannsml@xxxxxxxxxxxxx>
  • Date: Tue, 1 Dec 2009 21:04:16 +0100
  • Message-id: <200912012104.16318@xxxxxxxxxxxxxxxxxxx>
Hello Mates,

i'm working on fcron.

The FIle "fcron" is created in the spec:
%{__sed} \
-e 's|2345|-|' \
-e 's|2 3 4 5||' \
-e 's|SBIN=@@DESTSBIN@|SBIN=%{_sbindir}|' \
-e 's|/var|%{_localstatedir}|' script/sysVinit-launcher >

How can i change:
- # Default-Start:
+ # Default-Start: 3 4 5

Have a nice evening.

P.S. The Spec is ported from an Fedora Package, and i have changed the
openSUSE related things ( I hope i found all ).

Sincerely yours

Sascha Manns open-slx GmbH
openSUSE Member openSUSE Community & Support Agent
openSUSE Ambassador Web:
openSUSE Marketing Team Web:
openSUSE Build Service
openSUSE Medical Team
# Copyright (c) 2008 openSUSE-Build-Service
# Packaged by: <saigkill@xxxxxxxxxxxx>
# 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
# # norootforbuild

Name: fcron
Version: 3.0.4
Release: 1
Summary: A task scheduler
Group: Applications/System
License: GPLv2+
Source0: %{name}-%{version}.src.tar.gz
Source1: fcron.README
Source2: fcron.LISEZMOI
Source3: fcron_watch_config
Source4: fcron_watch_config.init
Source5: daemon_fcron_watch_config
Source6: fcron_config_modified.c
Patch0: fcron-3.0.4-dist_install.patch
Patch1: fcron-3.0.4-LSB.patch
Patch3: fcron-3.0.2-accept_readable_fcron.conf.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build

Requires: syslog
Requires: /usr/sbin/sendmail
Requires: vim
Requires: %{_bindir}/setsid

BuildRequires: pam-devel
BuildRequires: libselinux-devel
BuildRequires: postfix
BuildRequires: vim

Requires(post): aaa_base
Requires(preun): aaa_base, initscripts
Requires(postun): initscripts

Fcron is a scheduler. It aims at replacing Vixie Cron, so it implements most
of its functionalities.
But contrary to Vixie Cron, fcron does not need your system to be up 7 days
a week, 24 hours a day: it also works well with systems which are
not running neither all the time nor regularly (contrary to anacrontab).
In other words, fcron does both the job of Vixie Cron and anacron, but does
even more and better :)) ...

WARNING: fcron isn't started automatically on boot after installation.
You can use system-config-services to enable automatic fcron startup
on boot, or use chkconfig as explained in the
%%{_docdir}/%{name}-%{version}/README.Package file.


%setup -q

%{__install} -pm 644 %{SOURCE1} README.Package
%{__install} -pm 644 %{SOURCE2} LISEZMOI.Package

%patch0 -p1 -b .dist_install
%patch1 -p1 -b .LSB
%patch3 -p0 -b .accept_readable_fcron

for file in doc/en/txt/*.txt; do
iconv -f latin1 -t utf8 < $file > $
touch -c -r $file $
mv $ $file


%configure --with-boot-install=no
make %{?_smp_mflags}

%{__cc} %{SOURCE6} %{optflags} -D SYSCONFDIR='"%{_sysconfdir}"' -o

%{__rm} -rf %{buildroot}

cp -a doc/fr/HTML doc/fr/HTML-fr

make install-staged DESTDIR=%{buildroot}

%{__install} -d %{buildroot}%{_initrddir}
# don't start in the default case, and correct paths
%{__sed} \
-e 's|2345|-|' \
-e 's|2 3 4 5||' \
-e 's|SBIN=@@DESTSBIN@|SBIN=%{_sbindir}|' \
-e 's|/var|%{_localstatedir}|' script/sysVinit-launcher >

%{__sed} \
-e 's|/usr/sbin|%{_sbindir}|' \
-e 's|/var|%{_localstatedir}|' %{SOURCE4} >

%{__chmod} 0755 %{buildroot}%{_initrddir}/fcron*

touch -c -r %{SOURCE4} %{buildroot}%{_initrddir}/fcron_watch_config
touch -c -r script/sysVinit-launcher.LSB %{buildroot}%{_initrddir}/fcron
#touch -c -r script/sysVinit-launcher %{buildroot}%{_initrddir}/fcron

%{__sed} -e 's|/usr/bin|%{_bindir}|' \
-e 's|/var|%{_localstatedir}|' \
-e 's|/etc|%{_sysconfdir}|' script/check_system_crontabs >

%{__sed} -e 's|/etc|%{_sysconfdir}|g' %{SOURCE3} >

# fix permissions
%{__chmod} 755 %{buildroot}%{_bindir}/*
%{__chmod} 755 %{buildroot}%{_sbindir}/*

# reset script timestamp
touch -c -r script/check_system_crontabs
touch -c -r %{SOURCE3} %{buildroot}%{_sbindir}/fcron_watch_config

%{__install} -m755 -p debian/fcron-update-crontabs %{buildroot}%{_sbindir}/
%{__install} -m644 -p debian/fcron-update-crontabs.1

%{__install} -m755 -p %{SOURCE5} %{buildroot}%{_sbindir}/

%{__install} -m755 fcron_config_modified %{buildroot}%{_bindir}

#mkdir -p %{buildroot}%{_sysconfdir}/cron.d

# remove a page that is hold in cron
%{__rm} %{buildroot}%{_mandir}/man3/bitstring.3*
%{__rm} %{buildroot}%{_mandir}/fr/man3/bitstring.3*

for i in %{buildroot}%{_mandir}/man*/*
iconv -f latin1 -t UTF8 < $i > tmp
touch -c -r $i tmp
%{__mv} tmp $i

for i in %{buildroot}%{_mandir}/fr/man*/*
iconv -f latin1 -t UTF8 < $i > tmp
touch -c -r $i tmp
%{__mv} tmp $i

# rpmbuild insist that %ghost files exist
%{__install} -d %{buildroot}%{_localstatedir}/run/
touch %{buildroot}%{_localstatedir}/run/

getent group fcron >/dev/null || groupadd -r fcron
getent passwd fcron >/dev/null || \
useradd -r -g fcron -d %{_localstatedir}/spool/fcron -s /sbin/nologin \
-c "Fcron system user" fcron
exit 0

/sbin/chkconfig --add %{name}
/sbin/chkconfig --add %{name}_watch_config

if [ "$1" -ge "1" ] ; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
if [ "$1" -ge "1" ] ; then
/sbin/service %{name}_watch_config condrestart >/dev/null 2>&1 || :

if [ "$1" = "0" ]
/sbin/service %{name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}

/sbin/service %{name}_watch_config stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}_watch_config

%{__rm} -rf %{buildroot}

%doc doc/en/HTML/ doc/fr/HTML-fr/ doc/en/txt/*
%doc README.Package LISEZMOI.Package
%config(noreplace) %{_sysconfdir}/fcron.conf
%config(noreplace) %{_sysconfdir}/fcron.allow
%config(noreplace) %{_sysconfdir}/fcron.deny
%config(noreplace) %{_sysconfdir}/pam.d/fcron
%config(noreplace) %{_sysconfdir}/pam.d/fcrontab
%lang(fr) %{_mandir}/fr/man1/*
%lang(fr) %{_mandir}/fr/man5/*
%lang(fr) %{_mandir}/fr/man8/*
%attr(04754,root,fcron) %{_bindir}/fcronsighup
%attr(06755,fcron,fcron) %{_bindir}/fcrontab
%dir %attr(770,fcron,fcron) %{_localstatedir}/spool/fcron
%ghost %{_localstatedir}/run/
#%dir %{_sysconfdir}/cron.d


< Previous Next >
Follow Ups