diff --git a/astronaut/astronaut b/astronaut/astronaut index b0d7277..09772da 100755 --- a/astronaut/astronaut +++ b/astronaut/astronaut @@ -5,7 +5,7 @@ dir_build="$PWD/build" # Temporary directory to build packages dir_source="$PWD/source" # Directory where the package sources will be placed dir_install="$PWD/install" # Directory where the package will be installed dir_sysroot="" # The root dir (Used for dirs like etc and var) -dir_prefix="$dir_sysroot/usr" # Prefix directory +dir_prefix="$dir_sysroot/usr" # Prefix directory (Should always contain $dir_sysroot!) cmd_download="curl -# -L -o {dst} {src}" # Command to execute to download files cmd_extract="tar -x -C {dst} -f {src}" # Command to execute to extract files enable_check=true # Run the test suite of packages diff --git a/astronaut/hello.sat b/astronaut/hello.sat index a90e250..da71f06 100644 --- a/astronaut/hello.sat +++ b/astronaut/hello.sat @@ -85,6 +85,7 @@ fi #do_check make check make DESTDIR="$dir_install" install +rm "$dir_install/$dir_prefix/share/info/dir" # This file collides with some other packages. # Call the function we imported. For more info see the top of the file, and functions/say_hello.sh say_hello diff --git a/astronaut/pacman-astronaut b/astronaut/pacman-astronaut new file mode 100755 index 0000000..acd33f3 --- /dev/null +++ b/astronaut/pacman-astronaut @@ -0,0 +1,32 @@ +#!/bin/sh -e +# A hacky script to generate .pkg.tar.?z files using satellites. +# It's a fairly simple wrapper to astronaut, that generates a pacman package at the end. + +# This may also serve as an example on how you can wrap astronaut to package in any format. +# Sure, no dependency resolution, and the packages won't make it in any official repositories, +# but it isn't meant for that anyway. + +_topdir=$PWD +_astronaut="$(dirname "$0")/astronaut" +[ ! -f "$_astronaut" ] && _astronaut="astronaut" + +_nuke_dir_install=true + +. "$_astronaut" + +# _dir_pacman should be set from a configuration file (e.g. ~/.astronaut.conf), and points to wherever you want your packages to be placed. +[ "$_dir_pacman" ] && mkdir -p "$_dir_pacman" && cd "$_dir_pacman" || cd "$_topdir" + +cat << EOF > "$dir_install/.PKGINFO" +pkgname = $name +pkgver = $version-astro +pkgdesc = Generated with pacman-astronaut +url = $update_url +builddate = $(date -u '+%s') +size = $(du -sb --apparent-size "$dir_install" | awk '{print $1}') +arch = $(uname -m) +EOF + +bsdtar --strip-components 1 -C "$dir_install" -czf .MTREE --format=mtree --options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' . +mv .MTREE "$dir_install/.MTREE" # bsdtar doesn't like the file being in the same directory. +fakeroot -- bsdtar --strip-components 1 -C "$dir_install" -cf - . | xz -c -z - > "$name-$version-astro-$(uname -m).pkg.tar.xz" diff --git a/astronaut/template.sat b/astronaut/template.sat index e2ff2c3..3fde069 100644 --- a/astronaut/template.sat +++ b/astronaut/template.sat @@ -14,5 +14,6 @@ cd "$name-$version" make do_check make check make DESTDIR="$dir_install" install +rm "$dir_install/$dir_prefix/share/info/dir" # This file collides with some other packages. # vim:set tabstop=4 shiftwidth=4 syntax=sh et: