package.mk/bin/create-apk-pkginfo

30 lines
552 B
Bash
Executable File

#!/bin/sh
# This script creates the .PKGINFO file required by apk.
du_sk=$(du -sk . | sed "s/[ \t].*//g")
size=$(echo "$du_sk * 1000" | bc)
cat <<END >.PKGINFO
# Generated by 'create-package'.
pkgname = ${name}
pkgver = ${version}-r${release}
url = ${URL}
size = $size
origin =
buildtype = host
builddate = $(date "+%s")
END
for atom in ${dependencies}; do
echo "depend = ${atom}" >> .PKGINFO
done
for atom in ${provides}; do
echo "provides = ${atom}" >> .PKGINFO
done
for atom in ${conflicts}; do
echo "conflicts = ${atom}" >> .PKGINFO
done