diff --git a/astronaut/astronaut b/astronaut/astronaut index f37c6be..921572b 100755 --- a/astronaut/astronaut +++ b/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 ] [-Id] [-o ] -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. diff --git a/astronaut/astronautpkg b/astronaut/astronautpkg index 9c80a32..a348a70 100755 --- a/astronaut/astronautpkg +++ b/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" diff --git a/astronaut/functions/say_hello.sh b/astronaut/examples/functions/say_hello.sh similarity index 100% rename from astronaut/functions/say_hello.sh rename to astronaut/examples/functions/say_hello.sh diff --git a/astronaut/hello.sat b/astronaut/examples/hello.sat similarity index 98% rename from astronaut/hello.sat rename to astronaut/examples/hello.sat index 4b0568d..4cd9131 100644 --- a/astronaut/hello.sat +++ b/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 diff --git a/astronaut/template.sat b/astronaut/examples/template.sat similarity index 100% rename from astronaut/template.sat rename to astronaut/examples/template.sat diff --git a/astronaut/pacman-astronaut b/astronaut/pacman-astronaut index 8423dcc..76e807a 100755 --- a/astronaut/pacman-astronaut +++ b/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 diff --git a/astronaut/xbps-astronaut b/astronaut/xbps-astronaut index 8a2cf53..bc813f2 100755 --- a/astronaut/xbps-astronaut +++ b/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" diff --git a/satellites/fakeroot.sat b/satellites/fakeroot.sat new file mode 100644 index 0000000..5be19ab --- /dev/null +++ b/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: diff --git a/satellites/functions/compile/configure.sh b/satellites/functions/compile/configure.sh index 5d92530..0d803d4 100644 --- a/satellites/functions/compile/configure.sh +++ b/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 }