Commit ed9f3ec3 authored by Natanael Copa's avatar Natanael Copa

create .PKGINFO file

parent e15908ff
...@@ -165,22 +165,69 @@ package_apk() { ...@@ -165,22 +165,69 @@ package_apk() {
local p="$pkgname-$pkgver" local p="$pkgname-$pkgver"
[ "$pkgrel" -ne 0 ] && p="$p-r$pkgrel" [ "$pkgrel" -ne 0 ] && p="$p-r$pkgrel"
local pkg="$p.apk" local pkg="$p.apk"
local db="$dir/var/db/apk/$p" # local db="$dir/var/db/apk/$p"
mkdir -p "$db" # mkdir -p "$db"
echo "$arch" > "$db/ARCH" # echo "$arch" > "$db/ARCH"
echo "$pkgdesc" > "$db/DESC" # echo "$pkgdesc" > "$db/DESC"
echo "$license" > "$db/LICENSE" # echo "$license" > "$db/LICENSE"
echo "$depends" > "$db/DEPEND" # echo "$depends" > "$db/DEPEND"
echo "$url" > "$db/WWW" # 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 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 if [ -n "$install" ]; then
cp "$srcdir/$install" "$dir/.INSTALL" || return 1 cp "$srcdir/$install" "$dir/.INSTALL" || return 1
chmod +x "$dir/.INSTALL" chmod +x "$dir/.INSTALL"
metafiles="$metafiles .INSTALL"
fi fi
for i in pre-install post-install pre-deinstall post-deinstall; do
[ -f ../$i ] && cp ../$i "$db"/ # for i in pre-install post-install pre-deinstall post-deinstall; do
done # [ -f ../$i ] && cp ../$i "$db"/
( cd "$dir" && tar -zcf "$PKGDEST/$pkg" * ) # done
set *
[ "$1" = '*' ] && set --
( cd "$dir" && tar -zcf "$PKGDEST/$pkg" $metafiles $@ )
} }
package() { 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