diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2021-01-01 23:39:25 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2021-01-02 04:51:38 +0100 |
commit | 5f287cc195fb27e6cab46caca2195d55112499a5 (patch) | |
tree | 2a0b052c9f4da12a6071af34f3fc77ce42473b76 /build-aux | |
parent | 59ebb850386c174979847a9a40f10a65850c0988 (diff) | |
download | blogc-5f287cc195fb27e6cab46caca2195d55112499a5.tar.gz blogc-5f287cc195fb27e6cab46caca2195d55112499a5.tar.bz2 blogc-5f287cc195fb27e6cab46caca2195d55112499a5.zip |
build: debian: several improvements to debian/ubuntu repos
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/build-debian.sh | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/build-aux/build-debian.sh b/build-aux/build-debian.sh index 6932175..89cc193 100755 --- a/build-aux/build-debian.sh +++ b/build-aux/build-debian.sh @@ -1,26 +1,29 @@ #!/bin/bash -set -eo pipefail +set -exo pipefail -export DEBEMAIL="noreply@rafaelmartins.eng.br" -export DEBFULLNAME="Snapshot github-actions" +export DEBEMAIL="rafael+deb@rafaelmartins.eng.br" +export DEBFULLNAME="Automatic Builder (github-actions)" +export DEB_BUILD_OPTIONS="noddebs" download_pbuilder_chroots() { local arch="amd64" local os="$(uname -s | tr '[:upper:]' '[:lower:]')" - local index="$(curl --silent https://distfiles.rgm.io/pbuilder-chroots/LATEST/)" + local index="$(wget -q -O- https://distfiles.rgm.io/pbuilder-chroots/LATEST/)" local archive="$(echo "${index}" | sed -n "s/.*\(pbuilder-chroots-${os}-${arch}-.*\)\.sha512.*/\1/p")" local folder="$(echo "${index}" | sed -n "s/.*\(pbuilder-chroots-${os}-${arch}-.*\)\.tar.*\.sha512.*/\1/p")" local p="$(echo "${folder}" | sed "s/pbuilder-chroots-${os}-${arch}-\(.*\)/pbuilder-chroots-\1/")" - curl --fail --output "${archive}" "https://distfiles.rgm.io/pbuilder-chroots/${p}/${archive}" - curl --fail --output "${archive}.sha512" "https://distfiles.rgm.io/pbuilder-chroots/${p}/${archive}.sha512" + pushd "${SRCDIR}" > /dev/null + wget -c "https://distfiles.rgm.io/pbuilder-chroots/${p}/${archive}"{,.sha512} sha512sum --check --status "${archive}.sha512" sudo rm -rf /tmp/pbuilder - fakeroot tar -xf "${archive}" -C /tmp + fakeroot tar --checkpoint=.1000 -xf "${archive}" -C /tmp + + popd > /dev/null } create_reprepro_conf() { @@ -28,7 +31,7 @@ create_reprepro_conf() { echo "Origin: blogc-snapshot" echo "Label: blogc-snapshot" echo "Codename: ${dist}" - echo "Architectures: amd64" + echo "Architectures: source amd64" echo "Components: main" echo "Description: Apt repository containing blogc snapshots" echo @@ -41,16 +44,16 @@ ${MAKE_CMD:-make} dist-xz MY_P="${PN}_${PV}" -mv ${P}.tar.xz "../${MY_P}.orig.tar.xz" +mv ${P}.tar.xz "${BUILDDIR}/${MY_P}.orig.tar.xz" for dir in /tmp/pbuilder/*/base.cow; do export DIST="$(basename "$(dirname "${dir}")" | cut -d- -f1)" RES="${BUILDDIR}/deb/${DIST}" mkdir -p "${RES}" - rm -rf "../${P}" - tar -xf "../${MY_P}.orig.tar.xz" -C .. - cp -r ../debian "../${P}/" + rm -rf "${BUILDDIR}/${P}" + tar -xf "${BUILDDIR}/${MY_P}.orig.tar.xz" -C "${BUILDDIR}" + cp -r "${SRCDIR}/debian" "${BUILDDIR}/${P}/" REV= case ${DIST} in @@ -71,18 +74,16 @@ for dir in /tmp/pbuilder/*/base.cow; do ;; *) echo "error: unsupported dist: ${DIST}" + exit 1 ;; esac - pushd "../${P}" > /dev/null + pushd "${BUILDDIR}/${P}" > /dev/null - # do not mess with changelog for releases, it should be done manually during version bump - if [[ ${PV} == *-* ]]; then - dch \ - --distribution "${DIST}" \ - --newversion "${PV}-${REV}" \ - "snapshot" - fi + dch \ + --distribution "${DIST}" \ + --newversion "${PV}-${REV}" \ + "Automated build for ${DIST}" pdebuild \ --pbuilder cowbuilder \ @@ -101,9 +102,7 @@ create_reprepro_conf ${DISTS} > "${BUILDDIR}/deb-repo/conf/distributions" pushd "${BUILDDIR}/deb-repo" > /dev/null for dist in ${DISTS}; do - for deb in "../deb/${dist}"/*.deb; do - reprepro includedeb "${dist}" "${deb}" - done + reprepro include "${dist}" "../deb/${dist}"/*.changes done popd > /dev/null |