Browse Source

Add fakeroot support to astronautpkg

master
mid-kid 8 years ago
parent
commit
1fe65cfd64
  1. 9
      astronaut/astronaut
  2. 11
      astronaut/astronautpkg
  3. 0
      astronaut/examples/functions/say_hello.sh
  4. 9
      astronaut/examples/hello.sat
  5. 0
      astronaut/examples/template.sat
  6. 4
      astronaut/pacman-astronaut
  7. 2
      astronaut/xbps-astronaut
  8. 20
      satellites/fakeroot.sat
  9. 8
      satellites/functions/compile/configure.sh

9
astronaut/astronaut

@ -15,6 +15,13 @@ dir_install='/var/tmp/astronaut/install' # Directory where the package will be
dir_sysroot='' # The root directory of the system
dir_prefix='/usr' # Prefix directory (for /bin, /lib, /include, /share and such)
# Finer-grained control of runtime dirs
# This can't be set from the command line, but might need to be adapted for your distro.
dir_bindir='bin'
dir_sbindir='sbin'
dir_libdir='lib'
dir_libexecdir='lib'
# Default commands
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
@ -68,7 +75,7 @@ Usage: $0 [-sbipr <dir>] [-Id] [-o <options>] <satellite>
-v Only build vcs package if any updates have been made to it
-o Set package options (comma-separated)
Tips:$([ "$(basename "$0")" = "astronaut" ] && printf "\n- Use \`head -n 36 $0 > astronaut.conf.example\` to generate a default configuration file.")
Tips:$([ "$(basename "$0")" = "astronaut" ] && printf "\n- Use \`head -n 43 $0 > astronaut.conf.example\` to generate a default configuration file.")
- Keep in mind that when specifying options on the command line in a string, the first always takes priority.
For example, in \"opt,someotheropt,!opt\", opt is enabled, due to it being the first occurrence.
- If you have set \$dir_satellites in the config, you can omit the .sat suffix.

11
astronaut/astronautpkg

@ -4,8 +4,10 @@
# This may also serve as an example on how you can wrap astronaut to package in any format.
if [ "$(id -u)" != "0" ]; then
echo "This script has to be run as root" 1>&2
_fakeroot="$(command -v fakeroot)"
if [ ! "$_fakeroot" -a "$(id -u)" != "0" ]; then
echo "This script has to be run as root, or you need fakeroot installed." 1>&2
exit 1
fi
@ -18,6 +20,7 @@ _nuke_dir_install=true
. "$_astronaut"
# _dir_pkgtools should be set from a configuration file (e.g. ~/.astronaut.conf), and points to wherever you want your packages to be placed.
[ "$_dir_pkgtools" ] && mkdir -p "$_dir_pkgtools" || _dir_pkgtools="$_topdir"
[ "$dir_wrapper_pkgtools" ] && mkdir -p "$dir_wrapper_pkgtools" || dir_wrapper_pkgtools="$_topdir"
cd "$dir_install"
makepkg -l y -c n "$_dir_pkgtools/$name-$version-$(uname -m)-astro.tgz"
[ -d usr/share/man ] && gzip -r usr/share/man
PATH=$PATH:/sbin "$_fakeroot" makepkg -l y -c n "$dir_wrapper_pkgtools/$name-$version-$(uname -m)-astro.tgz"

0
astronaut/functions/say_hello.sh → astronaut/examples/functions/say_hello.sh

9
astronaut/hello.sat → astronaut/examples/hello.sat

@ -22,15 +22,16 @@ vcs_compile=true # Set this to true if it's a vcs package, and we've just downl
# Astronaut will generally prefix internal variables with "_". There are, however, a few exceptions.
# Some of those you can touch, some not.
# "You shouldn't even look, unless you're hacking really bad, but definitely don't touch"-variables:
# - dir_build (You cd into it automatically. Just use relative paths or $PWD.)
# - dir_source (This is handled by the commands detailed below. You should have no use for it.)
# "Look, but don't touch"-variables:
# - dir_install
# - dir_sysroot
# - dir_prefix
# - All other dir_* variables
# "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.)
# (Only use these to change the behaviour of some commands over the whole script, ignoring default/user config.)
# - cmd_download
# - cmd_extract
# - vcs_compile

0
astronaut/template.sat → astronaut/examples/template.sat

4
astronaut/pacman-astronaut

@ -14,8 +14,8 @@ _nuke_dir_install=true
. "$_astronaut"
# _dir_pacman should be set from a configuration file (e.g. ~/.astronaut.conf), and points to wherever you want your packages to be placed.
[ "$_dir_pacman" ] && mkdir -p "$_dir_pacman" && cd "$_dir_pacman" || cd "$_topdir"
# dir_wrapper_pacman should be set from a configuration file (e.g. ~/.astronaut.conf), and points to wherever you want your packages to be placed.
[ "$dir_wrapper_pacman" ] && mkdir -p "$dir_wrapper_pacman" && cd "$dir_wrapper_pacman" || cd "$_topdir"
cat << EOF > "$dir_install/.PKGINFO"
pkgname = $_satname

2
astronaut/xbps-astronaut

@ -15,6 +15,6 @@ _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"
[ "$dir_wrapper_xbps" ] && mkdir -p "$dir_wrapper_xbps" && cd "$dir_wrapper_xbps" || cd "$_topdir"
xbps-create --compression none -A "$(uname -m)" -n "$_satname-${version}_astro" -s "Generated with xbps-astronaut" -H "$update_url" "$dir_install"
xbps-rindex -f -a "$_satname-${version}_astro.$(uname -m).xbps"

20
satellites/fakeroot.sat

@ -0,0 +1,20 @@
import "compile/configure"
# TODO: Can't get 1.21 to install properly
name=fakeroot
#version=1.21
version=1.20.2
update_url="http://http.debian.net/debian/pool/main/f/$name/"
#dlextract "http://http.debian.net/debian/pool/main/f/$name/${name}_$version.orig.tar.gz" \
#"be5c9a0e516869fca4a6758105968e5a"
dlextract "http://http.debian.net/debian/pool/main/f/$name/${name}_$version.orig.tar.bz2" \
"a4b4564a75024aa96c86e4d1017ac786"
header_end
cd "$name-$version"
#./bootstrap
compile_configure
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:

8
satellites/functions/compile/configure.sh

@ -1,5 +1,11 @@
compile_configure() {
./configure --prefix="$dir_prefix" --sysconfdir=/etc $@
./configure \
--prefix="$dir_prefix" \
--bindir="$dir_prefix/$dir_bindir" \
--sbindir="$dir_prefix/$dir_sbindir" \
--libdir="$dir_prefix/$dir_libdir" \
--libexecdir="$dir_prefix/$dir_libexecdir" \
--sysconfdir=/etc $@
make
make DESTDIR="$dir_install/" install
}

Loading…
Cancel
Save