summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild2/download195
-rw-r--r--build2/release.txt113
2 files changed, 308 insertions, 0 deletions
diff --git a/build2/download b/build2/download
new file mode 100755
index 0000000..cbc1ee5
--- /dev/null
+++ b/build2/download
@@ -0,0 +1,195 @@
+#! /usr/bin/env bash
+
+# Download and arrange source and binary packages.
+#
+# Run from the root of the destination download directory. Note that the
+# destination files are expected not to exist.
+
+repo="https://queue.stage.build2.org"
+
+bin_repo="$repo/0/bindist"
+src_repo="$repo/1/alpha"
+
+declare -A vers
+declare -A srcs
+declare -A bins
+
+# Key is project name.
+#
+vers["xsd"]="4.2.0"
+vers["xerces-c"]="3.2.4+2"
+vers["libcutl"]="1.11.0"
+vers["libxsd-frontend"]="2.1.0"
+
+# Key is package name, value is project name (for version).
+#
+srcs["xsd"]="xsd"
+srcs["xsd-tests"]="xsd"
+srcs["xsd-examples"]="xsd"
+srcs["libxsd"]="xsd"
+srcs["libxsd-tests"]="xsd"
+srcs["libcutl"]="libcutl"
+srcs["libxsd-frontend"]="libxsd-frontend"
+srcs["libxerces-c"]="xerces-c"
+
+# The key is "<dist>/<os>/<proj>/<pkg>/<cfg>". The value is the destination
+# subdirectory.
+#
+# @@ TODO: replace default <cfg> with arch, etc.
+#
+bins["debian/debian11/xsd/xsd/default"]="debian/debian11/x86_64"
+bins["debian/debian11/xsd/libxsd/default"]="debian/debian11/x86_64"
+
+bins["debian/debian12/xsd/xsd/default"]="debian/debian12/x86_64"
+bins["debian/debian12/xsd/libxsd/default"]="debian/debian12/x86_64"
+
+bins["debian/ubuntu22.04/xsd/xsd/default"]="ubuntu/ubuntu22.04/x86_64"
+bins["debian/ubuntu22.04/xsd/libxsd/default"]="ubuntu/ubuntu22.04/x86_64"
+bins["debian/ubuntu22.04/xerces-c/libxerces-c/default"]="ubuntu/ubuntu22.04/x86_64"
+
+bins["fedora/fedora37/xsd/xsd/default"]="fedora/fedora37/x86_64"
+bins["fedora/fedora37/xsd/libxsd/default"]="fedora/fedora37/x86_64"
+
+bins["fedora/fedora38/xsd/xsd/default"]="fedora/fedora38/x86_64"
+bins["fedora/fedora38/xsd/libxsd/default"]="fedora/fedora38/x86_64"
+
+bins["fedora/rhel9.2/xsd/xsd/default"]="rhel/rhel9.2/x86_64"
+bins["fedora/rhel9.2/xsd/libxsd/default"]="rhel/rhel9.2/x86_64"
+bins["fedora/rhel9.2/xerces-c/libxerces-c/default"]="rhel/rhel9.2/x86_64"
+
+bins["archive/debian11/xsd/xsd/linux-glibc2_31"]="linux/linux-glibc2.31/x86_64"
+bins["archive/debian11/xsd/libxsd/linux"]="linux/linux-glibc2.31/x86_64"
+
+bins["archive/macos13.4/xsd/xsd/default"]="macos/macos13.4/x86_64"
+bins["archive/macos13.4/xsd/libxsd/default"]="macos/macos13.4/x86_64"
+bins["archive/macos13.4/xerces-c/libxerces-c/default"]="macos/macos13.4/x86_64"
+
+bins["archive/windows10/xsd/xsd/default"]="windows/windows10/x86_64"
+bins["archive/windows10/xsd/libxsd/default"]="windows/windows10/x86_64"
+bins["archive/windows10/xerces-c/libxerces-c/release"]="windows/windows10/x86_64"
+bins["archive/windows10/xerces-c/libxerces-c/debug"]="windows/windows10/x86_64"
+
+owd=`pwd`
+trap "{ cd $owd; exit 1; }" ERR
+set -o errtrace # Trap in functions.
+shopt -s lastpipe # Execute last pipeline command in current shell.
+
+function info () { echo "$*" 1>&2; }
+function error () { info "$*"; exit 1; }
+
+declare -A dirs # Package directories to generate packages.sha256 in.
+
+# Download and arrange sources.
+#
+if true; then
+for pkg in "${!srcs[@]}"; do
+ prj="${srcs[$pkg]}"
+ ver="${vers[$prj]}"
+
+ pkgf="$pkg-$ver.tar.gz"
+ url="$src_repo/$prj/$pkgf"
+
+ info "fetching $url"
+ curl -sSf -o "$pkgf" "$url"
+
+ # Make .zip archive for examples.
+ #
+ if [ -n "$(sed -rn -e 's/^.+-examples$/true/p' <<<"$pkg")" ]; then
+ pkgd="$pkg-$ver"
+
+ if [ -d "$pkgd" ]; then
+ error "package directory $pkgd already exist"
+ fi
+
+ info "repacking $pkgf"
+ tar -xf "$pkgf"
+ zip -r "$pkg-$ver.zip" "$pkgd"
+ rm -rf "$pkgd"
+ fi
+done
+dirs["."]=true
+fi
+
+# Download and arrange binaries.
+#
+if true; then
+for bk in "${!bins[@]}"; do
+ bv="${bins[$bk]}"
+
+ # Get the distribution type we are dealing with.
+ #
+ dist="$(sed -rn -e 's#^(.+)/.+/.+/.+/.+$#\1#p' <<<"$bk")"
+
+ # Get the project we are dealing with and its version.
+ #
+ prj="$(sed -rn -e 's#^.+/.+/(.+)/.+/.+$#\1#p' <<<"$bk")"
+ ver="${vers[$prj]}"
+
+ url="$bin_repo/"
+ url+="$(sed -rn -e "s#^(.+/.+/.+/.+)/(.+)\$#\\1/$ver/\\2#p" <<<"$bk")"
+
+ # Get the list of packages (keys) and their checksums (values) at this URL
+ # by loading its packages.sha256.
+ #
+ unset pkgs # Clear.
+ declare -A pkgs
+
+ curl -sSf "$url/packages.sha256" | while read l; do
+
+ pkg="$(sed -rn -e 's#^([^ ]+) \*(.+)$#\2#p' <<<"$l")"
+
+ # Get the extension and omit certain distribution-specific file types.
+ #
+ e="$(sed -rn -e 's#^.+\.([^.]+)$#\1#p' <<<"$pkg")"
+
+ case "$dist" in
+ "debian")
+ if [ "$e" = "buildinfo" -o "$e" = "changes" ]; then
+ continue
+ fi
+ ;;
+
+ "fedora")
+ ;;
+ esac
+
+ csm="$(sed -rn -e 's#^([^ ]+) \*(.+)$#\1#p' <<<"$l")"
+ pkgs["$pkg"]="$csm"
+ done
+
+ mkdir -p "$bv"
+
+ # Download each package and verify checksum.
+ #
+ for pkg in "${!pkgs[@]}"; do
+
+ pkgf="$bv/$pkg"
+
+ if [ -f "$pkgf" ]; then
+ error "destination package $pkgf from $bk already exist"
+ fi
+
+ info "fetching $url/$pkg"
+ curl -sSf -o "$pkgf" "$url/$pkg"
+
+ csm="$(sha256sum -b "$pkgf" | sed -rn -e 's#^([^ ]+) \*(.+)$#\1#p')"
+
+ if [ "$csm" != "${pkgs[$pkg]}" ]; then
+ error "checksum mismatch for package $pkgf from $bk"
+ fi
+
+ done
+
+ dirs["$bv"]=true
+done
+fi
+
+# Generate packages.sha256
+#
+for d in "${!dirs[@]}"; do
+ cd "$d"
+ rm -f "packages.sha256"
+ l="$(find . -maxdepth 1 -type f -printf '%P\n' | sort)" # Array-like.
+ sha256sum -b $l >"packages.sha256"
+ cd "$owd"
+done
diff --git a/build2/release.txt b/build2/release.txt
new file mode 100644
index 0000000..e96ecf8
--- /dev/null
+++ b/build2/release.txt
@@ -0,0 +1,113 @@
+1. Finalize xsd and all dependencies (libxerces-c, libcutl, libxsd-frontend).
+
+ * Review @@.
+ * Update NEWS files.
+ * Update build2 toolchain version constraints.
+ * Update copyright.
+ * Update bindist configs if necessary (e.g., generic linux config).
+ * CI and make sure all good.
+ * Publish to queue.stage.build2.org and make sure all good.
+ * Do manual Q&A (schemas/{citygml.org/2.0.0/, fpml.org/5.1/}).
+ * Push everything.
+
+2. Release and publish to queue.stage.build2.org to build binary packages.
+
+ * Release BUT DON'T PUSH in the dependency order:
+
+ - Update version constraints to previouly released final version.
+
+ bdep release --no-open
+
+ * Test locally (bdep test -a).
+
+ * Publish to queue.stage.build2.org.
+
+ * Confirm all good and binaries are built (libxerces-c, libxsd, and xsd).
+
+ * Update and run `download` script to download and arrange source and
+ binary packages.
+
+ * Build Mac OS aarch64 binaries manually (make sure have the same OS
+ and Xcode).
+
+ - First install stage toolchain.
+
+ bpkg create -d xerces-cfg cc config.cc.coptions="-Wall -O3" config.cxx.std=c++11
+ cd xerces-cfg
+ bpkg build --configure-only libxerces-c@https://queue.stage.build2.org/1/alpha
+ bpkg update -v libxerces-c
+ bpkg test libxerces-c
+ bpkg -v bindist --distribution archive --recursive separate --output-root ../xerces-bindist --archive-lang-impl=cc=clang14 --archive-install-root=/usr/local config.install.relocatable=true libxerces-c
+
+ bpkg create -d libxsd-cfg cc config.cc.coptions="-Wall -O3" config.cxx.std=c++11
+ cd libxsd-cfg
+ bpkg build --configure-only libxsd@https://queue.stage.build2.org/1/alpha
+ bpkg update -v libxsd
+ bpkg -v bindist --distribution archive --recursive separate --output-root ../libxsd-bindist --archive-lang-impl=cc=clang14 --archive-install-root=/usr/local --archive-build-meta=macos config.install.relocatable=true libxsd
+
+ bpkg create -d xsd-cfg cc config.cc.coptions="-Wall -O3" config.bin.lib=static "config.bin.liba.lib=shared static"
+ cd xsd-cfg
+ bpkg build --configure-only xsd@https://queue.stage.build2.org/1/alpha
+ bpkg update -v xsd
+ bpkg test xsd
+ bpkg -v bindist --distribution archive --recursive separate --output-root ../xsd-bindist --archive-lang-impl=cc=clang14 --archive-install-root=/usr/local --recursive=auto --archive-lang-impl=cc= config.install.relocatable=true xsd
+
+ - Add to binary packages and generate packages.sha256:
+
+ cd .../aarch64/
+ sha256sum -b "$(ls -1 | sort)" >packages.sha256
+
+ * Copy packages over to download directory, make sure there is enough
+ disk space on host to publish.
+
+ * Copy over (or add new) README.cli and update.
+
+3. Update web pages
+
+ * Update "Compilers & Platforms" page.
+
+ * Update "Download" page.
+
+ * Copy over updated documentation to projects/xsd/documentation/. Review
+ with gitk for any unexpected differences.
+
+ * Generate doxygen (reference and hello):
+
+ cd libxsd/doc/
+ b config.libxsd.doxygen=true
+
+ - copy result over to documentation/cxx/tree/reference/
+ - check everything looks sensible
+
+ - copy hello example directory to documentation/.../
+
+ xsd cxx-tree --generate-doxygen hello.xsd
+
+ - add hello.doxygen from old documentation
+
+ doxygen hello.doxygen
+
+ - clean source files, etc
+ - check everything looks sensible and cross-links to references work
+
+3. Publish and announce
+
+ * bdep-publish all the packages and make sure queued builds are good.
+
+ * Publish binaries and updated web pages.
+
+ * Migrate packages from queue to public. Cleanup any betas.
+
+ * Write release announcements and send to xsd-{users, announcements}.
+
+ * Announce on #build2.
+
+ * Add news entries to web pages.
+
+4. Finish
+
+ * Commit web pages.
+
+ * Commit xsd-etc.
+
+ * Update Homebrew formula.