From d18f6af9c89b1a77783b91b61d6fe39b39166aa9 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Sun, 3 Nov 2019 17:22:17 +0800 Subject: [PATCH] updated --- 02-base | 5 +++-- files/core.httpup | 8 ++++++++ files/httpup | 27 +++++++++++++++++++++++++++ files/pkgin | 21 +++++++++++++-------- toolchain/43-curl | 13 +++++++++++++ toolchain/44-httpup | 9 +++++++++ toolchain/45-ports | 12 ++++++++++++ 7 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 files/core.httpup create mode 100755 files/httpup create mode 100755 toolchain/43-curl create mode 100755 toolchain/44-httpup create mode 100755 toolchain/45-ports diff --git a/02-base b/02-base index 82638ea..742713f 100755 --- a/02-base +++ b/02-base @@ -148,8 +148,9 @@ if [ ! -f $LFS/var/lib/pkg/db ]; then fi mkdir -p $LFS/usr/ports/ -echo "==> Copying ports" -cp -Ra ports/* $LFS/usr/ports/ +runinchroot ports -u || die +#echo "==> Copying ports" +#cp -Ra ports/* $LFS/usr/ports/ mountbind_cache diff --git a/files/core.httpup b/files/core.httpup new file mode 100644 index 0000000..44d810b --- /dev/null +++ b/files/core.httpup @@ -0,0 +1,8 @@ +# +# /etc/ports/core.httpup: core's port collection +# + +ROOT_DIR=/usr/ports/core +URL=https://raw.githubusercontent.com/emmett1/lfs-scripts/master/ports/core/ + +# End of file diff --git a/files/httpup b/files/httpup new file mode 100755 index 0000000..5c8db84 --- /dev/null +++ b/files/httpup @@ -0,0 +1,27 @@ +#!/bin/sh +# +# /etc/ports/drivers/httpup: httpup driver script for ports(8) +# + +if [ $# -ne 1 ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +. $1 + +if [ -z "$ROOT_DIR" ]; then + echo "ROOT_DIR not set in '$1'" >&2 + exit 2 +fi +if [ -z "$URL" ]; then + echo "URL not set in '$1'" >&2 + exit 2 +fi + +for REPO in $URL; do + PORT=`echo $REPO | sed -n '/#.*$/s|^.*#||p'` + httpup sync $REPO $ROOT_DIR/$PORT +done + +# End of file. diff --git a/files/pkgin b/files/pkgin index a08fe05..91feb1d 100755 --- a/files/pkgin +++ b/files/pkgin @@ -11,7 +11,7 @@ trap "exit 1" SIGHUP SIGINT SIGQUIT SIGTERM -PORT="/usr/ports" +REPO="/usr/ports/core /usr/ports/extra /usr/ports/xorg /usr/ports/multilib" while [ $1 ]; do case $1 in @@ -31,13 +31,18 @@ for p in ${PKG[@]}; do echo "Package '$p' is installed." continue fi - if [ -f $PORT/$p/Pkgfile ]; then - cd $PORT/$p &>/dev/null - pkgmk ${PKGMK_CMD[@]} || exit $? - [ -x bootstrap-post-install ] && ./bootstrap-post-install - [ -x post-install ] && ./post-install - cd - &>/dev/null - else + PKGFOUND=no + for r in $REPO; do + if [ -f $r/$p/Pkgfile ]; then + PKGFOUND=yes + cd $r/$p &>/dev/null + pkgmk ${PKGMK_CMD[@]} || exit $? + [ -e bootstrap-post-install ] && sh bootstrap-post-install + [ -e post-install ] && sh post-install + cd - &>/dev/null + fi + done + if [ "$PKGFOUND" = "no" ]; then echo "Port '$p' not found." exit 1 fi diff --git a/toolchain/43-curl b/toolchain/43-curl new file mode 100755 index 0000000..35f0f2d --- /dev/null +++ b/toolchain/43-curl @@ -0,0 +1,13 @@ +name=curl +version=7.66.0 +source=(https://curl.haxx.se/download/$name-$version.tar.xz) + +build() { + cd $name-$version + ./configure --prefix=/tools \ + --disable-static \ + --enable-threaded-resolver \ + --with-ca-bundle=/tools/etc/ssl/certs/ca-certificates.crt + make + make DESTDIR=$PKG install +} diff --git a/toolchain/44-httpup b/toolchain/44-httpup new file mode 100755 index 0000000..0e8fa17 --- /dev/null +++ b/toolchain/44-httpup @@ -0,0 +1,9 @@ +name=httpup +version=0.5.0 +source=(https://crux.nu/files/$name-$version.tar.xz) + +build() { + cd $name-$version + make + make DESTDIR=$PKG prefix=/tools mandir=/tools/share/man install +} diff --git a/toolchain/45-ports b/toolchain/45-ports new file mode 100755 index 0000000..fb3321e --- /dev/null +++ b/toolchain/45-ports @@ -0,0 +1,12 @@ +name=ports +version=1.6 +source=(https://crux.nu/files/tools/ports/$name-$version.tar.gz) + +build() { + cd $name-$version + make + make DESTDIR=$PKG BINDIR=/tools/bin ETCDIR=/tools/etc/ports PORTSDIR=/tools/etc/ports MANDIR=/tools/share/man install + install -D -m 755 $FILEDIR/httpup /tools/etc/ports/drivers/httpup + install -m 644 $FILEDIR/core.httpup /tools/etc/ports/core.httpup + sed 's,etc/ports,tools/etc/ports,g' -i /tools/bin/ports +}