# Example of a satellite file, which is just a shell script with a cool name.
import "say_hello" # Import some functions. See functions/say_hello.sh for more info.
# Info (Please declare it, as it will be used outside of this script, too)
# Required info
name=hello # Name of the software, not the package name.
# Same source files will be used for the same software, despite the package name being different.
version=2.10
# Optional info
update_url="https://ftp.gnu.org/gnu/$name/" # URL to a downloadable plain-text file which updates when a new version is available.
update_names="$name-$version.tar.gz" # Specify what the lines containing the version number look like on the download page.
# It's a comma-separated list, and can contain multiple entries.
# Every entry must contain at least one instance of $version,
# as another program will look for any different versions on the same page.
# You may not need to set this, in which case the program will try to guess it from the download commands.
vcs_compile=true # Set this to true if it's a vcs package, and we've just downloaded an update for it. This is meant to be used in functions/header_end hooks, and has to be set before header_end is called (or by a header_end hook).
# Please note that setting the above info from an imported script is supported, as long as it's done in the header.
# Astronaut will generally prefix internal variables with "_". There are, however, a few exceptions.
# Some of those you can touch, some not.
# "You shouldn't even look, unless you're hacking really bad, but definitely don't touch"-variables:
# - dir_build (You cd into it automatically. Just use relative paths or $PWD.)
# - dir_source (This is handled by the commands detailed below. You should have no use for it.)
# "Look, but don't touch"-variables:
# - dir_install
# - dir_prefix
# - dir_sysroot
# "You'll only make your own life more difficult if you use them wrong, so I don't care what you do"-variables:
# (Only use these to change the behaviour of some commands over the whole script.)
# - cmd_download
# - cmd_extract
# - vcs_compile
# - options
# Get them files.
# URL [REQUIRED], MD5sum, Custom command
download "https://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
"6cd0ffea3884a4e79330338dcc2987d6" \
"curl -L -o {dst} {src}"
# Abbreviation download and extract. Does not allow custom commands.
#dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
# "6cd0ffea3884a4e79330338dcc2987d6"
# Abbreviation for downloading a file and copying it over.
#dlfile "http://example.com/Waffles.txt" \
# "MD5SUM"
# Copy local file to build directory. File should be stored in $(basedir <satellite file>)/extrafiles/$name/
#extrafile "Herpaderp.txt"
header_end # End of the header.
# The only commands that should be in the header are:
# - download
# - dlextract
# - dlfile
# - extrafile
# - import
# getfile and extract are technically allowed, but not encouraged.
# Basically, do not use anything that touches dir_build or dir_install or does anything other than fetching the required files.
# The same rule above applies for imported commands.
# Name [REQUIRED], Destination, Custom command
extract "$name-$version.tar.gz" \
"." \
"tar xvfC {src} {dst}"
# Copy some file you downloaded over to the build directory.
#getfile "Waffles.txt"
# Compilation instructions
cd "$name-$version"
./configure --prefix="$dir_prefix"
make
# Know if the user wants the package to be checked
# Check if an option is disabled
if option !no_check; then
make check
fi
# Abbreviation of the above
option test echo "Test option enabled"
# Bangs ("!") negate the operation.
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
# vim:set tabstop=4 shiftwidth=4 syntax=sh et: