#!/bin/bash # naming convention and rules for generation from http://cygwin.com/setup.html PACKAGE=make VERSION=3.82 # release number RELEASE=1 PACKAGE_BIN_FILE=${PACKAGE}-${VERSION}-${RELEASE}.tar.bz2 PACKAGE_SRC_FILE=${PACKAGE}-${VERSION}-${RELEASE}-src.tar.bz2 # constructed stuff PACKAGE_BIN_DIR=usr PACKAGE_SRC_DIR=${PACKAGE}-${VERSION}-${RELEASE} # stuff for building VENDOR_DIR=make-3.82 VENDOR_FILE=${VENDOR_DIR}.tar.gz BUILD_PREFIX=/usr # whack anything generated rm -f -r ${PACKAGE_BIN_FILE} \ ${PACKAGE_BIN_DIR} \ ${PACKAGE_SRC_FILE} \ ${PACKAGE_SRC_DIR} \ ${VENDOR_DIR} \ || exit 1 if [ "$1" = "clean" ] then exit 0 fi # unpack tarball tar zxf ${VENDOR_FILE} || exit 1 # archive source for package cp -r ${VENDOR_DIR} ${PACKAGE_SRC_DIR} || exit 1 # construct PACKAGE_SRC_FILE from archive (tar cf - --owner=0 --group=0 ${PACKAGE_SRC_DIR} | bzip2 > ${PACKAGE_SRC_FILE}) || exit 1 if [ "$1" = "nobuild" ] then exit 0 fi pushd ${PACKAGE_SRC_DIR} || exit 1 # run ./configure ./configure --prefix=${BUILD_PREFIX} || exit 1 # note that make needs an absolute path for installation make prefix="$(pwd)/../${PACKAGE_BIN_DIR}" install || exit 1 popd (tar cf - --owner=0 --group=0 ${PACKAGE_BIN_DIR} | \ bzip2 > ${PACKAGE_BIN_FILE}) || exit 1