From cbbe7641e93890403791605c543179c153e7e1b2 Mon Sep 17 00:00:00 2001 From: Ella-0 <23418164+Ella-0@users.noreply.github.com> Date: Sun, 27 Dec 2020 16:34:08 +0000 Subject: [PATCH] added fs info to metadata --- .gitignore | 4 +++ README.md | 1 + example.build.sh | 22 ++++++++++++ lazypkg.sh | 80 ++++++++++++++++++++++++++++++++++++++++++++ pkgs/musl/build.sh | 35 +++++++++++++++++++ pkgs/toybox/build.sh | 25 ++++++++++++++ 6 files changed, 167 insertions(+) create mode 100644 .gitignore create mode 100644 example.build.sh create mode 100755 lazypkg.sh create mode 100644 pkgs/musl/build.sh create mode 100644 pkgs/toybox/build.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6406cdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +src/ +out/ +pkgs/*/src +pkgs/*/out diff --git a/README.md b/README.md index 90955bd..6732771 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # lazybox UNIX like software distribution with no GNU components + diff --git a/example.build.sh b/example.build.sh new file mode 100644 index 0000000..a49db48 --- /dev/null +++ b/example.build.sh @@ -0,0 +1,22 @@ +fetch() { + # in ./src + # for fetching and patching source files +} + +build() { + # in ./src + # configure and build + ./configure --prefix=/ + # make is bmake + make +} + +package() { + # in ./src + # make is bmake + make install DESTDIR=$pkgdir + # samurai is the default ninja implementation + DESTDIR=$pkgdir samu install + # for rust programs we just do this + install -Dm755 target/release/$pkgname $pkgdir/bin +} diff --git a/lazypkg.sh b/lazypkg.sh new file mode 100755 index 0000000..78dd02d --- /dev/null +++ b/lazypkg.sh @@ -0,0 +1,80 @@ +#!/bin/dash + +. ./build.sh +dir=$(pwd) +mkdir -p src +cd src +srcdir=$(pwd) + +fetch +cd $srcdir + +build +cd $srcdir + +echo " +. $dir/build.sh +mkdir -p $dir/out/$pkgname +pkgdir=$dir/out/$pkgname package + + +mkdir -p $dir/out/$pkgname/lib/lazypkg + +cat > $dir/out/$pkgname/lib/lazypkg/$pkgname << EOF +[pkg] +name=$pkgname +ver=$pkgver + +[license] +EOF + +chmod 644 $dir/out/$pkgname/lib/lazypkg/$pkgname +cd $srcdir +license >> $dir/out/$pkgname/lib/lazypkg/$pkgname + +echo >> $dir/out/$pkgname/lib/lazypkg/$pkgname +echo [fs] >> $dir/out/$pkgname/lib/lazypkg/$pkgname + +cd $dir/out/$pkgname/ +find * >> $dir/out/$pkgname/lib/lazypkg/$pkgname + +cd $dir/out/$pkgname +tar -cJf ../$pkgname.$pkgver.tar.xz * + +echo $ext | tr ':' '\n' | while read e; do + echo \$e + + cd $srcdir + mkdir -p $dir/out/$pkgname-\$e + pkgdir=$dir/out/$pkgname-\$e + package_\$e + + mkdir -p $dir/out/$pkgname-\$e/lib/lazypkg + + cat > $dir/out/$pkgname-\$e/lib/lazypkg/$pkgname-\$e << EOF +[pkg] +name=$pkgname-\$e +ver=$pkgver + +[license] +EOF + + chmod 644 $dir/out/$pkgname-\$e/lib/lazypkg/$pkgname-\$e + cd $srcdir + license >> $dir/out/$pkgname-\$e/lib/lazypkg/$pkgname-\$e + + echo >> $dir/out/$pkgname-\$e/lib/lazypkg/$pkgname-\$e + echo [fs] >> $dir/out/$pkgname-\$e/lib/lazypkg/$pkgname-\$e + + cd $dir/out/$pkgname-\$e + + find * >> $dir/out/$pkgname-\$e/lib/lazypkg/$pkgname-\$e + + cd $dir/out/$pkgname-\$e + tar -cJf ../$pkgname-\$e.$pkgver.tar.xz * + +done + + +" | fakeroot sh +cd $dir diff --git a/pkgs/musl/build.sh b/pkgs/musl/build.sh new file mode 100644 index 0000000..be6f500 --- /dev/null +++ b/pkgs/musl/build.sh @@ -0,0 +1,35 @@ +pkgver=1.2.1 +pkgname=musl +bad="gmake" +ext="dev" + +fetch() { + curl "https://musl.libc.org/releases/$pkgname-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.gz + tar -xf $pkgname-$pkgver.tar.gz +} + +build() { + cd $pkgname-$pkgver + ./configure --prefix=/ --enable-wrapper=no + make +} + +package() { + cd $pkgname-$pkgver + make install DESTDIR=$pkgdir + rm -r $pkgdir/include + rm $pkgdir/lib/*.a + rm $pkgdir/lib/*.o +} + +package_dev() { + cd $pkgname-$pkgver + make install DESTDIR=$pkgdir + rm $pkgdir/lib/*.so + rm $pkgdir/lib/*.so.? +} + +license() { + cd $pkgname-$pkgver + cat COPYRIGHT +} diff --git a/pkgs/toybox/build.sh b/pkgs/toybox/build.sh new file mode 100644 index 0000000..fc995b3 --- /dev/null +++ b/pkgs/toybox/build.sh @@ -0,0 +1,25 @@ +pkgver=0.8.4 +pkgname=toybox +pkgrel=1 + +fetch() { + curl "http://www.landley.net/toybox/downloads/$pkgname-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.gz + tar -xf $pkgname-$pkgver.tar.gz +} + +build() { + cd $pkgname-$pkgver + make defconfig + make +} + +package() { + cd $pkgname-$pkgver + install -d $pkgdir/bin + install -Dm755 ./toybox $pkgdir/bin/ +} + +license() { + cd $pkgname-$pkgver + cat LICENSE +}