From cdea2f67ae42d4220e19a555259b69a960925283 Mon Sep 17 00:00:00 2001 From: davidovski Date: Tue, 5 Oct 2021 16:35:17 +0100 Subject: renamed --- psibuild | 144 -------------------------------------------- psibuilds/bash.psibuild | 12 ---- psibuilds/bc.psibuild | 15 ----- psibuilds/binutils.psibuild | 13 ---- psibuilds/bzip2.psibuild | 37 ------------ psibuilds/dejagnu.psibuild | 23 ------- psibuilds/expect.psibuild | 20 ------ psibuilds/file.psibuild | 20 ------ psibuilds/flex.psibuild | 19 ------ psibuilds/gcc.psibuild | 15 ----- psibuilds/glibc.psibuild | 78 ------------------------ psibuilds/gmp.psibuild | 25 -------- psibuilds/iana-etc.psibuild | 16 ----- psibuilds/m4.psibuild | 14 ----- psibuilds/psibuild.psibuild | 10 --- psibuilds/readline.psibuild | 19 ------ psibuilds/tar.psibuild | 13 ---- psibuilds/tcl.psibuild | 28 --------- psibuilds/xz.psibuild | 14 ----- psibuilds/zlib.psibuild | 19 ------ psibuilds/zstd.psibuild | 18 ------ xibuild | 144 ++++++++++++++++++++++++++++++++++++++++++++ xibuilds/bash.xibuild | 12 ++++ xibuilds/bc.xibuild | 15 +++++ xibuilds/binutils.xibuild | 13 ++++ xibuilds/bzip2.xibuild | 37 ++++++++++++ xibuilds/dejagnu.xibuild | 23 +++++++ xibuilds/expect.xibuild | 20 ++++++ xibuilds/file.xibuild | 20 ++++++ xibuilds/flex.xibuild | 19 ++++++ xibuilds/gcc.xibuild | 15 +++++ xibuilds/glibc.xibuild | 78 ++++++++++++++++++++++++ xibuilds/gmp.xibuild | 25 ++++++++ xibuilds/iana-etc.xibuild | 16 +++++ xibuilds/m4.xibuild | 14 +++++ xibuilds/readline.xibuild | 19 ++++++ xibuilds/tar.xibuild | 13 ++++ xibuilds/tcl.xibuild | 28 +++++++++ xibuilds/xibuild.xibuild | 10 +++ xibuilds/xz.xibuild | 14 +++++ xibuilds/zlib.xibuild | 19 ++++++ xibuilds/zstd.xibuild | 18 ++++++ 42 files changed, 572 insertions(+), 572 deletions(-) delete mode 100755 psibuild delete mode 100644 psibuilds/bash.psibuild delete mode 100644 psibuilds/bc.psibuild delete mode 100644 psibuilds/binutils.psibuild delete mode 100644 psibuilds/bzip2.psibuild delete mode 100644 psibuilds/dejagnu.psibuild delete mode 100644 psibuilds/expect.psibuild delete mode 100644 psibuilds/file.psibuild delete mode 100644 psibuilds/flex.psibuild delete mode 100644 psibuilds/gcc.psibuild delete mode 100644 psibuilds/glibc.psibuild delete mode 100644 psibuilds/gmp.psibuild delete mode 100644 psibuilds/iana-etc.psibuild delete mode 100644 psibuilds/m4.psibuild delete mode 100644 psibuilds/psibuild.psibuild delete mode 100644 psibuilds/readline.psibuild delete mode 100644 psibuilds/tar.psibuild delete mode 100644 psibuilds/tcl.psibuild delete mode 100644 psibuilds/xz.psibuild delete mode 100644 psibuilds/zlib.psibuild delete mode 100644 psibuilds/zstd.psibuild create mode 100755 xibuild create mode 100644 xibuilds/bash.xibuild create mode 100644 xibuilds/bc.xibuild create mode 100644 xibuilds/binutils.xibuild create mode 100644 xibuilds/bzip2.xibuild create mode 100644 xibuilds/dejagnu.xibuild create mode 100644 xibuilds/expect.xibuild create mode 100644 xibuilds/file.xibuild create mode 100644 xibuilds/flex.xibuild create mode 100644 xibuilds/gcc.xibuild create mode 100644 xibuilds/glibc.xibuild create mode 100644 xibuilds/gmp.xibuild create mode 100644 xibuilds/iana-etc.xibuild create mode 100644 xibuilds/m4.xibuild create mode 100644 xibuilds/readline.xibuild create mode 100644 xibuilds/tar.xibuild create mode 100644 xibuilds/tcl.xibuild create mode 100644 xibuilds/xibuild.xibuild create mode 100644 xibuilds/xz.xibuild create mode 100644 xibuilds/zlib.xibuild create mode 100644 xibuilds/zstd.xibuild diff --git a/psibuild b/psibuild deleted file mode 100755 index 3b26fed..0000000 --- a/psibuild +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/bash - -PSI_ROOT=$(pwd) - -ERROR="\033[0;31m" -INFO="\033[0;34m" -PASS="\033[0;32m" -NEUTRAL="\033[0;33m" -RESET="\033[0m" - -MAKEFLAGS="-j11" -alias make="make $MAKEFLAGS" - -usage () { - cat << EOF -usage: $0 PSIBUILD -EOF -} - -psibuild () { - BUILD_FILE=${@: -1} - - cd $PSI_ROOT - - [[ $# = 0 ]] && usage && exit 1 - [ ! -f "$BUILD_FILE" ] && echo "$BUILD_FILE not found" && exit 1 - - clean () { - # clean up - rm -rf $PKG_BUILD_DIR - rmdir $PSI_ROOT/tmp > /dev/null 2>&1 - } - - build () { - printf "\tpassing missing build stage..." - } - package () { - echo "Passing missing package stage" - } - - source $BUILD_FILE - - PKG_NAME=$(basename $BUILD_FILE .psibuild) - - LOGFILE=$PSI_ROOT/logs/$PKG_NAME.log - PKGS_OUTPUT=$PSI_ROOT/ppkgs - PKG_FILE=$PKGS_OUTPUT/$PKG_NAME.ppkg - - PKG_BUILD_DIR=$PSI_ROOT/tmp/$PKG_NAME - PKG_DEST=$PKG_PSI_ROOT/tmp/$PKG_NAME.package - - # make sure build dir is clean before starting - rm -rf $PKG_BUILD_DIR - - # make the directories - mkdir -p $PKG_BUILD_DIR - mkdir -p $PKG_DEST - mkdir -p $PKGS_OUTPUT - mkdir -p $PSI_ROOT/logs - - date > $LOGFILE - echo "Build log for $PKG_NAME from $BUILD_FILE\n" >> $LOGFILE - printf "\033[0;36m====> $PKG_NAME.ppkg\n" | tee -a $LOGFILE - - cd $PKG_BUILD_DIR - - # fetch, build then package the package - ############ - - # try get the commit hash for the package - VER_HASH=$(git ls-remote $SOURCE HEAD | awk '{ print $1 }') - - # If we already have this package, don't waste our time - if [ -f "$PKG_FILE.info" ] && [ -f "$PKG_FILE" ]; then - EXISTING_HASH=$(grep -a "VER_HASH" $PKG_FILE.info | sed "s/VER_HASH=//") - - echo "Comparing $EXISTING_HASH to $VER_HASH" >> $LOGFILE - - printf "$INFO\tvalidating commit hash..."; - if [ "$EXISTING_HASH" == "$VER_HASH" ]; then - printf "$NEUTRAL package exists\n" - return 0; - else - printf "$NEUTRAL package outdated\n" - fi - fi - - printf "$INFO\tfetching package..."; - git clone $SOURCE . >> $LOGFILE 2>&1 && printf "$PASS fetched $(du -sh $PKG_BUILD_DIR | awk '{ print $1 }') source\n" || printf "$ERROR error! See log\n" - - printf "$INFO\tbuilding package..."; - build >> $LOGFILE 2>&1 && printf "$PASS built\n" || printf "$ERROR error! See log\n"; - - - printf "\033[0;34m\tpackaging package...\033[0m"; - package >> $LOGFILE 2>&1 && printf "$PASS packaged\n" || printf "$ERROR error! See log\n" - - - # go back to root, make things easier - cd $PSI_ROOT - - printf "$INFO\tarchiving package..."; - tar -C $PKG_DEST -czf $PKG_FILE ./ >> $LOGFILE 2>&1 && printf "$PASS archived to $(du -sh $PKG_FILE | awk '{ print $1 }')\n" || printf "$ERROR error! See log\n" - - - # create info file - printf "$INFO\tcreating ppkg.info..."; - PKG_INFO=$PKGS_OUTPUT/$PKG_NAME.ppkg.info - - echo "" > $PKG_INFO - echo "NAME=$PKG_NAME" >> $PKG_INFO - echo "PKG_FILE=$PKG_NAME.ppkg" >> $PKG_INFO - echo "CHECKSUM=$(md5sum $PKG_FILE | awk '{ print $1 }')" >> $PKG_INFO - echo "VER_HASH=$VER_HASH" >> $PKG_INFO - echo "SOURCE=$SOURCE" >> $PKG_INFO - echo "DATE=$(date)" >> $PKG_INFO - echo "DEPS=(${DEPS[*]})" >> $PKG_INFO - - printf "$INFOsigning..."; - # 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 printf "$ERROR WARNING! No private key: unsigned packages!\n" - fi - printf "$PASS signed\n"; - - printf "$PASS successfully built $PKG_NAME to $(basename $PKG_FILE)$RESET\n\n" - - clean -} - - -FILES=$@ - -for BUILD_FILE in $FILES; do - psibuild $BUILD_FILE -done diff --git a/psibuilds/bash.psibuild b/psibuilds/bash.psibuild deleted file mode 100644 index b2a0156..0000000 --- a/psibuilds/bash.psibuild +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -DEPS=(readline glibc ncurses) - -SOURCE=https://git.savannah.gnu.org/git/bash.git - -build () { - ./configure --without-bash-malloc --prefix=/usr - make - make DESTDIR=$PKG_DEST install -} - diff --git a/psibuilds/bc.psibuild b/psibuilds/bc.psibuild deleted file mode 100644 index 989dc96..0000000 --- a/psibuilds/bc.psibuild +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -DEPS=(readline) - -SOURCE=https://github.com/gavinhoward/bc - - -build () { - CC=gcc ./configure --prefix=/usr -G -O3 - make - make test - make DESTDIR=$PKG_DEST install -} - - diff --git a/psibuilds/binutils.psibuild b/psibuilds/binutils.psibuild deleted file mode 100644 index ea8caac..0000000 --- a/psibuilds/binutils.psibuild +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -DEPS=() - -SOURCE=git://sourceware.org/git/binutils.git - - -build () { - ./configure --prefix=/usr --disable-nls --disable-werror - make - make DESTDIR=$PKG_DEST install -} - diff --git a/psibuilds/bzip2.psibuild b/psibuilds/bzip2.psibuild deleted file mode 100644 index 726f0f7..0000000 --- a/psibuilds/bzip2.psibuild +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -DEPS=(glibc sh) - -SOURCE=git://sourceware.org/git/bzip2.git - - -build () { - - # ensure symbolic links are relative - sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile - - make -f Makefile-libbz2_so - make clean - - make - - make PREFIX=$PKG_DEST/usr install - -} - -package () { - cp -av libbz2.so* $PKG_DEST/usr/lib - cp -av libbz2.so.1.0.8 $PKG_DEST/usr/lib/libbz2.so - - cp -v bzip2-shared $PKG_DEST/usr/bin/bzip2 - for i in $PKG_DEST/usr/bin/{bzcat,bunzip2}; do - cp -afv bzip2 $i - done - - # remove a useless static library - cp -v bzip2-shared $PKG_DEST/usr/bin/bzip2 - for i in $PKG_DEST/usr/bin/{bzcat,bunzip2}; do - ln -sfv bzip2 $i - done -} - diff --git a/psibuilds/dejagnu.psibuild b/psibuilds/dejagnu.psibuild deleted file mode 100644 index ee09ef3..0000000 --- a/psibuilds/dejagnu.psibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -DEPS=(sh expect) - -SOURCE=git://git.sv.gnu.org/dejagnu.git - - -build () { - mkdir -v build - cd build - - ../configure --prefix=/usr - - makeinfo --html --no-split -o doc/dejagnu.html ../doc/dejagnu.texi - makeinfo --plaintext -o doc/dejagnu.txt ../doc/dejagnu.texi - - make DESTDIR=$PKG_DEST install - - install -v -dm755 $PKG_DEST/usr/share/doc/dejagnu-1.6.3 - install -v -m644 doc/dejagnu.{html,txt} $PKG_DEST/usr/share/doc/dejagnu-1.6.3 -} - - diff --git a/psibuilds/expect.psibuild b/psibuilds/expect.psibuild deleted file mode 100644 index e2288a3..0000000 --- a/psibuilds/expect.psibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -DEPS=(tcl) - -SOURCE=https://github.com/aeruder/expect - - -build () { - # note: --with-tcl, we might want to make a way to use the tcl that we've compiled in another package - ./configure --prefix=/usr --with-tcl=/usr/lib --enable-shared --mandir=/usr/share/man --with-tclinclude=/usr/include - make - make test - make DESTDIR=$PKG_DEST install -} - -package () { - cp libexpect*.so $PKG_DEST/usr/lib -} - - diff --git a/psibuilds/file.psibuild b/psibuilds/file.psibuild deleted file mode 100644 index 9141847..0000000 --- a/psibuilds/file.psibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -DEPS=(glibc ) - -SOURCE=https://github.com/file/file - - -build () { - # cheating - wget http://ftp.astron.com/pub/file/file-5.40.tar.gz - tar -zxf file-5.40.tar.gz - cd file-5.40 - - ./configure --prefix=/usr - make - make check - make DESTDIR=$PKG_DEST install -} - - diff --git a/psibuilds/flex.psibuild b/psibuilds/flex.psibuild deleted file mode 100644 index 88d61a6..0000000 --- a/psibuilds/flex.psibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -DEPS=(glibc m4 sh) - -SOURCE=https://github.com/nlitsme/gnubc - - -build () { - ./configure --prefix=/usr --docdir=/usr/share/doc/flex --disable-static - make - make check - make DESTDIR=$PKG_DEST install -} - -package () { - ln -sv $PKG_DEST/usr/bin/flex $PKG_DEST/usr/bin/lex -} - - diff --git a/psibuilds/gcc.psibuild b/psibuilds/gcc.psibuild deleted file mode 100644 index 3edb513..0000000 --- a/psibuilds/gcc.psibuild +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -DEPS=(glibc) - -SOURCE=git://gcc.gnu.org/git/gcc.git - - -build () { - mkdir -v build - cd build - ../configure --prefix=/usr --disable-multilib --disable-bootstrap - make - make DESTDIR=$PKG_DEST install -} - diff --git a/psibuilds/glibc.psibuild b/psibuilds/glibc.psibuild deleted file mode 100644 index 5b111bd..0000000 --- a/psibuilds/glibc.psibuild +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -DEPS=(glibc) - -SOURCE=https://sourceware.org/git/glibc.git - -build () { - # patches as recommended by lfs - sed -e '/NOTIFY_REMOVED)/s/)/ \&\& data.attr != NULL)/' -i sysdeps/unix/sysv/linux/mq_notify.c - - mkdir -v build - cd build - - # ensure that the ldconfig and sln utilities are installed into /usr/sbin - echo "rootsbindir=/usr/sbin" > configparms - - ../configure --prefix=/usr \ - --disable-werror \ - --enable-kernel=3.2 \ - --enable-stack-protector=strong \ - --with-headers=/usr/include \ - libc_cv_slibdir=/usr/lib - - make - make check - - sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile - make DESTDIR=$PKG_DEST install - - - # fix hardcoded path to the excutable in ldd script - sed '/RTLDLIST=/s@/usr@@g' -i $PKG_DEST/usr/bin/ldd - - cp -v ../nscd/nscd.conf $PKG_DEST/etc/nscd.conf - mkdir -pv $PKG_DEST/var/cache/nscd -} - -package () { - cat > $PKG_DEST/etc/nsswitch.conf << "EOF" -# Begin /etc/nsswitch.conf -passwd: files -group: files -shadow: files -hosts: files dns -networks: files -protocols: files -services: files -ethers: files -rpc: files -# End /etc/nsswitch.conf -EOF - - wget https://mirrors.slackware.com/slackware/slackware64-current/source/a/glibc-zoneinfo/tzdata2021a.tar.gz - - tar -xf tzdata2021a.tar.gz - - ZONEINFO=$PKG_DEST/usr/share/zoneinfo - mkdir -pv $ZONEINFO/{posix,right} - for tz in etcetera southamerica northamerica europe africa antarctica \ - asia australasia backward; do - zic -L /dev/null -d $ZONEINFO ${tz} - zic -L /dev/null -d $ZONEINFO/posix ${tz} - zic -L leapseconds -d $ZONEINFO/right ${tz} - done - cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO - zic -d $ZONEINFO -p America/New_York - unset ZONEINFO - - - # configure the dynamic loader - - cat > $PKG_DEST/etc/ld.so.conf << "EOF" -# Begin /etc/ld.so.conf -/usr/local/lib -/opt/lib -EOF -} - diff --git a/psibuilds/gmp.psibuild b/psibuilds/gmp.psibuild deleted file mode 100644 index 4a62d77..0000000 --- a/psibuilds/gmp.psibuild +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -DEPS=(gcc-libs sh) - -SOURCE=https://github.com/ryepdx/gmp - - -build () { - ./configure --prefix=/usr --enable-cxx --disable-static --docdir=/usr/share/doc/gmp - - make - make html - - make check 2>&1 | tee gmp-check-log - awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log - - make DESTDIR=$PKG_DEST install - make DESTDIR=$PKG_DEST install-html -} - -package () { - ln -sv $PKG_DEST/usr/bin/flex $PKG_DEST/usr/bin/lex -} - - diff --git a/psibuilds/iana-etc.psibuild b/psibuilds/iana-etc.psibuild deleted file mode 100644 index 6466472..0000000 --- a/psibuilds/iana-etc.psibuild +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -DEPS=() - -SOURCE=https://github.com/Mic92/iana-etc - -build () { - python update.py out -} - -package () { - mkdir -vp $PKG_DEST/etc - cp -v out/dist/protocols $PKG_DEST/etc/ - cp -v out/dist/services $PKG_DEST/etc/ -} - diff --git a/psibuilds/m4.psibuild b/psibuilds/m4.psibuild deleted file mode 100644 index f28ec33..0000000 --- a/psibuilds/m4.psibuild +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -DEPS=(glibc bash) - -SOURCE=git://git.sv.gnu.org/m4 - - -build () { - ./configure --prefix=/usr - make - make check - make DESTDIR=$PKG_DEST install -} - diff --git a/psibuilds/psibuild.psibuild b/psibuilds/psibuild.psibuild deleted file mode 100644 index 2f68018..0000000 --- a/psibuilds/psibuild.psibuild +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DEPS=(bash tar) - -SOURCE=https://git.davidovski.xyz/psibuild.git - -package () { - cp psibuild $PKG_DEST/usr/bin/ -} - diff --git a/psibuilds/readline.psibuild b/psibuilds/readline.psibuild deleted file mode 100644 index 2721677..0000000 --- a/psibuilds/readline.psibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -DEPS=(glibc ncurses) - -SOURCE=https://git.savannah.gnu.org/git/readline.git - - -build () { - ./configure --prefix=/usr \ - --disable-static \ - --with-curses \ - --docdir=/usr/share/doc/readline-8.1 - - make SHLIB_LIBS="-lncursesw" - make SHLIB_LIBS="-lncursesw" DESTDIR=$PKG_DEST install - - install -v -m644 doc/*.{ps,pdf,html,dvi} $PKG_DEST/usr/share/doc/readline-8.1 -} - diff --git a/psibuilds/tar.psibuild b/psibuilds/tar.psibuild deleted file mode 100644 index 829d6d2..0000000 --- a/psibuilds/tar.psibuild +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -DEPS=(glibc) - -SOURCE=https://git.savannah.gnu.org/git/tar.git - -build () { - ./bootstrap - ./configure --prefix=/usr - make - make DESTDIR=$PKG_DEST install -} - diff --git a/psibuilds/tcl.psibuild b/psibuilds/tcl.psibuild deleted file mode 100644 index 16442f4..0000000 --- a/psibuilds/tcl.psibuild +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -DEPS=(zlib) - -SOURCE=https://github.com/tcltk/tcl - - -build () { - SRCDIR=$(pwd) - cd unix - ./configure --prefix=/usr --mandir=/usr/share/man $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit) - - make test - - make DESTDIR=$PKG_DEST install - - chmod -v u+w $PKG_DEST/usr/lib/libtcl8.6.so - - make DESTDIR=$PKG_DEST install-private-headers -} - -package () { - cp -f tclsh8.6 $PKG_DEST/usr/bin/tclsh - mv $PKG_DEST/usr/share/man/man3/{Thread,Tcl_Thread}.3 - -} - - diff --git a/psibuilds/xz.psibuild b/psibuilds/xz.psibuild deleted file mode 100644 index e17f53b..0000000 --- a/psibuilds/xz.psibuild +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -DEPS=(sh) - -SOURCE=https://git.tukaani.org/xz.git - - -build () { - ./configure --prefix=/usr --disable-static --docdir=$PKG_DEST/usr/share/doc/xz-5.2.5 - make - make check - make DESTDIR=$PKG_DEST install -} - diff --git a/psibuilds/zlib.psibuild b/psibuilds/zlib.psibuild deleted file mode 100644 index c771727..0000000 --- a/psibuilds/zlib.psibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -DEPS=(glibc) - -SOURCE=https://github.com/madler/zlib - - -build () { - ./configure --prefix=/usr - make - make check - make DESTDIR=$PKG_DEST install -} - -package () { - # Remove a useless static library (lfs recommended) - rm -fv $PKG_DEST/usr/lib/libz.a -} - diff --git a/psibuilds/zstd.psibuild b/psibuilds/zstd.psibuild deleted file mode 100644 index 63ba9af..0000000 --- a/psibuilds/zstd.psibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -DEPS=(glibc gcc-libs zlib xz lz4) - -SOURCE=https://github.com - - -build () { - make - make prefix=/usr check - make DESTDIR=$PKG_DEST install -} - -package () { - # Remove a useless static library (lfs recommended) - rm -v $PKG_DEST/usr/lib/libzstd.a -} - diff --git a/xibuild b/xibuild new file mode 100755 index 0000000..47ac90b --- /dev/null +++ b/xibuild @@ -0,0 +1,144 @@ +#!/bin/bash + +XI_ROOT=$(pwd) + +ERROR="\033[0;31m" +INFO="\033[0;34m" +PASS="\033[0;32m" +NEUTRAL="\033[0;33m" +RESET="\033[0m" + +MAKEFLAGS="-j11" +alias make="make $MAKEFLAGS" + +usage () { + cat << EOF +usage: $0 XIBUILD +EOF +} + +xibuild () { + BUILD_FILE=${@: -1} + + cd $XI_ROOT + + [[ $# = 0 ]] && usage && exit 1 + [ ! -f "$BUILD_FILE" ] && echo "$BUILD_FILE not found" && exit 1 + + clean () { + # clean up + rm -rf $PKG_BUILD_DIR + rmdir $XI_ROOT/tmp > /dev/null 2>&1 + } + + build () { + printf "\tpassing missing build stage..." + } + package () { + echo "Passing missing package stage" + } + + source $BUILD_FILE + + PKG_NAME=$(basename $BUILD_FILE .xibuild) + + LOGFILE=$XI_ROOT/logs/$PKG_NAME.log + PKGS_OUTPUT=$XI_ROOT/xipkgs + PKG_FILE=$PKGS_OUTPUT/$PKG_NAME.xipkg + + PKG_BUILD_DIR=$XI_ROOT/tmp/$PKG_NAME + PKG_DEST=$PKG_XI_ROOT/tmp/$PKG_NAME.package + + # make sure build dir is clean before starting + rm -rf $PKG_BUILD_DIR + + # make the directories + mkdir -p $PKG_BUILD_DIR + mkdir -p $PKG_DEST + mkdir -p $PKGS_OUTPUT + mkdir -p $XI_ROOT/logs + + date > $LOGFILE + echo "Build log for $PKG_NAME from $BUILD_FILE\n" >> $LOGFILE + printf "\033[0;36m====> $PKG_NAME.xipkg\n" | tee -a $LOGFILE + + cd $PKG_BUILD_DIR + + # fetch, build then package the package + ############ + + # try get the commit hash for the package + VER_HASH=$(git ls-remote $SOURCE HEAD | awk '{ print $1 }') + + # If we already have this package, don't waste our time + if [ -f "$PKG_FILE.info" ] && [ -f "$PKG_FILE" ]; then + EXISTING_HASH=$(grep -a "VER_HASH" $PKG_FILE.info | sed "s/VER_HASH=//") + + echo "Comparing $EXISTING_HASH to $VER_HASH" >> $LOGFILE + + printf "$INFO\tvalidating commit hash..."; + if [ "$EXISTING_HASH" == "$VER_HASH" ]; then + printf "$NEUTRAL package exists\n" + return 0; + else + printf "$NEUTRAL package outdated\n" + fi + fi + + printf "$INFO\tfetching package..."; + git clone $SOURCE . >> $LOGFILE 2>&1 && printf "$PASS fetched $(du -sh $PKG_BUILD_DIR | awk '{ print $1 }') source\n" || printf "$ERROR error! See log\n" + + printf "$INFO\tbuilding package..."; + build >> $LOGFILE 2>&1 && printf "$PASS built\n" || printf "$ERROR error! See log\n"; + + + printf "\033[0;34m\tpackaging package...\033[0m"; + package >> $LOGFILE 2>&1 && printf "$PASS packaged\n" || printf "$ERROR error! See log\n" + + + # go back to root, make things easier + cd $XI_ROOT + + printf "$INFO\tarchiving package..."; + tar -C $PKG_DEST -czf $PKG_FILE ./ >> $LOGFILE 2>&1 && printf "$PASS archived to $(du -sh $PKG_FILE | awk '{ print $1 }')\n" || printf "$ERROR error! See log\n" + + + # create info file + printf "$INFO\tcreating xipkg.info..."; + 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 "VER_HASH=$VER_HASH" >> $PKG_INFO + echo "SOURCE=$SOURCE" >> $PKG_INFO + echo "DATE=$(date)" >> $PKG_INFO + echo "DEPS=(${DEPS[*]})" >> $PKG_INFO + + printf "$INFOsigning..."; + # 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 printf "$ERROR WARNING! No private key: unsigned packages!\n" + fi + printf "$PASS signed\n"; + + printf "$PASS successfully built $PKG_NAME to $(basename $PKG_FILE)$RESET\n\n" + + clean +} + + +FILES=$@ + +for BUILD_FILE in $FILES; do + xibuild $BUILD_FILE +done diff --git a/xibuilds/bash.xibuild b/xibuilds/bash.xibuild new file mode 100644 index 0000000..b2a0156 --- /dev/null +++ b/xibuilds/bash.xibuild @@ -0,0 +1,12 @@ +#!/bin/bash + +DEPS=(readline glibc ncurses) + +SOURCE=https://git.savannah.gnu.org/git/bash.git + +build () { + ./configure --without-bash-malloc --prefix=/usr + make + make DESTDIR=$PKG_DEST install +} + diff --git a/xibuilds/bc.xibuild b/xibuilds/bc.xibuild new file mode 100644 index 0000000..989dc96 --- /dev/null +++ b/xibuilds/bc.xibuild @@ -0,0 +1,15 @@ +#!/bin/bash + +DEPS=(readline) + +SOURCE=https://github.com/gavinhoward/bc + + +build () { + CC=gcc ./configure --prefix=/usr -G -O3 + make + make test + make DESTDIR=$PKG_DEST install +} + + diff --git a/xibuilds/binutils.xibuild b/xibuilds/binutils.xibuild new file mode 100644 index 0000000..ea8caac --- /dev/null +++ b/xibuilds/binutils.xibuild @@ -0,0 +1,13 @@ +#!/bin/bash + +DEPS=() + +SOURCE=git://sourceware.org/git/binutils.git + + +build () { + ./configure --prefix=/usr --disable-nls --disable-werror + make + make DESTDIR=$PKG_DEST install +} + diff --git a/xibuilds/bzip2.xibuild b/xibuilds/bzip2.xibuild new file mode 100644 index 0000000..726f0f7 --- /dev/null +++ b/xibuilds/bzip2.xibuild @@ -0,0 +1,37 @@ +#!/bin/bash + +DEPS=(glibc sh) + +SOURCE=git://sourceware.org/git/bzip2.git + + +build () { + + # ensure symbolic links are relative + sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile + + make -f Makefile-libbz2_so + make clean + + make + + make PREFIX=$PKG_DEST/usr install + +} + +package () { + cp -av libbz2.so* $PKG_DEST/usr/lib + cp -av libbz2.so.1.0.8 $PKG_DEST/usr/lib/libbz2.so + + cp -v bzip2-shared $PKG_DEST/usr/bin/bzip2 + for i in $PKG_DEST/usr/bin/{bzcat,bunzip2}; do + cp -afv bzip2 $i + done + + # remove a useless static library + cp -v bzip2-shared $PKG_DEST/usr/bin/bzip2 + for i in $PKG_DEST/usr/bin/{bzcat,bunzip2}; do + ln -sfv bzip2 $i + done +} + diff --git a/xibuilds/dejagnu.xibuild b/xibuilds/dejagnu.xibuild new file mode 100644 index 0000000..ee09ef3 --- /dev/null +++ b/xibuilds/dejagnu.xibuild @@ -0,0 +1,23 @@ +#!/bin/bash + +DEPS=(sh expect) + +SOURCE=git://git.sv.gnu.org/dejagnu.git + + +build () { + mkdir -v build + cd build + + ../configure --prefix=/usr + + makeinfo --html --no-split -o doc/dejagnu.html ../doc/dejagnu.texi + makeinfo --plaintext -o doc/dejagnu.txt ../doc/dejagnu.texi + + make DESTDIR=$PKG_DEST install + + install -v -dm755 $PKG_DEST/usr/share/doc/dejagnu-1.6.3 + install -v -m644 doc/dejagnu.{html,txt} $PKG_DEST/usr/share/doc/dejagnu-1.6.3 +} + + diff --git a/xibuilds/expect.xibuild b/xibuilds/expect.xibuild new file mode 100644 index 0000000..e2288a3 --- /dev/null +++ b/xibuilds/expect.xibuild @@ -0,0 +1,20 @@ +#!/bin/bash + +DEPS=(tcl) + +SOURCE=https://github.com/aeruder/expect + + +build () { + # note: --with-tcl, we might want to make a way to use the tcl that we've compiled in another package + ./configure --prefix=/usr --with-tcl=/usr/lib --enable-shared --mandir=/usr/share/man --with-tclinclude=/usr/include + make + make test + make DESTDIR=$PKG_DEST install +} + +package () { + cp libexpect*.so $PKG_DEST/usr/lib +} + + diff --git a/xibuilds/file.xibuild b/xibuilds/file.xibuild new file mode 100644 index 0000000..9141847 --- /dev/null +++ b/xibuilds/file.xibuild @@ -0,0 +1,20 @@ +#!/bin/bash + +DEPS=(glibc ) + +SOURCE=https://github.com/file/file + + +build () { + # cheating + wget http://ftp.astron.com/pub/file/file-5.40.tar.gz + tar -zxf file-5.40.tar.gz + cd file-5.40 + + ./configure --prefix=/usr + make + make check + make DESTDIR=$PKG_DEST install +} + + diff --git a/xibuilds/flex.xibuild b/xibuilds/flex.xibuild new file mode 100644 index 0000000..88d61a6 --- /dev/null +++ b/xibuilds/flex.xibuild @@ -0,0 +1,19 @@ +#!/bin/bash + +DEPS=(glibc m4 sh) + +SOURCE=https://github.com/nlitsme/gnubc + + +build () { + ./configure --prefix=/usr --docdir=/usr/share/doc/flex --disable-static + make + make check + make DESTDIR=$PKG_DEST install +} + +package () { + ln -sv $PKG_DEST/usr/bin/flex $PKG_DEST/usr/bin/lex +} + + diff --git a/xibuilds/gcc.xibuild b/xibuilds/gcc.xibuild new file mode 100644 index 0000000..3edb513 --- /dev/null +++ b/xibuilds/gcc.xibuild @@ -0,0 +1,15 @@ +#!/bin/bash + +DEPS=(glibc) + +SOURCE=git://gcc.gnu.org/git/gcc.git + + +build () { + mkdir -v build + cd build + ../configure --prefix=/usr --disable-multilib --disable-bootstrap + make + make DESTDIR=$PKG_DEST install +} + diff --git a/xibuilds/glibc.xibuild b/xibuilds/glibc.xibuild new file mode 100644 index 0000000..5b111bd --- /dev/null +++ b/xibuilds/glibc.xibuild @@ -0,0 +1,78 @@ +#!/bin/bash + +DEPS=(glibc) + +SOURCE=https://sourceware.org/git/glibc.git + +build () { + # patches as recommended by lfs + sed -e '/NOTIFY_REMOVED)/s/)/ \&\& data.attr != NULL)/' -i sysdeps/unix/sysv/linux/mq_notify.c + + mkdir -v build + cd build + + # ensure that the ldconfig and sln utilities are installed into /usr/sbin + echo "rootsbindir=/usr/sbin" > configparms + + ../configure --prefix=/usr \ + --disable-werror \ + --enable-kernel=3.2 \ + --enable-stack-protector=strong \ + --with-headers=/usr/include \ + libc_cv_slibdir=/usr/lib + + make + make check + + sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile + make DESTDIR=$PKG_DEST install + + + # fix hardcoded path to the excutable in ldd script + sed '/RTLDLIST=/s@/usr@@g' -i $PKG_DEST/usr/bin/ldd + + cp -v ../nscd/nscd.conf $PKG_DEST/etc/nscd.conf + mkdir -pv $PKG_DEST/var/cache/nscd +} + +package () { + cat > $PKG_DEST/etc/nsswitch.conf << "EOF" +# Begin /etc/nsswitch.conf +passwd: files +group: files +shadow: files +hosts: files dns +networks: files +protocols: files +services: files +ethers: files +rpc: files +# End /etc/nsswitch.conf +EOF + + wget https://mirrors.slackware.com/slackware/slackware64-current/source/a/glibc-zoneinfo/tzdata2021a.tar.gz + + tar -xf tzdata2021a.tar.gz + + ZONEINFO=$PKG_DEST/usr/share/zoneinfo + mkdir -pv $ZONEINFO/{posix,right} + for tz in etcetera southamerica northamerica europe africa antarctica \ + asia australasia backward; do + zic -L /dev/null -d $ZONEINFO ${tz} + zic -L /dev/null -d $ZONEINFO/posix ${tz} + zic -L leapseconds -d $ZONEINFO/right ${tz} + done + cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO + zic -d $ZONEINFO -p America/New_York + unset ZONEINFO + + + # configure the dynamic loader + + cat > $PKG_DEST/etc/ld.so.conf << "EOF" +# Begin /etc/ld.so.conf +/usr/local/lib +/opt/lib +EOF +} + diff --git a/xibuilds/gmp.xibuild b/xibuilds/gmp.xibuild new file mode 100644 index 0000000..4a62d77 --- /dev/null +++ b/xibuilds/gmp.xibuild @@ -0,0 +1,25 @@ +#!/bin/bash + +DEPS=(gcc-libs sh) + +SOURCE=https://github.com/ryepdx/gmp + + +build () { + ./configure --prefix=/usr --enable-cxx --disable-static --docdir=/usr/share/doc/gmp + + make + make html + + make check 2>&1 | tee gmp-check-log + awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log + + make DESTDIR=$PKG_DEST install + make DESTDIR=$PKG_DEST install-html +} + +package () { + ln -sv $PKG_DEST/usr/bin/flex $PKG_DEST/usr/bin/lex +} + + diff --git a/xibuilds/iana-etc.xibuild b/xibuilds/iana-etc.xibuild new file mode 100644 index 0000000..6466472 --- /dev/null +++ b/xibuilds/iana-etc.xibuild @@ -0,0 +1,16 @@ +#!/bin/bash + +DEPS=() + +SOURCE=https://github.com/Mic92/iana-etc + +build () { + python update.py out +} + +package () { + mkdir -vp $PKG_DEST/etc + cp -v out/dist/protocols $PKG_DEST/etc/ + cp -v out/dist/services $PKG_DEST/etc/ +} + diff --git a/xibuilds/m4.xibuild b/xibuilds/m4.xibuild new file mode 100644 index 0000000..f28ec33 --- /dev/null +++ b/xibuilds/m4.xibuild @@ -0,0 +1,14 @@ +#!/bin/bash + +DEPS=(glibc bash) + +SOURCE=git://git.sv.gnu.org/m4 + + +build () { + ./configure --prefix=/usr + make + make check + make DESTDIR=$PKG_DEST install +} + diff --git a/xibuilds/readline.xibuild b/xibuilds/readline.xibuild new file mode 100644 index 0000000..2721677 --- /dev/null +++ b/xibuilds/readline.xibuild @@ -0,0 +1,19 @@ +#!/bin/bash + +DEPS=(glibc ncurses) + +SOURCE=https://git.savannah.gnu.org/git/readline.git + + +build () { + ./configure --prefix=/usr \ + --disable-static \ + --with-curses \ + --docdir=/usr/share/doc/readline-8.1 + + make SHLIB_LIBS="-lncursesw" + make SHLIB_LIBS="-lncursesw" DESTDIR=$PKG_DEST install + + install -v -m644 doc/*.{ps,pdf,html,dvi} $PKG_DEST/usr/share/doc/readline-8.1 +} + diff --git a/xibuilds/tar.xibuild b/xibuilds/tar.xibuild new file mode 100644 index 0000000..829d6d2 --- /dev/null +++ b/xibuilds/tar.xibuild @@ -0,0 +1,13 @@ +#!/bin/bash + +DEPS=(glibc) + +SOURCE=https://git.savannah.gnu.org/git/tar.git + +build () { + ./bootstrap + ./configure --prefix=/usr + make + make DESTDIR=$PKG_DEST install +} + diff --git a/xibuilds/tcl.xibuild b/xibuilds/tcl.xibuild new file mode 100644 index 0000000..16442f4 --- /dev/null +++ b/xibuilds/tcl.xibuild @@ -0,0 +1,28 @@ +#!/bin/bash + +DEPS=(zlib) + +SOURCE=https://github.com/tcltk/tcl + + +build () { + SRCDIR=$(pwd) + cd unix + ./configure --prefix=/usr --mandir=/usr/share/man $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit) + + make test + + make DESTDIR=$PKG_DEST install + + chmod -v u+w $PKG_DEST/usr/lib/libtcl8.6.so + + make DESTDIR=$PKG_DEST install-private-headers +} + +package () { + cp -f tclsh8.6 $PKG_DEST/usr/bin/tclsh + mv $PKG_DEST/usr/share/man/man3/{Thread,Tcl_Thread}.3 + +} + + diff --git a/xibuilds/xibuild.xibuild b/xibuilds/xibuild.xibuild new file mode 100644 index 0000000..cf88540 --- /dev/null +++ b/xibuilds/xibuild.xibuild @@ -0,0 +1,10 @@ +#!/bin/bash + +DEPS=(bash tar) + +SOURCE=https://git.davidovski.xyz/xibuild.git + +package () { + cp xibuild $PKG_DEST/usr/bin/ +} + diff --git a/xibuilds/xz.xibuild b/xibuilds/xz.xibuild new file mode 100644 index 0000000..e17f53b --- /dev/null +++ b/xibuilds/xz.xibuild @@ -0,0 +1,14 @@ +#!/bin/bash + +DEPS=(sh) + +SOURCE=https://git.tukaani.org/xz.git + + +build () { + ./configure --prefix=/usr --disable-static --docdir=$PKG_DEST/usr/share/doc/xz-5.2.5 + make + make check + make DESTDIR=$PKG_DEST install +} + diff --git a/xibuilds/zlib.xibuild b/xibuilds/zlib.xibuild new file mode 100644 index 0000000..c771727 --- /dev/null +++ b/xibuilds/zlib.xibuild @@ -0,0 +1,19 @@ +#!/bin/bash + +DEPS=(glibc) + +SOURCE=https://github.com/madler/zlib + + +build () { + ./configure --prefix=/usr + make + make check + make DESTDIR=$PKG_DEST install +} + +package () { + # Remove a useless static library (lfs recommended) + rm -fv $PKG_DEST/usr/lib/libz.a +} + diff --git a/xibuilds/zstd.xibuild b/xibuilds/zstd.xibuild new file mode 100644 index 0000000..63ba9af --- /dev/null +++ b/xibuilds/zstd.xibuild @@ -0,0 +1,18 @@ +#!/bin/bash + +DEPS=(glibc gcc-libs zlib xz lz4) + +SOURCE=https://github.com + + +build () { + make + make prefix=/usr check + make DESTDIR=$PKG_DEST install +} + +package () { + # Remove a useless static library (lfs recommended) + rm -v $PKG_DEST/usr/lib/libzstd.a +} + -- cgit v1.2.1