From c4e0c314e6eac6964328c9c3daeaa232ea06e965 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sat, 2 Oct 2021 15:36:06 +0100 Subject: rename --- psibuild | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ psibuilds/bash.psibuild | 19 ++++++++++++++ xibuild | 68 ------------------------------------------------- xibuilds/bash.xibuild | 19 -------------- 4 files changed, 87 insertions(+), 87 deletions(-) create mode 100755 psibuild create mode 100644 psibuilds/bash.psibuild delete mode 100755 xibuild delete mode 100644 xibuilds/bash.xibuild diff --git a/psibuild b/psibuild new file mode 100755 index 0000000..567fd2b --- /dev/null +++ b/psibuild @@ -0,0 +1,68 @@ +#!/bin/bash + +usage () { + cat << EOF +usage: $0 PSIBUILD +EOF +} + +BUILD_FILE=${@: -1} + +[[ $# = 0 ]] && usage && epsit 1 +[ -f "$FILE" ] && echo "$BUILD_FILE not found" && epsit 1 + +source $BUILD_FILE + +PKG_NAME=$(basename $BUILD_FILE .psibuild) + +PSI_ROOT=$(pwd) +PKGS_OUTPUT=$PSI_ROOT/psipkgs + +PKG_BUILD_DIR=$PSI_ROOT/tmp/$PKG_NAME +PKG_DEST=$PKG_BUILD_DIR/package + +# make the directories +mkdir -p $PKG_DEST +cd $PKG_BUILD_DIR + +# fetch, build then package the package +fetch +build +package + + +# go back to root, make things easier +cd $PSI_ROOT + +# bundle the package to a targz in the output dir +mkdir -p $PKGS_OUTPUT + +PKG_FILE=$PKGS_OUTPUT/$PKG_NAME.psipkg + +tar -C $PKG_BUILD_DIR/package -czf $PKG_FILE ./ + +# create info file +PKG_INFO=$PKGS_OUTPUT/$PKG_NAME.psipkg.info + +echo "" > $PKG_INFO +echo "NAME=$PKG_NAME" >> $PKG_INFO +echo "PKG_FILE=$PKG_NAME.psipkg" >> $PKG_INFO +echo "CHECKSUM=$(md5sum $PKG_FILE | awk '{ print $1 }')" >> $PKG_INFO +echo "DATE=$(date)" >> $PKG_INFO +echo "DEPS=(${DEPS[*]})" >> $PKG_INFO + +# sign the package +PRIV_KEY=$PSI_ROOT/keychain/psi.pem +PUB_KEY=$PSI_ROOT/keychain/psi.pub + +if [ -f "$PRIV_KEY" ]; then + echo "SIGNATURE=" >> $PKG_INFO + openssl dgst -sign $PRIV_KEY $PKG_FILE >> $PKG_INFO +else + echo "SIGNATURE=">> $PKG_INFO + echo "unsigned">> $PKG_INFO + >&2 echo "WARNING! no private key: unsigned packages!" +fi +# clean up +rm -rf $PKG_BUILD_DIR +rmdir $PSI_ROOT/tmp diff --git a/psibuilds/bash.psibuild b/psibuilds/bash.psibuild new file mode 100644 index 0000000..9a5d1af --- /dev/null +++ b/psibuilds/bash.psibuild @@ -0,0 +1,19 @@ +#!/bin/bash + +DEPS=(readline libreadline.so=8-64 glibc ncurses) + +fetch () { + git clone https://git.savannah.gnu.org/git/bash.git +} + +build () { + cd bash + ./configure --without-bash-malloc --prefix=/usr + make + make DESTDIR=$PKG_DEST install +} + +package () { + echo "packaged" +} + diff --git a/xibuild b/xibuild deleted file mode 100755 index 5b6d003..0000000 --- a/xibuild +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -usage () { - cat << EOF -usage: $0 XIBUILD -EOF -} - -BUILD_FILE=${@: -1} - -[[ $# = 0 ]] && usage && exit 1 -[ -f "$FILE" ] && echo "$BUILD_FILE not found" && exit 1 - -source $BUILD_FILE - -PKG_NAME=$(basename $BUILD_FILE .xibuild) - -XI_ROOT=$(pwd) -PKGS_OUTPUT=$XI_ROOT/xipackages - -PKG_BUILD_DIR=$XI_ROOT/tmp/$PKG_NAME -PKG_DEST=$PKG_BUILD_DIR/package - -# make the directories -mkdir -p $PKG_DEST -cd $PKG_BUILD_DIR - -# fetch, build then package the package -fetch -build -package - - -# go back to root, make things easier -cd $XI_ROOT - -# bundle the package to a targz in the output dir -mkdir -p $PKGS_OUTPUT - -PKG_FILE=$PKGS_OUTPUT/$PKG_NAME.xipkg - -tar -C $PKG_BUILD_DIR/package -czf $PKG_FILE ./ - -# create info file -PKG_INFO=$PKGS_OUTPUT/$PKG_NAME.xipkg.info - -echo "" > $PKG_INFO -echo "NAME=$PKG_NAME" >> $PKG_INFO -echo "PKG_FILE=$PKG_NAME.xipkg" >> $PKG_INFO -echo "CHECKSUM=$(md5sum $PKG_FILE | awk '{ print $1 }')" >> $PKG_INFO -echo "DATE=$(date)" >> $PKG_INFO -echo "DEPS=(${DEPS[*]})" >> $PKG_INFO - -# sign the package -PRIV_KEY=$XI_ROOT/keychain/xi.pem -PUB_KEY=$XI_ROOT/keychain/xi.pub - -if [ -f "$PRIV_KEY" ]; then - echo "SIGNATURE=" >> $PKG_INFO - openssl dgst -sign $PRIV_KEY $PKG_FILE >> $PKG_INFO -else - echo "SIGNATURE=">> $PKG_INFO - echo "unsigned">> $PKG_INFO - >&2 echo "WARNING! no private key: unsigned packages!" -fi -# clean up -rm -rf $PKG_BUILD_DIR -rmdir $XI_ROOT/tmp diff --git a/xibuilds/bash.xibuild b/xibuilds/bash.xibuild deleted file mode 100644 index 9a5d1af..0000000 --- a/xibuilds/bash.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -DEPS=(readline libreadline.so=8-64 glibc ncurses) - -fetch () { - git clone https://git.savannah.gnu.org/git/bash.git -} - -build () { - cd bash - ./configure --without-bash-malloc --prefix=/usr - make - make DESTDIR=$PKG_DEST install -} - -package () { - echo "packaged" -} - -- cgit v1.2.1