aboutsummaryrefslogtreecommitdiff
path: root/resources/scripts/helpers
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-06-08 13:44:03 +0100
committerFrancis Rowe <info@gluglug.org.uk>2015-06-08 13:44:03 +0100
commit628c3d7d9ebeba2fd6345153e2b3eba493b56b9a (patch)
treea21631f8716b042a7b47a34449a6cc293ceab16e /resources/scripts/helpers
parente846db194ea06a189cb8b2d51548463c9641720d (diff)
downloadlibrebootfr-628c3d7d9ebeba2fd6345153e2b3eba493b56b9a.tar.gz
librebootfr-628c3d7d9ebeba2fd6345153e2b3eba493b56b9a.zip
build/release/tobuild: intergrate it with current methods
Diffstat (limited to 'resources/scripts/helpers')
-rwxr-xr-xresources/scripts/helpers/build/release/tobuild63
1 files changed, 31 insertions, 32 deletions
diff --git a/resources/scripts/helpers/build/release/tobuild b/resources/scripts/helpers/build/release/tobuild
index c84e634e..afe1085a 100755
--- a/resources/scripts/helpers/build/release/tobuild
+++ b/resources/scripts/helpers/build/release/tobuild
@@ -23,54 +23,53 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
+version="$(git describe --tags HEAD)"
+versiondir="release/${version}"
+distname="tobuild"
+distdir="${versiondir}/${distname}"
+
printf "Creating source archive for flashrom and bucts\n"
# delete the old data
-rm -Rf tobuild
-rm -f tobuild.tar.xz
+rm -Rf "${distdir}/"
+rm -f "${distdir}.tar.xz"
# this is where they will go
-mkdir tobuild
+mkdir -p "${distdir}/"
# flashrom
-cp -R flashrom/ tobuild/
-cd tobuild/flashrom/
-rm -f flashrom_lenovobios_sst flashrom_lenovobios_macronix
-make clean
-cd ../../
-mkdir tobuild/resources/
-mkdir tobuild/resources/flashrom/
-cp -R resources/flashrom/patch/ tobuild/resources/flashrom/
+cp -R "flashrom/" "${distdir}/"
+rm -f "${distdir}/flashrom/flashrom_lenovobios_sst"
+rm -f "${distdir}/flashrom/flashrom_lenovobios_macronix"
+(cd "${distdir}/flashrom/" && make clean)
+mkdir -p "${distdir}/resources/flashrom/"
+cp -R "resources/flashrom/patch/" "${distdir}/resources/flashrom/"
# bucts
-cp -R bucts tobuild/
-cd tobuild/bucts/
-make clean
-cd ../../
-mkdir tobuild/resources/bucts/
-cp -R resources/bucts/patch/ tobuild/resources/bucts/
+cp -R "bucts/" "${distdir}/"
+(cd "${distdir}/bucts/" && make clean)
+mkdir -p "${distdir}/resources/bucts/"
+cp -R "resources/bucts/patch/" "${distdir}/resources/bucts/"
# the build script will be needed
-cp build tobuild/
+cp build "${distdir}/"
# needed build scripts (helpers)
-mkdir tobuild/resources/scripts/
-mkdir tobuild/resources/scripts/helpers/
-mkdir tobuild/resources/scripts/helpers/build/
-mkdir tobuild/resources/scripts/helpers/build/module/
-mkdir tobuild/resources/scripts/helpers/build/clean/
-cp resources/scripts/helpers/build/clean/bucts tobuild/resources/scripts/helpers/build/clean/
-cp resources/scripts/helpers/build/clean/flashrom tobuild/resources/scripts/helpers/build/clean/
-cp resources/scripts/helpers/build/module/bucts tobuild/resources/scripts/helpers/build/module/
-cp resources/scripts/helpers/build/module/flashrom tobuild/resources/scripts/helpers/build/module/
-cp resources/scripts/misc/powertop.trisquel7 tobuild/
+mkdir -p "${distdir}/resources/scripts/helpers/build/"
+mkdir -p "${distdir}/resources/scripts/helpers/build/module/"
+mkdir -p "${distdir}/resources/scripts/helpers/build/clean/"
+cp "resources/scripts/helpers/build/clean/bucts" "${distdir}/resources/scripts/helpers/build/clean/"
+cp "resources/scripts/helpers/build/clean/flashrom" "${distdir}/resources/scripts/helpers/build/clean/"
+cp "resources/scripts/helpers/build/module/bucts" "${distdir}/resources/scripts/helpers/build/module/"
+cp "resources/scripts/helpers/build/module/flashrom" "${distdir}/resources/scripts/helpers/build/module/"
+cp "resources/scripts/misc/powertop.trisquel7" "${distdir}/"
# that is all. now tar it up
-tar -c tobuild | xz -9e >tobuild.tar.xz
+(cd "${versiondir}/" && tar -c "${distname}/" | xz -9e >"${distname}.tar.xz")
# and delete the directory
-rm -Rf tobuild/
+rm -Rf "${distdir}/"
-printf "Tar archives are stored in release/.\n"
+printf "Tar archive created: %s\n" "${distdir}.tar.xz"
printf "NOTE: don't forget to add ARM binaries for flashrom.\n"
printf "NOTE: don't forget to add i386 binaries for flashrom/bucts.\n"
-printf "The archive tobuild.tar.xz has been created with everything needed to build these utilities.\n\n"
+printf "The archive %s.tar.xz has been created with everything needed to build these utilities.\n\n" "${distname}"