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.
105 lines
4.3 KiB
105 lines
4.3 KiB
10 years ago
|
# Example of a satellite file, which is just a shell script with a cool name.
|
||
|
|
||
9 years ago
|
import "say_hello" # Import some functions. See functions/say_hello.sh for more info.
|
||
|
|
||
10 years ago
|
# Info (Please declare it, as it will be used outside of this script, too)
|
||
9 years ago
|
# Required info
|
||
9 years ago
|
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
|
||
9 years ago
|
|
||
|
# Optional info
|
||
9 years ago
|
update_url="https://ftp.gnu.org/gnu/$name/" # URL to a downloadable plain-text file which updates when a new version is available.
|
||
9 years ago
|
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.
|
||
10 years ago
|
|
||
9 years ago
|
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).
|
||
10 years ago
|
|
||
9 years ago
|
# Please note that setting the above info from an imported script is supported, as long as it's done in the header.
|
||
|
|
||
9 years ago
|
# Astronaut will generally prefix internal variables with "_". There are, however, a few exceptions.
|
||
|
# Some of those you can touch, some not.
|
||
9 years ago
|
|
||
9 years ago
|
# "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.)
|
||
9 years ago
|
|
||
9 years ago
|
# "Look, but don't touch"-variables:
|
||
9 years ago
|
# - All other dir_* variables
|
||
|
|
||
9 years ago
|
# "You'll only make your own life more difficult if you use them wrong, so I don't care what you do"-variables:
|
||
9 years ago
|
# (Only use these to change the behaviour of some commands over the whole script, ignoring default/user config.)
|
||
9 years ago
|
# - cmd_download
|
||
|
# - cmd_extract
|
||
|
# - vcs_compile
|
||
9 years ago
|
# - options
|
||
10 years ago
|
|
||
9 years ago
|
# 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}"
|
||
10 years ago
|
|
||
9 years ago
|
# Abbreviation download and extract. Does not allow custom commands.
|
||
|
#dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
|
||
|
# "6cd0ffea3884a4e79330338dcc2987d6"
|
||
10 years ago
|
|
||
9 years ago
|
# Abbreviation for downloading a file and copying it over.
|
||
10 years ago
|
#dlfile "http://example.com/Waffles.txt" \
|
||
|
# "MD5SUM"
|
||
|
|
||
9 years ago
|
# Copy local file to build directory. File should be stored in $(basedir <satellite file>)/extrafiles/$name/
|
||
10 years ago
|
#extrafile "Herpaderp.txt"
|
||
10 years ago
|
|
||
9 years ago
|
header_end # End of the header.
|
||
|
# The only commands that should be in the header are:
|
||
|
# - download
|
||
|
# - dlextract
|
||
|
# - dlfile
|
||
|
# - extrafile
|
||
9 years ago
|
# - import
|
||
9 years ago
|
# getfile and extract are technically allowed, but not encouraged.
|
||
9 years ago
|
# 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.
|
||
9 years ago
|
|
||
|
# 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"
|
||
|
|
||
10 years ago
|
# Compilation instructions
|
||
10 years ago
|
cd "$name-$version"
|
||
9 years ago
|
./configure --prefix="$dir_prefix"
|
||
10 years ago
|
make
|
||
10 years ago
|
|
||
|
# Know if the user wants the package to be checked
|
||
9 years ago
|
# Check if an option is disabled
|
||
|
if option !no_check; then
|
||
10 years ago
|
make check
|
||
|
fi
|
||
9 years ago
|
# Abbreviation of the above
|
||
|
option test echo "Test option enabled"
|
||
|
# Bangs ("!") negate the operation.
|
||
9 years ago
|
#option !test echo "Test option disabled"
|
||
|
|
||
|
# Options with arguments.
|
||
|
echo "Value of option test2 = $(option "test2=default value")"
|
||
10 years ago
|
|
||
10 years ago
|
make DESTDIR="$dir_install" install
|
||
9 years ago
|
rm "$dir_install/$dir_prefix/share/info/dir" # This file collides with some other packages.
|
||
10 years ago
|
|
||
9 years ago
|
# Call the function we imported. For more info see the top of the file, and functions/say_hello.sh
|
||
|
say_hello
|
||
|
|
||
9 years ago
|
# Misc functions:
|
||
|
#safe_sed 'oh/i/hope\i\canuse%&thisinsed'
|
||
|
# Escapes all the necessary characters to be able to use it in a regular sed command
|
||
|
|
||
10 years ago
|
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
|