dragora-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dragora-users] Recipes for popt and logrotate


From: Alan Beadle
Subject: [Dragora-users] Recipes for popt and logrotate
Date: Thu, 4 May 2017 01:00:44 -0400

I have two more recipes ready for review: popt and logrotate. Why popt
you ask? Because it turns out that logrotate depends on it. Default
files are currently used for logrotate.conf and the logrotate cron job
(which is run daily, as most distros do).

I realize that it seems a bit silly to write the recipe for logrotate
before we have a recipe for sysklogd, but that will come soon enough.
Meanwhile, scrutinize (or maybe even test building) the two recipes
pasted below.

-Alan


# Build recipe for popt.
#
# Copyright (C) 2017 Alan Beadle, address@hidden
#
# This recipe is free software: you have unlimited permission
# to copy, distribute and modify it.

program=popt
version=1.16
release=1

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=http://rpm5.org/files/${program}/${program}-${version}.tar.gz

description="
popt is a commandline option parser

Popt is a C library for parsing command line parameters. Popt was heavily
influenced by the getopt() and getopt_long() functions, but it improves on them
by allowing more powerful argument expansion.
"

homepage=http://rpm5.org
license=MIT/X

# Source documentation
docs="CHANGES COPYING README"
docsdir="${docdir}/${program}-${version}"

build()
{
    set -e

    unpack "${tardir}/$tarname"

    cd "$srcdir"
    ./configure --prefix=/usr --disable-nls
    make
    make DESTDIR=${destdir} install

    # Compress man pages
    lzip -9 "${destdir}/${mandir}"/man?/*

    # Copy documentation
    mkdir -p "${destdir}${docsdir}"

    for file in $docs
    do
        cp -p $file "${destdir}${docsdir}"
    done
}



# Build recipe for logrotate.
#
# Copyright (C) 2017 Alan Beadle, address@hidden
#
# This recipe is free software: you have unlimited permission
# to copy, distribute and modify it.

program=logrotate
version=3.12.2
release=1

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://github.com/logrotate/logrotate/releases/download/${version}/${program}-${version}.tar.xz

description="
Utility to rotate system logs automatically.

The logrotate utility is designed to simplify the administration of log files on
a system which generates a lot of log files. Logrotate allows for the automatic
rotation compression, removal and mailing of log files. Logrotate can be set to
handle a log file daily, weekly, monthly or when the log file gets to a certain
size.
"

homepage=https://github.com/logrotate/logrotate
license="GPL, any version"

# Source documentation
docs="ChangeLog.md COPYING INSTALL README.md"
docsdir="${docdir}/${program}-${version}"

build()
{
    set -e

    unpack "${tardir}/$tarname"

    cd "$srcdir"

    ./configure --prefix=/usr \
                --sbindir=/usr/bin \
                --mandir=$mandir \
                --with-compress-command="/usr/bin/lzip -9"\
                --with-uncompress-command="/usr/bin/lzip -d" \
                --with-default-mail-command=/usr/bin/mail \
                --with-acl

    make
    make DESTDIR="$destdir" install

    mkdir -p "${destdir}/etc/logrotate.d"
    chmod 755 "${destdir}/etc/logrotate.d"

    mkdir -p "${destdir}/etc/cron.daily"
    chmod 755 "${destdir}/etc/cron.daily"

    cp -p "examples/logrotate-default" "${destdir}/etc/logrotate.conf"
    chmod 644 "${destdir}/etc/logrotate.conf"

    cp -p examples/logrotate.cron "${destdir}/etc/cron.daily/logrotate"
    chmod 755 "${destdir}/etc/cron.daily/logrotate"

    # Compress man pages
    lzip -9 "${destdir}/${mandir}"/man?/*

    # Copy documentation
    mkdir -p "${destdir}${docsdir}"

    for file in $docs
    do
        cp -p $file "${destdir}${docsdir}"
    done

}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]