iglunix/lazypkg.sh

92 lines
1.7 KiB
Bash
Raw Normal View History

#!/bin/sh
2020-12-28 13:54:13 +00:00
export MAKEFLAGS="-j6"
export CC=clang
export CXX=clang++
2020-12-27 16:34:08 +00:00
. ./build.sh
dir=$(pwd)
stat out > /dev/null && rm -rf out
2021-01-13 08:34:27 +00:00
mkdir out
function do_fetch() {
mkdir -p src
cd src
srcdir=$(pwd) fetch
}
stat src > /dev/null 2>/dev/null || do_fetch
srcdir=$(pwd)/src
2020-12-27 16:34:08 +00:00
cd $srcdir
build
cd $srcdir
echo "
. $dir/build.sh
mkdir -p $dir/out/$pkgname
pkgdir=$dir/out/$pkgname package
mkdir -p $dir/out/$pkgname/usr/share/lazypkg
2020-12-27 16:34:08 +00:00
cat > $dir/out/$pkgname/usr/share/lazypkg/$pkgname << EOF
2020-12-27 16:34:08 +00:00
[pkg]
name=$pkgname
ver=$pkgver
[license]
EOF
chmod 644 $dir/out/$pkgname/usr/share/lazypkg/$pkgname
2020-12-27 16:34:08 +00:00
cd $srcdir
license >> $dir/out/$pkgname/usr/share/lazypkg/$pkgname
2020-12-27 16:34:08 +00:00
echo >> $dir/out/$pkgname/usr/share/lazypkg/$pkgname
echo [fs] >> $dir/out/$pkgname/usr/share/lazypkg/$pkgname
2020-12-27 16:34:08 +00:00
cd $dir/out/$pkgname/
find * >> $dir/out/$pkgname/usr/share/lazypkg/$pkgname
2020-12-27 16:34:08 +00:00
cd $dir/out/$pkgname
tar -cf ../$pkgname.$pkgver.tar.xz *
2020-12-27 16:34:08 +00:00
echo $ext | tr ':' '\n' | while read e; do
echo \$e
cd $srcdir
mkdir -p $dir/out/$pkgname-\$e
pkgdir=$dir/out/$pkgname-\$e
2020-12-28 13:54:13 +00:00
package_\$(echo \$e | tr '-' '_')
2020-12-27 16:34:08 +00:00
mkdir -p $dir/out/$pkgname-\$e/usr/share/lazypkg
2020-12-27 16:34:08 +00:00
cat > $dir/out/$pkgname-\$e/usr/share/lazypkg/$pkgname-\$e << EOF
2020-12-27 16:34:08 +00:00
[pkg]
name=$pkgname-\$e
ver=$pkgver
[license]
EOF
chmod 644 $dir/out/$pkgname-\$e/usr/share/lazypkg/$pkgname-\$e
2020-12-27 16:34:08 +00:00
cd $srcdir
license >> $dir/out/$pkgname-\$e/usr/share/lazypkg/$pkgname-\$e
2020-12-27 16:34:08 +00:00
echo >> $dir/out/$pkgname-\$e/usr/share/lazypkg/$pkgname-\$e
echo [fs] >> $dir/out/$pkgname-\$e/usr/share/lazypkg/$pkgname-\$e
2020-12-27 16:34:08 +00:00
cd $dir/out/$pkgname-\$e
find * >> $dir/out/$pkgname-\$e/usr/share/lazypkg/$pkgname-\$e
2020-12-27 16:34:08 +00:00
cd $dir/out/$pkgname-\$e
tar -cf ../$pkgname-\$e.$pkgver.tar.xz *
2020-12-27 16:34:08 +00:00
done
" | sh
2020-12-27 16:34:08 +00:00
cd $dir