Magellan Linux

Annotation of /branches/R11-unstable/core/cronie/cronie-1.5.2-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32227 - (hide annotations) (download)
Mon Apr 29 11:58:12 2019 UTC (5 years ago) by niro
File size: 2897 byte(s)
-release branches/R11-unstable
1 niro 30951 # $Id$
2    
3     PNAME="cronie"
4     PVER="1.5.2"
5     PBUILD="r2"
6    
7     PCAT="sys-apps"
8    
9     DESCRIPTION="A periodical command scheduler."
10     HOMEPAGE="https://github.com/cronie-crond/cronie"
11    
12     DEPEND=">= virtual/glibc
13     >= virtual/editor
14     >= virtual/mta
15     >= sys-libs/pam-1.1
16     >= virtual/debianutils
17     >= sys-apps/pm-utils-1.4"
18    
19     SDEPEND=">= sys-dev/autoconf-5
20     >= sys-dev/automake-4"
21    
22     PROVIDE="virtual/cron"
23    
24     SRCFILE="${PNAME}-${PVER}.tar.gz"
25     SRCDIR="${BUILDDIR}/${PNAME}-${PNAME}-${PVER}"
26    
27     sminclude mtools systemd
28    
29     SRC_URI=(
30     https://github.com/cronie-crond/${PNAME}/archive/${SRCFILE}
31     mirror://${PNAME}/${SRCFILE}
32     mirror://${PNAME}/cronie.deny
33     mirror://${PNAME}/crontab
34     mirror://${PNAME}/crontabs.4
35     mirror://${PNAME}/cronie.pam
36     mirror://${PNAME}/cronie.service
37     )
38    
39     UP2DATE="updatecmd https://github.com/cronie-crond/cronie/releases | highesttarball gz"
40    
41     src_prepare()
42     {
43     munpack ${SRCFILE} || die
44     cd ${SRCDIR}
45    
46     # create configure
47     mautoreconf || die
48    
49     # log to syslog by default
50     sed -i 's:^\(CRONDARGS=\).*:\1"-s":' crond.sysconfig || die
51     }
52    
53     src_compile()
54     {
55     cd ${SRCDIR}
56    
57     mconfigure \
58     --localstatedir=/var \
59     --enable-anacron \
60     --enable-pie \
61     --with-pam \
62     --with-inotify \
63     --without-audit \
64     --without-selinux \
65     || die
66    
67     mmake || die
68     }
69    
70     src_install()
71     {
72     cd ${SRCDIR}
73     mmake DESTDIR=${BINDIR} install || die
74     mchmod 4755 /usr/bin/crontab || die
75    
76     # general needed cron-files (dcron vcron etc, uses this also)
77     mkeepdir /etc/cron.d || die
78     mkeepdir /etc/cron.hourly || die
79     mkeepdir /etc/cron.daily || die
80     mkeepdir /etc/cron.weekly || die
81     mkeepdir /etc/cron.monthly || die
82     mkeepdir /var/spool/cron || die
83    
84     # cronie needed directories
85     mkeepdir /var/spool/anacron || die
86    
87     # install etc
88     minstallfile -s cronie.deny /etc/cron.deny || die
89     minstallconf ${SRCDIR}/crond.sysconfig cronie || die
90     minstallfile contrib/anacrontab /etc/anacrontab || die
91     minstallfile contrib/0hourly /etc/cron.d/0hourly || die
92     minstallexec contrib/0anacron /etc/cron.hourly/0anacron || die
93     minstallfile -s crontab /etc/crontab || die
94     minstallman ${SOURCEDIR}/${PNAME}/crontabs.4 || die
95    
96     # systemd unit
97     minstallunit cronie.service || die
98    
99     # pam related
100     minstallpam cronie.pam crond || die
101    
102     minstalldocs AUTHORS ChangeLog COPYING NEWS README || die
103     }
104    
105     preinstall()
106     {
107     if [[ ! -z $(magequery -n fcron) ]]
108     then
109     echo -e ${COLRED}
110     echo -e "Error: sys-apps/fcron is installed!!"
111     echo -e "fcron cannot be installed side-by-side with cronie."
112     echo -e "Please uninstall sys-apps/fcron first!"
113     echo -e ${COLDEFAULT}
114     die "sys-apps/fcron found!"
115     fi
116     }
117    
118     postinstall()
119     {
120     mstartunit cronie.service
121    
122     echo
123     echo "To activate /etc/cron.{hourly|daily|weekly|montly} please run: "
124     echo "crontab /etc/crontab"
125     echo
126     echo "To run cronie at system boot please run: "
127     echo "systemctl enable cronie.service"
128     echo
129     echo "!!! That will replace root's current crontab !!!"
130     echo
131     }
132    
133     postremove()
134     {
135     mstopunit cronie.service
136     }