From 3ae891bbbaa3f96365f4c9fbe49e5cee26183fbc Mon Sep 17 00:00:00 2001 From: rhatto Date: Mon, 31 Jul 2006 20:45:44 +0000 Subject: initial import git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1 370017ae-e619-0410-ac65-c121f96126d4 --- rrdtool/rrdtool.SlackBuild | 249 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 249 insertions(+) create mode 100755 rrdtool/rrdtool.SlackBuild (limited to 'rrdtool/rrdtool.SlackBuild') diff --git a/rrdtool/rrdtool.SlackBuild b/rrdtool/rrdtool.SlackBuild new file mode 100755 index 00000000..b56d1fcb --- /dev/null +++ b/rrdtool/rrdtool.SlackBuild @@ -0,0 +1,249 @@ +#!/bin/sh +# Copyright (c) 2006 Eric Hameleers +# Distributed under the terms of the GNU General Public License, Version 2 +# ----------------------------------------------------------------------------- +# +# Slackware SlackBuild script +# =========================== +# By: Eric Hameleers +# For: rrdtool +# URL: http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ +# Needs: +# Changelog: +# 1.2.8-1: 18/May/2005 by Eric Hameleers +# * Initial build. +# 1.2.12-1: 21/feb/2006 by Eric Hameleers +# * Upgrade. The cgilib is no longer needed as of 1.2.12. +# +# Run 'sh SlackBuild --cleanup' to build a Slackware package. +# The package (.tgz) plus descriptive .txt file are created in /tmp . +# Install using 'installpkg'. +# +# Small modifications made by rhatto at riseup.net +# +# ----------------------------------------------------------------------------- + +# --- INIT --- +# Set initial variables: +CWD=`pwd` + +PRGNAM=rrdtool +_VERSION="1.2.13" +_ARCH="i486" +_BUILD="1rha" +_TMP="/tmp" + +if [ -f "/etc/slackbuildrc" ]; then + source /etc/slackbuildrc +fi + +if [ -f "~/.slackbuildrc" ]; then + source ~/.slackbuildrc +fi + +if [ -z "$VERSION" ]; then + VERSION="$_VERSION" +fi + +if [ -z "$ARCH" ]; then + ARCH="$_ARCH" +fi + +if [ -z "$BUILD" ]; then + BUILD="$_BUILD" +fi + +if [ "$ARCH" == "x86_64" ]; then + export LDFLAGS="-L/lib64 -L/usr/lib64" + LIBDIR=/usr/lib64 +else + LIBDIR=/usr/lib +fi + +if [ -z "$SRC" ]; then + SRC_DIR="$CWD" +else + SRC_DIR="$SRC" +fi + +if [ -z "$TMP" ]; then + TMP="$_TMP" +fi + +SRC="$PRGNAM-$VERSION.tar.gz" +URL="http://people.ee.ethz.ch/~oetiker/webtools/$PRGNAM/pub/$SRC" + +if [ ! -f "$SRC_DIR/$SRC" ]; then + wget "$URL" -O "$SRC_DIR/$SRC" +fi + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2" +fi + +PKG=$TMP/package-$PRGNAM + +if [ ! -d $TMP/tmp-$PRGNAM ]; then + mkdir -p $TMP/tmp-$PRGNAM # location to build the source +fi +if [ ! -d $PKG ]; then + mkdir -p $PKG # place for the package to be built +fi + +# --- PACKAGE BUILDING --- + +echo "++" +echo "|| $PRGNAM-$VERSION" +echo "++" + +rm -rf $PKG/* + +cd $PKG + +# Explode the package framework: +if [ -f $CWD/_$PRGNAM.tar.gz ]; then + explodepkg $CWD/_$PRGNAM.tar.gz +fi + +cd $TMP/tmp-$PRGNAM + + +# --- TARBALL EXTRACTION,PATCH,MODIFY --- + +echo "Extracting the program tarball for $PRGNAM..." +tar -xzvf $SRC_DIR/${PRGNAM}-${VERSION}.tar.gz + +cd ${PRGNAM}-${VERSION} +chown -R root.root . + +# --- BUILDING --- + +echo Building ... + +CPPFLAGS="$SLKCFLAGS" +CFLAGS="$SLKCFLAGS" +export CPPFLAGS CFLAGS +./configure --prefix=/usr \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --libdir=$LIBDIR \ + --enable-perl-site-install \ + 2>&1 | tee $TMP/configure-${PRGNAM}.log +make 2>&1 | tee $TMP/make-${PRGNAM}.log + +# +# Install all the needed stuff to the package dir +# +# Use installwatch if available: +which installwatch > /dev/null 2>&1 +if [ $? == 0 ]; then + installwatch -o $TMP/install-${PRGNAM}.log make DESTDIR=$PKG install +else + make DESTDIR=$PKG install 2>&1 |tee $TMP/install-${PRGNAM}.log +fi + +# unneeded perl stuff +find $PKG/usr/lib/perl5/ -name Bundle -type d | xargs rm -rf +find $PKG/usr/lib/perl5/ -name perllocal.pod | xargs rm -f +find $PKG/usr/lib/perl5/ -name .packlist | xargs rm -f +find $PKG/usr/lib/perl5/ -type f -size 0c | xargs rm -f +# Remove empty directories (assuming two levels of file-less directories) +find $PKG/usr/lib/perl5/ -type d | xargs rmdir 2>/dev/null +find $PKG/usr/lib/perl5/ -type d | xargs rmdir 2>/dev/null + +# Screw-uppings +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +mv $PKG/usr/share/rrdtool/examples $PKG/usr/doc/$PRGNAM-$VERSION/ +mv $PKG/usr/share/doc/*/html $PKG/usr/doc/$PRGNAM-$VERSION/ +rm -rf $PKG/usr/share/doc +mkdir -p $PKG/usr/man/man3/ +mv $PKG/usr/share/man/man3/* $PKG/usr/man/man3/ +rm -rf $PKG/usr/share/man + + +# --- DOCUMENTATION --- + +DOCS="CHANGES CONTRIBUTORS COPYING COPYRIGHT NEWS NT-BUILD-TIPS.txt \ + README THREADS TODO" + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS \ + $PKG/usr/doc/$PRGNAM-$VERSION +chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* + +# Compress the man page(s) +gzip -9f $PKG/usr/man/*/* + +# Strip binaries +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + + +# --- OWNERSHIP, RIGHTS --- + +chmod -R o-w $PKG +chown root:bin $PKG/usr/bin/* $PKG/usr/sbin/* $PKG/bin/* $PKG/sbin/* \ + $PKG/usr/X11R6/bin/* $PKG/opt/kde/bin/* 2>/dev/null + + +# --- PACKAGE DESCRIPTION --- + +mkdir -p $PKG/install + +cat << EOF > $PKG/install/slack-desc +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler-----------------------------------------------------| +rrdtool: rrdtool (Time-series data storage and graphing software) +rrdtool: +rrdtool: RRDtool (Round Robin Database Tool) is time-series data storage and +rrdtool: graphing utility created by the author of MRTG. Using RRDtool, you +rrdtool: can write your own MRTG-like tools in a matter minutes with only a +rrdtool: few lines of Perl or shell code. +rrdtool: +rrdtool: +rrdtool: +rrdtool: +rrdtool: +EOF + +if [ -f $CWD/doinst.sh ]; then + cat $CWD/doinst.sh > $PKG/install/doinst.sh +fi + + +# --- BUILDING --- + +# Build the package: +cd $PKG + +# pala +# mv usr/lib/perl usr/lib/perl5 + +makepkg --linkadd y --chown n $TMP/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz \ + 2>&1 | tee $TMP/makepkg-${PRGNAM}.log +(cd $TMP && md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz.md5) +cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $TMP/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.txt + + +# --- CLEANUP --- + +# Clean up the extra stuff: +if [ "$1" = "--cleanup" ]; then + rm -rf $TMP/tmp-$PRGNAM + rm -rf $PKG +fi + -- cgit v1.2.3