Commit ed9f3ec3 authored by Natanael Copa's avatar Natanael Copa

create .PKGINFO file

parent e15908ff
......@@ -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 <<EOF
pkgname = $pkgname
pkgver = $pkgver
pkgdesc = $pkgdesc
url = $url
builddate = $builddate
packager = ${PACKAGER:-"Unknown"}
size = $size
EOF
local i
for i in $license; do
echo "license = $i" >>.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() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment