You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
130 lines
5.3 KiB
130 lines
5.3 KiB
# Example of a satellite file, which is just a shell script with a cool name.
|
|
|
|
# Astronaut will generally prefix internal variables and functions with "_astronaut".
|
|
# Some of those you can touch, some not.
|
|
# None of your variables should start with "_astronaut".
|
|
|
|
# There are, however, a few exceptions. You shouldn't modify these variables directly, as they will affect how astronaut and it's wrappers run.
|
|
|
|
# Astronaut directory variables:
|
|
# - dir_build -- The directory where the package is built. You are by default in this directory.
|
|
# - dir_source -- The directory where the sources are placed. Don't rely on this unless necessary. Place everything in $dir_source/$name!
|
|
# - dir_install -- The directory where you will have to install the software.
|
|
|
|
# Package directory variables, taken straight from GNU autotools:
|
|
# - dir_prefix
|
|
# - dir_bin
|
|
# - dir_sbin
|
|
# - dir_libexec
|
|
# - dir_sysconf
|
|
# - dir_lib
|
|
# - dir_include
|
|
# - dir_data
|
|
# - dir_info
|
|
# - dir_locale
|
|
# - dir_man
|
|
# - dir_doc
|
|
|
|
# Command variables (see the default astronaut configuration)
|
|
# - cmd_download -- Used to download files
|
|
# - cmd_extract -- Used to extract files
|
|
|
|
# Misc variables
|
|
# - 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.
|
|
# - wrapper_* -- Reserved for wrapper configuration
|
|
|
|
import 'say_hello' # Import some functions. See functions/say_hello.sh for more info.
|
|
|
|
# Satellite 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.
|
|
# By default, it's the same as the filename, without the .sat extension.
|
|
version=2.10 # REQUIRED! Please declare it, as it will be used outside of the script as well.
|
|
|
|
# By default, astronaut doesn't use a "package name".
|
|
# It only uses the name variable, above, to create some sort of "namespaces", so that files from different projects don't overlap.
|
|
# The downloaded files and extra files in the "namespace" can be used by multiple satellites with the same name variable.
|
|
# This effectively gives you the ability to use the same files in multiple satellites.
|
|
|
|
# A few of the wrappers, however, do use a "package name". This is the same as the filename without the .sat extension.
|
|
# This "package name" can be accessed through the $name_sat variable, and you may use it as well.
|
|
|
|
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 conjunction with git, and has to be set before the end of the header.
|
|
|
|
# Define options used in this satellite.
|
|
define_option '!check: Enable the testsuite.' # Due to the '!' at the start, check is false by default.
|
|
define_option 'test=Default value' # It is also allowed to provide no description
|
|
# You should define every option used in your satellite.
|
|
# See lower for info on how to use these options.
|
|
|
|
# Please note that setting the above info in an imported script is supported, as long as it's done in the header.
|
|
|
|
# Get the files.
|
|
# URL [REQUIRED], MD5sum, Custom filename, Custom command
|
|
download "https://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
|
|
'6cd0ffea3884a4e79330338dcc2987d6' \
|
|
"$name-$version.tar.gz" \
|
|
'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'
|
|
|
|
_ # End of the header.
|
|
# The only commands that are allowed to be in the header are:
|
|
# - download
|
|
# - dlextract
|
|
# - dlfile
|
|
# - extrafile
|
|
# - import
|
|
# - define_option
|
|
# getfile and extract are technically allowed, but not encouraged. Those should be outside of the header.
|
|
# 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.
|
|
|
|
# Extract a downloaded file
|
|
# 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 enabled
|
|
if option check; then
|
|
make check
|
|
fi
|
|
# Abbreviation of the above
|
|
#option check make check
|
|
# Bangs ("!") negate the operation.
|
|
#option !check echo "The package wasn't checked"
|
|
|
|
make DESTDIR="$dir_install" install
|
|
rm "$dir_install/$dir_prefix/$dir_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
|
|
|
|
# Options with values.
|
|
echo "Value of option test = $(option =test)"
|
|
|
|
# Misc functions:
|
|
#safe_sed 'oh/i/hope\i\canuse%&thisinsed'
|
|
# Escapes all the necessary characters to be able to use an arbitrary string in a regular sed command
|
|
|
|
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:
|
|
|