2015-07-28 20:52:43 +03:00
#!/bin/sh
prefix='/usr/local'
bindir='$(prefix)/bin'
confdir='$(prefix)/etc'
datadir='$(prefix)/share'
libdir='$(prefix)/lib'
statedir='/var/spool/cron'
mandir='$(datadir)/man'
docdir='$(datadir)/doc/$(package)'
unitdir='$(libdir)/systemd/system'
runparts='/usr/bin/run-parts'
2017-03-19 16:17:57 +03:00
enable_strip=yes
2015-07-28 20:52:43 +03:00
# systemd ≥ 197
enable_boot=yes
enable_hourly=yes
enable_daily=yes
enable_weekly=yes
enable_monthly=yes
# systemd ≥ 209
enable_yearly=no
# systemd ≥ 212
enable_persistent=no
# systemd ≥ 217
enable_minutely=no
enable_quarterly=no
enable_semi_annually=no
2016-04-17 20:46:38 +03:00
# systemd ≥ 229
enable_randomized_delay=yes
2015-07-28 20:52:43 +03:00
ARGS=$(getopt -n "$(basename "${0}")" -o '' -l '
prefix:,
bindir:,
confdir:,
datadir:,
libdir:,
statedir:,
mandir:,
docdir:,
unitdir:,
runparts:,
enable-boot::,
enable-minutely::,
enable-hourly::,
enable-daily::,
enable-weekly::,
enable-monthly::,
enable-quarterly::,
enable-semi_annually::,
enable-yearly::,
enable-persistent::,
2016-04-17 20:46:38 +03:00
enable-randomized-delay::,
2017-03-19 16:17:57 +03:00
enable-strip::,
2015-07-28 20:52:43 +03:00
' -- "${@}")
if [ $? -ne 0 ]; then
exit 1
fi
set_enable_flag()
{
if [ -z ${2} ]; then
eval "enable_${1}=yes"
elif [ ${2} = 'yes' ] || [ ${2} = 'no' ]; then
eval "enable_${1}=${2}"
else
2015-12-17 15:52:45 +03:00
echo "ERROR: Unknown value for enable-${1}: '${2}'. Expected 'yes' or 'no'."
2015-07-28 20:52:43 +03:00
fi
}
eval set -- "${ARGS}"
while true;
do
case "${1}" in
'--prefix')
prefix="${2}"
shift 2;;
'--bindir')
bindir="${2}"
shift 2;;
'--confdir')
confdir="${2}"
shift 2;;
'--datadir')
datadir="${2}"
shift 2;;
'--libdir')
libdir="${2}"
shift 2;;
'--statedir')
statedir="${2}"
shift 2;;
'--mandir')
mandir="${2}"
shift 2;;
'--docdir')
docdir="${2}"
shift 2;;
'--unitdir')
unitdir="${2}"
shift 2;;
'--runparts')
runparts="${2}"
shift 2;;
'--enable-boot')
set_enable_flag boot ${2}
shift 2;;
'--enable-minutely')
set_enable_flag minutely ${2}
shift 2;;
'--enable-hourly')
set_enable_flag hourly ${2}
shift 2;;
'--enable-daily')
set_enable_flag daily ${2}
shift 2;;
'--enable-weekly')
set_enable_flag weekly ${2}
shift 2;;
'--enable-monthly')
set_enable_flag monthly ${2}
shift 2;;
'--enable-quarterly')
set_enable_flag quarterly ${2}
shift 2;;
'--enable-semi_annually')
set_enable_flag semi_annually ${2}
shift 2;;
'--enable-yearly')
set_enable_flag yearly ${2}
shift 2;;
'--enable-persistent')
set_enable_flag persistent ${2}
shift 2;;
2016-04-17 20:46:38 +03:00
'--enable-randomized-delay')
set_enable_flag randomized_delay ${2}
shift 2;;
2017-03-19 16:17:57 +03:00
'--enable-strip')
set_enable_flag strip ${2}
shift 2;;
2015-07-28 20:52:43 +03:00
'--')
shift
break;;
esac
done
if [ ${enable_boot} = 'yes' ]; then
2015-12-11 01:04:09 +03:00
schedules="${schedules} boot"
2015-07-28 20:52:43 +03:00
fi
if [ ${enable_minutely} = 'yes' ]; then
2015-12-11 01:04:09 +03:00
schedules="${schedules} minutely"
2015-07-28 20:52:43 +03:00
fi
if [ ${enable_hourly} = 'yes' ]; then
2015-12-11 01:04:09 +03:00
schedules="${schedules} hourly"
2015-07-28 20:52:43 +03:00
fi
if [ ${enable_daily} = 'yes' ]; then
2015-12-11 01:04:09 +03:00
schedules="${schedules} daily"
2015-07-28 20:52:43 +03:00
fi
if [ ${enable_weekly} = 'yes' ]; then
2015-12-11 01:04:09 +03:00
schedules="${schedules} weekly"
2015-07-28 20:52:43 +03:00
fi
if [ ${enable_monthly} = 'yes' ]; then
2015-12-11 01:04:09 +03:00
schedules="${schedules} monthly"
2015-07-28 20:52:43 +03:00
fi
if [ ${enable_quarterly} = 'yes' ]; then
2015-12-11 01:04:09 +03:00
schedules="${schedules} quarterly"
2015-07-28 20:52:43 +03:00
fi
if [ ${enable_semi_annually} = 'yes' ]; then
2015-12-11 01:04:09 +03:00
schedules="${schedules} semi-annually"
2015-07-28 20:52:43 +03:00
fi
if [ ${enable_yearly} = 'yes' ]; then
2015-12-11 01:04:09 +03:00
schedules="${schedules} yearly"
2015-07-28 20:52:43 +03:00
fi
echo '# Generated by ./configure' > Makefile
sed "
s|@schedules@|${schedules}|g
s|@enable_persistent@|${enable_persistent}|g
2016-04-17 20:46:38 +03:00
s|@enable_randomized_delay@|${enable_randomized_delay}|g
2017-03-19 16:17:57 +03:00
s|@enable_strip@|${enable_strip}|g
2015-07-28 20:52:43 +03:00
s|@prefix@|${prefix}|g
s|@bindir@|${bindir}|g
s|@confdir@|${confdir}|g
s|@datadir@|${datadir}|g
s|@libdir@|${libdir}|g
s|@statedir@|${statedir}|g
s|@mandir@|${mandir}|g
s|@docdir@|${docdir}|g
s|@unitdir@|${unitdir}|g
s|@runparts@|${runparts}|g
" Makefile.in >> Makefile