⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pkgbuild

📁 hsql是很有名的嵌入式数据库
💻
字号:
#!/bin/sh# $Id: pkgbuild,v 1.8 2002/11/10 22:50:51 unsaved Exp $# TODO:  Perhaps use RCS keywords to generate versions and write them#        into the install scripts, the info file, and to use in the#        stream package file name.set +uPROGNAME=`basename "$0"`Failout() {    echo "Aborting $PROGNAME.  $@" 1>&2    exit 1}case "`uname`" in    SunOS)	echonoterm() {	# Echo without trailing newline	    echo "$@\c"	}    ;;    Linux)	echonoterm() {	# Echo without trailing newline	    echo -n "$@"	}    ;;    *)    	echo 'Aborting.  Your OS is not supported yet.  If you seriously' 1>&2	echo "want support for it, email ${AUTHOR_EMAILADDR}."	exit 10    ;;esac# Being VERY careful here, because we do a relative "rm -rf" below!![ "$0" = "./$PROGNAME" ] || Failout "You have to run this script like './$PROGNAME'"GENPROTO=while [ "$#" -gt 0 ]; do    case "$1" in -*n*)    	pkgmk() {	     echo "pkgmk $@" 1>&2    	}    	pkgtrans() {	     echo "pkgtransmk $@" 1>&2    	}    	compress() {	     echo "compress $@" 1>&2    	}    	rm() {	     echo "rm $@" 1>&2    	}	;;    esac    case "$1" in -*p*) GENPROTO=1;; esac    case "$1" in -*v*) set -x;; esac # Verbose    shiftdone[ -n "$GENPROTO" ] || echo "Warning:  Using existing .proto file.Quit and invoke with '-p' if any component file(s) have changed."getent passwd hsqldb > /dev/null || Failout "You need to have the user account 'hsqldb' on this sytem (dead shell ok)"getent group hsqldb > /dev/null || Failout "You need to have the group 'hsqldb' on this sytem"PKGNAME=`sed -n '/^PKG=/ {    s:^PKG=::    p}' cfg/HSQLhsqldb.info` || Failout 'Failed to package name version from info file'[ -n "$PKGNAME" ] || Failout 'Failed to retrieve package name from info file'VERINFO=`sed -n '/^VERDIR=/ {    s:^VERDIR=::    p}' cfg/HSQLhsqldb.info` || Failout 'Failed to retrieve version from info file'[ -n "$VERINFO" ] || Failout 'Failed to retrieve version from info file'VERPOST=`sed -n '/^BASE=/ {    s:^BASE=::    p}' cfg/HSQLhsqldb.postinstall` || Failout 'Failed to retrieve version from info postinstall script'[ -n "$VERPOST" ] || Failout 'Failed to retrieve version from info postinstall script'VERPRE=`sed -n '/^BASE=/ {    s:^BASE=::    p}' cfg/HSQLhsqldb.preremove ` || Failout 'Failed to retrieve version from info preremove script'[ -n "$VERPRE" ] || Failout 'Failed to retrieve version from info preremove script'[ "$VERPRE" = "$VERPOST" ] || Failout  \ "Version specs (BASE) don't agree in preremove script and postinstall script"[ "$VERPRE" = "$VERINFO" ] ||  Failout "Version specs (BASE and VERDIR) don't agree in preremove script and info script"case "$VERPRE" in hsqldb-*);; *)    Failout  \"Sorry, but this script requires BASE/VERDIR to be of the form 'hsqldb-VERSION'  (Yours is '$VERPRE')";;esacVER=`echo $VERPRE | sed s:hsqldb-::`PWD=`pwd`   # Bourne doesn't necessarily set $PWDSRCBASE=`dirname $PWD`SRCBASE=`dirname $SRCBASE`SRCBASE=`dirname $SRCBASE`for jarfile in $SRCBASE/lib/hsqldb_jre*.jar; do    [ -f "$jarfile" ] ||     Failout "Looks like your hsqldb_jre*.jar files are not built"donePROTOFILE="`echo cfg/H*.proto`"[ -f "$PROTOFILE" ] || Failout "You need to fix cfg/H*.proto, or fix the wildcard in this scriptEven if you're generating it, you have to start with an old version."[ -n "$GENPROTO" ] && {    perl -v > /dev/null 2>&1 ||     Failout 'You need perl in your search path to generate the proto file'    echo 'Generating prototype file...'    # Remove all lines after "# REGENERATE..."    perl -pi -we 'if (/^# REGENERATE AFTER HERE/i) {print; exit;}' $PROTOFILE    (cd $SRCBASE && pkgproto '.=$VERDIR') >> $PROTOFILE    perl -ni.safe -we '	next if m:^\s*\S\s+none\s+\$VERDIR/classes:;	#next if m:^\s*\S\s+none\s+\$VERDIR/src:; Keep SOURCE!	next if m:^[^#=]*build/packaging:;    	next if m:^[^#]*[/ ]CVS:;	next if m:/lib/hsqldb\.jar\b:;	s/ 0644 root other$// unless /^\!default\s/;	print;    ' $PROTOFILE    grep '^d none $VERDIR/data 0755 root other' $PROTOFILE ||     echo 'd none $VERDIR/data 0755 root other' >> $PROTOFILE    grep '^d none $VERDIR/data/db1 0755 hsqldb hsqldb' $PROTOFILE ||     echo 'd none $VERDIR/data/db1 0755 hsqldb hsqldb' >> $PROTOFILE}# Be careful if you edit this[ -r "$PKGNAME" ] && {    echonoterm "Remove old dir package '$PKGNAME'?  "    read REPLY    case "$REPLY" in [Yy]*)    	echonoterm 'Removing old dir package...  '    	rm -rf "./$PKGNAME"    	echo Done;;    	[Qq]*) exit 0;;    esac}echo "Building version $VER with source base $SRCBASE"pkgmk -o -b $SRCBASE -d . -f $PROTOFILE || exit 1# Package file name format is the Solaris package standard:#   PKGNAME-ver_with_underscores-platform.pkg[.Z]# So, we need to convert dots to underscores in the version nameexport VERVER="`perl -we '$_ = $ENV{VER}; s:\.:_:g; print;'`"echonoterm  \ "ENTER to quit, Y to build stream package ${PKGNAME}-${VER}-solaris.pkg.Z:  "read REPLYcase "$REPLY" in [Yy]*)    rm -f "${PKGNAME}-${VER}-solaris.pkg" "${PKGNAME}-${VER}-solaris.pkg.Z"    pkgtrans -os . "$PWD/${PKGNAME}-${VER}-solaris.pkg" $PKGNAME &&    echonoterm 'Now compressing... '    compress "${PKGNAME}-${VER}-solaris.pkg"    echo 'Done(If there is a message above that the file is "unchanged", that just means thatthe file compression was skipped because compression resulted in no savings).'    ;;    [Qq]*) exit 0;;esac

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -