aboutsummaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-05-31 17:21:37 -0400
committerFrancis Rowe <info@gluglug.org.uk>2015-06-06 23:23:26 +0100
commit1a92b1b84e09956ad262587dc21209531c43665e (patch)
treef01798fcb3b962db3f3bee451197a0ddfb561810 /resources
parentca2fc96ab3d24c372dd902b23eb10c330db3c995 (diff)
downloadlibrebootfr-1a92b1b84e09956ad262587dc21209531c43665e.tar.gz
librebootfr-1a92b1b84e09956ad262587dc21209531c43665e.zip
build/release/src: New script
This new script: * Doesn't generate a manifest. * Changes directories as little as possible. * Uses git-describe to generate a version string instead of getting the HEAD commit ID from the master branch (which assumed the release was being made from master). * Optionally includes a version string in the archive file name.
Diffstat (limited to 'resources')
-rwxr-xr-xresources/scripts/helpers/build/release/archives130
-rwxr-xr-xresources/scripts/helpers/build/release/src113
2 files changed, 113 insertions, 130 deletions
diff --git a/resources/scripts/helpers/build/release/archives b/resources/scripts/helpers/build/release/archives
index dd490ea0..a389f913 100755
--- a/resources/scripts/helpers/build/release/archives
+++ b/resources/scripts/helpers/build/release/archives
@@ -58,35 +58,6 @@ rm -f tobuild.tar.xz
rm -rf release/
rm -rf tobuild/
rm -rf libreboot_bin
-rm -rf libreboot_src
-
-# Get manifest which will be used to copy everything
-find -maxdepth 1 > releasefilelist
-
-printf "\n\n"
-
-# ### Prepare libreboot_src archive ready for release
-# ----------------------------------------------------------------------------------------------------------------------------
-
-printf "Copying libreboot sources to libreboot_src/\n"
-mkdir libreboot_src
-
-for resource in $(cat releasefilelist)
-do
- if [ "$resource" != "." ] && [ "$resource" != "./docs" ]; then
- cp -r $resource libreboot_src
- fi
-done
-
-cd libreboot_src/
-
-# clean everything
-./build clean all
-
-# back to main checkout directory
-cd ../
-
-printf "\n\n"
# ### Create the release/ directory where the archives will go
# ----------------------------------------------------------------------------------------------------------------------------
@@ -95,48 +66,6 @@ printf "\n\n"
mkdir release/
mkdir release/rom/
-# ### Further work in libreboot_src: delete *.git and *.svn
-# ### To save space since they are not useful in the release archives
-# ### Changes to these projects should be submitted upstream
-# ----------------------------------------------------------------------------------------------------------------------------
-
-echo "Deleting .git* and .svn* in the modules of libreboot_src/\n"
-
-cd libreboot_src/
-
-# These instructions will also work even if .git or .svn are already deleted
-# because "rm -rf" won't complain if they are missing. It is still useful on
-# the release archives (non-git), for example if the user re-downloads these programmes.
-
-# remove .git for libreboot project itself
-rm -rf .git*
-
-# remove .git for bucts
-cd bucts/
-rm -rf .git*
-cd ../
-
-# coreboot:
-# the instructions for coreboot remain in the download script
-# they need to stay there, because otherwise "git diff"
-# will show the blobs that were deleted (which means,
-# that libreboot would be distributing blobs)
-
-# Flashrom:
-cd flashrom/
-rm -rf .svn
-cd ../
-
-# GRUB:
-cd grub/
-rm -rf .git
-rm -f .gitignore
-cd ../
-
-printf "\n\n"
-
-cd ../
-
# ### Prepare ROM archives ready for release
# ----------------------------------------------------------------------------------------------------------------------------
@@ -348,72 +277,14 @@ printf "\n\n"
# ### Create the release tarballs
# ----------------------------------------------------------------------------------------------------------------------------
-# Also delete the manifest
-rm -f libreboot_src/releasefilelist
-rm -f libreboot_util/releasefilelist
-rm -f releasefilelist
-
-# Useless files
-rm -rf libreboot_src/TODO/
-rm -f libreboot_src/push
-
-# Delete the deblob scripts from libreboot_src
-# Since _src doesn't distribute the download scripts,
-# and already comes with a deblobbed coreboot, the
-# deblobbing scripts aren't needed at all
-rm -rf libreboot_src/resources/utilities/coreboot-libre/
-
-# We don't want to encourage development
-# to happen on the release archives.
-# Development goes in git. These scripts are
-# not needed in libreboot_src, because
-# the files that they download are already included
-rm -rf libreboot_src/resources/scripts/helpers/build/release
-rm -f libreboot_src/download
-rm -rf libreboot_src/resources/scripts/helpers/download/
-# no need for script to purge sources, since purged sources
-# are already included in libreboot_src
-rm -rf libreboot_src/resources/scripts/helpers/build/trim/
-
-# Patches are not needed, because they are
-# already merged in libreboot_src/coreboot/
-rm -rf libreboot_src/resources/libreboot/patch/
-
-# ich9deblob: there are certain files in there
-# that the user most likely does not want to share
-rm -f libreboot_src/resources/utilities/ich9deblob/deblobbed_descriptor.bin
-rm -f libreboot_src/resources/utilities/ich9deblob/factory.rom
-rm -f libreboot_src/resources/utilities/ich9deblob/libreboot.rom
-rm -f libreboot_src/resources/utilities/ich9deblob/mkdescriptor.c
-rm -f libreboot_src/resources/utilities/ich9deblob/mkdescriptor.h
-rm -f libreboot_src/resources/utilities/ich9deblob/mkgbe.c
-rm -f libreboot_src/resources/utilities/ich9deblob/mkgbe.h
-rm -f libreboot_src/resources/utilities/ich9deblob/ich9fdgbe_4m.bin
-rm -f libreboot_src/resources/utilities/ich9deblob/ich9fdgbe_8m.bin
-rm -f libreboot_src/resources/utilities/ich9deblob/demefactory_4kdescriptor.bin
-rm -f libreboot_src/mkgbe.c
-rm -f libreboot_src/mkgbe.h
-rm -f libreboot_src/ich9fdgbe_8m.bin
-rm -f libreboot_src/ich9fdgbe_4m.bin
-
-# delete the "tobuild"
-rm -rf libreboot_src/tobuild/
-rm -f libreboot_src/tobuild.tar.xz
-
# mention the commit ID (libreboot, git) in the release archives
-cat commitid > libreboot_src/commitid
cat commitid > libreboot_util/commitid
-# create lzma compressed src archive
-printf "Compressing libreboot_src/ into libreboot_src.tar.xz\n"
-tar -c libreboot_src | xz -9e >libreboot_src.tar.xz
-
printf "Compressing libreboot_util/ into libreboot_util.tar.xz\n"
# create lzma compressed util archive
tar -c libreboot_util | xz -9e >libreboot_util.tar.xz
# Move the archives to the release directory
-mv libreboot_src.tar.xz release/
mv libreboot_util.tar.xz release/
# Put the change log in the release directory.
cp docs/release.html release/
@@ -430,7 +301,6 @@ printf "\n\n"
# ----------------------------------------------------------------------------------------------------------------------------
# The uncompressed archives are no longer needed
-rm -rf libreboot_src
rm -rf libreboot_util
# For those utilities that have to be built on the target
diff --git a/resources/scripts/helpers/build/release/src b/resources/scripts/helpers/build/release/src
new file mode 100755
index 00000000..7bd53b10
--- /dev/null
+++ b/resources/scripts/helpers/build/release/src
@@ -0,0 +1,113 @@
+#!/bin/sh
+
+#
+# helper script: generate the source release archive
+#
+# Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
+# Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+[ "x${DEBUG+set}" = 'xset' ] && set -v
+set -u -e
+
+printf 'Building the source release archive\n'
+
+version="$(git describe --tags HEAD)"
+if [ "x${VERSION_IN_FILENAMES+set}" = 'xset' ]; then
+ distdir="libreboot_${version}_src"
+else
+ distdir='libreboot_src'
+fi
+
+printf 'Deleting old source release archives\n'
+rm -f "${distdir}.tar.xz"
+rm -f "release/${distdir}.tar.xz"
+rm -Rf "${distdir}/"
+
+mkdir "${distdir}/"
+
+printf 'Copying sources to %s/\n' "${distdir}"
+for resource in *; do
+ case "${resource}" in
+ libreboot_* | release | tobuild* | docs);;
+ *) cp -R "${resource}" "${distdir}/";;
+ esac
+done
+
+printf '%s\n' "${version}" >"${distdir}/version"
+
+printf 'Cleaning files in %s/\n' "${distdir}"
+
+# Clean old builds.
+(cd "${distdir}/" && ./build clean all)
+printf '\n'
+
+# Delete Git repositories and properties and Subversion administrative
+# directories and properties.
+rm -Rf "${distdir}/bucts/".git*
+rm -Rf "${distdir}/flashrom/".svn*
+rm -Rf "${distdir}/grub/".git*
+
+# Delete useless files.
+rm -Rf "${distdir}/TODO/"
+rm -f "${distdir}/push"
+
+# Delete the deblob scripts.
+# Since the source archive doesn't distribute the download scripts and already
+# comes with a deblobbed coreboot, the deblobbing scripts aren't needed at all.
+rm -Rf "${distdir}/resources/utilities/coreboot-libre/"
+
+# We don't want to encourage development to happen on the release archives.
+# Development goes in Git. These scripts are not needed in the source archive,
+# because the files that they download are already included and trimmed.
+rm -Rf "${distdir}/resources/scripts/helpers/build/release/"
+rm -f "${distdir}/download"
+rm -Rf "${distdir}/resources/scripts/helpers/download/"
+rm -Rf "${distdir}/resources/scripts/helpers/build/trim/"
+
+# Patches are not needed, because they are already applied to coreboot sources.
+rm -Rf "${distdir}/resources/libreboot/patch/"
+
+# coreboot's crossgcc archives are distributed separately.
+rm -Rf "${distdir}/coreboot/util/crossgcc/tarballs/"
+
+# ich9deblob: There are certain files in there that the user most likely does
+# not want to share.
+rm -f "${distdir}/resources/utilities/ich9deblob/deblobbed_descriptor.bin"
+rm -f "${distdir}/resources/utilities/ich9deblob/factory.rom"
+rm -f "${distdir}/resources/utilities/ich9deblob/libreboot.rom"
+rm -f "${distdir}/resources/utilities/ich9deblob/mkdescriptor.c"
+rm -f "${distdir}/resources/utilities/ich9deblob/mkdescriptor.h"
+rm -f "${distdir}/resources/utilities/ich9deblob/mkgbe.c"
+rm -f "${distdir}/resources/utilities/ich9deblob/mkgbe.h"
+rm -f "${distdir}/resources/utilities/ich9deblob/ich9fdgbe_4m.bin"
+rm -f "${distdir}/resources/utilities/ich9deblob/ich9fdgbe_8m.bin"
+rm -f "${distdir}/resources/utilities/ich9deblob/demefactory_4kdescriptor.bin"
+rm -f "${distdir}/mkgbe.c"
+rm -f "${distdir}/mkgbe.h"
+rm -f "${distdir}/ich9fdgbe_8m.bin"
+rm -f "${distdir}/ich9fdgbe_4m.bin"
+
+printf 'Creating %s.tar.xz\n' "${distdir}"
+tar -c "${distdir}/" | xz -9e >"${distdir}.tar.xz"
+
+# Move the archives to the release/ directory.
+[ -d release/ ] || mkdir release/
+mv "${distdir}.tar.xz" release/
+
+rm -Rf "${distdir}/"
+
+printf 'Source release archives are stored in release/\n'