wok view logrotate/receipt @ rev 24497
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 19 14:19:02 2022 +0000 (2022-02-19) |
parents | 26e2e48007c1 |
children | e8372db7c74f |
line source
1 # SliTaz package receipt.
3 PACKAGE="logrotate"
4 VERSION="3.16.0"
5 CATEGORY="system-tools"
6 SHORT_DESC="Automatic rotation, compression, and removal of log files."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://github.com/logrotate/logrotate/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="${WEB_SITE}releases/download/$VERSION/$TARBALL"
14 DEPENDS="popt"
15 BUILD_DEPENDS="automake popt-dev"
17 CONFIG_FILES="/etc/logrotate.conf"
19 current_version()
20 {
21 wget -O - ${WGET_URL%/down*} 2>/dev/null | \
22 sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q'
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 autoreconf -fiv &&
29 ./configure \
30 --prefix=/usr \
31 --mandir=/usr/share/man \
32 $CONFIGURE_ARGS &&
33 make -j 1 &&
34 make PREFIX=$DESTDIR install
35 }
37 # Rules to gen a SliTaz package suitable for Tazpkg.
38 genpkg_rules()
39 {
40 mkdir -p $fs/usr
41 mkdir -p $fs/etc
43 echo -e "#Logrotate Config file\n\ninclude /etc/logrotate.d" \
44 > $fs/etc/logrotate.conf
45 cp -a $install/usr/sbin $fs/usr
46 }
48 post_install()
49 {
50 if [ -f "$1/var/spool/cron/crontabs/root" ]
51 then
52 echo "Runing post install command..."
53 echo -e "#Run log rotation\n25 6 * * * /usr/sbin/logrotate /etc/logrotate.conf " \
54 >> "$1/var/spool/cron/crontabs/root"
55 fi
56 }
59 post_remove()
60 {
61 if [ -f "$1/var/spool/cron/crontabs/root" ]
62 then
63 echo "Runing post install command..."
64 sed -i s!.*logrotate.*!! "$1/var/spool/cron/crontabs/root"
65 fi
66 }