Browse Source

Added pacman-astronaut

master
mid-kid 9 years ago
parent
commit
5ea4c18912
  1. 2
      astronaut/astronaut
  2. 1
      astronaut/hello.sat
  3. 32
      astronaut/pacman-astronaut
  4. 1
      astronaut/template.sat

2
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_source="$PWD/source" # Directory where the package sources will be placed
dir_install="$PWD/install" # Directory where the package will be installed dir_install="$PWD/install" # Directory where the package will be installed
dir_sysroot="" # The root dir (Used for dirs like etc and var) 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_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 cmd_extract="tar -x -C {dst} -f {src}" # Command to execute to extract files
enable_check=true # Run the test suite of packages enable_check=true # Run the test suite of packages

1
astronaut/hello.sat

@ -85,6 +85,7 @@ fi
#do_check make check #do_check make check
make DESTDIR="$dir_install" install 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 # Call the function we imported. For more info see the top of the file, and functions/say_hello.sh
say_hello say_hello

32
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"

1
astronaut/template.sat

@ -14,5 +14,6 @@ cd "$name-$version"
make make
do_check make check do_check make check
make DESTDIR="$dir_install" install 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: # vim:set tabstop=4 shiftwidth=4 syntax=sh et:

Loading…
Cancel
Save