summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkeygen.sh4
-rwxr-xr-xpsibuild164
-rw-r--r--psibuilds/bash.psibuild11
-rw-r--r--psibuilds/bc.psibuild15
-rw-r--r--psibuilds/binutils.psibuild13
-rw-r--r--psibuilds/bzip2.psibuild37
-rw-r--r--psibuilds/dejagnu.psibuild23
-rw-r--r--psibuilds/expect.psibuild20
-rw-r--r--psibuilds/file.psibuild20
-rw-r--r--psibuilds/flex.psibuild19
-rw-r--r--psibuilds/gcc.psibuild15
-rw-r--r--psibuilds/glibc.psibuild78
-rw-r--r--psibuilds/gmp.psibuild25
-rw-r--r--psibuilds/iana-etc.psibuild16
-rw-r--r--psibuilds/m4.psibuild14
-rw-r--r--psibuilds/psibuild.psibuild10
-rw-r--r--psibuilds/readline.psibuild19
-rw-r--r--psibuilds/tar.psibuild13
-rw-r--r--psibuilds/tcl.psibuild28
-rw-r--r--psibuilds/xz.psibuild14
-rw-r--r--psibuilds/zlib.psibuild19
-rw-r--r--psibuilds/zstd.psibuild18
22 files changed, 540 insertions, 55 deletions
diff --git a/keygen.sh b/keygen.sh
index 5ec5bbd..7f8cda2 100755
--- a/keygen.sh
+++ b/keygen.sh
@@ -1,4 +1,4 @@
#!/bin/sh
mkdir -p keychain
-openssl genrsa -out keychain/xi.pem 4096
-openssl rsa -in keychain/xi.pem -pubout > keychain/xi.pub
+openssl genrsa -out keychain/psi.pem 4096
+openssl rsa -in keychain/psi.pem -pubout > keychain/psi.pub
diff --git a/psibuild b/psibuild
index 567fd2b..3b26fed 100755
--- a/psibuild
+++ b/psibuild
@@ -1,68 +1,144 @@
#!/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
}
-BUILD_FILE=${@: -1}
+psibuild () {
+ BUILD_FILE=${@: -1}
-[[ $# = 0 ]] && usage && epsit 1
-[ -f "$FILE" ] && echo "$BUILD_FILE not found" && epsit 1
+ cd $PSI_ROOT
-source $BUILD_FILE
+ [[ $# = 0 ]] && usage && exit 1
+ [ ! -f "$BUILD_FILE" ] && echo "$BUILD_FILE not found" && exit 1
-PKG_NAME=$(basename $BUILD_FILE .psibuild)
+ clean () {
+ # clean up
+ rm -rf $PKG_BUILD_DIR
+ rmdir $PSI_ROOT/tmp > /dev/null 2>&1
+ }
-PSI_ROOT=$(pwd)
-PKGS_OUTPUT=$PSI_ROOT/psipkgs
+ 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
-PKG_BUILD_DIR=$PSI_ROOT/tmp/$PKG_NAME
-PKG_DEST=$PKG_BUILD_DIR/package
+ date > $LOGFILE
+ echo "Build log for $PKG_NAME from $BUILD_FILE\n" >> $LOGFILE
+ printf "\033[0;36m====> $PKG_NAME.ppkg\n" | tee -a $LOGFILE
-# make the directories
-mkdir -p $PKG_DEST
-cd $PKG_BUILD_DIR
+ cd $PKG_BUILD_DIR
-# fetch, build then package the package
-fetch
-build
-package
+ # fetch, build then package the package
+ ############
+ # try get the commit hash for the package
+ VER_HASH=$(git ls-remote $SOURCE HEAD | awk '{ print $1 }')
-# go back to root, make things easier
-cd $PSI_ROOT
+ # 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=//")
-# bundle the package to a targz in the output dir
-mkdir -p $PKGS_OUTPUT
+ echo "Comparing $EXISTING_HASH to $VER_HASH" >> $LOGFILE
-PKG_FILE=$PKGS_OUTPUT/$PKG_NAME.psipkg
+ 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
-tar -C $PKG_BUILD_DIR/package -czf $PKG_FILE ./
+ 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"
-# create info file
-PKG_INFO=$PKGS_OUTPUT/$PKG_NAME.psipkg.info
+ 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
+}
-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
+FILES=$@
-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
+for BUILD_FILE in $FILES; do
+ psibuild $BUILD_FILE
+done
diff --git a/psibuilds/bash.psibuild b/psibuilds/bash.psibuild
index 9a5d1af..b2a0156 100644
--- a/psibuilds/bash.psibuild
+++ b/psibuilds/bash.psibuild
@@ -1,19 +1,12 @@
#!/bin/bash
-DEPS=(readline libreadline.so=8-64 glibc ncurses)
+DEPS=(readline glibc ncurses)
-fetch () {
- git clone https://git.savannah.gnu.org/git/bash.git
-}
+SOURCE=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/psibuilds/bc.psibuild b/psibuilds/bc.psibuild
new file mode 100644
index 0000000..989dc96
--- /dev/null
+++ b/psibuilds/bc.psibuild
@@ -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/psibuilds/binutils.psibuild b/psibuilds/binutils.psibuild
new file mode 100644
index 0000000..ea8caac
--- /dev/null
+++ b/psibuilds/binutils.psibuild
@@ -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/psibuilds/bzip2.psibuild b/psibuilds/bzip2.psibuild
new file mode 100644
index 0000000..726f0f7
--- /dev/null
+++ b/psibuilds/bzip2.psibuild
@@ -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/psibuilds/dejagnu.psibuild b/psibuilds/dejagnu.psibuild
new file mode 100644
index 0000000..ee09ef3
--- /dev/null
+++ b/psibuilds/dejagnu.psibuild
@@ -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/psibuilds/expect.psibuild b/psibuilds/expect.psibuild
new file mode 100644
index 0000000..e2288a3
--- /dev/null
+++ b/psibuilds/expect.psibuild
@@ -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/psibuilds/file.psibuild b/psibuilds/file.psibuild
new file mode 100644
index 0000000..9141847
--- /dev/null
+++ b/psibuilds/file.psibuild
@@ -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/psibuilds/flex.psibuild b/psibuilds/flex.psibuild
new file mode 100644
index 0000000..88d61a6
--- /dev/null
+++ b/psibuilds/flex.psibuild
@@ -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/psibuilds/gcc.psibuild b/psibuilds/gcc.psibuild
new file mode 100644
index 0000000..3edb513
--- /dev/null
+++ b/psibuilds/gcc.psibuild
@@ -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/psibuilds/glibc.psibuild b/psibuilds/glibc.psibuild
new file mode 100644
index 0000000..5b111bd
--- /dev/null
+++ b/psibuilds/glibc.psibuild
@@ -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/psibuilds/gmp.psibuild b/psibuilds/gmp.psibuild
new file mode 100644
index 0000000..4a62d77
--- /dev/null
+++ b/psibuilds/gmp.psibuild
@@ -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/psibuilds/iana-etc.psibuild b/psibuilds/iana-etc.psibuild
new file mode 100644
index 0000000..6466472
--- /dev/null
+++ b/psibuilds/iana-etc.psibuild
@@ -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/psibuilds/m4.psibuild b/psibuilds/m4.psibuild
new file mode 100644
index 0000000..f28ec33
--- /dev/null
+++ b/psibuilds/m4.psibuild
@@ -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/psibuilds/psibuild.psibuild b/psibuilds/psibuild.psibuild
new file mode 100644
index 0000000..2f68018
--- /dev/null
+++ b/psibuilds/psibuild.psibuild
@@ -0,0 +1,10 @@
+#!/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
new file mode 100644
index 0000000..2721677
--- /dev/null
+++ b/psibuilds/readline.psibuild
@@ -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/psibuilds/tar.psibuild b/psibuilds/tar.psibuild
new file mode 100644
index 0000000..829d6d2
--- /dev/null
+++ b/psibuilds/tar.psibuild
@@ -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/psibuilds/tcl.psibuild b/psibuilds/tcl.psibuild
new file mode 100644
index 0000000..16442f4
--- /dev/null
+++ b/psibuilds/tcl.psibuild
@@ -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/psibuilds/xz.psibuild b/psibuilds/xz.psibuild
new file mode 100644
index 0000000..e17f53b
--- /dev/null
+++ b/psibuilds/xz.psibuild
@@ -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/psibuilds/zlib.psibuild b/psibuilds/zlib.psibuild
new file mode 100644
index 0000000..c771727
--- /dev/null
+++ b/psibuilds/zlib.psibuild
@@ -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/psibuilds/zstd.psibuild b/psibuilds/zstd.psibuild
new file mode 100644
index 0000000..63ba9af
--- /dev/null
+++ b/psibuilds/zstd.psibuild
@@ -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
+}
+