From d6eb90fa4a28c4b38feb90092c96017a8067c97f Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sat, 16 Jul 2016 23:36:46 +0200 Subject: [PATCH] Dirs galore, because I need fine-tuning... I actually wanted to try to avoid having to do something like this. I've thought about using options, but that'd allow each package to set their own default. This seemed the easiest way to handle all possible linux distributions, adhering to autoconf standards. --- astronaut/astronaut | 12 ++++++++++-- satellites/extrafiles/nxengine/nxengine.sh | 16 +++++++++------- satellites/fakeroot.sat | 2 +- satellites/functions/compile/cmake.sh | 2 +- satellites/functions/compile/configure.sh | 6 ++++-- satellites/functions/compile/python.sh | 2 +- satellites/functions/compile/qt.sh | 2 +- satellites/nxengine.sat | 6 ++++-- 8 files changed, 31 insertions(+), 17 deletions(-) diff --git a/astronaut/astronaut b/astronaut/astronaut index 80e1539..0b9f636 100755 --- a/astronaut/astronaut +++ b/astronaut/astronaut @@ -13,14 +13,22 @@ dir_install='/var/tmp/astronaut/install' # Directory where the package will be # Runtime directories dir_sysroot='' # The root directory of the system -dir_prefix='/usr' # Prefix directory (for /bin, /lib, /include, /share and such) +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. + +# Dirs always outside of $dir_prefix +dir_sysconfdir='etc' + +# Dirs outside and inside of $dir_prefix dir_bindir='bin' dir_sbindir='sbin' dir_libdir='lib' + +# Dirs only inside of $dir_prefix dir_libexecdir='libexec' +dir_datadir='share' dir_mandir='share/man' dir_docdir='share/doc' dir_infodir='share/info' @@ -79,7 +87,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 45 $0 > astronaut.conf.example\` to generate a default configuration file.") +Tips:$([ "$(basename "$0")" = "astronaut" ] && printf "\n- Use \`head -n 55 $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/satellites/extrafiles/nxengine/nxengine.sh b/satellites/extrafiles/nxengine/nxengine.sh index 5385dcc..1c8aaf4 100644 --- a/satellites/extrafiles/nxengine/nxengine.sh +++ b/satellites/extrafiles/nxengine/nxengine.sh @@ -2,15 +2,17 @@ dir_prefix="%PREFIX%" dir_runtime="%RUNTIME%" +dir_libdir="%LIBDIR%" +dir_datadir="%DATADIR%" files=" - lib/nxengine/nx - share/nxengine/font.ttf - share/nxengine/smalfont.bmp - share/nxengine/sprites.sif - share/nxengine/tilekey.dat - share/nxengine/Doukutsu.exe - share/nxengine/data + $dir_libdir/nxengine/nx + $dir_datadir/nxengine/font.ttf + $dir_datadir/nxengine/smalfont.bmp + $dir_datadir/nxengine/sprites.sif + $dir_datadir/nxengine/tilekey.dat + $dir_datadir/nxengine/Doukutsu.exe + $dir_datadir/nxengine/data " mkdir -p "$dir_runtime" diff --git a/satellites/fakeroot.sat b/satellites/fakeroot.sat index 5be19ab..faf2a01 100644 --- a/satellites/fakeroot.sat +++ b/satellites/fakeroot.sat @@ -15,6 +15,6 @@ header_end cd "$name-$version" #./bootstrap -compile_configure +compile_configure --disable-static # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/functions/compile/cmake.sh b/satellites/functions/compile/cmake.sh index 6a3d27b..1162c4f 100644 --- a/satellites/functions/compile/cmake.sh +++ b/satellites/functions/compile/cmake.sh @@ -1,6 +1,6 @@ compile_cmake_base() { mkdir -p build; cd build - cmake -DCMAKE_INSTALL_PREFIX="$dir_prefix" -DCMAKE_BUILD_TYPE=Release $@ .. + cmake -DCMAKE_INSTALL_PREFIX="/$dir_prefix" -DCMAKE_BUILD_TYPE=Release $@ .. make } diff --git a/satellites/functions/compile/configure.sh b/satellites/functions/compile/configure.sh index 4fe1681..0071168 100644 --- a/satellites/functions/compile/configure.sh +++ b/satellites/functions/compile/configure.sh @@ -1,15 +1,17 @@ compile_configure() { ./configure \ - --prefix="$dir_prefix" \ + --prefix="/$dir_prefix" \ + --sysconfdir="/$dir_sysconfdir" \ --bindir="$dir_prefix/$dir_bindir" \ --sbindir="$dir_prefix/$dir_sbindir" \ --libdir="$dir_prefix/$dir_libdir" \ --libexecdir="$dir_prefix/$dir_libexecdir" \ + --datadir="$dir_prefix/$dir_datadir" \ --mandir="$dir_prefix/$dir_mandir" \ --docdir="$dir_prefix/$dir_docdir/$name" \ --infodir="$dir_prefix/$dir_infodir" \ --localedir="$dir_prefix/$dir_localedir" \ - --sysconfdir=/etc $@ + $@ make make DESTDIR="$dir_install/" install } diff --git a/satellites/functions/compile/python.sh b/satellites/functions/compile/python.sh index 0486bde..a9cd020 100644 --- a/satellites/functions/compile/python.sh +++ b/satellites/functions/compile/python.sh @@ -1,4 +1,4 @@ compile_python() { local ver="$1"; shift - python$ver setup.py install --prefix="$dir_prefix" --root="$dir_install" $@ + python$ver setup.py install --prefix="/$dir_prefix" --root="$dir_install" $@ } diff --git a/satellites/functions/compile/qt.sh b/satellites/functions/compile/qt.sh index d2feda2..733da26 100644 --- a/satellites/functions/compile/qt.sh +++ b/satellites/functions/compile/qt.sh @@ -1,6 +1,6 @@ compile_qt() { local ver="$1"; shift - qmake-qt$ver PREFIX="$dir_prefix" build_mode=release build_type=shared $@ + qmake-qt$ver PREFIX="/$dir_prefix" build_mode=release build_type=shared $@ make make INSTALL_ROOT="$dir_install" install } diff --git a/satellites/nxengine.sat b/satellites/nxengine.sat index 4c0dbaa..01f6b03 100644 --- a/satellites/nxengine.sat +++ b/satellites/nxengine.sat @@ -26,7 +26,7 @@ sed -i -e '/g++/s/-o/$(CFLAGS) -o/g' nx/Makefile make -C nx # Install the nxengine executable -install -Dm755 nx/nx "$dir_install/$dir_prefix/lib/nxengine/nx" +install -Dm755 nx/nx "$dir_install/$dir_prefix/$dir_libdir/nxengine/nx" # Install the necessary data mkdir -p "$dir_install/$dir_prefix/share/nxengine" @@ -38,8 +38,10 @@ cp -r CaveStory/data "$dir_install/$dir_prefix/share/nxengine/data" dir_runtime="$(option dir_runtime=\$HOME/.nxengine)" sed -i -e "s/%PREFIX%/$(safe_sed "$dir_prefix")/" \ -e "s/%RUNTIME%/$(safe_sed "$dir_runtime")/" \ + -e "s/%LIBDIR%/$(safe_sed "$dir_libdir")" \ + -e "s/%DATADIR%/$(safe_sed "$dir_datadir")" \ nxengine.sh -install -Dm755 nxengine.sh "$dir_install/$dir_prefix/bin/nxengine" +install -Dm755 nxengine.sh "$dir_install/$dir_prefix/$dir_bindir/nxengine" # Install desktop file and icon install -Dm644 nxengine.png "$dir_install/$dir_prefix/share/pixmaps/nxengine.png"