Blastwave

I actually work on my zonestats tool, which use rrdtool, not yet package in blastwave. Since I met - during a GUSES meat - a blastwave maintainer (William Bonnet) I tried to package rrdtool. William send me some script I used to create my owns, which I post here.

I hope these scripts will be helpful !

Makefile

#
# Build a package and create a blastwave package
# Bruno Bonfils, <asyd@solaris-fr.org>
#
 
include build.prefs
 
UPSTREAM=rrdtool-1.2.11.tar.gz
SOURCE=rrdtool-1.2.11
DIST=${PWD}/package/dist
PROTOTYPE=${PWD}/package/prototype
ARCH=i386
PACKAGE_FILE=rrdtool-1.2.11-SunOS-5.11-${ARCH}
PACKAGE_NAME=CSWrrdtool
 
default: package
 
${SOURCE}/.archive:
        @echo "=============== Extracting archive ==============="
        @gtar xvfz ${DOWNLOAD}/${UPSTREAM}
        touch ${SOURCE}/.archive
 
${SOURCE}/.configured: ${SOURCE}/.archive
        @echo "=============== Configuring ==============="
        (cd ${SOURCE} ; rm -f config.cache ; \
        CC=${CC} CFLAGS=${CFLAGS} CPPFLAGS=${CPPFLAGS} LDFLAGS="${LDFLAGS}" \
                ./configure --prefix=${DIST} \
                --mandir=${DIST}/share/man \
                --disable-python \
                --disable-rrdcgi );
        @touch ${SOURCE}/.configured
 
${SOURCE}/.built: ${SOURCE}/.configured
        @echo "=============== Building upstream ==============="
        (cd ${SOURCE} ; \
        make);
        touch ${SOURCE}/.built
 
${DIST}:
        mkdir ${DIST}
 
${SOURCE}/.install: ${SOURCE}/.built ${DIST}
        @echo "=============== Installing package ==============="
        (cd ${SOURCE} ; make install);
        touch ${SOURCE}/.install
 
package: ${SOURCE}/.install
        @echo "=============== Creating package ==============="
        @echo i pkginfo > ${PROTOTYPE}
        @echo i copyright >> ${PROTOTYPE}
        @echo i depend >> ${PROTOTYPE}
        @echo d none /opt/csw 0755 root bin >> ${PROTOTYPE}
        (cd package ; pkgproto dist=/opt/csw >> prototype );
        @gsed "s/ARCH=.*/ARCH=${ARCH}/" -i blastwave/pkginfo
        @gsed "s/${USER} ${GROUP}/root bin/" -i ${PROTOTYPE}
        @cp blastwave/* package/
        (cd package ; pkgmk -o );
        pkgtrans -s /var/spool/pkg ${PWD}/${PACKAGE_FILE} ${PACKAGE_NAME}
        gzip -f ${PACKAGE_FILE}
 
# Human targets
archive: ${SOURCE}/.archive
 
configure: ${SOURCE}/.configured
 
build: ${SOURCE}/.built
 
install: ${DIST}/.install
 
distclean:
        @rm -fr ${SOURCE} package ${PACKAGE_FILE}.gz

build.prefs

PATH=/opt/SUNWspro/bin:/opt/csw/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/usr/sfw/bin:/sbin:/usr/sbin
CFLAGS=-I/opt/csw/include
LDFLAGS=-L/opt/csw/lib -R/opt/csw/lib
CPPFLAGS=-I/opt/csw/include
CC=cc
USER=root
GROUP=staff
DOWNLOAD=/home/bonfils/download