diff --git a/astronaut/astronaut b/astronaut/astronaut
index cc04015..da89dae 100755
--- a/astronaut/astronaut
+++ b/astronaut/astronaut
@@ -1,72 +1,83 @@
-#!/bin/sh
-set -e
+#!/bin/sh -e
# Configuration
-dir_build="$PWD/build"
-dir_source="$PWD/source"
-dir_install="$PWD/install"
-cmd_download="curl -#L -o {dst} {src}"
-cmd_extract="tar xf {src}"
-enable_movedirs=false
-enable_check=true
-if [ -f /etc/astronaut.conf ]; then
- . /etc/astronaut.conf
-fi
+dir_build="$PWD/build" # Temporary directory to build packages
+dir_source="$PWD/source" # Directory where the package sources will be placed
+dir_install="$PWD/install" # Directory where the package will be installed
+prefix="/usr" # Prefix directory
+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
+enable_check=true # Run the test suite of packages
+unset dir_satellites # Directory where the satellite files are placed.
+[ -f /etc/astronaut.conf ] && . /etc/astronaut.conf
+[ -f "$HOME/.astronaut.conf" ] && . "$HOME/.astronaut.conf"
+
+# Options not in the configuration
+_download_only=false
+unset _header_end_hooks
+_vcs_only=false
+vcs_compile=false
+#_nuke_dir_install (This can be set from wrappers)
# Some printing functions
-show_help() {
+_show_help() {
echo "This astronaut will help you build some satellites.
Just describe what he's got to do in a satellite file.
-Usage: $0 [-sbi
] [-cCmM]
-
--s Set source directory
--b Set build directory [WARNING: Will be deleted before build]
--i Set install directory
--c Enable package checking
--C Disable package checking
--m Enable moving directories to match custom tree
--M Disable moving directories to match custom tree"
+Usage: $0 [-sbip ] [-IcCd]
+
+-h/? Show this message
+-b Set build directory [WARNING: Will be deleted before build]
+-s Set source directory
+-i Set install directory
+-p Set prefix directory
+-I Nuke install directory before build
+-c/C Enable/Disable package checking
+-d Only download package files
+-v Only build vcs package if any updates have been made to it"
}
-msg() {
+_msg() {
echo "=> $@"
}
-exiterr() {
+_exiterr() {
echo "===> Houston, we've got a problem: $@" 1>&2
exit 1
}
# Gather info
-while getopts "h?s:b:i:cCmM" opt; do
+while getopts "h?s:b:i:p:IcCdv" opt; do
case "$opt" in
h|\?)
- show_help
+ _show_help
exit 0
;;
s)
- mkdir -p "$OPTARG"
dir_source="$(realpath "$OPTARG")"
;;
b)
- mkdir -p "$OPTARG"
dir_build="$(realpath "$OPTARG")"
;;
i)
- mkdir -p "$OPTARG"
dir_install="$(realpath "$OPTARG")"
;;
+ p)
+ prefix="$(realpath "$OPTARG")"
+ ;;
+ I)
+ _nuke_dir_install=true
+ ;;
c)
enable_check=true
;;
C)
enable_check=false
;;
- m)
- enable_movedirs=true
+ d)
+ _download_only=true
;;
- M)
- enable_movedirs=false
+ v)
+ _vcs_only=true
;;
esac
done
@@ -75,57 +86,50 @@ shift $((OPTIND-1))
[ "$1" = "--" ] && shift
if [ ! "$1" ]; then
- show_help
+ _show_help
exit 1
fi
-satellite="$(realpath "$1")"
-
-if [ ! -f "$satellite" ]; then
- exiterr "Can't find satellite file"
-fi
-
# Tools for the astronaut
-mksum() {
+_mksum() {
echo "$(md5sum "$@" 2> /dev/null | cut -d' ' -f1)"
}
download() {
- local name="$(basename "$1" | cut -d? -f1)"
- local path="$dir_source/$name"
- local checksum=""
- if [ "$2" -a -f "$path" ]; then
- checksum="$(mksum "$path")"
- fi
- if [ ! -f "$path" -o "$checksum" != "$2" ]; then
- msg "Downloading $name"
- if [ "$3" ]; then
- local cmd="$3"
- else
- local cmd="$cmd_download"
- fi
+ mkdir -p "$dir_source/$name"
+
+ local filename="$(basename "$1" | cut -d? -f1)"
+ local path="$dir_source/$name/$filename"
+
+ [ "$2" -a -f "$path" ] && local checksum="$(_mksum "$path")"
+
+ if [ ! -e "$path" -o "$checksum" != "$2" ]; then
+ _msg "Downloading $filename"
+
+ [ "$3" ] && local cmd="$3" || local cmd="$cmd_download"
$(echo "$cmd" | sed -e 's@{dst}@'"$path"'@g' -e 's@{src}@'"$1"'@g')
- checksum="$(mksum "$path")"
+ checksum="$(_mksum "$path")"
if [ "$2" -a "$checksum" != "$2" ]; then
- msg "Checksum: $checksum"
- exiterr "Checksum failed"
+ _msg "Checksum: $checksum"
+ _exiterr "Checksum failed"
fi
fi
}
extract() {
- msg "Extracting $1"
- if [ "$2" ]; then
- local cmd="$2"
- else
- local cmd="$cmd_extract"
- fi
- $(echo "$cmd" | sed -e 's@{src}@'"$dir_source/$1"'@g')
+ _msg "Extracting $1"
+ [ "$2" ] && local dest="$2" || local dest="."
+ [ "$3" ] && local cmd="$3" || local cmd="$cmd_extract"
+ $(echo "$cmd" | sed -e 's@{src}@'"$dir_source/$name/$1"'@g' -e 's@{dst}@'"$dest"'@g')
}
getfile() {
- cp "$dir_source/$1" "$dir_build/$1"
+ cp -r "$dir_source/$name/$1" "$dir_build/$1"
+}
+
+extrafile() {
+ cp "$(dirname "$_satellite")/extrafiles/$_satname/$1" "$dir_build/$1"
}
dlextract() {
@@ -138,45 +142,84 @@ dlfile() {
getfile "$(basename "$1" | cut -d? -f1)"
}
-extrafile() {
- cp "$(dirname "$satellite")/extrafiles/$name/$1" "$dir_build/$1"
-}
-
do_check() {
if [ "$1" ]; then
- if $enable_check; then
- $@
- fi
+ [ "$enable_check" = true ] && $@
else
- if $enable_check; then
- return 0
- fi
- return 1
+ [ "$enable_check" = true ]
+ return $?
fi
}
-# Create the satellite
-rm -rf "$dir_build"
-mkdir -p "$dir_source"
-mkdir -p "$dir_build"
-mkdir -p "$dir_install"
-
-cd "$dir_build"
-. "$satellite"
-
-movefiles() {
- mkdir -p "$2"
- mv $(find "$1" -maxdepth 1 -mindepth 1) "$2"
- rm -rf "$1"
+import() {
+ unset _hooks
+ . "$(dirname "$_satellite")/functions/$1.sh"
+ if [ "$_hooks" ]; then
+ _header_end_hooks="$_header_end_hooks $_hooks"
+ fi
}
-if $enable_movedirs; then
- if [ "$(uname -m)" == "x86_64" ]; then
- if [ -d "$dir_install/lib64" ]; then
- movefiles "$dir_install/lib64" "$dir_install/lib"
+_run_header_end_hooks() {
+ for _hook in $_header_end_hooks; do
+ $_hook
+ done
+ unset _hook
+}
+
+# Set some functions in accordance to the _download_only option.
+header_end() { _run_header_end_hooks; }
+if [ "$_vcs_only" = true ]; then
+ header_end() {
+ _run_header_end_hooks
+ if [ ! "$vcs_compile" = true ]; then
+ exit
fi
- if [ -d "$dir_install/usr/lib64" ]; then
- movefiles "$dir_install/usr/lib64" "$dir_install/lib"
+ }
+fi
+if [ "$_download_only" = true ]; then
+ # Disable some functions
+ extract() { :; }
+ getfile() { :; }
+ extrafile() { :; }
+
+ # Exit at the end of the header
+ header_end() {
+ _run_header_end_hooks
+ exit
+ }
+fi
+
+_satellite="$(realpath "$1")"
+_satname="$(basename "$_satellite" .sat)"
+
+# Try to find the satellite file if it can't be found.
+if [ ! -f "$_satellite" ]; then
+ if [ -d "$dir_satellites" ]; then
+ file="$(find "$dir_satellites" -type f \( -name "$_satname.sat" -o -name "$_satname" \) -print -quit)"
+ if [ -f "$file" ]; then
+ _satellite="$(realpath "$file")"
+ _satname="$(basename "$_satellite" .sat)"
fi
fi
+
+ # If it still can't be found, exit.
+ if [ ! -f "$_satellite" ]; then
+ _exiterr "Can't find satellite"
+ fi
fi
+
+# Create the directories
+if [ "$_download_only" = false ]; then
+ # This variable can be set by a wrapper script in need to nuke the install dir.
+ if [ "$_nuke_dir_install" = true ]; then
+ rm -rf "$dir_install"
+ fi
+
+ rm -rf "$dir_build"
+ mkdir -p "$dir_build"
+ mkdir -p "$dir_install"
+ cd "$dir_build"
+fi
+
+# Create the satellite
+. "$_satellite"
diff --git a/astronaut/freshnaut b/astronaut/freshnaut
new file mode 100755
index 0000000..4e858a4
--- /dev/null
+++ b/astronaut/freshnaut
@@ -0,0 +1,161 @@
+#!/bin/sh -e
+
+# A script to check for satellite updates.
+# It just downloads the documents which should be updated when the software has an update.
+# It's a shitty method, but it kinda works... Other than having a lot of false-positives.
+
+_show_help() {
+echo "This program will help keep your satellites fresh and up to date.
+Usage: $0 <[\$dir_satellites] [\$_dir_fresh]|ignore >
+
+\$dir_satellites = The directory where all the satellites are you want to update.
+\$_dir_fresh = The directory that will be used to keep all the files for checking.
+ignore = Use this option to generate an ignorediff.
+diff = A diff file. Generated without -u or any other fancy options.
+ignorediff = A file containing the differences to be ignored (this file will be appended to).
+
+The variables (starting with \$) can also be set from a configuration file."
+}
+
+get_variable() {
+ printf "
+ download() { :; }
+ extract() { :; }
+ getfile() { :; }
+ extrafile() { :; }
+ dlextract() { :; }
+ dlfile() { :; }
+ header_end() { echo \$$1; exit; }
+ . %s
+ " $2 | sh
+}
+
+download() {
+ $(echo "$cmd_download" | sed -e 's@{dst}@'"$2"'@g' -e 's@{src}@'"$1"'@g') 2> /dev/null
+}
+
+diff_extractlines() {
+ # Extract all the line numbers from a diff.
+
+ stage=0
+ for line in $(echo "$1" | awk '{print $1}'); do
+ if [ "$stage" = 0 ]; then
+ if [ "$line" != ">" -a "$line" != "<" ]; then
+ echo "$line"
+ stage=1
+ fi
+ elif [ "$stage" = 1 ]; then
+ if [ "$line" != ">" -a "$line" != "<" ]; then
+ if [ "$line" = "---" ]; then
+ stage=0
+ else
+ echo "$line"
+ fi
+ fi
+ fi
+ done
+}
+
+apply_ignorediff() {
+ # Filter a diff, only return the differences that shouldn't be ignored.
+ # TODO: This function is slow, due to the usage of awk on every line. A solution for this problem would be great.
+
+ stage=0
+ ignore=0
+ echo "$1" | while read line; do
+ first="$(echo "$line" | awk '{print $1}')"
+ if [ "$stage" = 0 ]; then
+ if [ "$first" != ">" -a "$first" != "<" ]; then
+ stage=1
+ ignore=0
+ if grep -e "^$line\$" "$2" > /dev/null; then
+ ignore=1
+ fi
+ fi
+ elif [ "$stage" = 1 ]; then
+ if [ "$first" != ">" -a "$first" != "<" ]; then
+ if [ "$line" = "---" ]; then
+ stage=0
+ else
+ ignore=0
+ if grep -e "^$line\$" "$2" > /dev/null; then
+ ingore=1
+ fi
+ fi
+ fi
+ fi
+
+ if [ "$ignore" = 0 ]; then
+ echo "$line"
+ fi
+ done
+}
+
+# Do something completely different when this option is provided.
+if [ "$1" = "ignore" ]; then
+ if [ $# -lt 3 ]; then
+ _show_help
+ exit 1
+ fi
+
+ diff_extractlines "$(cat "$2")" >> "$3"
+
+ # Don't do anything else
+ exit
+fi
+
+# Load the config
+cmd_download="curl -L -o {dst} {src}" # Command to execute to download files
+[ -f /etc/astronaut.conf ] && . /etc/astronaut.conf
+[ -f "$HOME/.astronaut.conf" ] && . "$HOME/.astronaut.conf"
+
+# Override config with command-line parameters.
+[ "$1" ] && dir_satellites="$1"
+[ "$2" ] && _dir_fresh="$2"
+
+if [ ! "$dir_satellites" -o ! "$_dir_fresh" ]; then
+ _show_help
+ exit 1
+fi
+
+mkdir -p "$_dir_fresh"
+
+for sat in "$dir_satellites"/*.sat; do
+ update_url="$(get_variable update_url "$sat")"
+ name="$(basename "$sat" .sat)"
+
+ if [ "$update_url" ]; then
+ printf "Checking: $name..."
+ cols="$(expr $(tput cols) - $(printf "Checking: $name..." | wc -c))"
+
+ download "$update_url" "$_dir_fresh/$name.fresh"
+
+ if [ -f "$_dir_fresh/$name" ]; then
+ check="$(diff "$_dir_fresh/$name" "$_dir_fresh/$name.fresh" || true)"
+
+ if [ -f "$_dir_fresh/$name.ignorediff" ]; then
+ check="$(apply_ignorediff "$check" "$_dir_fresh/$name.ignorediff")"
+ fi
+
+ if [ "$check" ]; then
+ printf "%${cols}s\n" "Update detected"
+ echo "$check" >> "$_dir_fresh/$name-$(date +%Y%m%d%H%M%S).diff"
+ else
+ printf "\n"
+ fi
+ else
+ printf "%${cols}s\n" "First update check, creating new file"
+ download "$update_url" "$_dir_fresh/$name.checkfresh"
+ check="$(diff "$_dir_fresh/$name.fresh" "$_dir_fresh/$name.checkfresh" || true)"
+
+ if [ "$check" ]; then
+ echo "$(diff_extractlines "$check")" >> "$_dir_fresh/$name.ignorediff"
+ echo "> Created ignorediff"
+ fi
+
+ rm "$_dir_fresh/$name.checkfresh"
+ fi
+
+ mv "$_dir_fresh/$name.fresh" "$_dir_fresh/$name"
+ fi
+done
diff --git a/astronaut/functions/say_hello.sh b/astronaut/functions/say_hello.sh
new file mode 100644
index 0000000..26fe622
--- /dev/null
+++ b/astronaut/functions/say_hello.sh
@@ -0,0 +1,18 @@
+# This is a functions file. You can use this kind of files to share code between satellites.
+
+# You define a function here, and it becomes available in any script that imports it.
+say_hello() {
+ # Any function or variable that shouldn't be seen by the satellite is prefixed with "_func_"
+ _func_tmp="Hello, there!"
+ echo "Function ran! $_func_tmp"
+}
+
+# Any hook is prefixed with "_hook_"
+_hook_hello() {
+ echo "The hook ran at header_end!"
+}
+
+# This is a space-separated list of all the hooks.
+_hooks="_hook_hello"
+# Hooks are functions with code that is run at header_end, regardless if you're in download-only mode. So don't go messing in the build directory here.
+# This is purely to set variables (like update_url), maybe download code, or something else.
diff --git a/astronaut/hello.sat b/astronaut/hello.sat
index afdeffc..7007a38 100644
--- a/astronaut/hello.sat
+++ b/astronaut/hello.sat
@@ -1,36 +1,66 @@
# 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)
-name=hello
-version=2.9
+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
+update_url="https://ftp.gnu.org/gnu/$name/" # URL to a downloadable plain-text file which updates when a new version is available.
-# Get them files
-# URL [REQUIRED], MD5sum [REQUIRED], Custom command
-download "http://ftp.gnu.org/pub/gnu/$name/$name-$version.tar.gz" \
- "67607d2616a0faaf5bc94c59dca7c3cb" \
- "curl -L -o {dst} {src}"
+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).
-# Name [REQUIRED], Custom command
-extract "$name-$version.tar.gz" \
- "tar xvf {src}"
+# 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
+# - prefix
+# "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
+# - enable_check
+# - vcs_compile
-# Abbreviation for the above functions. Does not allow custom commands
-#dlextract "http://ftp.gnu.org/pub/gnu/$name/$name-$version.tar.gz" \
-# "67607d2616a0faaf5bc94c59dca7c3cb"
+# 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}"
-# Copy some file you downloaded over to the build directory
-#getfile "Waffles.txt"
+# 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
+# Abbreviation for downloading a file and copying it over.
#dlfile "http://example.com/Waffles.txt" \
# "MD5SUM"
-# Copy local file to build directory. Path relative to the location of the satellite file
+# Copy local file to build directory. File should be stored in $(basedir )/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
+# getfile and extract are technically allowed, but not encouraged.
+
+# 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=/usr
+./configure --prefix="$prefix"
make
# Know if the user wants the package to be checked
@@ -42,4 +72,7 @@ fi
make DESTDIR="$dir_install" install
+# 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:
diff --git a/astronaut/template.sat b/astronaut/template.sat
new file mode 100644
index 0000000..602a118
--- /dev/null
+++ b/astronaut/template.sat
@@ -0,0 +1,18 @@
+# Template satellite file without all the comments.
+
+name=hello
+version=2.10
+update_url="https://ftp.gnu.org/gnu/$name/"
+
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
+ "6cd0ffea3884a4e79330338dcc2987d6"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix="$prefix"
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/astronaut/xbps-astronaut b/astronaut/xbps-astronaut
new file mode 100755
index 0000000..4ad1acd
--- /dev/null
+++ b/astronaut/xbps-astronaut
@@ -0,0 +1,21 @@
+#!/bin/sh -e
+# A hacky script to generate .xbps files using satellites.
+# It's a fairly simple wrapper to astronaut, that generates a xbps 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_xbps should be set from a configuration file (e.g. ~/.astronaut.conf), and points to wherever you want your packages to be placed.
+[ "$_dir_xbps" ] && mkdir -p "$_dir_xbps" && cd "$_dir_xbps" || cd "$_topdir"
+xbps-create --compression none -A "$(uname -m)" -n "$_satname-${version}_astro" -s "Generated with xbps-astronaut" -H "$update_url" "$dir_install"
+rm -rf "$dir_install"
+xbps-rindex -f -a "$_satname-${version}_astro.$(uname -m).xbps"
diff --git a/graveyard/first_attempt.cause_of_death b/graveyard/first_attempt.cause_of_death
new file mode 100644
index 0000000..f908c3d
--- /dev/null
+++ b/graveyard/first_attempt.cause_of_death
@@ -0,0 +1,9 @@
+First attempt died on 18 november 2015.
+Latest update is unknown.
+Birth date is unknown.
+
+Description:
+The first attempt was the first attempt I made at making a distro.
+
+Cause of death:
+Because the latest changes only being version bumps, and me having never actually tested those changes, and after I've made some substantial changes in how satellites are written (adding functions, support for vcs, header_end hooks, etc.), I've decided that if I ever take up making a distro again, I'll rewrite all of these satellites from scratch anyway.
diff --git a/graveyard/first_attempt/satellites/acl.sat b/graveyard/first_attempt/satellites/acl.sat
new file mode 100644
index 0000000..51665ef
--- /dev/null
+++ b/graveyard/first_attempt/satellites/acl.sat
@@ -0,0 +1,18 @@
+name=acl
+version=2.2.52
+update_url="http://download.savannah.gnu.org/releases/$name/"
+
+enable_check=false # These tests require a specific filesystem.
+
+dlextract "http://download.savannah.gnu.org/releases/$name/$name-$version.src.tar.gz" \
+ "a61415312426e9c2212bd7dc7929abda"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr
+make
+do_check make -j1 tests
+make DIST_ROOT="$dir_install" install install-lib install-dev
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/attr.sat b/graveyard/first_attempt/satellites/attr.sat
new file mode 100644
index 0000000..b182185
--- /dev/null
+++ b/graveyard/first_attempt/satellites/attr.sat
@@ -0,0 +1,18 @@
+name=attr
+version=2.4.47
+update_url="http://download.savannah.gnu.org/releases/$name/"
+
+enable_check=false # These tests require a specific filesystem.
+
+dlextract "http://download.savannah.gnu.org/releases/$name/$name-$version.src.tar.gz" \
+ "84f58dec00b60f2dc8fd1c9709291cc7"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr
+make
+do_check make -j1 tests root-tests
+make DIST_ROOT="$dir_install" install install-lib install-dev
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/binutils.sat b/graveyard/first_attempt/satellites/binutils.sat
new file mode 100644
index 0000000..6f4514f
--- /dev/null
+++ b/graveyard/first_attempt/satellites/binutils.sat
@@ -0,0 +1,16 @@
+name=binutils
+version=2.25.1
+enable_check=false
+
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
+ "ac493a78de4fee895961d025b7905be4"
+header_end
+
+mkdir "$name-build"; cd "$name-build"
+
+"../$name-$version/configure" --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/coreutils.sat b/graveyard/first_attempt/satellites/coreutils.sat
new file mode 100644
index 0000000..1d65cd0
--- /dev/null
+++ b/graveyard/first_attempt/satellites/coreutils.sat
@@ -0,0 +1,16 @@
+name=coreutils
+version=8.24
+update_url="https://ftp.gnu.org/gnu/$name/"
+
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.xz" \
+ "40efdbce865d2458d8da0a9dcee7c16c"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr --enable-no-install-program=kill
+make
+do_check make check # NEED: user nobody, group nogroup, diff -c
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/file.sat b/graveyard/first_attempt/satellites/file.sat
new file mode 100644
index 0000000..b321edd
--- /dev/null
+++ b/graveyard/first_attempt/satellites/file.sat
@@ -0,0 +1,15 @@
+name=file
+version=5.24
+
+dlextract "ftp://ftp.astron.com/pub/$name/$name-$version.tar.gz" \
+ "ec161b5a0d2aef147fb046e5630b1408"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/gcc.sat b/graveyard/first_attempt/satellites/gcc.sat
new file mode 100644
index 0000000..e756cc4
--- /dev/null
+++ b/graveyard/first_attempt/satellites/gcc.sat
@@ -0,0 +1,23 @@
+name=gcc
+version=5.2.0
+enable_check=false
+
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version/$name-$version.tar.bz2" \
+ "a51bcfeb3da7dd4c623e27207ed43467"
+header_end
+
+mkdir "$name-build"; cd "$name-build"
+
+SED=sed "../$name-$version/configure" --prefix=/usr --enable-languages=c,c++ --with-system-zlib --disable-bootstrap --disable-multilib
+make
+if do_check; then
+ ulimit -s 32768
+ make -k check
+fi
+make DESTDIR="$dir_install" install
+
+ln -s gcc "$dir_install/usr/bin/cc"
+mkdir -p "$dir_install/usr/lib/bfd-plugins"
+ln -s "../../libexec/gcc/$(gcc -dumpmachine)/5.2.0/liblto_plugin.so" "$dir_install/usr/lib/bfd-plugins/"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/glibc.sat b/graveyard/first_attempt/satellites/glibc.sat
new file mode 100644
index 0000000..470030d
--- /dev/null
+++ b/graveyard/first_attempt/satellites/glibc.sat
@@ -0,0 +1,19 @@
+name=glibc
+version=2.22
+enable_check=false
+
+dlextract "https://ftp.gnu.org/gnu/libc/$name-$version.tar.xz" \
+ "e51e02bf552a0a1fbbdc948fb2f5e83c"
+header_end
+
+mkdir "$name-build"; cd "$name-build"
+
+"../$name-$version/configure" --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# It likes leaving this file here. Something it really shouldn't.
+rm "$dir_install/etc/ld.so.cache"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/gmp.sat b/graveyard/first_attempt/satellites/gmp.sat
new file mode 100644
index 0000000..8070cd7
--- /dev/null
+++ b/graveyard/first_attempt/satellites/gmp.sat
@@ -0,0 +1,16 @@
+name=gmp
+shortver=6.0.0
+version=${shortver}a
+
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.xz" \
+ "1e6da4e434553d2811437aa42c7f7c76"
+header_end
+
+cd "$name-$shortver"
+
+./configure --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/groups/package-management b/graveyard/first_attempt/satellites/groups/package-management
new file mode 100644
index 0000000..fe951d5
--- /dev/null
+++ b/graveyard/first_attempt/satellites/groups/package-management
@@ -0,0 +1,7 @@
+tar
+perl
+stow
+openssl
+ca-certificates
+curl
+astronaut
diff --git a/graveyard/first_attempt/satellites/groups/toolchain b/graveyard/first_attempt/satellites/groups/toolchain
new file mode 100644
index 0000000..c2e3074
--- /dev/null
+++ b/graveyard/first_attempt/satellites/groups/toolchain
@@ -0,0 +1,8 @@
+linux-api
+glibc # Adjust the toolchain after (http://linuxfromscratch.org/lfs/view/stable/chapter06/adjusting.html)
+binutils
+gmp # From here, run ldconfig after every package install.
+mpfr
+mpc
+zlib # Dependency of gcc
+gcc
diff --git a/graveyard/first_attempt/satellites/linux-api.sat b/graveyard/first_attempt/satellites/linux-api.sat
new file mode 100644
index 0000000..6116cdc
--- /dev/null
+++ b/graveyard/first_attempt/satellites/linux-api.sat
@@ -0,0 +1,14 @@
+name=linux
+version=4.1.6
+
+dlextract "https://www.kernel.org/pub/$name/kernel/v4.x/$name-$version.tar.xz" \
+ "1dae0c808e34164cab3dfd57be88bd53"
+header_end
+
+cd "$name-$version"
+
+make mrproper
+make INSTALL_HDR_PATH="$dir_install/usr" headers_install
+find "$dir_install/usr/include" \( -name .install -o -name ..install.cmd \) -delete
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/mpc.sat b/graveyard/first_attempt/satellites/mpc.sat
new file mode 100644
index 0000000..7b60d64
--- /dev/null
+++ b/graveyard/first_attempt/satellites/mpc.sat
@@ -0,0 +1,15 @@
+name=mpc
+version=1.0.3
+
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
+ "d6a1d5f8ddea3abd2cc3e98f58352d26"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/mpfr.sat b/graveyard/first_attempt/satellites/mpfr.sat
new file mode 100644
index 0000000..2df9e85
--- /dev/null
+++ b/graveyard/first_attempt/satellites/mpfr.sat
@@ -0,0 +1,15 @@
+name=mpfr
+version=3.1.3
+
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.xz" \
+ "6969398cd2fbc56a6af570b5273c56a9"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/shadow.sat b/graveyard/first_attempt/satellites/shadow.sat
new file mode 100644
index 0000000..e13d5ef
--- /dev/null
+++ b/graveyard/first_attempt/satellites/shadow.sat
@@ -0,0 +1,16 @@
+name=shadow
+version=4.2.1
+update_url="https://pkg-shadow.alioth.debian.org/"
+
+dlextract "https://pkg-shadow.alioth.debian.org/releases/$name-$version.tar.xz" \
+ "2bfafe7d4962682d31b5eba65dba4fc8"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/tar.sat b/graveyard/first_attempt/satellites/tar.sat
new file mode 100644
index 0000000..b215bc3
--- /dev/null
+++ b/graveyard/first_attempt/satellites/tar.sat
@@ -0,0 +1,16 @@
+name=tar
+version=1.28
+update_url="https://ftp.gnu.org/gnu/$name/"
+
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.xz" \
+ "49b6306167724fe48f419a33a5beb857"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/tzdata.sat b/graveyard/first_attempt/satellites/tzdata.sat
new file mode 100644
index 0000000..cca6e29
--- /dev/null
+++ b/graveyard/first_attempt/satellites/tzdata.sat
@@ -0,0 +1,17 @@
+name=tzdata
+version=2015f
+
+dlextract "https://www.iana.org/time-zones/repository/releases/$name$version.tar.gz" \
+ "e3b82732d20e973e48af1c6f13df9a1d"
+header_end
+
+timezones="africa antarctica asia australasia backward backzone etcetera europe factory northamerica pacificnew southamerica systemv"
+
+zic -y ./yearistype -d "$dir_install/usr/share/zoneinfo" $timezones
+zic -y ./yearistype -d "$dir_install/usr/share/zoneinfo/posix" $timezones
+zic -y ./yearistype -d "$dir_install/usr/share/zoneinfo/right" -L leapseconds $timezones
+zic -y ./yearistype -d "$dir_install/usr/share/zoneinfo" -p America/New_York
+
+cp zone1970.tab iso3166.tab "$dir_install/usr/share/zoneinfo"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/util-linux.sat b/graveyard/first_attempt/satellites/util-linux.sat
new file mode 100644
index 0000000..88a3ed2
--- /dev/null
+++ b/graveyard/first_attempt/satellites/util-linux.sat
@@ -0,0 +1,17 @@
+name=util-linux
+majver=2.26
+version=$majver.2
+update_url="https://www.kernel.org/pub/linux/utils/$name/"
+
+dlextract "https://www.kernel.org/pub/linux/utils/$name/v$majver/$name-$version.tar.xz" \
+ "9bdf368c395f1b70325d0eb22c7f48fb"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install # NEEDS: group tty
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/satellites/zlib.sat b/graveyard/first_attempt/satellites/zlib.sat
new file mode 100644
index 0000000..e2beb3f
--- /dev/null
+++ b/graveyard/first_attempt/satellites/zlib.sat
@@ -0,0 +1,15 @@
+name=zlib
+version=1.2.8
+
+dlextract "http://zlib.net/$name-$version.tar.xz" \
+ "28f1205d8dd2001f26fec1e8c2cebe37"
+header_end
+
+cd "$name-$version"
+
+./configure --prefix=/usr
+make
+do_check make check
+make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/tools/chroot b/graveyard/first_attempt/tools/chroot
similarity index 52%
rename from tools/chroot
rename to graveyard/first_attempt/tools/chroot
index 680b78b..50e5a17 100755
--- a/tools/chroot
+++ b/graveyard/first_attempt/tools/chroot
@@ -14,20 +14,11 @@ fi
rocket="$(realpath "$rocket")"
-checkmount() {
- local point="$(eval echo \${$#})"
- if cut -d' ' -f2 /proc/mounts | grep "$point" > /dev/null; then
- true
- else
- mount $@
- fi
-}
-
mkdir -p "$rocket/dev" "$rocket/proc" "$rocket/sys" "$rocket/run"
-checkmount --bind /dev "$rocket/dev"
-checkmount -t devpts devpts "$rocket/dev/pts"
-checkmount -t proc proc "$rocket/proc"
-checkmount -t tmpfs tmpfs "$rocket/run"
+mount --bind /dev "$rocket/dev" 2> /dev/null || true
+mount --bind /dev/pts "$rocket/dev/pts" 2> /dev/null || true # Bind-mounting this because not doing so breaks some things.
+mount -t proc proc "$rocket/proc" 2> /dev/null || true
+mount -t tmpfs tmpfs "$rocket/run" 2> /dev/null || true
if [ -h "$rocket/dev/shm" ]; then
mkdir -p "$rocket/$(readlink "$rocket/dev/shm")"
fi
@@ -35,15 +26,17 @@ fi
mkdir -p "$rocket/etc"
cp /etc/resolv.conf "$rocket/etc/resolv.conf"
+# FORCE_UNSAFE_CONFIGURE is needed for building some packages as root
chroot "$rocket" /tools/bin/env -i \
HOME=/root \
TERM="$TERM" \
PS1="(buildenv) \u:\w \$ " \
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/tools/bin \
+ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/tools/bin:/tools/sbin \
MAKEFLAGS="$MAKEFLAGS" \
+ FORCE_UNSAFE_CONFIGURE=1 \
/tools/bin/ash -l
-umount "$rocket/dev/pts"
-umount "$rocket/dev"
-umount "$rocket/proc"
-umount "$rocket/run"
+umount "$rocket/dev/pts" || true
+umount "$rocket/dev" || true
+umount "$rocket/proc" || true
+umount "$rocket/run" || true
diff --git a/tools/library-check.sh b/graveyard/first_attempt/tools/library-check.sh
old mode 100644
new mode 100755
similarity index 88%
rename from tools/library-check.sh
rename to graveyard/first_attempt/tools/library-check.sh
index 37dbb9f..60a2bec
--- a/tools/library-check.sh
+++ b/graveyard/first_attempt/tools/library-check.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copied from LFS 7.6
+# Copied from LFS 7.7
for lib in lib{gmp,mpfr,mpc}.la; do
echo $lib: $(if find /usr/lib* -name $lib|
grep -q $lib;then :;else echo not;fi) found
diff --git a/tools/mktools b/graveyard/first_attempt/tools/mktools
similarity index 55%
rename from tools/mktools
rename to graveyard/first_attempt/tools/mktools
index 16372f4..aba8290 100755
--- a/tools/mktools
+++ b/graveyard/first_attempt/tools/mktools
@@ -1,21 +1,28 @@
#!/bin/sh
-# Tool to build tools to build final system
+# Tool to build tools to build the temporary system
set -e
umask 022
+download_only=false
+if [ "$1" = "download" ]; then
+ download_only=true
+fi
+
command -v astronaut >/dev/null 2>&1 || {
echo 'Can'\''t find astronaut in $PATH' 1>&2
exit 1
}
-if [ ! "$rocket" ]; then
- echo 'Please set the $rocket variable' 1>&2
- exit 1
-fi
+if [ "$download_only" = false ]; then
+ if [ ! "$rocket" ]; then
+ echo 'Please set the $rocket variable' 1>&2
+ exit 1
+ fi
-if [ "$(readlink /tools)" != "$(realpath "$rocket")/tools" ]; then
- echo "Please create a symlink from /tools to $(realpath "$rocket")/tools" 1>&2
- exit 1
+ if [ "$(readlink /tools)" != "$(realpath "$rocket")/tools" ]; then
+ echo "Please create a symlink from /tools to $(realpath "$rocket")/tools" 1>&2
+ exit 1
+ fi
fi
# Options for supported shells
@@ -27,6 +34,11 @@ fi
satellite_dir="$(dirname "$(realpath "$0")")/satellites"
envrun() {
+ if [ "$download_only" = true ]; then
+ $@
+ return
+ fi
+
env -i \
HOME="$HOME" \
TERM="$TERM" \
@@ -39,11 +51,18 @@ envrun() {
}
astrobuild() {
- envrun astronaut -M -i "$rocket" "$satellite_dir/$1.sat"
+ if [ "$download_only" = true ]; then
+ envrun astronaut -d "$satellite_dir/$1.sat"
+ else
+ envrun astronaut -i "$rocket" "$satellite_dir/$1.sat"
+ fi
}
-mkdir -p "$rocket/tools/lib"
-ln -sf lib "$rocket/tools/lib64"
+# Needed for x86_64
+if [ "$download_only" = false ]; then
+ mkdir -p "$rocket/tools/lib"
+ ln -sf lib "$rocket/tools/lib64"
+fi
# Just enter the environment
#envrun
@@ -55,7 +74,7 @@ astrobuild "binutils-1"
astrobuild "gcc-1"
astrobuild "linux-api"
astrobuild "glibc"
-astrobuild "libstdc"
+astrobuild "libstdcxx"
astrobuild "binutils-2"
astrobuild "gcc-2"
@@ -65,14 +84,17 @@ astrobuild "bash"
astrobuild "gawk"
astrobuild "make"
astrobuild "m4"
-astrobuild "tcl"
+
+# Testing
+astrobuild "tcl-core"
astrobuild "expect"
astrobuild "dejagnu"
astrobuild "check"
+# Package management
astrobuild "perl"
+astrobuild "stow"
astrobuild "openssl"
astrobuild "ca-certificates"
astrobuild "curl"
-astrobuild "stow"
astrobuild "astronaut"
diff --git a/graveyard/first_attempt/tools/prepchroot b/graveyard/first_attempt/tools/prepchroot
new file mode 100755
index 0000000..664d44f
--- /dev/null
+++ b/graveyard/first_attempt/tools/prepchroot
@@ -0,0 +1,54 @@
+#!/bin/sh
+umask 022
+set -e
+
+if [ "$(id -u)" != "0" ]; then
+ echo "Please run this script as root" 1>&2
+ exit 1
+fi
+
+if [ ! "$rocket" ]; then
+ echo 'Please set the $rocket variable' 1>&2
+ exit 1
+fi
+
+echo "Changing ownership of $rocket to root"
+chown -R 0.0 "$rocket"
+
+echo "Creating device nodes"
+mkdir -p "$rocket/dev"
+umount -R "$rocket/dev" 2> /dev/null || true
+mknod -m 600 "$rocket/dev/console" c 5 1 2> /dev/null || true
+mknod -m 666 "$rocket/dev/null" c 1 3 2> /dev/null || true
+
+echo "Creating directories"
+install -dm750 "$rocket/root"
+install -dm1777 "$rocket/tmp"
+mkdir -p "$rocket/etc" "$rocket/usr/pkg" "$rocket/usr/sat"
+
+echo "Creating temporary symlinks"
+mkdir -p "$rocket/usr/pkg/tmp-coreutils/bin"
+ln -f "$rocket/tools/bin/busybox" "$rocket/usr/pkg/tmp-coreutils/bin/pwd"
+mkdir -p "$rocket/usr/pkg/tmp-sh/bin"
+ln -f "$rocket/tools/bin/busybox" "$rocket/usr/pkg/tmp-sh/bin/sh"
+mkdir -p "$rocket/usr/pkg/tmp-bash/bin"
+ln -f "$rocket/tools/bin/bash" "$rocket/usr/pkg/tmp-bash/bin/bash"
+mkdir -p "$rocket/usr/pkg/tmp-ca-certificates/etc/ssl"
+ln -sf /tools/ssl/certs "$rocket/usr/pkg/tmp-ca-certificates/etc/ssl/certs"
+mkdir -p "$rocket/usr/pkg/tmp-gcc/usr/lib"
+ln -f "$rocket/tools/lib/libgcc_s.so" "$rocket/usr/pkg/tmp-gcc/usr/lib/libgcc_s.so"
+ln -f "$rocket/tools/lib/libgcc_s.so.1" "$rocket/usr/pkg/tmp-gcc/usr/lib/libgcc_s.so.1"
+ln -f "$rocket/tools/lib/libstdc++.so" "$rocket/usr/pkg/tmp-gcc/usr/lib/libstdc++.so"
+ln -f "$rocket/tools/lib/libstdc++.so.6" "$rocket/usr/pkg/tmp-gcc/usr/lib/libstdc++.so.6"
+ln -f "$rocket/tools/lib/libstdc++.so.6.0.21" "$rocket/usr/pkg/tmp-gcc/usr/lib/libstdc++.so.6.0.21"
+
+echo "Creating users and groups"
+echo 'root:x:0:0:root:/root:/bin/sh
+nobody:x:99:99:Unprivileged User:/dev/null:/bin/false' > "$rocket/etc/passwd"
+echo 'root:x:0:
+tty:x:1:
+nogroup:x:99:' > "$rocket/etc/group"
+
+echo "Configuring stow"
+echo '-d /usr/pkg
+-t /' > "$rocket/etc/stowrc"
diff --git a/tools/satellites/astronaut.sat b/graveyard/first_attempt/tools/satellites/astronaut.sat
similarity index 95%
rename from tools/satellites/astronaut.sat
rename to graveyard/first_attempt/tools/satellites/astronaut.sat
index 62010bd..bbd74ab 100644
--- a/tools/satellites/astronaut.sat
+++ b/graveyard/first_attempt/tools/satellites/astronaut.sat
@@ -1,4 +1,6 @@
# This is a hacky satellite. Please refrain of making more like this if possible.
+
+header_end
msg "Installing astronaut"
install -Dm755 "$(command -v "$0")" "$dir_install/tools/bin/astronaut"
diff --git a/tools/satellites/bash.sat b/graveyard/first_attempt/tools/satellites/bash.sat
similarity index 75%
rename from tools/satellites/bash.sat
rename to graveyard/first_attempt/tools/satellites/bash.sat
index 337725a..0254ca3 100644
--- a/tools/satellites/bash.sat
+++ b/graveyard/first_attempt/tools/satellites/bash.sat
@@ -1,8 +1,9 @@
name=bash
version=4.3.30
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
"a27b3ee9be83bd3ba448c0ff52b28447"
+header_end
cd "$name-$version"
diff --git a/tools/satellites/binutils-1.sat b/graveyard/first_attempt/tools/satellites/binutils-1.sat
similarity index 70%
rename from tools/satellites/binutils-1.sat
rename to graveyard/first_attempt/tools/satellites/binutils-1.sat
index 525ee3d..0650fa3 100644
--- a/tools/satellites/binutils-1.sat
+++ b/graveyard/first_attempt/tools/satellites/binutils-1.sat
@@ -1,8 +1,9 @@
name=binutils
-version=2.25
+version=2.25.1
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
- "e0f71a7b2ddab0f8612336ac81d9636b"
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
+ "ac493a78de4fee895961d025b7905be4"
+header_end
mkdir "$name-build"; cd "$name-build"
diff --git a/tools/satellites/binutils-2.sat b/graveyard/first_attempt/tools/satellites/binutils-2.sat
similarity index 77%
rename from tools/satellites/binutils-2.sat
rename to graveyard/first_attempt/tools/satellites/binutils-2.sat
index c2ccaec..932c407 100644
--- a/tools/satellites/binutils-2.sat
+++ b/graveyard/first_attempt/tools/satellites/binutils-2.sat
@@ -1,8 +1,9 @@
name=binutils
-version=2.25
+version=2.25.1
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
- "e0f71a7b2ddab0f8612336ac81d9636b"
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
+ "ac493a78de4fee895961d025b7905be4"
+header_end
mkdir "$name-build"; cd "$name-build"
diff --git a/tools/satellites/busybox.sat b/graveyard/first_attempt/tools/satellites/busybox.sat
similarity index 80%
rename from tools/satellites/busybox.sat
rename to graveyard/first_attempt/tools/satellites/busybox.sat
index 209a705..0b4ac48 100644
--- a/tools/satellites/busybox.sat
+++ b/graveyard/first_attempt/tools/satellites/busybox.sat
@@ -1,9 +1,10 @@
name=busybox
-version=1.23.1
+version=1.23.2
dlextract "http://www.busybox.net/downloads/$name-$version.tar.bz2" \
- "337d1a15ab1cb1d4ed423168b1eb7d7e"
+ "7925683d7dd105aabe9b6b618d48cc73"
extrafile "busybox.config"
+header_end
sed 's@./_install@'"$dir_install/tools"'@' busybox.config > "$name-$version/.config"
cd "$name-$version"
diff --git a/graveyard/first_attempt/tools/satellites/ca-certificates.sat b/graveyard/first_attempt/tools/satellites/ca-certificates.sat
new file mode 100644
index 0000000..35cad1b
--- /dev/null
+++ b/graveyard/first_attempt/tools/satellites/ca-certificates.sat
@@ -0,0 +1,17 @@
+name=ca-certificates
+version=$(date +%Y%m%d)
+
+dlfile "https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt"
+extrafile "make-ca.sh"
+extrafile "make-cert.pl"
+extrafile "remove-expired-certs.sh"
+header_end
+
+./make-ca.sh
+./remove-expired-certs.sh certs
+mkdir -p "$dir_install/tools/ssl/certs"
+cp certs/*.pem "$dir_install/tools/ssl/certs"
+c_rehash "$dir_install/tools/ssl/certs"
+cp ca-certificates.crt "$dir_install/tools/ssl/certs"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/graveyard/first_attempt/tools/satellites/check.sat b/graveyard/first_attempt/tools/satellites/check.sat
new file mode 100644
index 0000000..4937c8c
--- /dev/null
+++ b/graveyard/first_attempt/tools/satellites/check.sat
@@ -0,0 +1,13 @@
+name=check
+version=0.10.0
+
+dlextract "https://sourceforge.net/projects/$name/files/$name/$version/$name-$version.tar.gz" \
+ "53c5e5c77d090e103a17f3ed7fd7d8b8"
+header_end
+
+cd "$name-$version"
+
+PKG_CONFIG= ./configure --prefix=/tools
+make; make DESTDIR="$dir_install" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/tools/satellites/curl.sat b/graveyard/first_attempt/tools/satellites/curl.sat
similarity index 76%
rename from tools/satellites/curl.sat
rename to graveyard/first_attempt/tools/satellites/curl.sat
index 07e9de9..13c7c02 100644
--- a/tools/satellites/curl.sat
+++ b/graveyard/first_attempt/tools/satellites/curl.sat
@@ -1,8 +1,9 @@
name=curl
-version=7.40.0
+version=7.44.0
dlextract "http://curl.haxx.se/download/$name-$version.tar.bz2" \
- "1efecb5b0e43c17d968f0d228bbbbbbd"
+ "6b952ca00e5473b16a11f05f06aa8dae"
+header_end
cd "$name-$version"
diff --git a/tools/satellites/dejagnu.sat b/graveyard/first_attempt/tools/satellites/dejagnu.sat
similarity index 53%
rename from tools/satellites/dejagnu.sat
rename to graveyard/first_attempt/tools/satellites/dejagnu.sat
index cdff069..9620196 100644
--- a/tools/satellites/dejagnu.sat
+++ b/graveyard/first_attempt/tools/satellites/dejagnu.sat
@@ -1,8 +1,9 @@
name=dejagnu
-version=1.5.2
+version=1.5.3
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
- "8386e04e362345f50ad169f052f4c4ab"
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.gz" \
+ "5bda2cdb1af51a80aecce58d6e42bd2f"
+header_end
cd "$name-$version"
diff --git a/tools/satellites/expect.sat b/graveyard/first_attempt/tools/satellites/expect.sat
similarity index 74%
rename from tools/satellites/expect.sat
rename to graveyard/first_attempt/tools/satellites/expect.sat
index d76e97f..e253aa1 100644
--- a/tools/satellites/expect.sat
+++ b/graveyard/first_attempt/tools/satellites/expect.sat
@@ -1,8 +1,9 @@
name=expect
version=5.45
-dlextract "http://sourceforge.net/projects/$name/files/Expect/$version/$name$version.tar.gz" \
+dlextract "https://sourceforge.net/projects/$name/files/Expect/$version/$name$version.tar.gz" \
"44e1a4f4c877e9ddc5a542dfa7ecc92b"
+header_end
cd "$name$version"
diff --git a/tools/satellites/extrafiles/busybox/busybox.config b/graveyard/first_attempt/tools/satellites/extrafiles/busybox/busybox.config
similarity index 97%
rename from tools/satellites/extrafiles/busybox/busybox.config
rename to graveyard/first_attempt/tools/satellites/extrafiles/busybox/busybox.config
index 7c00925..25bd73b 100644
--- a/tools/satellites/extrafiles/busybox/busybox.config
+++ b/graveyard/first_attempt/tools/satellites/extrafiles/busybox/busybox.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Busybox version: 1.22.1
-# Sun Dec 7 14:30:18 2014
+# Busybox version: 1.23.2
+# Thu Aug 27 07:40:27 2015
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -12,7 +12,7 @@ CONFIG_HAVE_DOT_CONFIG=y
#
# General Configuration
#
-# CONFIG_DESKTOP is not set
+CONFIG_DESKTOP=y
# CONFIG_EXTRA_COMPAT is not set
# CONFIG_INCLUDE_SUSv2 is not set
# CONFIG_USE_PORTABLE_CODE is not set
@@ -36,6 +36,8 @@ CONFIG_LAST_SUPPORTED_WCHAR=0
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
# CONFIG_UNICODE_PRESERVE_BROKEN is not set
+# CONFIG_PAM is not set
+CONFIG_FEATURE_USE_SENDFILE=y
# CONFIG_LONG_OPTS is not set
# CONFIG_FEATURE_DEVPTS is not set
# CONFIG_FEATURE_CLEAN_UP is not set
@@ -73,6 +75,7 @@ CONFIG_EXTRA_LDLIBS=""
#
# CONFIG_DEBUG is not set
# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_UNIT_TEST is not set
# CONFIG_WERROR is not set
CONFIG_NO_DEBUG_LIB=y
# CONFIG_DMALLOC is not set
@@ -183,6 +186,7 @@ CONFIG_FEATURE_DATE_COMPAT=y
CONFIG_HOSTID=y
CONFIG_ID=y
CONFIG_GROUPS=y
+CONFIG_SHUF=y
CONFIG_TEST=y
CONFIG_FEATURE_TEST_64=y
CONFIG_TOUCH=y
@@ -191,6 +195,7 @@ CONFIG_FEATURE_TOUCH_SUSV3=y
CONFIG_TR=y
CONFIG_FEATURE_TR_CLASSES=y
CONFIG_FEATURE_TR_EQUIV=y
+CONFIG_UNLINK=y
CONFIG_BASE64=y
# CONFIG_WHO is not set
# CONFIG_USERS is not set
@@ -298,6 +303,11 @@ CONFIG_FEATURE_WC_LARGE=y
CONFIG_WHOAMI=y
CONFIG_YES=y
+#
+# Common options
+#
+CONFIG_FEATURE_VERBOSE=y
+
#
# Common options for cp and mv
#
@@ -384,6 +394,9 @@ CONFIG_FEATURE_VI_SETOPTS=y
CONFIG_FEATURE_VI_SET=y
CONFIG_FEATURE_VI_WIN_RESIZE=y
CONFIG_FEATURE_VI_ASK_TERMINAL=y
+CONFIG_FEATURE_VI_UNDO=y
+CONFIG_FEATURE_VI_UNDO_QUEUE=y
+CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256
CONFIG_FEATURE_ALLOW_EXEC=y
#
@@ -400,6 +413,7 @@ CONFIG_FEATURE_FIND_MAXDEPTH=y
CONFIG_FEATURE_FIND_NEWER=y
CONFIG_FEATURE_FIND_INUM=y
CONFIG_FEATURE_FIND_EXEC=y
+CONFIG_FEATURE_FIND_EXEC_PLUS=y
CONFIG_FEATURE_FIND_USER=y
CONFIG_FEATURE_FIND_GROUP=y
CONFIG_FEATURE_FIND_NOT=y
@@ -421,6 +435,7 @@ CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
+CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
#
# Init Utilities
@@ -457,6 +472,7 @@ CONFIG_INIT_TERMINAL_TYPE=""
# CONFIG_ADDUSER is not set
# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
# CONFIG_FEATURE_CHECK_NAMES is not set
+CONFIG_LAST_ID=0
CONFIG_FIRST_SYSTEM_ID=0
CONFIG_LAST_SYSTEM_ID=0
# CONFIG_ADDGROUP is not set
@@ -468,7 +484,6 @@ CONFIG_LAST_SYSTEM_ID=0
# CONFIG_GETTY is not set
# CONFIG_LOGIN is not set
# CONFIG_LOGIN_SESSION_AS_CHILD is not set
-# CONFIG_PAM is not set
# CONFIG_LOGIN_SCRIPTS is not set
# CONFIG_FEATURE_NOLOGIN is not set
# CONFIG_FEATURE_SECURETTY is not set
@@ -526,6 +541,7 @@ CONFIG_DEFAULT_DEPMOD_FILE=""
# Linux System Utilities
#
# CONFIG_BLOCKDEV is not set
+# CONFIG_FATATTR is not set
# CONFIG_FSTRIM is not set
# CONFIG_MDEV is not set
# CONFIG_FEATURE_MDEV_CONF is not set
@@ -597,6 +613,7 @@ CONFIG_DEFAULT_DEPMOD_FILE=""
# CONFIG_SCRIPTREPLAY is not set
# CONFIG_SETARCH is not set
# CONFIG_SWAPONOFF is not set
+# CONFIG_FEATURE_SWAPON_DISCARD is not set
# CONFIG_FEATURE_SWAPON_PRI is not set
# CONFIG_SWITCH_ROOT is not set
# CONFIG_UMOUNT is not set
@@ -631,6 +648,10 @@ CONFIG_DEFAULT_DEPMOD_FILE=""
# Miscellaneous Utilities
#
# CONFIG_CONSPY is not set
+# CONFIG_CROND is not set
+# CONFIG_FEATURE_CROND_D is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_FEATURE_CROND_DIR=""
# CONFIG_LESS is not set
CONFIG_FEATURE_LESS_MAXLINES=0
# CONFIG_FEATURE_LESS_BRACKETS is not set
@@ -645,6 +666,8 @@ CONFIG_FEATURE_LESS_MAXLINES=0
# CONFIG_NANDDUMP is not set
# CONFIG_RFKILL is not set
# CONFIG_SETSERIAL is not set
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
# CONFIG_UBIATTACH is not set
# CONFIG_UBIDETACH is not set
# CONFIG_UBIMKVOL is not set
@@ -667,10 +690,6 @@ CONFIG_FEATURE_BEEP_LENGTH_MS=0
# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
# CONFIG_CHRT is not set
-# CONFIG_CROND is not set
-# CONFIG_FEATURE_CROND_D is not set
-# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
-CONFIG_FEATURE_CROND_DIR=""
# CONFIG_CRONTAB is not set
# CONFIG_DC is not set
# CONFIG_FEATURE_DC_LIBM is not set
@@ -712,8 +731,6 @@ CONFIG_FEATURE_CROND_DIR=""
# CONFIG_RX is not set
# CONFIG_SETSID is not set
# CONFIG_STRINGS is not set
-# CONFIG_TASKSET is not set
-# CONFIG_FEATURE_TASKSET_FANCY is not set
# CONFIG_TIME is not set
# CONFIG_TIMEOUT is not set
# CONFIG_TTYSIZE is not set
@@ -749,13 +766,13 @@ CONFIG_FEATURE_CROND_DIR=""
# CONFIG_FTPD is not set
# CONFIG_FEATURE_FTP_WRITE is not set
# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
+# CONFIG_FEATURE_FTP_AUTHENTICATION is not set
# CONFIG_FTPGET is not set
# CONFIG_FTPPUT is not set
# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
# CONFIG_HOSTNAME is not set
# CONFIG_HTTPD is not set
# CONFIG_FEATURE_HTTPD_RANGES is not set
-# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set
# CONFIG_FEATURE_HTTPD_SETUID is not set
# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
@@ -812,6 +829,7 @@ CONFIG_IFUPDOWN_IFSTATE_PATH=""
# CONFIG_NSLOOKUP is not set
# CONFIG_NTPD is not set
# CONFIG_FEATURE_NTPD_SERVER is not set
+# CONFIG_FEATURE_NTPD_CONF is not set
# CONFIG_PSCAN is not set
# CONFIG_ROUTE is not set
# CONFIG_SLATTACH is not set
@@ -845,6 +863,7 @@ CONFIG_IFUPDOWN_IFSTATE_PATH=""
CONFIG_DHCPD_LEASES_FILE=""
# CONFIG_UDHCPC is not set
# CONFIG_FEATURE_UDHCPC_ARPING is not set
+# CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set
# CONFIG_FEATURE_UDHCP_PORT is not set
CONFIG_UDHCP_DEBUG=0
# CONFIG_FEATURE_UDHCP_RFC3397 is not set
@@ -854,11 +873,11 @@ CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0
CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
# CONFIG_UDPSVD is not set
# CONFIG_VCONFIG is not set
-CONFIG_WGET=y
-CONFIG_FEATURE_WGET_STATUSBAR=y
-CONFIG_FEATURE_WGET_AUTHENTICATION=y
+# CONFIG_WGET is not set
+# CONFIG_FEATURE_WGET_STATUSBAR is not set
+# CONFIG_FEATURE_WGET_AUTHENTICATION is not set
# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set
-CONFIG_FEATURE_WGET_TIMEOUT=y
+# CONFIG_FEATURE_WGET_TIMEOUT is not set
# CONFIG_ZCIP is not set
#
@@ -963,6 +982,7 @@ CONFIG_ASH_GETOPTS=y
CONFIG_ASH_BUILTIN_ECHO=y
CONFIG_ASH_BUILTIN_PRINTF=y
CONFIG_ASH_BUILTIN_TEST=y
+CONFIG_ASH_HELP=y
CONFIG_ASH_CMDCMD=y
# CONFIG_ASH_MAIL is not set
# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set
diff --git a/tools/satellites/extrafiles/ca-certificates/make-ca.sh b/graveyard/first_attempt/tools/satellites/extrafiles/ca-certificates/make-ca.sh
old mode 100755
new mode 100644
similarity index 79%
rename from tools/satellites/extrafiles/ca-certificates/make-ca.sh
rename to graveyard/first_attempt/tools/satellites/extrafiles/ca-certificates/make-ca.sh
index 0f1e207..d7fe1d4
--- a/tools/satellites/extrafiles/ca-certificates/make-ca.sh
+++ b/graveyard/first_attempt/tools/satellites/extrafiles/ca-certificates/make-ca.sh
@@ -10,26 +10,16 @@
#
# Version 20120211
-if [ "$1" ]; then
- certdata="$1"
-else
- certdata="./certdata.txt"
-fi
-
-if [ "$2" ]; then
- certdir="$2"
-else
- certdir="./certs"
-fi
+certdata="certdata.txt"
if [ ! -r $certdata ]; then
- echo "Can't find certdata" 1>&2
+ echo "$certdata must be in the local directory"
exit 1
fi
TEMPDIR=$(mktemp -d)
-TRUSTATTRIBUTES="CKA_TRUST_SERVER_AUTH"
-CONVERTSCRIPT="./make-cert.pl"
+BUNDLE="ca-certificates.crt"
+CONVERTSCRIPT="make-cert.pl"
mkdir "${TEMPDIR}/certs"
@@ -53,8 +43,8 @@ done
unset CERTBEGINLIST CERTDATA CERTENDLIST certbegin certend
-mkdir -p "$certdir"
-rm -f "$certdir/*" # Make sure the directory is clean
+mkdir -p certs
+rm -f certs/* # Make sure the directory is clean
for tempfile in ${TEMPDIR}/certs/*.tmp; do
# Make sure that the cert is trusted...
@@ -77,19 +67,18 @@ for tempfile in ${TEMPDIR}/certs/*.tmp; do
cp "${tempfile}" tempfile.cer
perl ${CONVERTSCRIPT} > tempfile.crt
keyhash=$(openssl x509 -noout -in tempfile.crt -hash)
- mv tempfile.crt "$certdir/${keyhash}.pem"
+ mv tempfile.crt "certs/${keyhash}.pem"
rm -f tempfile.cer "${tempfile}"
echo "Created ${keyhash}.pem"
done
# Remove blacklisted files
# MD5 Collision Proof of Concept CA
-if test -f "$certdir/8f111d69.pem"; then
+if test -f certs/8f111d69.pem; then
echo "Certificate 8f111d69 is not trusted! Removing..."
- rm -f "$certdir/8f111d69.pem"
+ rm -f certs/8f111d69.pem
fi
# Finally, generate the bundle and clean up.
-cat "$certdir"/*.pem > "$certdir/ca-certificates.crt"
-echo "Created ca-certificates.crt"
+cat certs/*.pem > ${BUNDLE}
rm -r "${TEMPDIR}"
diff --git a/tools/satellites/extrafiles/ca-certificates/make-cert.pl b/graveyard/first_attempt/tools/satellites/extrafiles/ca-certificates/make-cert.pl
old mode 100755
new mode 100644
similarity index 100%
rename from tools/satellites/extrafiles/ca-certificates/make-cert.pl
rename to graveyard/first_attempt/tools/satellites/extrafiles/ca-certificates/make-cert.pl
diff --git a/graveyard/first_attempt/tools/satellites/extrafiles/ca-certificates/remove-expired-certs.sh b/graveyard/first_attempt/tools/satellites/extrafiles/ca-certificates/remove-expired-certs.sh
new file mode 100644
index 0000000..0882a26
--- /dev/null
+++ b/graveyard/first_attempt/tools/satellites/extrafiles/ca-certificates/remove-expired-certs.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+# Begin /usr/sbin/remove-expired-certs.sh
+#
+# Version 20120211
+
+# Make sure the date is parsed correctly on all systems
+mydate()
+{
+ local y=$( echo $1 | cut -d" " -f4 )
+ local M=$( echo $1 | cut -d" " -f1 )
+ local d=$( echo $1 | cut -d" " -f2 )
+ local m
+
+ if [ ${d} -lt 10 ]; then d="0${d}"; fi
+
+ case $M in
+ Jan) m="01";;
+ Feb) m="02";;
+ Mar) m="03";;
+ Apr) m="04";;
+ May) m="05";;
+ Jun) m="06";;
+ Jul) m="07";;
+ Aug) m="08";;
+ Sep) m="09";;
+ Oct) m="10";;
+ Nov) m="11";;
+ Dec) m="12";;
+ esac
+
+ certdate="${y}${m}${d}"
+}
+
+OPENSSL=/usr/bin/openssl
+DIR=/etc/ssl/certs
+
+if [ $# -gt 0 ]; then
+ DIR="$1"
+fi
+
+certs=$( find ${DIR} -type f -name "*.pem" -o -name "*.crt" )
+today=$( date +%Y%m%d )
+
+for cert in $certs; do
+ notafter=$( $OPENSSL x509 -enddate -in "${cert}" -noout )
+ date=$( echo ${notafter} | sed 's/^notAfter=//' )
+ mydate "$date"
+
+ if [ ${certdate} -lt ${today} ]; then
+ echo "${cert} expired on ${certdate}! Removing..."
+ rm -f "${cert}"
+ fi
+done
diff --git a/graveyard/first_attempt/tools/satellites/extrafiles/stow/etc-stowrc.patch b/graveyard/first_attempt/tools/satellites/extrafiles/stow/etc-stowrc.patch
new file mode 100644
index 0000000..51f999b
--- /dev/null
+++ b/graveyard/first_attempt/tools/satellites/extrafiles/stow/etc-stowrc.patch
@@ -0,0 +1,21 @@
+diff -ur stow-2.2.0-orig/bin/stow.in stow-2.2.0/bin/stow.in
+--- stow-2.2.0-orig/bin/stow.in 2015-08-20 18:05:18.543173733 +0200
++++ stow-2.2.0/bin/stow.in 2015-08-20 18:05:58.844669895 +0200
+@@ -577,15 +577,14 @@
+ # Parameters: none
+ # Returns : a list of default options
+ # Throws : no exceptions
+-# Comments : prepends the contents of '~/.stowrc' and '.stowrc' to the command
++# Comments : prepends the contents of '/etc/stowrc', '~/.stowrc' and '.stowrc' to the command
+ # : line so they get parsed just like normal arguments. (This was
+ # : hacked in so that Emil and I could set different preferences).
+ #=============================================================================
+ sub get_config_file_options {
+ my @defaults = ();
+- for my $file ("$ENV{HOME}/.stowrc", '.stowrc') {
++ for my $file ('/etc/stowrc', "$ENV{HOME}/.stowrc", '.stowrc') {
+ if (-r $file) {
+- warn "Loading defaults from $file\n";
+ open my $FILE, '<', $file
+ or die "Could not open $file for reading\n";
+ while (my $line = <$FILE>){
diff --git a/tools/satellites/extrafiles/stow/fix-warning-message-perl5.20.patch b/graveyard/first_attempt/tools/satellites/extrafiles/stow/fix-warning-message-perl5.20.patch
similarity index 100%
rename from tools/satellites/extrafiles/stow/fix-warning-message-perl5.20.patch
rename to graveyard/first_attempt/tools/satellites/extrafiles/stow/fix-warning-message-perl5.20.patch
diff --git a/tools/satellites/gawk.sat b/graveyard/first_attempt/tools/satellites/gawk.sat
similarity index 52%
rename from tools/satellites/gawk.sat
rename to graveyard/first_attempt/tools/satellites/gawk.sat
index d4f8238..3782b12 100644
--- a/tools/satellites/gawk.sat
+++ b/graveyard/first_attempt/tools/satellites/gawk.sat
@@ -1,8 +1,9 @@
name=gawk
-version=4.1.1
+version=4.1.3
-dlextract "http://ftp.gnu.org/gnu/gawk/gawk-4.1.1.tar.xz" \
- "a2a26543ce410eb74bc4a508349ed09a"
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.xz" \
+ "97f8f44149ea9b9e94be97f68988be87"
+header_end
cd "$name-$version"
diff --git a/tools/satellites/gcc-1.sat b/graveyard/first_attempt/tools/satellites/gcc-1.sat
similarity index 63%
rename from tools/satellites/gcc-1.sat
rename to graveyard/first_attempt/tools/satellites/gcc-1.sat
index 24e775b..87b6f64 100644
--- a/tools/satellites/gcc-1.sat
+++ b/graveyard/first_attempt/tools/satellites/gcc-1.sat
@@ -1,25 +1,26 @@
name=gcc
-version=4.9.2
-gmp_version=6.0.0
-gmp_minver=a
-mpfr_version=3.1.2
-mpc_version=1.0.2
+version=5.2.0
+gmp_shortver=6.0.0
+gmp_version=${gmp_shortver}a
+mpfr_version=3.1.3
+mpc_version=1.0.3
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version/$name-$version.tar.bz2" \
- "4df8ee253b7f3863ad0b86359cd39c43"
-download "http://ftp.gnu.org/gnu/gmp/gmp-$gmp_version$gmp_minver.tar.xz" \
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version/$name-$version.tar.bz2" \
+ "a51bcfeb3da7dd4c623e27207ed43467"
+download "https://ftp.gnu.org/gnu/gmp/gmp-$gmp_version.tar.xz" \
"1e6da4e434553d2811437aa42c7f7c76"
-download "http://ftp.gnu.org/gnu/mpfr/mpfr-$mpfr_version.tar.xz" \
- "e3d203d188b8fe60bb6578dd3152e05c"
-download "http://ftp.gnu.org/gnu/mpc/mpc-$mpc_version.tar.gz" \
- "68fadff3358fb3e7976c7a398a0af4c3"
+download "https://ftp.gnu.org/gnu/mpfr/mpfr-$mpfr_version.tar.xz" \
+ "6969398cd2fbc56a6af570b5273c56a9"
+download "https://ftp.gnu.org/gnu/mpc/mpc-$mpc_version.tar.gz" \
+ "d6a1d5f8ddea3abd2cc3e98f58352d26"
+header_end
cd "$name-$version"
-extract "gmp-$gmp_version$gmp_minver.tar.xz"
+extract "gmp-$gmp_version.tar.xz"
extract "mpfr-$mpfr_version.tar.xz"
extract "mpc-$mpc_version.tar.gz"
-mv "gmp-$gmp_version" gmp
+mv "gmp-$gmp_shortver" gmp
mv "mpfr-$mpfr_version" mpfr
mv "mpc-$mpc_version" mpc
@@ -37,13 +38,12 @@ do
touch $file.orig
done
-sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure
-
mkdir "../$name-build"; cd "../$name-build"
"../$name-$version/configure" \
--target="$target" \
--prefix=/tools \
+ --with-glibc-version=2.11 \
--with-sysroot="$dir_install" \
--with-newlib \
--without-headers \
@@ -56,13 +56,10 @@ mkdir "../$name-build"; cd "../$name-build"
--disable-threads \
--disable-libatomic \
--disable-libgomp \
- --disable-libitm \
--disable-libquadmath \
- --disable-libsanitizer \
--disable-libssp \
--disable-libvtv \
- --disable-libcilkrts \
- --disable-libstdc++-v3 \
+ --disable-libstdcxx \
--enable-languages=c,c++
make; make DESTDIR="$dir_install" install
diff --git a/tools/satellites/gcc-2.sat b/graveyard/first_attempt/tools/satellites/gcc-2.sat
similarity index 62%
rename from tools/satellites/gcc-2.sat
rename to graveyard/first_attempt/tools/satellites/gcc-2.sat
index b89f60e..9c44ee5 100644
--- a/tools/satellites/gcc-2.sat
+++ b/graveyard/first_attempt/tools/satellites/gcc-2.sat
@@ -1,28 +1,32 @@
name=gcc
-version=4.9.2
-gmp_version=6.0.0
-gmp_minver=a
-mpfr_version=3.1.2
-mpc_version=1.0.2
-
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version/$name-$version.tar.bz2" \
- "4df8ee253b7f3863ad0b86359cd39c43"
-download "http://ftp.gnu.org/gnu/gmp/gmp-$gmp_version$gmp_minver.tar.xz" \
+version=5.2.0
+gmp_shortver=6.0.0
+gmp_version=${gmp_shortver}a
+mpfr_version=3.1.3
+mpc_version=1.0.3
+
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version/$name-$version.tar.bz2" \
+ "a51bcfeb3da7dd4c623e27207ed43467"
+download "https://ftp.gnu.org/gnu/gmp/gmp-$gmp_version.tar.xz" \
"1e6da4e434553d2811437aa42c7f7c76"
-download "http://ftp.gnu.org/gnu/mpfr/mpfr-$mpfr_version.tar.xz" \
- "e3d203d188b8fe60bb6578dd3152e05c"
-download "http://ftp.gnu.org/gnu/mpc/mpc-$mpc_version.tar.gz" \
- "68fadff3358fb3e7976c7a398a0af4c3"
+download "https://ftp.gnu.org/gnu/mpfr/mpfr-$mpfr_version.tar.xz" \
+ "6969398cd2fbc56a6af570b5273c56a9"
+download "https://ftp.gnu.org/gnu/mpc/mpc-$mpc_version.tar.gz" \
+ "d6a1d5f8ddea3abd2cc3e98f58352d26"
+header_end
cd "$name-$version"
-extract "gmp-$gmp_version$gmp_minver.tar.xz"
+extract "gmp-$gmp_version.tar.xz"
extract "mpfr-$mpfr_version.tar.xz"
extract "mpc-$mpc_version.tar.gz"
-mv "gmp-$gmp_version" gmp
+mv "gmp-$gmp_shortver" gmp
mv "mpfr-$mpfr_version" mpfr
mv "mpc-$mpc_version" mpc
+cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
+ "$(dirname "$($target-gcc -print-libgcc-file-name)")/include-fixed/limits.h"
+
for file in \
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
@@ -37,11 +41,6 @@ do
touch $file.orig
done
-sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure
-
-cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
- "`dirname "$($target-gcc -print-libgcc-file-name)"`/include-fixed/limits.h"
-
mkdir "../$name-build"; cd "../$name-build"
CC="$target-gcc" \
diff --git a/tools/satellites/glibc.sat b/graveyard/first_attempt/tools/satellites/glibc.sat
similarity index 64%
rename from tools/satellites/glibc.sat
rename to graveyard/first_attempt/tools/satellites/glibc.sat
index 32efdff..9f67e7c 100644
--- a/tools/satellites/glibc.sat
+++ b/graveyard/first_attempt/tools/satellites/glibc.sat
@@ -1,17 +1,19 @@
name=glibc
-version=2.21
+version=2.22
-dlextract "http://ftp.gnu.org/gnu/libc/glibc-2.20.tar.xz" \
- "948a6e06419a01bd51e97206861595b0"
+dlextract "https://ftp.gnu.org/gnu/libc/$name-$version.tar.xz" \
+ "e51e02bf552a0a1fbbdc948fb2f5e83c"
+header_end
mkdir "$name-build"; cd "$name-build"
"../$name-$version/configure" \
--prefix=/tools \
--host="$target" \
- --build="$(../glibc-2.20/scripts/config.guess)" \
+ --build="$(../$name-$version/scripts/config.guess)" \
--disable-profile \
--enable-kernel=2.6.32 \
+ --enable-obsolete-rpc \
--with-headers=/tools/include \
libc_cv_forced_unwind=yes \
libc_cv_ctors_header=yes \
diff --git a/tools/satellites/libstdc.sat b/graveyard/first_attempt/tools/satellites/libstdcxx.sat
similarity index 71%
rename from tools/satellites/libstdc.sat
rename to graveyard/first_attempt/tools/satellites/libstdcxx.sat
index bd455de..dbb4528 100644
--- a/tools/satellites/libstdc.sat
+++ b/graveyard/first_attempt/tools/satellites/libstdcxx.sat
@@ -1,8 +1,9 @@
name=gcc
-version=4.9.2
+version=5.2.0
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version/$name-$version.tar.bz2" \
- "4df8ee253b7f3863ad0b86359cd39c43"
+dlextract "https://ftp.gnu.org/gnu/gcc/$name-$version/$name-$version.tar.bz2" \
+ "a51bcfeb3da7dd4c623e27207ed43467"
+header_end
mkdir "$name-build"; cd "$name-build"
@@ -10,7 +11,6 @@ mkdir "$name-build"; cd "$name-build"
--host="$target" \
--prefix=/tools \
--disable-multilib \
- --disable-shared \
--disable-nls \
--disable-libstdcxx-threads \
--disable-libstdcxx-pch \
diff --git a/graveyard/first_attempt/tools/satellites/linux-api.sat b/graveyard/first_attempt/tools/satellites/linux-api.sat
new file mode 100644
index 0000000..d54e101
--- /dev/null
+++ b/graveyard/first_attempt/tools/satellites/linux-api.sat
@@ -0,0 +1,13 @@
+name=linux
+version=4.1.6
+
+dlextract "https://www.kernel.org/pub/$name/kernel/v4.x/$name-$version.tar.xz" \
+ "1dae0c808e34164cab3dfd57be88bd53"
+header_end
+
+cd "$name-$version"
+
+make mrproper
+make INSTALL_HDR_PATH="$dir_install/tools" headers_install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/tools/satellites/m4.sat b/graveyard/first_attempt/tools/satellites/m4.sat
similarity index 73%
rename from tools/satellites/m4.sat
rename to graveyard/first_attempt/tools/satellites/m4.sat
index 1378fc4..1b7c928 100644
--- a/tools/satellites/m4.sat
+++ b/graveyard/first_attempt/tools/satellites/m4.sat
@@ -1,8 +1,9 @@
name=m4
version=1.4.17
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version.tar.xz" \
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.xz" \
"12a3c829301a4fd6586a57d3fcf196dc"
+header_end
cd "$name-$version"
diff --git a/tools/satellites/make.sat b/graveyard/first_attempt/tools/satellites/make.sat
similarity index 74%
rename from tools/satellites/make.sat
rename to graveyard/first_attempt/tools/satellites/make.sat
index 0088ea6..40dc9c1 100644
--- a/tools/satellites/make.sat
+++ b/graveyard/first_attempt/tools/satellites/make.sat
@@ -1,8 +1,9 @@
name=make
version=4.1
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
"57a7a224a822f94789a587ccbcedff69"
+header_end
cd "$name-$version"
diff --git a/tools/satellites/openssl.sat b/graveyard/first_attempt/tools/satellites/openssl.sat
similarity index 51%
rename from tools/satellites/openssl.sat
rename to graveyard/first_attempt/tools/satellites/openssl.sat
index 74be61e..dc7bb9b 100644
--- a/tools/satellites/openssl.sat
+++ b/graveyard/first_attempt/tools/satellites/openssl.sat
@@ -1,13 +1,13 @@
name=openssl
-version=1.0.2
+version=1.0.2d
dlextract "https://www.openssl.org/source/$name-$version.tar.gz" \
- "f7175c9cd3c39bb1907ac8bba9df8ed3"
+ "38dd619b2e77cbac69b99f52a053d25a"
+header_end
cd "$name-$version"
./config --prefix=/tools shared
-# This makefile fails when building in parallel
-make -j1 all; make -j1 INSTALL_PREFIX="$dir_install" install_sw
+make all; make INSTALL_PREFIX="$dir_install" install_sw
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/tools/satellites/perl.sat b/graveyard/first_attempt/tools/satellites/perl.sat
similarity index 81%
rename from tools/satellites/perl.sat
rename to graveyard/first_attempt/tools/satellites/perl.sat
index 786597c..59590c1 100644
--- a/tools/satellites/perl.sat
+++ b/graveyard/first_attempt/tools/satellites/perl.sat
@@ -1,8 +1,9 @@
name=perl
-version=5.20.1
+version=5.22.0
dlextract "http://www.cpan.org/src/5.0/$name-$version.tar.gz" \
- "7a195abb7d6769f751e90c7d30dcf2e0"
+ "e32cb6a8dda0084f2a43dac76318d68d"
+header_end
cd "$name-$version"
diff --git a/tools/satellites/stow.sat b/graveyard/first_attempt/tools/satellites/stow.sat
similarity index 71%
rename from tools/satellites/stow.sat
rename to graveyard/first_attempt/tools/satellites/stow.sat
index e2c7f94..6bbc310 100644
--- a/tools/satellites/stow.sat
+++ b/graveyard/first_attempt/tools/satellites/stow.sat
@@ -1,13 +1,16 @@
name=stow
version=2.2.0
-dlextract "http://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
+dlextract "https://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
"5bb56592eff9aaf9dfb6c975b3004240"
extrafile "fix-warning-message-perl5.20.patch"
+extrafile "etc-stowrc.patch"
+header_end
cd "$name-$version"
patch -p1 -i "../fix-warning-message-perl5.20.patch"
+patch -p1 -i "../etc-stowrc.patch"
./configure --prefix=/tools
make DESTDIR="$dir_install" install-exec-am install-pmDATA install-dist_pmstowDATA
diff --git a/tools/satellites/tcl.sat b/graveyard/first_attempt/tools/satellites/tcl-core.sat
similarity index 60%
rename from tools/satellites/tcl.sat
rename to graveyard/first_attempt/tools/satellites/tcl-core.sat
index 048547f..f4491d1 100644
--- a/tools/satellites/tcl.sat
+++ b/graveyard/first_attempt/tools/satellites/tcl-core.sat
@@ -1,9 +1,11 @@
name=tcl
+fullname=$name-core
majver=8.6
-version=$majver.3
+version=$majver.4
-dlextract "http://prdownloads.sourceforge.net/$name/$name$version-src.tar.gz" \
- "db382feca91754b7f93da16dc4cdad1f"
+dlextract "https://sourceforge.net/projects/tcl/files/Tcl/$version/$fullname$version-src.tar.gz" \
+ "8b8c9d85469d8dbe32e51117b8ef11e3"
+header_end
cd "$name$version/unix"
diff --git a/tools/version-check.sh b/graveyard/first_attempt/tools/version-check.sh
old mode 100644
new mode 100755
similarity index 66%
rename from tools/version-check.sh
rename to graveyard/first_attempt/tools/version-check.sh
index 12251e3..40673a4
--- a/tools/version-check.sh
+++ b/graveyard/first_attempt/tools/version-check.sh
@@ -1,24 +1,34 @@
#!/bin/bash
# Simple script to list version numbers of critical development tools
-# Copied from LFS 7.6
+# Copied from LFS 7.7
export LC_ALL=C
-bash --version | head -n1 | cut -d" " -f2-4 #TODO: check if it's necessary for building the temporary tools.
+bash --version | head -n1 | cut -d" " -f2-4
echo "/bin/sh -> `readlink -f /bin/sh`"
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
bison --version | head -n1
-if [ -e /usr/bin/yacc ];
- then echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
- else echo "yacc not found"; fi
+
+if [ -h /usr/bin/yacc ]; then
+ echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
+elif [ -x /usr/bin/yacc ]; then
+ echo yacc is `/usr/bin/yacc --version | head -n1`
+else
+ echo "yacc not found"
+fi
bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6-
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
diff --version | head -n1
find --version | head -n1
gawk --version | head -n1
-if [ -e /usr/bin/awk ];
- then echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`";
- else echo "awk not found"; fi
+
+if [ -h /usr/bin/awk ]; then
+ echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`";
+elif [ -x /usr/bin/awk ]; then
+ echo yacc is `/usr/bin/awk --version | head -n1`
+else
+ echo "awk not found"
+fi
gcc --version | head -n1
g++ --version | head -n1
@@ -32,6 +42,7 @@ patch --version | head -n1
echo Perl `perl -V:version`
sed --version | head -n1
tar --version | head -n1
+makeinfo --version | head -n1
xz --version | head -n1
curl --version | head -n1
@@ -40,4 +51,3 @@ if [ -x dummy ]
then echo "g++ compilation OK";
else echo "g++ compilation failed"; fi
rm -f dummy.c dummy
-
diff --git a/graveyard/internaut b/graveyard/internaut
new file mode 100755
index 0000000..62a7a9b
--- /dev/null
+++ b/graveyard/internaut
@@ -0,0 +1,106 @@
+#!/bin/sh -e
+
+# This is a very hacky script to generate satellites.
+# A honestly shitty attempt to auto-generate satellites.
+
+astronaut="$(dirname "$0")/astronaut"
+[ ! -f "$astronaut" ] && astronaut="astronaut"
+
+# TODO: These variables won't always be valid
+dir_build="$PWD/build"
+dir_source="$PWD/source"
+dir_install="$PWD/install"
+
+tempdir="/tmp/internaut"
+rm -rf "$tempdir"
+mkdir -p "$tempdir"
+
+intshell() {
+ # This is the most hacky part in the script, so bear with me.
+ # Why this is even a thing, is because I need two things:
+ # - Run some commands on start
+ # - Capture all input
+ # I'm sure "tee ouput | bash --rcfile filewithcommands" would effectively do the same thing, but fuck bash.
+
+ echo "Entering shell..."
+
+ cmdfifo="$tempdir/cmdfifo"
+ waitfifo="$tempdir/waitfifo"
+ mkfifo "$cmdfifo" 2> /dev/null || true
+ mkfifo "$waitfifo" 2> /dev/null || true
+
+ sh -s < "$cmdfifo" "$pkgfile" &
+ shpid=$!
+
+ echo ". \"$astronaut\"; set +e; echo \$PWD > \"$waitfifo\"; cat \"$waitfifo\"" > "$cmdfifo"
+ while ps -p $shpid > /dev/null; do
+ printf "$(cat "$waitfifo")> "
+ read cmd
+
+ case "$cmd" in
+ exit) ;;
+ !*) cmd="$(echo "$cmd" | cut -c 2-)" ;;
+ *) echo "$cmd" >> "$pkgfile" ;;
+ esac
+
+ echo "$cmd" > "$cmdfifo"
+
+ echo "echo \$PWD > \"$waitfifo\"; cat \"$waitfifo\"" > "$cmdfifo"
+ printf '' > "$waitfifo"
+ done
+
+ rm -f "$waitfifo" "$cmdfifo"
+ echo 'End shell.'
+}
+
+# The rest of this script is your olde gather info stuff.
+
+printf 'Package name: '
+read pkgname
+pkgfile="$PWD/$pkgname.sat"
+
+echo "# Generated with internaut. Please revise and edit." > "$pkgfile"
+echo >> "$pkgfile"
+
+printf 'Software name [enter for same as package]: '
+read name
+if [ "$name" ]; then
+ echo "name=$name" >> "$pkgfile"
+else
+ echo "name=$pkgname" >> "$pkgfile"
+fi
+
+printf 'Version: '
+read version
+echo "version=$version" >> "$pkgfile"
+
+printf 'Update URL: '
+read update_url
+echo "update_url=\"$update_url\"" >> "$pkgfile"
+
+echo >> "$pkgfile"
+
+# Now we ask the user to fetch the files they need.
+echo '=> Header'
+intshell
+
+# Generate the md5sums, append them to the satellite, for manual inspection.
+for file in $(find "$dir_source" -type f); do
+ printf '# ' >> "$pkgfile"
+ md5sum "$file" >> "$pkgfile"
+done
+
+printf 'header_end\n\n' >> "$pkgfile"
+
+# Now we ask the user to build and install the program in question.
+echo '=> Build'
+intshell
+
+# Replacing all the instances of the name and the version with the variable.
+#sed -i -e "s/$name/\$name/g" -e "s/$version/\$version/g" -e "s/name=\$name/name=$name/g" -e "s/version=\$version/version=$version/g" "$pkgfile"
+# TODO: Why dun dis shit work?
+
+# The usual vim config line.
+printf '\n# vim:set tabstop=4 shiftwidth=4 syntax=sh et:\n' >> "$pkgfile"
+
+rm -rf "$tempdir"
diff --git a/graveyard/internaut.cause_of_death b/graveyard/internaut.cause_of_death
new file mode 100644
index 0000000..2e4623f
--- /dev/null
+++ b/graveyard/internaut.cause_of_death
@@ -0,0 +1,6 @@
+Internaut died on 14 november 2015.
+It's latest known update was 31 october of the same year.
+Birth date is unknown.
+
+Cause of death:
+I initially wanted something that could generate satellites easily, and after hacking together internaut, I may have used it one or two times, but that was it. I haven't touched it in a few months and it's latest update has been to change the way the astronaut program is found. It just isn't practical, and the implementation is awful. After deciding I wanted to make some changes to the way satellites work, I've come to realize that maintaining it is more work than it's worth.
diff --git a/satellites/astronaut.sat b/satellites/astronaut.sat
new file mode 100644
index 0000000..e8f573b
--- /dev/null
+++ b/satellites/astronaut.sat
@@ -0,0 +1,13 @@
+name=astronaut
+version=$(date +%Y%m%d)
+
+extrafile "astronaut"
+extrafile "freshnaut"
+extrafile "xbps-astronaut"
+header_end
+
+install -D "astronaut" "$dir_install/$prefix/bin/astronaut"
+install -D "freshnaut" "$dir_install/$prefix/bin/freshnaut"
+install -D "xbps-astronaut" "$dir_install/$prefix/bin/xbps-astronaut"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/bin/ctrulib.sat b/satellites/bin/ctrulib.sat
new file mode 100644
index 0000000..da7bf94
--- /dev/null
+++ b/satellites/bin/ctrulib.sat
@@ -0,0 +1,13 @@
+name=ctrulib
+libname=libctru
+version=0.6.0
+update_url="https://sourceforge.net/projects/devkitpro/files/$libname/"
+
+download "https://sourceforge.net/projects/devkitpro/files/$libname/$version/$libname-$version.tar.bz2" \
+ "2dffb7826ae3d30a32c9ad773b133a07"
+header_end
+
+mkdir -p "$dir_install/opt/devkitPRO/$libname"
+extract "$libname-$version.tar.bz2" "$dir_install/opt/devkitPRO/$libname"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/bin/devkitarm.sat b/satellites/bin/devkitarm.sat
new file mode 100644
index 0000000..f107080
--- /dev/null
+++ b/satellites/bin/devkitarm.sat
@@ -0,0 +1,14 @@
+name=devkitARM
+version=r44
+update_url="https://sourceforge.net/projects/devkitpro/files/$name/"
+
+download "https://sourceforge.net/projects/devkitpro/files/$name/${name}_$version/${name}_$version-x86_64-linux.tar.bz2" \
+ "1609d74be8e167c32d9a6194c704ae36"
+extrafile "devkitarm.sh"
+header_end
+
+mkdir -p "$dir_install/opt/devkitPRO"
+extract "${name}_$version-x86_64-linux.tar.bz2" "$dir_install/opt/devkitPRO"
+install -Dm644 devkitarm.sh "$dir_install/etc/profile.d/devkitarm.sh"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/bin/extrafiles/devkitarm/devkitarm.sh b/satellites/bin/extrafiles/devkitarm/devkitarm.sh
new file mode 100644
index 0000000..ee53818
--- /dev/null
+++ b/satellites/bin/extrafiles/devkitarm/devkitarm.sh
@@ -0,0 +1,3 @@
+export DEVKITPRO=/opt/devkitPRO
+export DEVKITARM="$DEVKITPRO/devkitARM"
+export PATH="$DEVKITARM/bin:$PATH"
diff --git a/satellites/bin/extrafiles/palemoon/palemoon.desktop b/satellites/bin/extrafiles/palemoon/palemoon.desktop
new file mode 100644
index 0000000..2538f46
--- /dev/null
+++ b/satellites/bin/extrafiles/palemoon/palemoon.desktop
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Version=1.0
+Name=Pale Moon Web Browser
+Comment=Browse the World Wide Web
+Keywords=Internet;WWW;Browser;Web;Explorer
+Exec=palemoon %u
+Terminal=false
+X-MultipleArgs=false
+Type=Application
+Icon=palemoon
+Categories=Network;WebBrowser;Internet
+MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
+StartupNotify=true
diff --git a/satellites/bin/palemoon.sat b/satellites/bin/palemoon.sat
new file mode 100644
index 0000000..6185b10
--- /dev/null
+++ b/satellites/bin/palemoon.sat
@@ -0,0 +1,24 @@
+name=palemoon
+version=25.7.3
+update_url="https://linux.palemoon.org/download/mainline/"
+
+download "https://linux.palemoon.org/files/$version/$name-$version.en-US.linux-x86_64.tar.bz2" \
+ "a0b11f6c3a78592fa27904dce9f7942c"
+extrafile "palemoon.desktop"
+header_end
+
+mkdir -p "$dir_install/opt" "$dir_install/$prefix/bin" "$dir_install/$prefix/share/applications" \
+ "$dir_install/$prefix/share/icons/hicolor/16x16/apps" \
+ "$dir_install/$prefix/share/icons/hicolor/32x32/apps" \
+ "$dir_install/$prefix/share/icons/hicolor/48x48/apps" \
+ "$dir_install/$prefix/share/icons/hicolor/128x128/apps" \
+
+extract "$name-$version.en-US.linux-x86_64.tar.bz2" "$dir_install/opt"
+ln -s "/opt/$name/$name" "$dir_install/$prefix/bin/$name"
+ln -s "/opt/$name/browser/chrome/icons/default/default16.png" "$dir_install/$prefix/share/icons/hicolor/16x16/apps/$name.png"
+ln -s "/opt/$name/browser/chrome/icons/default/default32.png" "$dir_install/$prefix/share/icons/hicolor/32x32/apps/$name.png"
+ln -s "/opt/$name/browser/chrome/icons/default/default48.png" "$dir_install/$prefix/share/icons/hicolor/48x48/apps/$name.png"
+ln -s "/opt/$name/browser/icons/mozicon128.png" "$dir_install/$prefix/share/icons/hicolor/128x128/apps/$name.png"
+cp "palemoon.desktop" "$dir_install/$prefix/share/applications/palemoon.desktop"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/bin/unetbootin.sat b/satellites/bin/unetbootin.sat
new file mode 100644
index 0000000..361cdd9
--- /dev/null
+++ b/satellites/bin/unetbootin.sat
@@ -0,0 +1,11 @@
+name=unetbootin
+version=613
+update_url="https://unetbootin.github.io/linux_download.html"
+
+dlfile "https://launchpad.net/$name/trunk/$version/+download/$name-linux64-$version.bin" \
+ "d5d1cddc144fc64d8291c33ebd4f457b"
+header_end
+
+install -D $name-linux64-$version.bin "$dir_install/$prefix/bin/$name"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/extrafiles/astronaut b/satellites/extrafiles/astronaut
new file mode 120000
index 0000000..aa984df
--- /dev/null
+++ b/satellites/extrafiles/astronaut
@@ -0,0 +1 @@
+../../../astronaut
\ No newline at end of file
diff --git a/satellites/functions/compile/cmake.sh b/satellites/functions/compile/cmake.sh
new file mode 100644
index 0000000..1df64f7
--- /dev/null
+++ b/satellites/functions/compile/cmake.sh
@@ -0,0 +1,16 @@
+compile_cmake_base() {
+ mkdir -p build; cd build
+ cmake -DCMAKE_INSTALL_PREFIX="$prefix" -DCMAKE_BUILD_TYPE=Release $@ ..
+ make
+}
+
+compile_cmake() {
+ compile_cmake_base $@
+ make DESTDIR="$dir_install" install
+}
+
+compile_cmake_installbin() {
+ _func_file="$1"; shift
+ compile_cmake_base $@
+ install -D "$_func_file" "$dir_install/$prefix/bin/$_file"
+}
diff --git a/satellites/functions/compile/python.sh b/satellites/functions/compile/python.sh
new file mode 100644
index 0000000..a3dc741
--- /dev/null
+++ b/satellites/functions/compile/python.sh
@@ -0,0 +1,4 @@
+compile_python() {
+ _func_ver="$1"; shift
+ python$_func_ver setup.py install --prefix="$prefix" --root="$dir_install" $@
+}
diff --git a/satellites/functions/compile/qt.sh b/satellites/functions/compile/qt.sh
new file mode 100644
index 0000000..dd500fa
--- /dev/null
+++ b/satellites/functions/compile/qt.sh
@@ -0,0 +1,6 @@
+compile_qt() {
+ _func_ver="$1"; shift
+ qmake-qt$_func_ver PREFIX="$prefix" build_mode=release build_type=shared $@
+ make
+ make INSTALL_ROOT="$dir_install" install
+}
diff --git a/satellites/functions/download/git.sh b/satellites/functions/download/git.sh
new file mode 100644
index 0000000..18022ab
--- /dev/null
+++ b/satellites/functions/download/git.sh
@@ -0,0 +1,10 @@
+download_git() {
+ if [ ! -d "$dir_source/$name/$2" ]; then
+ rm -rf "$dir_source/$name/$2"
+ git clone --recursive --depth=1 -b "$2" "$1" "$dir_source/$name/$2"
+ else
+ cd "$dir_source/$name/$2"
+ git checkout "tags/$2"
+ cd "$OLDPWD"
+ fi
+}
diff --git a/satellites/functions/vcs/git.sh b/satellites/functions/vcs/git.sh
new file mode 100644
index 0000000..da1f075
--- /dev/null
+++ b/satellites/functions/vcs/git.sh
@@ -0,0 +1,21 @@
+vcs_git() {
+ if [ ! -d "$dir_source/$name/vcs" ]; then
+ rm -rf "$dir_source/$name/vcs"
+ git clone --recursive --depth=1 "$1" "$dir_source/$name/vcs"
+ vcs_compile=true
+ fi
+}
+
+_hook_git() {
+ cd "$dir_source/$name/vcs"
+
+ git remote update
+ if [ "$(git rev-parse @)" != "$(git rev-parse @{u})" ]; then
+ git pull
+ vcs_compile=true
+ fi
+ version="$(git rev-list HEAD --count)-$(git rev-parse --short HEAD)"
+ cd "$OLDPWD"
+}
+
+_hooks="_hook_git"
diff --git a/satellites/markdown.sat b/satellites/markdown.sat
new file mode 100644
index 0000000..f80e396
--- /dev/null
+++ b/satellites/markdown.sat
@@ -0,0 +1,14 @@
+name=Markdown
+version=1.0.1
+update_url="https://daringfireball.net/projects/markdown/"
+
+download "https://daringfireball.net/projects/downloads/${name}_$version.zip" \
+ "f17b3c2b2830c6fd2fe0098226e59a2f"
+header_end
+
+# TODO: Support other formats, such as zip, with the extract command.
+extract "${name}_$version.zip" "" \
+ "unzip -qd {dst} {src}"
+install -D "${name}_$version/$name.pl" "$dir_install/$prefix/bin/markdown"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/python3.4-crc16.sat b/satellites/python3.4-crc16.sat
new file mode 100644
index 0000000..284bfc6
--- /dev/null
+++ b/satellites/python3.4-crc16.sat
@@ -0,0 +1,14 @@
+import "compile/python"
+
+name=pycrc16
+version=0.1.1
+update_url="https://api.github.com/repos/gennady/$name/tags"
+
+dlextract "https://github.com/gennady/$name/archive/v$version.tar.gz" \
+ "0e6432cea6cd71a151cfe7fba96b67c9"
+header_end
+
+cd "$name-$version"
+compile_python 3.4
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/python3.4-websocket-client.sat b/satellites/python3.4-websocket-client.sat
new file mode 100644
index 0000000..9ee2dc7
--- /dev/null
+++ b/satellites/python3.4-websocket-client.sat
@@ -0,0 +1,14 @@
+import "compile/python"
+
+name=websocket-client
+version=0.34.0
+update_url="https://api.github.com/repos/liris/$name/tags"
+
+dlextract "https://github.com/liris/$name/archive/v$version.tar.gz" \
+ "d7b222cb75877a5ddd5a0260f09af2e6"
+header_end
+
+cd "$name-$version"
+compile_python 3.4
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/qwbfsmanager.sat b/satellites/qwbfsmanager.sat
new file mode 100644
index 0000000..49a60e7
--- /dev/null
+++ b/satellites/qwbfsmanager.sat
@@ -0,0 +1,18 @@
+# This program includes libfresh, but since it's only needed by this, and has seen no versioned release, I'll just include it in this package.
+import "compile/qt"
+import "download/git"
+
+name=qwbfsmanager
+version=1.2.5
+update_url="https://api.github.com/repos/pasnox/$name/tags"
+
+# Downloading this way to get dependencies.
+download_git "https://github.com/pasnox/$name" "v$version"
+header_end
+
+getfile "v$version"; cd "v$version"
+sed -i -e "s/CONFIG \*= fresh//" qwbfs.pro qwbfs/qwbfs.pro # Make sure we always use the bundled library.
+
+compile_qt 5
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/speedtest-cli.sat b/satellites/speedtest-cli.sat
new file mode 100644
index 0000000..d626b5f
--- /dev/null
+++ b/satellites/speedtest-cli.sat
@@ -0,0 +1,14 @@
+import "compile/python"
+
+name=speedtest-cli
+version=0.3.4
+update_url="https://api.github.com/repos/sivel/$name/tags"
+
+dlextract "https://github.com/sivel/$name/archive/v$version.tar.gz" \
+ "45344501fab5e19492ae3ef1de4ed9ae"
+header_end
+
+cd "$name-$version"
+compile_python 3.4
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/vcs/armips.sat b/satellites/vcs/armips.sat
new file mode 100644
index 0000000..c244e97
--- /dev/null
+++ b/satellites/vcs/armips.sat
@@ -0,0 +1,12 @@
+import "vcs/git"
+import "compile/cmake"
+
+name=armips
+
+vcs_git "https://github.com/Kingcom/$name"
+header_end
+
+getfile "$name"; cd "$name"
+compile_cmake_installbin "$name"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/vcs/ctr.sat b/satellites/vcs/ctr.sat
new file mode 100644
index 0000000..60351a7
--- /dev/null
+++ b/satellites/vcs/ctr.sat
@@ -0,0 +1,13 @@
+import "vcs/git"
+
+name=ctr
+
+vcs_git "https://github.com/b1l1s/$name"
+header_end
+
+getfile "$name"; cd "$name"
+
+mkdir -p "$dir_install/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/opt/devkitPRO/devkitARM/arm-none-eabi/lib"
+make DEVKITARM="$dir_install/opt/devkitPRO/devkitARM" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/vcs/ctrff.sat b/satellites/vcs/ctrff.sat
new file mode 100644
index 0000000..9c5395d
--- /dev/null
+++ b/satellites/vcs/ctrff.sat
@@ -0,0 +1,13 @@
+import "vcs/git"
+
+name=ctrff
+
+vcs_git "https://github.com/b1l1s/$name"
+header_end
+
+getfile "$name"; cd "$name"
+
+mkdir -p "$dir_install/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/opt/devkitPRO/devkitARM/arm-none-eabi/lib"
+make DEVKITARM="$dir_install/opt/devkitPRO/devkitARM" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/vcs/ctrtool.sat b/satellites/vcs/ctrtool.sat
new file mode 100644
index 0000000..df9f0c4
--- /dev/null
+++ b/satellites/vcs/ctrtool.sat
@@ -0,0 +1,13 @@
+import "vcs/git"
+
+name=Project_CTR
+
+vcs_git "https://github.com/profi200/$name"
+header_end
+
+getfile "$name"; cd "$name/ctrtool"
+
+make
+install -D ctrtool "$dir_install/$prefix/bin/ctrtool"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/vcs/ctrulib-git.sat b/satellites/vcs/ctrulib-git.sat
new file mode 100644
index 0000000..0b1aa50
--- /dev/null
+++ b/satellites/vcs/ctrulib-git.sat
@@ -0,0 +1,12 @@
+import "vcs/git"
+
+name=ctrulib
+
+vcs_git "https://github.com/smealum/$name"
+header_end
+
+getfile "$name"; cd "$name/libctru"
+
+make DEVKITPRO="$dir_install/opt/devkitPRO" install
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/vcs/functions b/satellites/vcs/functions
new file mode 120000
index 0000000..c0b5bcc
--- /dev/null
+++ b/satellites/vcs/functions
@@ -0,0 +1 @@
+../functions
\ No newline at end of file
diff --git a/satellites/vcs/makerom.sat b/satellites/vcs/makerom.sat
new file mode 100644
index 0000000..4f923d5
--- /dev/null
+++ b/satellites/vcs/makerom.sat
@@ -0,0 +1,13 @@
+import "vcs/git"
+
+name=Project_CTR
+
+vcs_git "https://github.com/profi200/$name"
+header_end
+
+getfile "$name"; cd "$name/makerom"
+
+make
+install -D makerom "$dir_install/$prefix/bin/makerom"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/satellites/vcs/sockfile.sat b/satellites/vcs/sockfile.sat
new file mode 100644
index 0000000..e66fc9f
--- /dev/null
+++ b/satellites/vcs/sockfile.sat
@@ -0,0 +1,12 @@
+import "compile/cmake"
+import "vcs/git"
+
+name=sockfile
+
+vcs_git "https://github.com/mid-kid/$name"
+header_end
+
+getfile "$name"; cd "$name"
+compile_cmake_installbin "$name"
+
+# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/tools/prepchroot b/tools/prepchroot
deleted file mode 100755
index caf5241..0000000
--- a/tools/prepchroot
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-umask 022
-set -e
-
-if [ "$(id -u)" != "0" ]; then
- echo "Please run this script as root" 1>&2
- exit 1
-fi
-
-if [ ! "$rocket" ]; then
- echo 'Please set the $rocket variable' 1>&2
- exit 1
-fi
-
-echo "Changing ownership of $rocket to root"
-chown -R 0.0 "$rocket"
-
-echo "Creating device nodes"
-mkdir -p "$rocket/dev"
-if cut -d' ' -f2 /proc/mounts | grep "$rocket/dev" > /dev/null; then
- umount -R "$rocket/dev"
-fi
-mknod -m 600 "$rocket/dev/console" c 5 1 2> /dev/null || true
-mknod -m 666 "$rocket/dev/null" c 1 3 2> /dev/null || true
-
-echo "Creating directories"
-install -dm750 "$rocket/root"
-install -dm1777 "$rocket/tmp"
-mkdir -p "$rocket/etc" "$rocket/usr/pkg" "$rocket/usr/sat"
-#if [ "$(uname -m)" == "x86_64" ]; then
-# ln -sf lib "$rocket/lib64"
-# ln -sf lib "$rocket/usr/lib64"
-#fi
-
-echo "Creating temporary symlinks"
-mkdir -p "$rocket/usr/pkg/tmp-coreutils/bin"
-ln -sf ../../../../tools/bin/sh "$rocket/usr/pkg/tmp-coreutils/bin/sh"
-ln -sf ../../../../tools/bin/pwd "$rocket/usr/pkg/tmp-coreutils/bin/pwd"
-mkdir -p "$rocket/usr/pkg/tmp-bash/bin"
-ln -sf ../../../../tools/bin/bash "$rocket/usr/pkg/tmp-bash/bin/bash"
-mkdir -p "$rocket/usr/pkg/tmp-ca-certificates/etc/ssl"
-ln -sf ../../../../../tools/lib/ssl/certs "$rocket/usr/pkg/tmp-ca-certificates/etc/ssl/certs"
-mkdir -p "$rocket/usr/pkg/tmp-gcc/usr/lib"
-ln -sf ../../../../../tools/lib/libgcc_s.so "$rocket/usr/pkg/tmp-gcc/usr/lib/libgcc_s.so"
-ln -sf ../../../../../tools/lib/libgcc_s.so.1 "$rocket/usr/pkg/tmp-gcc/usr/lib/libgcc_s.so.1"
-ln -sf ../../../../../tools/lib/libstdc++.so "$rocket/usr/pkg/tmp-gcc/usr/lib/libstdc++.so"
-ln -sf ../../../../../tools/lib/libstdc++.so.6 "$rocket/usr/pkg/tmp-gcc/usr/lib/libstdc++.so.6"
-
-echo "Creating users and groups"
-echo 'root:x:0:0:root:/root:/bin/sh' > "$rocket/etc/passwd"
-echo 'root:x:0:' > "$rocket/etc/group"
diff --git a/tools/satellites/ca-certificates.sat b/tools/satellites/ca-certificates.sat
deleted file mode 100644
index a042420..0000000
--- a/tools/satellites/ca-certificates.sat
+++ /dev/null
@@ -1,12 +0,0 @@
-name=ca-certificates
-version=$(date +%d%m%Y)
-
-dlfile "https://mxr.mozilla.org/mozilla-central/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1"
-extrafile "make-ca.sh"
-extrafile "make-cert.pl"
-
-mkdir -p "$dir_install/tools/lib/ssl/certs"
-sh ./make-ca.sh ./certdata.txt "$dir_install/tools/lib/ssl/certs"
-c_rehash "$dir_install/tools/lib/ssl/certs"
-
-# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/tools/satellites/check.sat b/tools/satellites/check.sat
deleted file mode 100644
index 123985f..0000000
--- a/tools/satellites/check.sat
+++ /dev/null
@@ -1,12 +0,0 @@
-name=check
-version=0.9.14
-
-dlextract "http://sourceforge.net/projects/$name/files/$name/$version/$name-$version.tar.gz" \
- "38263d115d784c17aa3b959ce94be8b8"
-
-cd "$name-$version"
-
-PKG_CONFIG= ./configure --prefix=/tools
-make; make DESTDIR="$dir_install" install
-
-# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
diff --git a/tools/satellites/linux-api.sat b/tools/satellites/linux-api.sat
deleted file mode 100644
index 98115b6..0000000
--- a/tools/satellites/linux-api.sat
+++ /dev/null
@@ -1,13 +0,0 @@
-srcname=linux
-name=$srcname-api
-version=3.19
-
-dlextract "https://www.kernel.org/pub/$srcname/kernel/v3.x/$srcname-$version.tar.xz" \
- "ce49828adecf8908eb3a9ffc5b860d44"
-
-cd "$srcname-$version"
-
-make mrproper
-make INSTALL_HDR_PATH="$dir_install/tools" headers_install
-
-# vim:set tabstop=4 shiftwidth=4 syntax=sh et: