Browse Source

Make astronautpkg more configureable

master
mid-kid 7 years ago
parent
commit
2bcfbba056
  1. 8
      astronaut/astronautpkg
  2. 1
      astronaut/examples/hello.sat
  3. 6
      astronaut/pacman-astronaut
  4. 6
      astronaut/xbps-astronaut

8
astronaut/astronautpkg

@ -20,7 +20,9 @@ _astronaut="$(dirname "$0")/astronaut"
[ ! -f "$_astronaut" ] && _astronaut='astronaut' [ ! -f "$_astronaut" ] && _astronaut='astronaut'
# Configuration # Configuration
dir_wrapper_pkgtools="$PWD" # Where the packages should be stored wrapper_pkgtools_dir="$PWD" # Where the packages should be stored
wrapper_pkgtools_compression='txz' # What to compress the package with
wrapper_pkgtools_build='astro' # What to use as "generic" build number
# Wrapper functions # Wrapper functions
_astronaut_wrapper_pre() { _astronaut_wrapper_pre() {
@ -166,8 +168,8 @@ EOF
# Create the package # Create the package
cd "$dir_install" cd "$dir_install"
mkdir -p "$dir_wrapper_pkgtools" mkdir -p "$wrapper_pkgtools_dir"
PATH="$PATH:/sbin" $_astronaut_wrapper_fakeroot makepkg -l y -c n "$dir_wrapper_pkgtools/$name_sat-$(echo "$version" | tr - _)-$(uname -m)-astro.txz" PATH="$PATH:/sbin" $_astronaut_wrapper_fakeroot makepkg -l y -c n "$wrapper_pkgtools_dir/$name_sat-$(echo "$version" | tr - _)-$(uname -m)-$wrapper_pkgtools_build.$wrapper_pkgtools_compression"
} }
. "$_astronaut" . "$_astronaut"

1
astronaut/examples/hello.sat

@ -32,6 +32,7 @@
# Misc variables # Misc variables
# - options -- The options this package is built with. # - options -- The options this package is built with.
# - download_only -- Whether we're in 'download only' mode or not. If we are, you may only create files in $dir_source/$name. # - download_only -- Whether we're in 'download only' mode or not. If we are, you may only create files in $dir_source/$name.
# - wrapper_* -- Reserved for wrapper configuration
import 'say_hello' # Import some functions. See functions/say_hello.sh for more info. import 'say_hello' # Import some functions. See functions/say_hello.sh for more info.

6
astronaut/pacman-astronaut

@ -13,7 +13,7 @@ _astronaut="$(dirname "$0")/astronaut"
[ ! -f "$_astronaut" ] && _astronaut="astronaut" [ ! -f "$_astronaut" ] && _astronaut="astronaut"
# Configuration # Configuration
dir_wrapper_pacman="$PWD" # Where the packages should be stored wrapper_pacman_dir="$PWD" # Where the packages should be stored
# Wrapper functions # Wrapper functions
_astronaut_wrapper_pre() { _astronaut_wrapper_pre() {
@ -33,8 +33,8 @@ size = $(du -sb --apparent-size "$dir_install" | awk '{print $1}')
arch = $(uname -m) arch = $(uname -m)
EOF EOF
mkdir -p "$dir_wrapper_pacman" mkdir -p "$wrapper_pacman_dir"
cd "$dir_wrapper_pacman" cd "$wrapper_pacman_dir"
# Create the package # Create the package
bsdtar --strip-components 1 -C "$dir_install" -czf .MTREE --format=mtree --options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' . bsdtar --strip-components 1 -C "$dir_install" -czf .MTREE --format=mtree --options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' .

6
astronaut/xbps-astronaut

@ -13,7 +13,7 @@ _astronaut="$(dirname "$0")/astronaut"
[ ! -f "$_astronaut" ] && _astronaut="astronaut" [ ! -f "$_astronaut" ] && _astronaut="astronaut"
# Configuration # Configuration
dir_wrapper_xbps="$PWD" wrapper_xbps_dir="$PWD"
# Wrapper functions # Wrapper functions
_astronaut_wrapper_pre() { _astronaut_wrapper_pre() {
@ -22,8 +22,8 @@ _astronaut_wrapper_pre() {
} }
_astronaut_wrapper_post() { _astronaut_wrapper_post() {
mkdir -p "$dir_wrapper_xbps" mkdir -p "$wrapper_xbps_dir"
cd "$dir_wrapper_xbps" cd "$wrapper_xbps_dir"
# Create the package # Create the package
xbps-create --compression none -A "$(uname -m)" -n "$name_sat-${version}_astro" -s "Generated with xbps-astronaut" -H "$update_url" "$dir_install" xbps-create --compression none -A "$(uname -m)" -n "$name_sat-${version}_astro" -s "Generated with xbps-astronaut" -H "$update_url" "$dir_install"

Loading…
Cancel
Save