##
## logrotate.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2004 The OpenPKG Project
## Copyright (c) 2000-2004 Ralf S. Engelschall
## Copyright (c) 2000-2004 Cable & Wireless
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package version
%define V_dist 3.7
%define V_opkg 3.7
# package information
Name: logrotate
Summary: Rotates, compresses, removes and mails system log files.
URL: http://download.fedora.redhat.com
Vendor: Redhat
Packager: Portland State
Distribution: OpenPKG
Class: EVAL
Group: System
License: GPL
Version: %{V_opkg}
Release: 20040804
# list of sources
Source: http://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/logrotate-%{V_dist}.tar.gz
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 2.1.0
PreReq: OpenPKG, openpkg >= 2.1.0
BuildPreReq: popt >= 1.7
AutoReq: no
AutoReqProv: no
%description
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. Normally,
logrotate runs as a daily cron job.
Install the logrotate package if you need a utility to deal with the
log files on your system.
%track
prog top = {
version = %{V_dist}
url = http://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS
regex = logrotate-(__VER__)\.tar\.gz
}
%prep
%setup -q -n logrotate-%{V_dist}
# Set the include and library flags to use l_prefix
%{l_shtool} subst \
-e 's;\(^CFLAGS.*\);\1 -I%{l_prefix}/include;' \
-e 's;\(^LOADLIBES =\)\(.*-lpopt.*\);\1 -L%{l_prefix}/lib \2;' \
Makefile
# Put the logrotate status file in the l_prefix var directory
%{l_shtool} subst \
-e 's;\(.*#define STATEFILE\).*;\1 "%{l_prefix}/var/logrotate/logrotate.status";' \
config.h
%build
# build program
%{l_make} %{l_mflags}
%install
rm -rf $RPM_BUILD_ROOT
# install program
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/sbin \
$RPM_BUILD_ROOT%{l_prefix}/man/man8 \
$RPM_BUILD_ROOT%{l_prefix}/var/logrotate \
$RPM_BUILD_ROOT%{l_prefix}/etc/logrotate
%{l_shtool} install -c -s -m 755 \
logrotate $RPM_BUILD_ROOT%{l_prefix}/sbin/
%{l_shtool} install -c -m 644 \
logrotate.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
%{l_shtool} install -c -m 644 \
examples/logrotate-default $RPM_BUILD_ROOT%{l_prefix}/etc/logrotate/logrotate.conf
touch $RPM_BUILD_ROOT%{l_prefix}/var/logrotate/logrotate.status
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%config(noreplace) %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/var/logrotate/logrotate.status'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT