dvbapp : TranscodingSetup update
[vuplus_openembedded] / recipes / logrotate / logrotate_3.7.1.bb
1 DESCRIPTION = "Rotates, compresses, removes and mails system log files"
2 HOMEPAGE = "http://packages.debian.org/unstable/admin/logrotate"
3 RCONFLICTS = "logrotate-script"
4 DEPENDS = "popt"
5 RDEPENDS = "cron"
6 SECTION = "admin"
7 LICENSE = "GPL"
8 PR = "r2"
9
10 SRC_URI = "http://ftp.debian.org/debian/pool/main/l/logrotate/logrotate_${PV}.orig.tar.gz \
11            file://logrotate-3.7.1.patch;patch=1 \
12            file://logrotate.conf"
13
14 CFLAGS_prepend  += "-I${STAGING_INCDIR} "
15 LDFLAGS_prepend += "-L${STAGING_LIBDIR} "
16 EXTRA_OEMAKE    =  "-p"
17
18 do_compile() {
19     oe_runmake
20 }
21
22 do_install () {
23     # Install the binary and conf file
24     install -D -m 0755 ${S}/logrotate ${D}${base_sbindir}/logrotate
25     install -D -m 0644 ${WORKDIR}/logrotate.conf ${D}${sysconfdir}/logrotate.conf
26     install -m 0755 -d ${D}${sysconfdir}/logrotate.d
27 }
28
29 pkg_postinst () {
30     # Add the logrotate line to /etc/crontab
31     grep -q "${base_sbindir}/logrotate" ${sysconfdir}/crontab || echo "*/5 * * * *   ${base_sbindir}/logrotate ${sysconfdir}/logrotate.conf" >> ${sysconfdir}/crontab
32 }
33
34 pkg_postrm() {
35     # Remove the logrotate line from /etc/crontab
36     grep -v ${base_sbindir}/logrotate ${sysconfdir}/crontab > ${sysconfdir}/crontab.no-${PF}
37     mv ${sysconfdir}/crontab.no-${PF} ${sysconfdir}/crontab
38 }
39
40 CONFFILES_${PN} += "${sysconfdir}/logrotate.conf"