mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-23 23:42:35 +00:00
create .PKGINFO file
This commit is contained in:
parent
e15908ffc2
commit
ed9f3ec342
69
abuild
69
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 <<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() {
|
||||
|
Loading…
Reference in New Issue
Block a user