From: Maria Matejka Date: Sat, 6 Dec 2025 21:43:54 +0000 (+0100) Subject: CI: No more APKG in Debian packaging X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d90af06a0266fee59379f79058cc9bb876967e08;p=thirdparty%2Fbird.git CI: No more APKG in Debian packaging All of that can be handled by a little Bash script. --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 654a869f7..3355bee60 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -699,10 +699,8 @@ build-release: <<: *test-job stage: pkg script: - # create venv only if it's installed - - if python3 -m venv venv; then . venv/bin/activate; fi - - pip3 install apkg - - apkg build -a bird-$(cat VERSION)*.tar.gz + - if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then export BRANCH=mergerequest-$CI_MERGE_REQUEST_IID; else export BRANCH=$CI_COMMIT_BRANCH; fi + - tools/make-debian -BS artifacts: paths: - pkg/pkgs/* @@ -712,15 +710,8 @@ build-release: <<: *test-job stage: pkg script: - # create venv only if it's installed - - if python3 -m venv venv; then . venv/bin/activate; fi - # install older version of bs4 that does not use python version >= 3.6 - # apkg depends on bs4, and unless we want to backport python 3.6 - # to ancient distros, we need to do this workaround - - pip3 install beautifulsoup4==4.11.2 - - pip3 install markupsafe==2.0.1 - - pip3 install apkg - - apkg build -a bird-$(cat VERSION)*.tar.gz + - if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then export BRANCH=mergerequest-$CI_MERGE_REQUEST_IID; else export BRANCH=$CI_COMMIT_BRANCH; fi + - tools/make-debian -BS artifacts: paths: - pkg/pkgs/* diff --git a/distro/pkg/deb/changelog b/distro/pkg/deb/changelog index 360d97813..2570ee962 100644 --- a/distro/pkg/deb/changelog +++ b/distro/pkg/deb/changelog @@ -2,4 +2,4 @@ bird3 ({{ version }}-cznic.{{ release }}) unstable; urgency=medium * upstream package - -- Jakub Ružička {{ now }} + -- Maria Matějka {{ now }} diff --git a/distro/pkg/deb/control b/distro/pkg/deb/control index 5e8378834..8ef017191 100644 --- a/distro/pkg/deb/control +++ b/distro/pkg/deb/control @@ -17,7 +17,7 @@ Build-Depends-Indep: linuxdoc-tools-latex, opensp, texlive-latex-extra, -Maintainer: Jakub Ružička +Maintainer: Maria Matejka Standards-Version: 4.7.0 Vcs-Browser: https://salsa.debian.org/debian/bird3 Vcs-Git: https://salsa.debian.org/debian/bird3.git diff --git a/distro/pkg/deb/watch b/distro/pkg/deb/watch index cec2d6646..9dd6ae082 100644 --- a/distro/pkg/deb/watch +++ b/distro/pkg/deb/watch @@ -1,2 +1,2 @@ version=4 -https://bird.network.cz/download/bird-(2\.[\d.]+).tar.gz +https://bird.nic.cz/get-bird/ /download/bird-(2.17.\d+).tar.gz diff --git a/misc/docker/debian-10-amd64/Dockerfile b/misc/docker/debian-10-amd64/Dockerfile index 1e281a0d1..9e11c53af 100644 --- a/misc/docker/debian-10-amd64/Dockerfile +++ b/misc/docker/debian-10-amd64/Dockerfile @@ -20,6 +20,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ quilt \ python3 \ python3-pip \ diff --git a/misc/docker/debian-10-i386/Dockerfile b/misc/docker/debian-10-i386/Dockerfile index e3c164e8c..638df920d 100644 --- a/misc/docker/debian-10-i386/Dockerfile +++ b/misc/docker/debian-10-i386/Dockerfile @@ -20,6 +20,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/debian-11-amd64/Dockerfile b/misc/docker/debian-11-amd64/Dockerfile index 94f2a54de..2a5fa3a80 100644 --- a/misc/docker/debian-11-amd64/Dockerfile +++ b/misc/docker/debian-11-amd64/Dockerfile @@ -20,6 +20,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/debian-11-i386/Dockerfile b/misc/docker/debian-11-i386/Dockerfile index 1fcbc37d7..0878eb7d8 100644 --- a/misc/docker/debian-11-i386/Dockerfile +++ b/misc/docker/debian-11-i386/Dockerfile @@ -20,6 +20,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/debian-12-amd64/Dockerfile b/misc/docker/debian-12-amd64/Dockerfile index cdee03f99..34f2c40d8 100644 --- a/misc/docker/debian-12-amd64/Dockerfile +++ b/misc/docker/debian-12-amd64/Dockerfile @@ -20,6 +20,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/debian-12-i386/Dockerfile b/misc/docker/debian-12-i386/Dockerfile index 906f9fa5c..5f6b56d60 100644 --- a/misc/docker/debian-12-i386/Dockerfile +++ b/misc/docker/debian-12-i386/Dockerfile @@ -20,6 +20,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/debian-13-amd64/Dockerfile b/misc/docker/debian-13-amd64/Dockerfile index d90883fcb..9b6db59ae 100644 --- a/misc/docker/debian-13-amd64/Dockerfile +++ b/misc/docker/debian-13-amd64/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/debian-13-i386/Dockerfile b/misc/docker/debian-13-i386/Dockerfile index 52ee361d4..d1c54b08f 100644 --- a/misc/docker/debian-13-i386/Dockerfile +++ b/misc/docker/debian-13-i386/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/debian-testing-amd64/Dockerfile b/misc/docker/debian-testing-amd64/Dockerfile index 61ebd0d7c..625f4774a 100644 --- a/misc/docker/debian-testing-amd64/Dockerfile +++ b/misc/docker/debian-testing-amd64/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/debian-testing-i386/Dockerfile b/misc/docker/debian-testing-i386/Dockerfile index 4c66aa340..fa8c0deae 100644 --- a/misc/docker/debian-testing-i386/Dockerfile +++ b/misc/docker/debian-testing-i386/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/docbuilder/Dockerfile b/misc/docker/docbuilder/Dockerfile index 464ec3030..ff758808e 100644 --- a/misc/docker/docbuilder/Dockerfile +++ b/misc/docker/docbuilder/Dockerfile @@ -1,5 +1,5 @@ # bump this to recreate the image: 2 -FROM debian:bookworm-slim +FROM debian:trixie-slim ENV DEBIAN_FRONTEND=noninteractive RUN apt-get -y update RUN apt-get -y upgrade @@ -12,7 +12,7 @@ RUN apt-get -y --no-install-recommends install \ pandoc \ ncurses-dev \ libreadline-dev \ - libssh-gcrypt-dev \ + libssh-dev \ linuxdoc-tools-latex \ texlive-latex-extra \ groff \ @@ -22,6 +22,7 @@ RUN apt-get -y --no-install-recommends install \ RUN apt-get -y --no-install-recommends install \ dpkg-dev \ debhelper \ + distro-info-data \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/ubuntu-18.04-amd64/Dockerfile b/misc/docker/ubuntu-18.04-amd64/Dockerfile index 92a804378..9a60f5279 100644 --- a/misc/docker/ubuntu-18.04-amd64/Dockerfile +++ b/misc/docker/ubuntu-18.04-amd64/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/ubuntu-20.04-amd64/Dockerfile b/misc/docker/ubuntu-20.04-amd64/Dockerfile index 13e411c22..2870603b7 100644 --- a/misc/docker/ubuntu-20.04-amd64/Dockerfile +++ b/misc/docker/ubuntu-20.04-amd64/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/ubuntu-22.04-amd64/Dockerfile b/misc/docker/ubuntu-22.04-amd64/Dockerfile index 03db8c949..fcee7e7b1 100644 --- a/misc/docker/ubuntu-22.04-amd64/Dockerfile +++ b/misc/docker/ubuntu-22.04-amd64/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/docker/ubuntu-24.04-amd64/Dockerfile b/misc/docker/ubuntu-24.04-amd64/Dockerfile index ee317196b..ed1707393 100644 --- a/misc/docker/ubuntu-24.04-amd64/Dockerfile +++ b/misc/docker/ubuntu-24.04-amd64/Dockerfile @@ -22,6 +22,7 @@ RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ + lsb-release \ apt-utils \ quilt \ python3 \ diff --git a/misc/gitlab/template.yml.j2 b/misc/gitlab/template.yml.j2 index 2b696f89e..d2a12b56b 100644 --- a/misc/gitlab/template.yml.j2 +++ b/misc/gitlab/template.yml.j2 @@ -239,10 +239,8 @@ build-release: <<: *test-job stage: pkg script: - # create venv only if it's installed - - if python3 -m venv venv; then . venv/bin/activate; fi - - pip3 install apkg - - apkg build -a bird-$(cat VERSION)*.tar.gz + - if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then export BRANCH=mergerequest-$CI_MERGE_REQUEST_IID; else export BRANCH=$CI_COMMIT_BRANCH; fi + - tools/make-debian -BS artifacts: paths: - pkg/pkgs/* @@ -252,15 +250,8 @@ build-release: <<: *test-job stage: pkg script: - # create venv only if it's installed - - if python3 -m venv venv; then . venv/bin/activate; fi - # install older version of bs4 that does not use python version >= 3.6 - # apkg depends on bs4, and unless we want to backport python 3.6 - # to ancient distros, we need to do this workaround - - pip3 install beautifulsoup4==4.11.2 - - pip3 install markupsafe==2.0.1 - - pip3 install apkg - - apkg build -a bird-$(cat VERSION)*.tar.gz + - if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then export BRANCH=mergerequest-$CI_MERGE_REQUEST_IID; else export BRANCH=$CI_COMMIT_BRANCH; fi + - tools/make-debian -BS artifacts: paths: - pkg/pkgs/* diff --git a/tools/make-debian b/tools/make-debian new file mode 100755 index 000000000..d91cd7071 --- /dev/null +++ b/tools/make-debian @@ -0,0 +1,74 @@ +#!/bin/bash + +# Run this script after tools/make-archive + +set -e + +BUILD=false +SOURCE=false + +for OPT in $(getopt -o BS -n "$0" -- "$@"); do + case "$OPT" in + '-B') + BUILD=true + continue + ;; + '-S') + SOURCE=true + continue + ;; + '--') + continue + ;; + -*) + echo "Unknown option $OPT" + exit 2 + ;; + *) + echo "Invalid argument $OPT" + exit 2 + ;; + esac +done + +PKGVERSION=$(tools/version) +TMPDIR=$(mktemp -dp .) +DEBPKGSTEM=bird${PKGVERSION:0:1}_$PKGVERSION +DEBIAN_RELEASE=$(lsb_release -cs) +ORIG=$(pwd) +DIRTARGET=$(lsb_release -is)-$(lsb_release -rs | tr '/' '-') +DIRTARGET=${DIRTARGET,,} +SRCTARGET=${ORIG}/pkg/srcpkgs/$DIRTARGET/$DEBPKGSTEM-cznic.1/ +BINTARGET=${ORIG}/pkg/pkgs/$DIRTARGET/$DEBPKGSTEM-cznic.1/ + +echo "Packaging BIRD $PKGVERSION for $(lsb_release -is) $(lsb_release -rs) $(lsb_release -cs) in $TMPDIR" + +lsb_release -a + +mkdir -p $SRCTARGET $BINTARGET + +pushd $TMPDIR + ln ${ORIG}/bird-$PKGVERSION.tar.gz $DEBPKGSTEM.orig.tar.gz + tar xf $DEBPKGSTEM.orig.tar.gz + pushd bird-$PKGVERSION + # Local-fix version + cp -r ${ORIG}/distro/pkg/deb debian + sed -i "s#{{ version }}#$PKGVERSION#;s#{{ release }}#1~$DEBIAN_RELEASE#;s#{{ now }}#$(date -R)#;" debian/changelog + + # Prepare files for dput + if $SOURCE; then + dpkg-buildpackage -S -sa -d -us -uc + mv ../bird?_*-cznic* ${SRCTARGET}/ + ln ../bird?_*.orig.tar.gz ${SRCTARGET}/ + fi + + # Build locally + if $BUILD; then + dpkg-buildpackage -B -sa -d -us -uc + mv ../bird?{,-dbgsym}_*-cznic* ${BINTARGET}/ + ln ../bird?_*.orig.tar.gz ${BINTARGET}/ + fi + popd +popd + +rm -rf $TMPDIR