diff --git a/abuild b/abuild index dc790f1..357fca5 100755 --- a/abuild +++ b/abuild @@ -165,22 +165,69 @@ package_apk() { local p="$pkgname-$pkgver" [ "$pkgrel" -ne 0 ] && p="$p-r$pkgrel" local pkg="$p.apk" - local db="$dir/var/db/apk/$p" - mkdir -p "$db" - echo "$arch" > "$db/ARCH" - echo "$pkgdesc" > "$db/DESC" - echo "$license" > "$db/LICENSE" - echo "$depends" > "$db/DEPEND" - echo "$url" > "$db/WWW" +# local db="$dir/var/db/apk/$p" +# mkdir -p "$db" +# echo "$arch" > "$db/ARCH" +# echo "$pkgdesc" > "$db/DESC" +# echo "$license" > "$db/LICENSE" +# echo "$depends" > "$db/DEPEND" +# echo "$url" > "$db/WWW" + + [ ! -d "$dir" ] && die "Missing $dir" + cd "$dir" + msg "Creating $pkg" + local builddate=$(date -u "+%s") + local size=$(du -sk | awk '{print $1 * 1024}') + + echo "# Generated by $(basename $0) $myver" >.PKGINFO + if [ -n "$FAKEROOTKEY" ]; then + echo "# using $(fakeroot -v)" >> .PKGINFO + fi + echo "# $(date -u)" >> .PKGINFO + cat >> .PKGINFO <>.PKGINFO + done + for i in $replaces; do + echo "replaces = $i" >>.PKGINFO + done + for i in $depends; do + echo "depend = $i" >>.PKGINFO + done + for i in $conflicts; do + echo "conflict = $i" >>.PKGINFO + done + for i in $provides; do + echo "provides = $i" >>.PKGINFO + done + for i in $backup; do + echo "backup = $i" >>.PKGINFO + done + + local metafiles=".PKGINFO" if [ -n "$install" ]; then cp "$srcdir/$install" "$dir/.INSTALL" || return 1 chmod +x "$dir/.INSTALL" + metafiles="$metafiles .INSTALL" fi - for i in pre-install post-install pre-deinstall post-deinstall; do - [ -f ../$i ] && cp ../$i "$db"/ - done - ( cd "$dir" && tar -zcf "$PKGDEST/$pkg" * ) + +# for i in pre-install post-install pre-deinstall post-deinstall; do +# [ -f ../$i ] && cp ../$i "$db"/ +# done + + set * + [ "$1" = '*' ] && set -- + ( cd "$dir" && tar -zcf "$PKGDEST/$pkg" $metafiles $@ ) } package() {