+###########################################################
+##### #####
+##### DO NOT EDIT THIS FILE BY HAND #####
+##### #####
+###########################################################
+##### #####
+##### This file is autogenerated from misc/gitlab/. #####
+##### Edit those files and run `make gitlab` instead. #####
+##### #####
+###########################################################
+
variables:
DEBIAN_FRONTEND: noninteractive
LC_ALL: C.UTF-8
STAYRTR_BINARY: /usr/bin/stayrtr
stages:
-# - image
+ - consistency
+ - image
- build
- pkg
- test
-.docker: &docker_build
+## Common rules
+# Ignore WIP commits
+.never-wip: &never-wip
+ if: $CI_COMMIT_MESSAGE =~ /^(fixup! )*WIP/
+ when: never
+# Run for stable branches
+.if-stable: &if-stable
+ if: $CI_COMMIT_BRANCH =~ /^(stable-.*|thread-next|master)$/
+ when: always
+# Do run for tags
+.if-tag: &if-tag
+ if: $CI_COMMIT_TAG
+ when: always
+# Never run for tags
+.never-tag: &never-tag
+ if: $CI_COMMIT_TAG
+ when: never
+
+## Consistency checks for stable branches
+commit-messages:
+ stage: consistency
+ image: registry.nic.cz/labs/bird:docbuilder
+ script:
+ - tools/git-check-commits
+ rules:
+ - *if-stable
+ - when: never
+
+## Tag check
+tag-collect:
+ stage: consistency
+ image: registry.nic.cz/labs/bird:docbuilder
+ script:
+ - python3 -m venv venv
+ - . venv/bin/activate
+ - pip3 install requests
+ - tools/git-check-tag-local $CI_COMMIT_TAG
+ - tools/git-check-tag-ci $CI_COMMIT_SHA
+ artifacts:
+ paths:
+ - obj/doc/bird-singlepage.html
+ - bird-*.tar.gz
+ - pkg/pkgs/*
+ - pkg/srcpkgs/*
+ rules:
+ - *if-tag
+ - when: never
+
+## Default test job rules
+.test-job: &test-job
+ rules:
+ - *never-wip
+ - *never-tag
+ - when: always
+
+############################
+## Docker builder rebuild ##
+############################
+# We are running all the build / packaging tests in Dockers (unless otherwise)
+# and these are rules to build these docker images. These are expensive to run
+# and should run only if needed.
+#
+# Modify the appropriate dockerfile to rebuild these images
+
+.docker: &docker-build
stage: image
- allow_failure: true
script:
- - $DOCKER_CMD login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.nic.cz
+ - $DOCKER_CMD login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.nic.cz
# Make sure we refresh the base image if it updates (eg. security updates, etc)
# If we do just the build, cache is always reused and the freshness of the
# base image is never checked. However, pull always asks and updates the
tags:
# That's Docker in Docker
- dind
+ rules:
+ # Never rebuild for WIP commits
+ - *never-wip
-# Docker build example
-#docker_debian-11-amd64:
-# variables:
-# IMG_NAME: "debian-11-amd64"
-# <<: *docker_build
+ # Never rebuild for tags
+ - if: '$CI_COMMIT_TAG'
+ when: never
+ # Never rebuild for new branches
+ - if: $CI_COMMIT_BEFORE_SHA == "0000000000000000000000000000000000000000"
+ when: never
-.build: &build-base
- stage: build
- script:
- - autoreconf
- - ./configure CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS"
- # Detect which make is available
- - MAKE=make
- - which gmake 2>/dev/null >/dev/null && MAKE=gmake
- - $MAKE
- - $MAKE check
- # Build docs when tools are available
- - if which linuxdoc pdflatex >/dev/null ; then $MAKE docs ; fi
-
-.build-linux: &build-linux
- <<: *build-base
- tags:
- - docker
- - linux
- - amd64
+ # Do any change in Dockerfile (e.g. change a comment) to rebuild the image
+ # FIXME: This probably belongs to bird-tools instead, we may end up with
+ # screwed up docker repository in case of colliding image updates
+ - changes:
+ - misc/docker/$IMG_NAME/Dockerfile
+ when: always
-build-debian-9-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:debian-9-amd64
+ - when: never
-build-debian-9-i386:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:debian-9-i386
-build-debian-10-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:debian-10-amd64
+docker-docbuilder:
+ variables:
+ IMG_NAME: "docbuilder"
+ <<: *docker-build
-build-debian-10-i386:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:debian-10-i386
+docker-centos-7-amd64:
+ variables:
+ IMG_NAME: "centos-7-amd64"
+ <<: *docker-build
-build-debian-11-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:debian-11-amd64
+docker-centos-8-amd64:
+ variables:
+ IMG_NAME: "centos-8-amd64"
+ <<: *docker-build
-build-debian-12-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:debian-12-amd64
+docker-fedora-32-amd64:
+ variables:
+ IMG_NAME: "fedora-32-amd64"
+ <<: *docker-build
-#build-debian-11-i386:
-# <<: *build-linux
-# image: registry.nic.cz/labs/bird:debian-11-i386
+docker-fedora-33-amd64:
+ variables:
+ IMG_NAME: "fedora-33-amd64"
+ <<: *docker-build
-build-debian-testing-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:debian-testing-amd64
+docker-opensuse-15.0-amd64:
+ variables:
+ IMG_NAME: "opensuse-15.0-amd64"
+ <<: *docker-build
-#build-debian-testing-i386:
-# <<: *build-linux
-# image: registry.nic.cz/labs/bird:debian-testing-i386
+docker-opensuse-15.1-amd64:
+ variables:
+ IMG_NAME: "opensuse-15.1-amd64"
+ <<: *docker-build
-build-fedora-25-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-25-amd64
+docker-opensuse-15.2-amd64:
+ variables:
+ IMG_NAME: "opensuse-15.2-amd64"
+ <<: *docker-build
-build-fedora-26-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-26-amd64
+docker-opensuse-15.3-amd64:
+ variables:
+ IMG_NAME: "opensuse-15.3-amd64"
+ <<: *docker-build
-build-fedora-27-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-27-amd64
+docker-opensuse-15.4-amd64:
+ variables:
+ IMG_NAME: "opensuse-15.4-amd64"
+ <<: *docker-build
-build-fedora-28-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-28-amd64
+docker-opensuse-15.5-amd64:
+ variables:
+ IMG_NAME: "opensuse-15.5-amd64"
+ <<: *docker-build
-build-fedora-29-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-29-amd64
+docker-fedora-34-amd64:
+ variables:
+ IMG_NAME: "fedora-34-amd64"
+ <<: *docker-build
-build-fedora-30-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-30-amd64
+docker-fedora-35-amd64:
+ variables:
+ IMG_NAME: "fedora-35-amd64"
+ <<: *docker-build
-build-fedora-31-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-31-amd64
+docker-fedora-36-amd64:
+ variables:
+ IMG_NAME: "fedora-36-amd64"
+ <<: *docker-build
-build-fedora-32-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-32-amd64
+docker-fedora-37-amd64:
+ variables:
+ IMG_NAME: "fedora-37-amd64"
+ <<: *docker-build
-build-fedora-33-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-33-amd64
+docker-fedora-38-amd64:
+ variables:
+ IMG_NAME: "fedora-38-amd64"
+ <<: *docker-build
-build-fedora-34-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:fedora-33-amd64
+docker-fedora-39-amd64:
+ variables:
+ IMG_NAME: "fedora-39-amd64"
+ <<: *docker-build
-build-centos-8-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:centos-8-amd64
+docker-fedora-40-amd64:
+ variables:
+ IMG_NAME: "fedora-40-amd64"
+ <<: *docker-build
-build-ubuntu-16_04-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:ubuntu-16.04-amd64
+docker-fedora-41-amd64:
+ variables:
+ IMG_NAME: "fedora-41-amd64"
+ <<: *docker-build
-build-ubuntu-18_04-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:ubuntu-18.04-amd64
+docker-fedora-42-amd64:
+ variables:
+ IMG_NAME: "fedora-42-amd64"
+ <<: *docker-build
-build-ubuntu-20_04-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:ubuntu-20.04-amd64
+docker-ubuntu-18.04-amd64:
+ variables:
+ IMG_NAME: "ubuntu-18.04-amd64"
+ <<: *docker-build
+
+docker-debian-10-amd64:
+ variables:
+ IMG_NAME: "debian-10-amd64"
+ <<: *docker-build
+
+docker-debian-10-i386:
+ variables:
+ IMG_NAME: "debian-10-i386"
+ <<: *docker-build
+
+docker-debian-11-amd64:
+ variables:
+ IMG_NAME: "debian-11-amd64"
+ <<: *docker-build
+
+docker-debian-11-i386:
+ variables:
+ IMG_NAME: "debian-11-i386"
+ <<: *docker-build
+
+docker-debian-12-amd64:
+ variables:
+ IMG_NAME: "debian-12-amd64"
+ <<: *docker-build
+
+docker-debian-12-i386:
+ variables:
+ IMG_NAME: "debian-12-i386"
+ <<: *docker-build
+
+docker-debian-testing-amd64:
+ variables:
+ IMG_NAME: "debian-testing-amd64"
+ <<: *docker-build
+
+docker-debian-testing-i386:
+ variables:
+ IMG_NAME: "debian-testing-i386"
+ <<: *docker-build
+
+docker-ubuntu-20.04-amd64:
+ variables:
+ IMG_NAME: "ubuntu-20.04-amd64"
+ <<: *docker-build
+
+docker-ubuntu-22.04-amd64:
+ variables:
+ IMG_NAME: "ubuntu-22.04-amd64"
+ <<: *docker-build
+
+docker-ubuntu-24.04-amd64:
+ variables:
+ IMG_NAME: "ubuntu-24.04-amd64"
+ <<: *docker-build
+
+docker-ubuntu-24.10-amd64:
+ variables:
+ IMG_NAME: "ubuntu-24.10-amd64"
+ <<: *docker-build
+
+
+#####################################################
+## Linux distro build tests inside Docker builders ##
+#####################################################
+
+## Build stage
+#
+# Now we compile and run unit tests ... in every single distribution.
+# Every task needs its docker, see above.
+
+.build: &build-base
+ <<: *test-job
+ stage: build
+ script:
+ - export BRANCH=$CI_COMMIT_BRANCH
+ - tools/version && ( echo -n "BIRD version "; tools/version ) > version-expected
+ - |
+ STABLE_VERSION="`cat VERSION`"
+ if [ "$CI_COMMIT_MESSAGE" == "NEWS and version update
+ " ]; then
+ if [ "${STABLE_VERSION}" == "`tools/version`" ]; then
+ echo "Stable version precheck OK"
+ else
+ echo "Stable version discrepancy: $STABLE_VERSION vs. $(tools/version)"
+ exit 1
+ fi
+ else
+ if grep -qF "BIRD version ${STABLE_VERSION}+branch" version-expected; then
+ true
+ else
+ echo -n "Commit $CI_COMMIT_SHA message $CI_COMMIT_MESSAGE expects version "
+ cat version-expected
+ exit 1
+ fi
+ fi
+ - autoreconf
+ - ./configure CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" $CONFIGURE_OPTIONS
+ # Detect which make is available
+ - MAKE=make
+ - which gmake 2>/dev/null >/dev/null && MAKE=gmake
+ - $MAKE
+ - $MAKE check
+ # Build docs when tools are available
+ - if which linuxdoc pdflatex sgmlsasp >/dev/null ; then $MAKE docs ; fi
+ # Check that the reported version is the right one
+ - ./bird --version |& tee obj/version-built
+ - diff obj/version-built version-expected
+
+.build-docker-linux-amd64: &build-docker-linux-amd64
+ <<: *build-base
+ tags:
+ - docker
+ - linux
+ - amd64
+
+
+build-centos-7-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-centos-7-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:centos-7-amd64
+ variables:
+ CC: /opt/rh/devtoolset-8/root/usr/bin/gcc
+ LC_ALL: en_US.UTF-8
-build-ubuntu-21_10-amd64:
- <<: *build-linux
- image: registry.nic.cz/labs/bird:ubuntu-21.10-amd64
+build-centos-8-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-centos-8-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:centos-8-amd64
-#build-ubuntu-21_04-amd64:
-# <<: *build-linux
-# image: registry.nic.cz/labs/bird:ubuntu-21.04-amd64
+build-fedora-32-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-32-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-32-amd64
+
+build-fedora-33-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-33-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-33-amd64
build-opensuse-15.0-amd64:
- <<: *build-linux
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-opensuse-15.0-amd64
+ optional: true
image: registry.nic.cz/labs/bird:opensuse-15.0-amd64
build-opensuse-15.1-amd64:
- <<: *build-linux
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-opensuse-15.1-amd64
+ optional: true
image: registry.nic.cz/labs/bird:opensuse-15.1-amd64
build-opensuse-15.2-amd64:
- <<: *build-linux
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-opensuse-15.2-amd64
+ optional: true
image: registry.nic.cz/labs/bird:opensuse-15.2-amd64
build-opensuse-15.3-amd64:
- <<: *build-linux
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-opensuse-15.3-amd64
+ optional: true
image: registry.nic.cz/labs/bird:opensuse-15.3-amd64
-#build-freebsd-11-amd64:
-# <<: *build-base
-# tags:
-# - freebsd
-# - amd64
+build-opensuse-15.4-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-opensuse-15.4-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:opensuse-15.4-amd64
+
+build-opensuse-15.5-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-opensuse-15.5-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:opensuse-15.5-amd64
+
+build-fedora-34-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-34-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-34-amd64
+
+build-fedora-35-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-35-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-35-amd64
+
+build-fedora-36-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-36-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-36-amd64
+
+build-fedora-37-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-37-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-37-amd64
+
+build-fedora-38-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-38-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-38-amd64
+
+build-fedora-39-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-39-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-39-amd64
+
+build-fedora-40-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-40-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-40-amd64
+
+build-fedora-41-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-41-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-41-amd64
+
+build-fedora-42-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-fedora-42-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:fedora-42-amd64
+
+build-ubuntu-18.04-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-ubuntu-18.04-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:ubuntu-18.04-amd64
+
+build-debian-10-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-debian-10-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:debian-10-amd64
+
+build-debian-10-i386:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-debian-10-i386
+ optional: true
+ image: registry.nic.cz/labs/bird:debian-10-i386
+
+build-debian-11-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-debian-11-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:debian-11-amd64
+
+build-debian-11-i386:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-debian-11-i386
+ optional: true
+ image: registry.nic.cz/labs/bird:debian-11-i386
-#build-freebsd-11-i386:
-# <<: *build-base
-# tags:
-# - freebsd
-# - i386
+build-debian-12-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-debian-12-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:debian-12-amd64
+
+build-debian-12-i386:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-debian-12-i386
+ optional: true
+ image: registry.nic.cz/labs/bird:debian-12-i386
+
+build-debian-testing-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-debian-testing-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:debian-testing-amd64
+build-debian-testing-i386:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-debian-testing-i386
+ optional: true
+ image: registry.nic.cz/labs/bird:debian-testing-i386
+
+build-ubuntu-20.04-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-ubuntu-20.04-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:ubuntu-20.04-amd64
+
+build-ubuntu-22.04-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-ubuntu-22.04-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:ubuntu-22.04-amd64
+
+build-ubuntu-24.04-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-ubuntu-24.04-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:ubuntu-24.04-amd64
+
+build-ubuntu-24.10-amd64:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-ubuntu-24.10-amd64
+ optional: true
+ image: registry.nic.cz/labs/bird:ubuntu-24.10-amd64
+
+
+#######################################################
+## A special task for preparing the release archives ##
+#######################################################
+build-release:
+ <<: *test-job
+ image: registry.nic.cz/labs/bird:docbuilder
+ needs:
+ - job: docker-docbuilder
+ optional: true
+ stage: build
+ tags:
+ - docker
+ - linux
+ script:
+ - export BRANCH=$CI_COMMIT_BRANCH
+ - autoreconf
+ - ./configure --with-protocols= --disable-client
+ - make obj/doc/bird-singlepage.html
+ - tools/make-archive
+ artifacts:
+ paths:
+ - obj/doc/bird-singlepage.html
+ - bird-*.tar.gz
+ expire_in: 1 day
+
+# Packaging rules
+# As we support some ancient versions of different distributions,
+# we need to keep several different machineries. It's not so bad
+# but it's bad nevertheless.
+#
+# We do NOT build separate documentation packages in these rules.
.pkg-deb: &pkg-deb
+ <<: *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
+ - apkg build -a bird-$(cat VERSION)*.tar.gz
#- apkg install -y pkg/pkgs/*/*/*.deb
artifacts:
paths:
- pkg/pkgs/*
+ - pkg/srcpkgs/*
.pkg-deb-legacy: &pkg-deb-legacy
+ <<: *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
- - pip3 install beautifulsoup4==4.11.2
+ # 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 apkg
- - BRANCH=$CI_COMMIT_BRANCH ARCHIVE_DOCS=false apkg build
+ - apkg build -a bird-$(cat VERSION)*.tar.gz
#- apkg install -y pkg/pkgs/*/*/*.deb
artifacts:
paths:
- pkg/pkgs/*
+ - pkg/srcpkgs/*
.pkg-rpm: &pkg-rpm
+ <<: *test-job
stage: pkg
script:
- pip3 install apkg
- - apkg build
+ - apkg build -a bird-$(cat VERSION)*.tar.gz
#- apkg install -y pkg/pkgs/*/*/*.rpm
artifacts:
paths:
- pkg/pkgs/*
+ - pkg/srcpkgs/*
.pkg-rpm-wa: &pkg-rpm-wa
+ <<: *test-job
stage: pkg
script:
- sed -i "s/runstatedir/with-runtimedir/" distro/pkg/rpm/bird.spec
# install older version of bs4 that does not use python version >= 3.6
- pip3 install beautifulsoup4==4.11.2
- pip3 install apkg
- - apkg build
+ - apkg build -a bird-$(cat VERSION)*.tar.gz
#- apkg install -y pkg/pkgs/*/*/*.rpm
artifacts:
paths:
- pkg/pkgs/*
+ - pkg/srcpkgs/*
-pkg-debian-10-amd64:
- <<: *pkg-deb
- needs: [build-debian-10-amd64]
- image: registry.nic.cz/labs/bird:debian-10-amd64
-
-pkg-debian-10-i386:
- <<: *pkg-deb
- needs: [build-debian-10-i386]
- image: registry.nic.cz/labs/bird:debian-10-i386
-pkg-debian-11-amd64:
- <<: *pkg-deb
- needs: [build-debian-11-amd64]
- image: registry.nic.cz/labs/bird:debian-11-amd64
-pkg-debian-12-amd64:
- <<: *pkg-deb
- needs: [build-debian-12-amd64]
- image: registry.nic.cz/labs/bird:debian-12-amd64
-
-pkg-fedora-30-amd64:
+pkg-centos-7-amd64:
<<: *pkg-rpm-wa
- needs: [build-fedora-30-amd64]
- image: registry.nic.cz/labs/bird:fedora-30-amd64
+ needs:
+ - job: build-centos-7-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:centos-7-amd64
+ variables:
+ CC: /opt/rh/devtoolset-8/root/usr/bin/gcc
+ LC_ALL: en_US.UTF-8
-pkg-fedora-31-amd64:
+pkg-centos-8-amd64:
<<: *pkg-rpm-wa
- needs: [build-fedora-31-amd64]
- image: registry.nic.cz/labs/bird:fedora-31-amd64
+ needs:
+ - job: build-centos-8-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:centos-8-amd64
pkg-fedora-32-amd64:
<<: *pkg-rpm-wa
- needs: [build-fedora-32-amd64]
+ needs:
+ - job: build-fedora-32-amd64
+ artifacts: false
+ - job: build-release
image: registry.nic.cz/labs/bird:fedora-32-amd64
pkg-fedora-33-amd64:
<<: *pkg-rpm-wa
- needs: [build-fedora-33-amd64]
+ needs:
+ - job: build-fedora-33-amd64
+ artifacts: false
+ - job: build-release
image: registry.nic.cz/labs/bird:fedora-33-amd64
+pkg-opensuse-15.0-amd64:
+ <<: *pkg-rpm-wa
+ needs:
+ - job: build-opensuse-15.0-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:opensuse-15.0-amd64
+
+pkg-opensuse-15.1-amd64:
+ <<: *pkg-rpm-wa
+ needs:
+ - job: build-opensuse-15.1-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:opensuse-15.1-amd64
+
+pkg-opensuse-15.2-amd64:
+ <<: *pkg-rpm-wa
+ needs:
+ - job: build-opensuse-15.2-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:opensuse-15.2-amd64
+
+pkg-opensuse-15.3-amd64:
+ <<: *pkg-rpm-wa
+ needs:
+ - job: build-opensuse-15.3-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:opensuse-15.3-amd64
+
+pkg-opensuse-15.4-amd64:
+ <<: *pkg-rpm-wa
+ needs:
+ - job: build-opensuse-15.4-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:opensuse-15.4-amd64
+
+pkg-opensuse-15.5-amd64:
+ <<: *pkg-rpm-wa
+ needs:
+ - job: build-opensuse-15.5-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:opensuse-15.5-amd64
+
pkg-fedora-34-amd64:
<<: *pkg-rpm
- needs: [build-fedora-34-amd64]
+ needs:
+ - job: build-fedora-34-amd64
+ artifacts: false
+ - job: build-release
image: registry.nic.cz/labs/bird:fedora-34-amd64
-pkg-centos-8-amd64:
- <<: *pkg-rpm-wa
- needs: [build-centos-8-amd64]
- image: registry.nic.cz/labs/bird:centos-8-amd64
+pkg-fedora-35-amd64:
+ <<: *pkg-rpm
+ needs:
+ - job: build-fedora-35-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:fedora-35-amd64
+
+pkg-fedora-36-amd64:
+ <<: *pkg-rpm
+ needs:
+ - job: build-fedora-36-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:fedora-36-amd64
+
+pkg-fedora-37-amd64:
+ <<: *pkg-rpm
+ needs:
+ - job: build-fedora-37-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:fedora-37-amd64
+
+pkg-fedora-38-amd64:
+ <<: *pkg-rpm
+ needs:
+ - job: build-fedora-38-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:fedora-38-amd64
+
+pkg-fedora-39-amd64:
+ <<: *pkg-rpm
+ needs:
+ - job: build-fedora-39-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:fedora-39-amd64
+
+pkg-fedora-40-amd64:
+ <<: *pkg-rpm
+ needs:
+ - job: build-fedora-40-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:fedora-40-amd64
+
+pkg-fedora-41-amd64:
+ <<: *pkg-rpm
+ needs:
+ - job: build-fedora-41-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:fedora-41-amd64
+
+pkg-fedora-42-amd64:
+ <<: *pkg-rpm
+ needs:
+ - job: build-fedora-42-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:fedora-42-amd64
pkg-ubuntu-18.04-amd64:
<<: *pkg-deb-legacy
- needs: [build-ubuntu-18_04-amd64]
+ needs:
+ - job: build-ubuntu-18.04-amd64
+ artifacts: false
+ - job: build-release
image: registry.nic.cz/labs/bird:ubuntu-18.04-amd64
+pkg-debian-10-amd64:
+ <<: *pkg-deb
+ needs:
+ - job: build-debian-10-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:debian-10-amd64
+
+pkg-debian-10-i386:
+ <<: *pkg-deb
+ needs:
+ - job: build-debian-10-i386
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:debian-10-i386
+
+pkg-debian-11-amd64:
+ <<: *pkg-deb
+ needs:
+ - job: build-debian-11-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:debian-11-amd64
+
+pkg-debian-11-i386:
+ <<: *pkg-deb
+ needs:
+ - job: build-debian-11-i386
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:debian-11-i386
+
+pkg-debian-12-amd64:
+ <<: *pkg-deb
+ needs:
+ - job: build-debian-12-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:debian-12-amd64
+
+pkg-debian-12-i386:
+ <<: *pkg-deb
+ needs:
+ - job: build-debian-12-i386
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:debian-12-i386
+
+pkg-debian-testing-amd64:
+ <<: *pkg-deb
+ needs:
+ - job: build-debian-testing-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:debian-testing-amd64
+
+pkg-debian-testing-i386:
+ <<: *pkg-deb
+ needs:
+ - job: build-debian-testing-i386
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:debian-testing-i386
+
pkg-ubuntu-20.04-amd64:
<<: *pkg-deb
- needs: [build-ubuntu-20_04-amd64]
+ needs:
+ - job: build-ubuntu-20.04-amd64
+ artifacts: false
+ - job: build-release
image: registry.nic.cz/labs/bird:ubuntu-20.04-amd64
+pkg-ubuntu-22.04-amd64:
+ <<: *pkg-deb
+ needs:
+ - job: build-ubuntu-22.04-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:ubuntu-22.04-amd64
-pkg-ubuntu-21.10-amd64:
+pkg-ubuntu-24.04-amd64:
<<: *pkg-deb
- needs: [build-ubuntu-21_10-amd64]
- image: registry.nic.cz/labs/bird:ubuntu-21.10-amd64
+ needs:
+ - job: build-ubuntu-24.04-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:ubuntu-24.04-amd64
-#pkg-ubuntu-21.04-amd64:
-# <<: *pkg-deb
-# needs: [build-ubuntu-21_04-amd64]
-# image: registry.nic.cz/labs/bird:ubuntu-21.04-amd64
+pkg-ubuntu-24.10-amd64:
+ <<: *pkg-deb
+ needs:
+ - job: build-ubuntu-24.10-amd64
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:ubuntu-24.10-amd64
-pkg-opensuse-15.1-amd64:
- <<: *pkg-rpm-wa
- needs: [build-opensuse-15.1-amd64]
- image: registry.nic.cz/labs/bird:opensuse-15.1-amd64
-pkg-opensuse-15.2-amd64:
- <<: *pkg-rpm-wa
- needs: [build-opensuse-15.2-amd64]
- image: registry.nic.cz/labs/bird:opensuse-15.2-amd64
+###################################
+## Non-linux build tests in QEMU ##
+###################################
+.build-birdlab-base: &build-birdlab-base
+ <<: *build-base
+ stage: build
+# script:
+# - export BRANCH=$CI_COMMIT_BRANCH
+# - autoreconf
+# - ./configure $CONFIGURE_OPTIONS
+# - gmake
+# - gmake check
-pkg-opensuse-15.3-amd64:
- <<: *pkg-rpm-wa
- needs: [build-opensuse-15.3-amd64]
- image: registry.nic.cz/labs/bird:opensuse-15.3-amd64
+build-birdlab-openbsd-75:
+ <<: *build-birdlab-base
+ variables:
+ AUTOCONF_VERSION: '2.71'
+ tags:
+ - birdlab-openbsd-75
+ - amd64
+
+build-birdlab-openbsd-76:
+ <<: *build-birdlab-base
+ variables:
+ AUTOCONF_VERSION: '2.72'
+ tags:
+ - birdlab-openbsd-76
+ - amd64
+
+build-birdlab-netbsd-09:
+ <<: *build-birdlab-base
+ tags:
+ - birdlab-netbsd-09
+ - amd64
+
+build-birdlab-netbsd-10:
+ <<: *build-birdlab-base
+ tags:
+ - birdlab-netbsd-10
+ - amd64
+
+build-birdlab-freebsd-13:
+ <<: *build-birdlab-base
+ tags:
+ - birdlab-freebsd-13
+ - amd64
+
+build-birdlab-freebsd-13-netlink:
+ <<: *build-birdlab-base
+ variables:
+ CONFIGURE_OPTIONS: --with-sysconfig=bsd-netlink --disable-client
+ tags:
+ - birdlab-freebsd-13
+ - amd64
+
+build-birdlab-freebsd-14:
+ <<: *build-birdlab-base
+ tags:
+ - birdlab-freebsd-14
+ - amd64
+
+build-birdlab-freebsd-14-netlink:
+ <<: *build-birdlab-base
+ variables:
+ CONFIGURE_OPTIONS: --with-sysconfig=bsd-netlink --disable-client
+ tags:
+ - birdlab-freebsd-14
+ - amd64
+
+
+#########################
+## Partial build tests ##
+#########################
+
+.build-only: &build-only
+ <<: *build-docker-linux-amd64
+ image: registry.nic.cz/labs/bird:debian-12-amd64
+ needs:
+ - job: docker-debian-12-amd64
+ optional: true
+
+
+partial-build-linux-aggregator:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=aggregator
+
+partial-build-linux-babel:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=babel
+
+partial-build-linux-bfd:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=bfd
+
+partial-build-linux-bgp:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=bgp
+
+partial-build-linux-bgp,bmp:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=bgp,bmp
+
+partial-build-linux-l3vpn:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=l3vpn
+
+partial-build-linux-mrt:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=mrt
+
+partial-build-linux-ospf:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=ospf
+
+partial-build-linux-pipe:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=pipe
+
+partial-build-linux-radv:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=radv
+
+partial-build-linux-rip:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=rip
+
+partial-build-linux-rpki:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=rpki
+
+partial-build-linux-static:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols=static
+
+
+################################
+## Netlab functionality tests ##
+################################
build-netlab:
+ <<: *test-job
stage: build
variables:
BDIR: build-netlab
- mkdir $BDIR
- cd $BDIR
- ../configure
- - make
+ - BRANCH=$CI_COMMIT_BRANCH make
artifacts:
paths:
- $BDIR/bird
- $BDIR/birdc
expire_in: 2 hours
-.test: &test-base
+.netlab-test: &test-base
+ <<: *test-job
stage: test
needs: [build-netlab]
tags:
- cd $TOOLS_DIR
- sudo git clean -fx
- git pull --ff-only
- - mv $DIR/build-netlab/* netlab/common/
+ - "mv $DIR/build-netlab/* netlab/common/"
- ln -s $STAYRTR_BINARY netlab/common/stayrtr
- cd netlab
- sudo ./stop
- sudo ./runtest -s v3 -m check $TEST_NAME
+
+test-babel-base:
+ <<: *test-base
+ variables:
+ TEST_NAME: cf-babel-base
+
+test-babel-auth:
+ <<: *test-base
+ variables:
+ TEST_NAME: cf-babel-auth
+
test-ospf-base:
<<: *test-base
variables:
variables:
TEST_NAME: cf-bgp-rs-multitab
+test-bgp-rs-singletab:
+ <<: *test-base
+ variables:
+ TEST_NAME: cf-bgp-rs-singletab
+
+test-ebgp-graceful:
+ <<: *test-base
+ variables:
+ TEST_NAME: cf-ebgp-graceful
+
test-ebgp-loop:
<<: *test-base
variables:
variables:
TEST_NAME: cf-ebgp-role
-test-ebgp-graceful:
- <<: *test-base
- variables:
- TEST_NAME: cf-ebgp-graceful
-
test-ebgp-import-limit:
<<: *test-base
variables:
variables:
TEST_NAME: cf-ibgp-loop
-#test-ibgp-loop-big:
-# <<: *test-base
-# variables:
-# TEST_NAME: cf-ibgp-loop-big
-#
-test-ibgp-flat:
+test-ibgp-loop-big:
<<: *test-base
variables:
- TEST_NAME: cf-ibgp-flat
+ TEST_NAME: cf-ibgp-loop-big
-test-babel-base:
- <<: *test-base
- variables:
- TEST_NAME: cf-babel-base
-
-test-babel-auth:
+test-ibgp-flat:
<<: *test-base
variables:
- TEST_NAME: cf-babel-auth
+ TEST_NAME: cf-ibgp-flat
test-rip-base:
<<: *test-base
variables:
TEST_NAME: cf-mpls-bgp-l3vpn
-
-.build-birdlab-base: &build-birdlab-base
- stage: build
- script:
- - autoreconf
- - ./configure
- - gmake
- - gmake check
-
-build-birdlab-debian-11:
- <<: *build-birdlab-base
- tags:
- - birdlab-debian-11
- - amd64
-
-build-birdlab-centos-08:
- <<: *build-birdlab-base
- tags:
- - birdlab-centos-08
- - amd64
-
-build-birdlab-fedora-37:
- <<: *build-birdlab-base
- tags:
- - birdlab-fedora-37
- - amd64
-
-build-birdlab-freebsd-13:
- <<: *build-birdlab-base
- tags:
- - birdlab-freebsd-13
- - amd64
-
-build-birdlab-openbsd-71:
- <<: *build-birdlab-base
- variables:
- AUTOCONF_VERSION: "2.71"
- tags:
- - birdlab-openbsd-71
- - amd64
# Makefile for the BIRD Internet Routing Daemon
# (c) 1999--2000 Martin Mares <mj@ucw.cz>
-# (c) 2016 Jan Moskyto Matejka <mq@ucw.cz>
+# (c) 2016--2025 Maria Matejka <mq@ucw.cz>
# Disable build-in rules
MAKEFLAGS += -r
objdir := @objdir@
exedir := @exedir@
-git-label:=$(strip $(shell cd $(srcdir) && [ "$$(git rev-parse --show-toplevel)" = "$$(readlink -f .)" ] && git describe --always --dirty=-x 2>/dev/null))
-ifneq ($(git-label),)
- CFLAGS += -DGIT_LABEL="$(git-label)"
-endif
+# Find out which version we are actually building
+# This is rewritten by the release tools by hardcoded version
+VERSION := $(strip $(shell $(srcdir)/tools/version))
+
+CFLAGS += -DBIRD_VERSION='"$(VERSION)"'
ifeq ($(objdir),.)
objdir := $(realpath .)
docgoals := docs userdocs progdocs
testgoals := check test tests tests_run
cleangoals := clean distclean testsclean
-.PHONY: all daemon cli $(docgoals) $(testgoals) $(cleangoals) tags cscope prepare
+.PHONY: all daemon cli $(docgoals) $(testgoals) $(cleangoals) tags cscope prepare gitlab
all: daemon cli
$(client) $(daemon):
$(E)echo LD $(LDFLAGS) -o $@ $^ $(LIBS)
- $(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+ +$(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
$(objdir)/sysdep/paths.h: Makefile
$(E)echo GEN $@
$(tests_targets): %: %.o $(tests_objs) | prepare
$(E)echo LD $(LDFLAGS) -o $@ $< "..." $(LIBS)
- $(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+ +$(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
# Hack to avoid problems with tests linking everything
$(tests_targets): LIBS += $(DAEMON_LIBS)
cscope:
cd $(srcdir) ; find $(dirs) -name '*.[chY]' > cscope.files ; cscope -b
+# Gitlab CI tests
+gitlab: .gitlab-ci.yml
+.gitlab-ci.yml: $(addprefix misc/gitlab/,pipeline.py data.yml.j2 template.yml.j2)
+ ( \
+ VENV=$$(mktemp -d); \
+ python3 -m venv $$VENV; \
+ . $$VENV/bin/activate; \
+ pip3 install jinja2 pyaml; \
+ python3 misc/gitlab/pipeline.py > $@ \
+ rm -rf $$VENV \
+ )
+
# Install
install: all
apkg build -Hi
-tools/make-dev-archive script is in charge of creating archive from source.
+tools/make-archive script is in charge of creating archive from source.
## Create (source) package from upstream release
[project]
name = "bird"
# needed for make-archive
-make_archive_script = "tools/make-dev-archive"
+make_archive_script = "tools/make-archive"
[upstream]
# needed for get-archive
$(srcdir)/tools/progdoc $(srcdir) $@
$(o)%.sgml: $(s)%.sgml $(objdir)/.dir-stamp
- cp $< $@
+ sed 's#{{ VERSION }}#$(VERSION)#' <$< >$@
$(o)%.html: $(o)%.sgml
cd $(dir $@) && $(toolsdir)/linuxdoc -B html $(notdir $<)
$(PANDOC) -f $(LINUXDOC_PANDOC_PARSER) -s -t markdown -o $@ $<
$(o)%-singlepage.html: $(o)%.sgml $(SINGLEPAGE_HTML_TEMPLATE) $(LINUXDOC_PANDOC_PARSER) $(objdir)/.dir-stamp
- $(PANDOC) -f $(LINUXDOC_PANDOC_PARSER) -t html5 --shift-heading-level-by=1 --section-divs --table-of-contents --toc-depth=3 -M bird_version="3.0.2" --template=$(SINGLEPAGE_HTML_TEMPLATE) -o $@ $<
+ $(PANDOC) -f $(LINUXDOC_PANDOC_PARSER) -t html5 --shift-heading-level-by=1 --section-divs --table-of-contents --toc-depth=3 -M bird_version="$(VERSION)" --template=$(SINGLEPAGE_HTML_TEMPLATE) -o $@ $<
endif
<!doctype birddoc system>
<!--
- BIRD 3.0 documentation
+ BIRD documentation
This documentation can have 4 forms: sgml (this is master copy), html, ASCII
text and dvi/postscript (generated from sgml using sgmltools). You should always
<book>
-<title>BIRD 3.0 User's Guide
+<title>BIRD {{ VERSION }} User's Guide
<author>
Ondrej Filip <it/<feela@network.cz>/,
Martin Mares <it/<mj@ucw.cz>/,
--- /dev/null
+# Docker files for our test machinery
+
+**These files are not distribution files for running BIRD. We currently
+do not supply official BIRD images and do not prepare any Docker files ourselves.**
+
+We build for the major Linux distributions, FreeBSD and OpenBSD. If you feel
+that your favourite Linux distribution is missing, feel free to send a patch.
+
+Where to add your favourite Linux distribution:
+
+- add an appropriate dockerfile here
+- add `docker-*` job in `.gitlab-ci.yml`
+- add `build-*` job in `.gitlab-ci.yml`
+- add `pkg-*` job in `.gitlab-ci.yml`
+
+Our build machinery needs at least Python 3.6 because of `beautifulsoup4`.
+There is a hack for older distributions, installing an older version of
+that dependency which works also with an older Python.
+
+## Debian-based distributions
+
+We support Debian between oldoldstable and testing. If not, poke us.
+
+We support Ubuntu LTS at least 5 years old and non-LTS before EOL. After EOL,
+the non-LTS package repositories tend to disappear quite quickly so we don't
+have resources to build against.
+
+## RedHat-based distributions
+
+We support OpenSUSE, Fedora and CentOS. If you are missing your favourite new
+release, poke us. We are discontinuing the old releases as they stop working.
+
+The current support for CentOS 7 and 8 has been paid for and we may drop it without
+further notice at the exact moment the customer stops using it.
+
+## Any other based distributions
+
+We currently don't package for Arch or Gentoo. Contributions are open, please
+refer to `CONTRIBUTING.md` for further information.
+
+You may also need to send a patch to [APKG](https://gitlab.nic.cz/packaging/apkg)
+to facilitate the package building. Yet, if you wish to just test and check
+builds without packaging, feel free to send the patch anyway.
+
+## FreeBSD and OpenBSD
+
+These are not built in Docker but in proper virtuals in QEMU, refer to
+<https://gitlab.nic.cz/labs/bird-tools/-/tree/master/birdlab-tmp>
+++ /dev/null
-FROM centos:6
-RUN yum -y upgrade
-RUN yum -y install \
- autoconf \
- flex \
- bison \
- pkgconfig \
- 'readline-devel' \
- 'pkgconfig(ncurses)' \
- gcc \
- make
+# bump number for image rebuild: 0
FROM centos:7
+
+# Has to be done for yum to work properly. CentOS 7 is EOL.
+RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo
+RUN sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo
+RUN sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo
+
+# Add new repos for devtoolset-8-gcc.
+# We need to use devtoolset, because BIRD cannot be correctly compiled with CentOS 7 version of gcc.
+RUN echo -e \
+ "\n[centos-sclo-rh]\nname=CentOS-7.8.2003 - SCLo rh\nbaseurl=https://vault.centos.org/7.8.2003/sclo/\$basearch/rh/\ngpgcheck=0\nenabled=1" \
+ >> /etc/yum.repos.d/CentOS-Base.repo
+RUN echo -e \
+ "\n[centos-sclo-sclo]\nname=CentOS-7.8.2003 - SCLo sclo\nbaseurl=https://vault.centos.org/7.8.2003/sclo/\$basearch/sclo/\ngpgcheck=0\nenabled=1" \
+ >> /etc/yum.repos.d/CentOS-Base.repo
+
RUN yum -y upgrade
+
+# Change kernel-headers
+RUN yum -y remove \
+ kernel-headers
+RUN yum -y install \
+ https://dl.lamp.sh/kernel/el7/kernel-ml-headers-6.6.41-1.el7.x86_64.rpm
+
RUN yum -y install \
gcc \
make \
autoconf \
libssh-devel \
ncurses-devel \
- readline-devel
+ readline-devel \
+ centos-release-scl
+
RUN yum -y install \
git \
rpm-build \
- systemd \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ devtoolset-8-toolchain
+
+# Backported newer RPM macros, hoping that it stays there for some while until we drop CentOS 7 support
+RUN yum -y install \
+ ftp://ftp.icm.edu.pl/packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/systemsmanagement:/Ardana:/8:/CentOS/CentOS_7.3/noarch/systemd-rpm-macros-3-5.2.noarch.rpm
+# bump number for image rebuild: 0
FROM centos:8
+
+# Has to be done for yum to work properly. CentOS 8 is EOL.
+RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo
+RUN sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo
+RUN sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo
+
RUN yum -y upgrade
RUN yum -y install \
gcc \
+# bump number for image rebuild: 0
FROM debian:buster-slim
-ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
+ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y --no-install-recommends install \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
+# bump number for image rebuild: 0
FROM i386/debian:buster-slim
-ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
+ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y --no-install-recommends install \
git \
dpkg-dev \
debhelper \
+ apt-utils \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
+# bump number for image rebuild: 0
FROM amd64/debian:bullseye-slim
ENV DEBIAN_FRONTEND=noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y --no-install-recommends install \
git \
dpkg-dev \
debhelper \
+ apt-utils \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
+# bump number for image rebuild: 1
FROM i386/debian:bullseye-slim
ENV DEBIAN_FRONTEND=noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
-RUN apt-get -y update && apt-get -y upgrade
+RUN apt-get -y update
+RUN apt-get -y upgrade
RUN apt-get -y --no-install-recommends install \
build-essential \
flex \
git \
dpkg-dev \
debhelper \
+ apt-utils \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
-FROM debian:stretch-slim
-ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
+# bump number for image rebuild: 2
+FROM amd64/debian:bookworm-slim
+ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y --no-install-recommends install \
git \
dpkg-dev \
debhelper \
+ apt-utils \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
-FROM i386/debian:stretch-slim
-ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
+# bump number for image rebuild: 1
+FROM i386/debian:bookworm-slim
+ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y --no-install-recommends install \
git \
dpkg-dev \
debhelper \
+ apt-utils \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
+++ /dev/null
-FROM debian:wheezy-slim
-ENV DEBIAN_FRONTEND noninteractive
-RUN echo 'deb http://archive.debian.org/debian/ wheezy main' > /etc/apt/sources.list
-RUN echo 'deb http://archive.debian.org/debian-security/ wheezy/updates main' >> /etc/apt/sources.list
-RUN apt-get -y update -o Acquire::Check-Valid-Until=false
-RUN apt-get -y upgrade
-RUN apt-get -y install \
- build-essential \
- flex \
- bison \
- autoconf \
- ncurses-dev \
- libreadline-dev
+++ /dev/null
-FROM i386/debian:wheezy-slim
-ENV DEBIAN_FRONTEND noninteractive
-RUN echo 'deb http://archive.debian.org/debian/ wheezy main' > /etc/apt/sources.list
-RUN echo 'deb http://archive.debian.org/debian-security/ wheezy/updates main' >> /etc/apt/sources.list
-RUN apt-get -y update -o Acquire::Check-Valid-Until=false
-RUN apt-get -y upgrade
-RUN apt-get -y install \
- build-essential \
- flex \
- bison \
- autoconf \
- ncurses-dev \
- libreadline-dev
+++ /dev/null
-FROM debian:jessie-slim
-ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
-RUN apt-get -y update
-RUN apt-get -y upgrade
-RUN apt-get -y install \
- build-essential \
- flex \
- bison \
- autoconf \
- ncurses-dev \
- libreadline-dev
+++ /dev/null
-FROM i386/debian:jessie-slim
-ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
-RUN apt-get -y update
-RUN apt-get -y upgrade
-RUN apt-get -y install \
- build-essential \
- flex \
- bison \
- autoconf \
- ncurses-dev \
- libreadline-dev
+# bump number for image rebuild: 0
FROM debian:testing-slim
ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y upgrade
-RUN apt-get -y install \
+RUN apt-get -y --no-install-recommends install \
build-essential \
flex \
bison \
autoconf \
ncurses-dev \
- libreadline-dev
+ libreadline-dev \
+ libssh-dev \
+ linuxdoc-tools-latex \
+ texlive-latex-extra \
+ opensp \
+ docbook-xsl \
+ xsltproc
+RUN apt-get -y --no-install-recommends install \
+ git \
+ dpkg-dev \
+ debhelper \
+ apt-utils \
+ quilt \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-venv
+# bump number for image rebuild: 0
FROM i386/debian:testing-slim
ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y upgrade
-RUN apt-get -y install \
+RUN apt-get -y --no-install-recommends install \
build-essential \
flex \
bison \
autoconf \
ncurses-dev \
- libreadline-dev
+ libreadline-dev \
+ libssh-dev \
+ linuxdoc-tools-latex \
+ texlive-latex-extra \
+ opensp \
+ docbook-xsl \
+ xsltproc
+RUN apt-get -y --no-install-recommends install \
+ git \
+ dpkg-dev \
+ debhelper \
+ apt-utils \
+ quilt \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-venv
--- /dev/null
+# bump this to recreate the image: 2
+FROM debian:bookworm-slim
+ENV DEBIAN_FRONTEND=noninteractive
+RUN apt-get -y update
+RUN apt-get -y upgrade
+RUN apt-get -y --no-install-recommends install \
+ build-essential \
+ flex \
+ bison \
+ autoconf \
+ git \
+ pandoc \
+ ncurses-dev \
+ libreadline-dev \
+ libssh-gcrypt-dev \
+ linuxdoc-tools-latex \
+ texlive-latex-extra \
+ groff \
+ opensp \
+ docbook-xsl \
+ xsltproc
+RUN apt-get -y --no-install-recommends install \
+ dpkg-dev \
+ debhelper \
+ apt-utils \
+ quilt \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-venv
+++ /dev/null
-FROM fedora:25
-RUN dnf -y upgrade
-RUN dnf -y install \
- make \
- autoconf \
- flex \
- bison \
- pkgconfig \
- 'readline-devel' \
- 'pkgconfig(ncurses)' \
- gcc
+++ /dev/null
-FROM fedora:26
-RUN dnf -y upgrade
-RUN dnf -y install \
- make \
- autoconf \
- flex \
- bison \
- pkgconfig \
- 'readline-devel' \
- 'pkgconfig(ncurses)' \
- gcc
+++ /dev/null
-FROM fedora:27
-RUN dnf -y upgrade
-RUN dnf -y install \
- make \
- autoconf \
- flex \
- bison \
- pkgconfig \
- 'readline-devel' \
- 'pkgconfig(ncurses)' \
- gcc
+++ /dev/null
-FROM fedora:28
-RUN dnf -y upgrade
-RUN dnf -y install \
- make \
- autoconf \
- flex \
- bison \
- pkgconfig \
- 'readline-devel' \
- 'pkgconfig(ncurses)' \
- gcc
+++ /dev/null
-FROM fedora:29
-RUN dnf -y upgrade
-RUN dnf -y install \
- make \
- autoconf \
- flex \
- bison \
- pkgconfig \
- 'readline-devel' \
- 'pkgconfig(ncurses)' \
- gcc
+# bump number for image rebuild: 0
FROM fedora:32
-RUN dnf -y update
+RUN dnf -y upgrade
RUN dnf -y install \
gcc \
make \
flex \
bison \
autoconf \
+ pkgconfig \
libssh-devel \
ncurses-devel \
readline-devel
+# bump number for image rebuild: 0
FROM fedora:33
RUN dnf -y upgrade
RUN dnf -y install \
flex \
bison \
autoconf \
+ pkgconfig \
libssh-devel \
ncurses-devel \
readline-devel
+# bump number for image rebuild: 0
FROM fedora:34
RUN dnf -y upgrade
RUN dnf -y install \
flex \
bison \
autoconf \
+ pkgconfig \
libssh-devel \
ncurses-devel \
readline-devel
-FROM fedora:30
-RUN dnf -y update
+# bump number for image rebuild: 0
+FROM fedora:35
+RUN dnf -y upgrade
RUN dnf -y install \
gcc \
make \
flex \
bison \
autoconf \
+ pkgconfig \
libssh-devel \
ncurses-devel \
readline-devel
-FROM fedora:31
-RUN dnf -y update
+# bump number for image rebuild: 0
+FROM fedora:36
+RUN dnf -y upgrade
RUN dnf -y install \
gcc \
make \
flex \
bison \
autoconf \
+ pkgconfig \
libssh-devel \
ncurses-devel \
readline-devel
--- /dev/null
+# bump number for image rebuild: 0
+FROM fedora:37
+RUN dnf -y upgrade
+RUN dnf -y install \
+ gcc \
+ make \
+ flex \
+ bison \
+ autoconf \
+ pkgconfig \
+ libssh-devel \
+ ncurses-devel \
+ readline-devel
+RUN dnf -y install \
+ git \
+ rpm-build \
+ systemd-rpm-macros \
+ python3 \
+ python3-pip \
+ python3-setuptools
--- /dev/null
+# bump number for image rebuild: 0
+FROM fedora:38
+RUN dnf -y upgrade
+RUN dnf -y install \
+ gcc \
+ make \
+ flex \
+ bison \
+ autoconf \
+ pkgconfig \
+ libssh-devel \
+ ncurses-devel \
+ readline-devel
+RUN dnf -y install \
+ git \
+ rpm-build \
+ systemd-rpm-macros \
+ python3 \
+ python3-pip \
+ python3-setuptools
--- /dev/null
+# bump number for image rebuild: 0
+FROM fedora:39
+RUN dnf -y upgrade
+RUN dnf -y install \
+ gcc \
+ make \
+ flex \
+ bison \
+ autoconf \
+ pkgconfig \
+ libssh-devel \
+ ncurses-devel \
+ readline-devel
+RUN dnf -y install \
+ git \
+ rpm-build \
+ systemd-rpm-macros \
+ python3 \
+ python3-pip \
+ python3-setuptools
--- /dev/null
+# bump number for image rebuild: 0
+FROM fedora:40
+RUN dnf -y upgrade
+RUN dnf -y install \
+ gcc \
+ make \
+ flex \
+ bison \
+ autoconf \
+ pkgconfig \
+ libssh-devel \
+ ncurses-devel \
+ readline-devel
+RUN dnf -y install \
+ git \
+ rpm-build \
+ systemd-rpm-macros \
+ python3 \
+ python3-pip \
+ python3-setuptools
--- /dev/null
+# bump number for image rebuild: 0
+FROM fedora:41
+RUN dnf -y upgrade
+RUN dnf -y install \
+ gcc \
+ make \
+ flex \
+ bison \
+ autoconf \
+ pkgconfig \
+ libssh-devel \
+ ncurses-devel \
+ readline-devel
+RUN dnf -y install \
+ git \
+ rpm-build \
+ systemd-rpm-macros \
+ python3 \
+ python3-pip \
+ python3-setuptools
--- /dev/null
+# bump number for image rebuild: 0
+FROM fedora:42
+RUN dnf -y upgrade
+RUN dnf -y install \
+ gcc \
+ make \
+ flex \
+ bison \
+ autoconf \
+ pkgconfig \
+ libssh-devel \
+ ncurses-devel \
+ readline-devel
+RUN dnf -y install \
+ git \
+ rpm-build \
+ systemd-rpm-macros \
+ python3 \
+ python3-pip \
+ python3-setuptools
+# bump number for image rebuild: 0
FROM opensuse/leap:15.0
RUN zypper -n up
RUN zypper -n install \
- autoconf \
+ gcc \
+ make \
flex \
bison \
+ autoconf \
pkgconfig \
- readline-devel \
+ libssh-devel \
ncurses-devel \
- gcc \
- gmake
+ readline-devel
+RUN zypper -n install \
+ git \
+ rpm-build \
+ systemd \
+ systemd-rpm-macros \
+ python3 \
+ python3-pip \
+ python3-setuptools
+# bump number for image rebuild: 0
FROM opensuse/leap:15.1
RUN zypper -n up
RUN zypper -n install \
flex \
bison \
autoconf \
+ pkgconfig \
libssh-devel \
ncurses-devel \
readline-devel
+# bump number for image rebuild: 0
FROM opensuse/leap:15.2
RUN zypper -n up
RUN zypper -n install \
flex \
bison \
autoconf \
+ pkgconfig \
libssh-devel \
ncurses-devel \
readline-devel
+# bump number for image rebuild: 0
FROM opensuse/leap:15.3
RUN zypper -n up
RUN zypper -n install \
flex \
bison \
autoconf \
+ pkgconfig \
libssh-devel \
ncurses-devel \
readline-devel
--- /dev/null
+# bump number for image rebuild: 1
+FROM opensuse/leap:15.4
+RUN zypper -n up
+RUN zypper -n install \
+ gcc \
+ make \
+ flex \
+ bison \
+ autoconf \
+ pkgconfig \
+ libssh-devel \
+ ncurses-devel \
+ readline-devel
+RUN zypper -n install \
+ git \
+ rpm-build \
+ systemd \
+ systemd-rpm-macros \
+ python3 \
+ python3-pip \
+ python3-setuptools
--- /dev/null
+# bump number for image rebuild: 0
+FROM opensuse/leap:15.5
+RUN zypper -n up
+RUN zypper -n install \
+ gcc \
+ make \
+ flex \
+ bison \
+ autoconf \
+ pkgconfig \
+ libssh-devel \
+ ncurses-devel \
+ readline-devel
+RUN zypper -n install \
+ git \
+ rpm-build \
+ systemd \
+ systemd-rpm-macros \
+ python3 \
+ python3-pip \
+ python3-setuptools
+++ /dev/null
-FROM ubuntu:14.04
-ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
-RUN apt-get -y update
-RUN apt-get -y upgrade
-RUN apt-get -y install \
- build-essential \
- flex \
- bison \
- autoconf \
- ncurses-dev \
- libreadline-dev
+++ /dev/null
-FROM ubuntu:16.04
-ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
-RUN apt-get -y update
-RUN apt-get -y upgrade
-RUN apt-get -y install \
- build-essential \
- flex \
- bison \
- autoconf \
- ncurses-dev \
- libreadline-dev
+# bump number for image rebuild: 0
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y upgrade
-RUN apt-get -y install \
+RUN apt-get -y --no-install-recommends install \
+ tzdata \
build-essential \
flex \
bison \
opensp \
docbook-xsl \
xsltproc
-RUN apt-get -y install \
+RUN apt-get -y --no-install-recommends install \
git \
dpkg-dev \
debhelper \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
+# bump number for image rebuild: 0
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y upgrade
-RUN apt-get -y install \
+RUN apt-get -y --no-install-recommends install \
+ tzdata \
build-essential \
flex \
bison \
opensp \
docbook-xsl \
xsltproc
-RUN apt-get -y install \
+RUN apt-get -y --no-install-recommends install \
git \
dpkg-dev \
debhelper \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
-FROM ubuntu:21.10
+# bump this to refresh the image: 1
+FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y --no-install-recommends install \
opensp \
docbook-xsl \
xsltproc
-RUN apt-get -y install \
+RUN apt-get -y --no-install-recommends install \
git \
dpkg-dev \
debhelper \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
-FROM ubuntu:21.04
+# bump this to refresh the image: 1
+FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
-RUN sed -i 's/deb.debian.org/ftp.cz.debian.org/' /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y upgrade
-RUN apt-get -y install \
+RUN apt-get -y --no-install-recommends install \
+ tzdata \
build-essential \
flex \
bison \
opensp \
docbook-xsl \
xsltproc
-RUN apt-get -y install \
+RUN apt-get -y --no-install-recommends install \
git \
dpkg-dev \
debhelper \
quilt \
python3 \
python3-pip \
- python3-setuptools
+ python3-setuptools \
+ python3-venv
--- /dev/null
+# bump this to refresh the image: 1
+FROM ubuntu:24.10
+ENV DEBIAN_FRONTEND=noninteractive
+RUN apt-get -y update
+RUN apt-get -y upgrade
+RUN apt-get -y --no-install-recommends install \
+ tzdata \
+ build-essential \
+ flex \
+ bison \
+ autoconf \
+ ncurses-dev \
+ libreadline-dev \
+ libssh-gcrypt-dev \
+ linuxdoc-tools-latex \
+ texlive-latex-extra \
+ opensp \
+ docbook-xsl \
+ xsltproc
+RUN apt-get -y --no-install-recommends install \
+ git \
+ dpkg-dev \
+ debhelper \
+ apt-utils \
+ quilt \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-venv
--- /dev/null
+distros:
+ # CentOS 7 with quite some hacks
+ - name: centos-7-amd64
+ variables:
+ LC_ALL: en_US.UTF-8
+ CC: /opt/rh/devtoolset-8/root/usr/bin/gcc
+ type: pkg-rpm-wa
+
+ {% for name in (
+ 'centos-8',
+ 'fedora-32',
+ 'fedora-33',
+ ) -%}
+ - name: {{ name }}-amd64
+ type: pkg-rpm-wa
+ {% endfor %}
+
+ # For some unknown reason we also require older Python packages
+ # for OpenSUSE even with the recent versions.
+ {% for num in (0,1,2,3,4,5) -%}
+ - name: opensuse-15.{{ num }}-amd64
+ type: pkg-rpm-wa
+ {% endfor %}
+
+ # Fedora regular builds
+ {% for num in (34, 35, 36, 37, 38, 39, 40, 41, 42) -%}
+ - name: fedora-{{ num }}-amd64
+ type: pkg-rpm
+ {% endfor %}
+
+ # Ubuntu legacy build
+ - name: ubuntu-18.04-amd64
+ type: pkg-deb-legacy
+
+ # Debian regular builds
+ {% for num in (10, 11, 12, 'testing') -%}
+ {% for arch in ('amd64', 'i386') -%}
+ - name: debian-{{num}}-{{arch}}
+ type: pkg-deb
+ {% endfor %}
+ {% endfor %}
+
+ # Ubuntu regular builds
+ {% for num in ('20.04', '22.04', '24.04', '24.10') -%}
+ - name: ubuntu-{{ num }}-amd64
+ type: pkg-deb
+ {% endfor %}
+
+birdlab:
+ - name: openbsd-75
+ variables:
+ AUTOCONF_VERSION: "2.71"
+
+ - name: openbsd-76
+ variables:
+ AUTOCONF_VERSION: "2.72"
+
+ {% for num in ("09", "10") -%}
+ - name: netbsd-{{ num }}
+ {% endfor %}
+
+ {% for num in (13, 14) -%}
+ - name: freebsd-{{ num }}
+ - name: freebsd-{{ num }}-netlink
+ dist: freebsd-{{ num }}
+ variables:
+ CONFIGURE_OPTIONS: --with-sysconfig=bsd-netlink --disable-client
+ {% endfor %}
+
+partial_build_image:
+ name: debian-12-amd64
+
+partial_build:
+ - protocols: aggregator
+ - protocols: babel
+ - protocols: bfd
+ - protocols: bgp
+ - protocols: bgp,bmp
+ - protocols: l3vpn
+ - protocols: mrt
+ - protocols: ospf
+ - protocols: pipe
+ - protocols: radv
+ - protocols: rip
+ - protocols: rpki
+ - protocols: static
+
+netlab:
+ - name: babel-base
+ - name: babel-auth
+ - name: ospf-base
+ - name: ospf-default
+ - name: ospf-priority
+ - name: ospf-nbma
+ - name: ospf-ptmp
+ - name: ospf-authentication
+ - name: ospf-bfd
+ - name: ospf-custom
+ - name: ospf-area
+ - name: ospf-vrf
+ - name: bgp-base
+ - name: bgp-auth
+ - name: bgp-int
+ - name: bgp-merged
+ - name: bgp-flowspec
+ - name: bgp-rs-multitab
+ - name: bgp-rs-singletab
+ - name: ebgp-graceful
+ - name: ebgp-loop
+ - name: ebgp-star
+ - name: ebgp-role
+ - name: ebgp-import-limit
+ - name: ibgp-loop
+ - name: ibgp-loop-big
+ - name: ibgp-flat
+ - name: rip-base
+ - name: kernel-learn
+ - name: mpls-bgp
+ - name: mpls-bgp-l3vpn
--- /dev/null
+#!/usr/bin/env python3
+
+import importlib
+import jinja2
+import pathlib
+import subprocess
+import sys
+import yaml
+
+# Find where we are
+localdir = pathlib.Path(__file__).parent
+
+# Prepare Jinja2 environment
+env = jinja2.Environment(loader=jinja2.FileSystemLoader(str(localdir)))
+env.filters.update({ "to_yaml": lambda x: "" if type(x) is jinja2.runtime.Undefined else yaml.dump(x).rstrip() })
+
+# Load and process input data
+try:
+ data = yaml.safe_load(rendered := env.get_template(f'data.yml.j2').render({}))
+except yaml.parser.ParserError as e:
+ print("Failed to render input data, generated output here:")
+ print(rendered)
+ raise e
+
+# Load the actual template
+template = env.get_template(f'template.yml.j2')
+
+# Render the template
+final = template.render({ **data })
+
+# YAML is picky about tabs, forbid them
+assert('\t' not in final)
+
+# Produce output
+print(final)
--- /dev/null
+###########################################################
+##### #####
+##### DO NOT EDIT THIS FILE BY HAND #####
+##### #####
+###########################################################
+##### #####
+##### This file is autogenerated from misc/gitlab/. #####
+##### Edit those files and run `make gitlab` instead. #####
+##### #####
+###########################################################
+
+variables:
+ DEBIAN_FRONTEND: noninteractive
+ LC_ALL: C.UTF-8
+ GIT_STRATEGY: fetch
+ DOCKER_CMD: docker --config="$HOME/.docker/$CI_JOB_ID/"
+ IMG_BASE: registry.nic.cz/labs/bird
+ TOOLS_DIR: /home/gitlab-runner/bird-tools
+ STAYRTR_BINARY: /usr/bin/stayrtr
+
+stages:
+ - consistency
+ - image
+ - build
+ - pkg
+ - test
+
+## Common rules
+# Ignore WIP commits
+.never-wip: &never-wip
+ if: $CI_COMMIT_MESSAGE =~ /^(fixup! )*WIP/
+ when: never
+# Run for stable branches
+.if-stable: &if-stable
+ if: $CI_COMMIT_BRANCH =~ /^(stable-.*|thread-next|master)$/
+ when: always
+# Do run for tags
+.if-tag: &if-tag
+ if: $CI_COMMIT_TAG
+ when: always
+# Never run for tags
+.never-tag: &never-tag
+ if: $CI_COMMIT_TAG
+ when: never
+
+## Consistency checks for stable branches
+commit-messages:
+ stage: consistency
+ image: registry.nic.cz/labs/bird:docbuilder
+ script:
+ - tools/git-check-commits
+ rules:
+ - *if-stable
+ - when: never
+
+## Tag check
+tag-collect:
+ stage: consistency
+ image: registry.nic.cz/labs/bird:docbuilder
+ script:
+ - python3 -m venv venv
+ - . venv/bin/activate
+ - pip3 install requests
+ - tools/git-check-tag-local $CI_COMMIT_TAG
+ - tools/git-check-tag-ci $CI_COMMIT_SHA
+ artifacts:
+ paths:
+ - obj/doc/bird-singlepage.html
+ - bird-*.tar.gz
+ - pkg/pkgs/*
+ - pkg/srcpkgs/*
+ rules:
+ - *if-tag
+ - when: never
+
+## Default test job rules
+.test-job: &test-job
+ rules:
+ - *never-wip
+ - *never-tag
+ - when: always
+
+############################
+## Docker builder rebuild ##
+############################
+# We are running all the build / packaging tests in Dockers (unless otherwise)
+# and these are rules to build these docker images. These are expensive to run
+# and should run only if needed.
+#
+# Modify the appropriate dockerfile to rebuild these images
+
+.docker: &docker-build
+ stage: image
+ script:
+ - $DOCKER_CMD login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.nic.cz
+ # Make sure we refresh the base image if it updates (eg. security updates, etc)
+ # If we do just the build, cache is always reused and the freshness of the
+ # base image is never checked. However, pull always asks and updates the
+ # image only if it changed ‒ therefore, the cache is used unless there's a
+ # change.
+ - $DOCKER_CMD pull `sed -ne 's/^FROM //p' "misc/docker/$IMG_NAME/Dockerfile"`
+ - $DOCKER_CMD build -t "bird:$IMG_NAME" "misc/docker/$IMG_NAME"
+ - $DOCKER_CMD tag "bird:$IMG_NAME" "$IMG_BASE:$IMG_NAME"
+ - $DOCKER_CMD push "$IMG_BASE:$IMG_NAME"
+ after_script:
+ - rm -f "$HOME/.docker/$CI_JOB_ID/" # cleanup the credentials
+ tags:
+ # That's Docker in Docker
+ - dind
+ rules:
+ # Never rebuild for WIP commits
+ - *never-wip
+
+ # Never rebuild for tags
+ - if: '$CI_COMMIT_TAG'
+ when: never
+
+ # Never rebuild for new branches
+ - if: $CI_COMMIT_BEFORE_SHA == "0000000000000000000000000000000000000000"
+ when: never
+
+ # Do any change in Dockerfile (e.g. change a comment) to rebuild the image
+ # FIXME: This probably belongs to bird-tools instead, we may end up with
+ # screwed up docker repository in case of colliding image updates
+ - changes:
+ - misc/docker/$IMG_NAME/Dockerfile
+ when: always
+
+ - when: never
+
+{% for docker in [ { "name": "docbuilder" } ] + distros %}
+docker-{{ docker["name"] }}:
+ variables:
+ IMG_NAME: "{{ docker["name"] }}"
+ <<: *docker-build
+{% endfor %}
+
+#####################################################
+## Linux distro build tests inside Docker builders ##
+#####################################################
+
+## Build stage
+#
+# Now we compile and run unit tests ... in every single distribution.
+# Every task needs its docker, see above.
+
+.build: &build-base
+ <<: *test-job
+ stage: build
+ script:
+ - export BRANCH=$CI_COMMIT_BRANCH
+ - tools/version && ( echo -n "BIRD version "; tools/version ) > version-expected
+ - |
+ STABLE_VERSION="`cat VERSION`"
+ if [ "$CI_COMMIT_MESSAGE" == "NEWS and version update
+ " ]; then
+ if [ "${STABLE_VERSION}" == "`tools/version`" ]; then
+ echo "Stable version precheck OK"
+ else
+ echo "Stable version discrepancy: $STABLE_VERSION vs. $(tools/version)"
+ exit 1
+ fi
+ else
+ if grep -qF "BIRD version ${STABLE_VERSION}+branch" version-expected; then
+ true
+ else
+ echo -n "Commit $CI_COMMIT_SHA message $CI_COMMIT_MESSAGE expects version "
+ cat version-expected
+ exit 1
+ fi
+ fi
+ - autoreconf
+ - ./configure CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" $CONFIGURE_OPTIONS
+ # Detect which make is available
+ - MAKE=make
+ - which gmake 2>/dev/null >/dev/null && MAKE=gmake
+ - $MAKE
+ - $MAKE check
+ # Build docs when tools are available
+ - if which linuxdoc pdflatex sgmlsasp >/dev/null ; then $MAKE docs ; fi
+ # Check that the reported version is the right one
+ - ./bird --version |& tee obj/version-built
+ - diff obj/version-built version-expected
+
+.build-docker-linux-amd64: &build-docker-linux-amd64
+ <<: *build-base
+ tags:
+ - docker
+ - linux
+ - amd64
+
+{% for dist in distros %}
+build-{{dist["name"]}}:
+ <<: *build-docker-linux-amd64
+ needs:
+ - job: docker-{{ dist["name"] }}
+ optional: true
+ image: registry.nic.cz/labs/bird:{{ dist["name"] }}
+{%- if 'variables' in dist %}
+ variables:
+{{ dist["variables"] | to_yaml | indent(4, true) }}
+{%- endif %}
+{% endfor %}
+
+#######################################################
+## A special task for preparing the release archives ##
+#######################################################
+build-release:
+ <<: *test-job
+ image: registry.nic.cz/labs/bird:docbuilder
+ needs:
+ - job: docker-docbuilder
+ optional: true
+ stage: build
+ tags:
+ - docker
+ - linux
+ script:
+ - export BRANCH=$CI_COMMIT_BRANCH
+ - autoreconf
+ - ./configure --with-protocols= --disable-client
+ - make obj/doc/bird-singlepage.html
+ - tools/make-archive
+ artifacts:
+ paths:
+ - obj/doc/bird-singlepage.html
+ - bird-*.tar.gz
+ expire_in: 1 day
+
+# Packaging rules
+# As we support some ancient versions of different distributions,
+# we need to keep several different machineries. It's not so bad
+# but it's bad nevertheless.
+#
+# We do NOT build separate documentation packages in these rules.
+
+.pkg-deb: &pkg-deb
+ <<: *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
+ #- apkg install -y pkg/pkgs/*/*/*.deb
+ artifacts:
+ paths:
+ - pkg/pkgs/*
+ - pkg/srcpkgs/*
+
+.pkg-deb-legacy: &pkg-deb-legacy
+ <<: *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 apkg
+ - apkg build -a bird-$(cat VERSION)*.tar.gz
+ #- apkg install -y pkg/pkgs/*/*/*.deb
+ artifacts:
+ paths:
+ - pkg/pkgs/*
+ - pkg/srcpkgs/*
+
+.pkg-rpm: &pkg-rpm
+ <<: *test-job
+ stage: pkg
+ script:
+ - pip3 install apkg
+ - apkg build -a bird-$(cat VERSION)*.tar.gz
+ #- apkg install -y pkg/pkgs/*/*/*.rpm
+ artifacts:
+ paths:
+ - pkg/pkgs/*
+ - pkg/srcpkgs/*
+
+.pkg-rpm-wa: &pkg-rpm-wa
+ <<: *test-job
+ stage: pkg
+ script:
+ - sed -i "s/runstatedir/with-runtimedir/" distro/pkg/rpm/bird.spec
+ # install older version of bs4 that does not use python version >= 3.6
+ - pip3 install beautifulsoup4==4.11.2
+ - pip3 install apkg
+ - apkg build -a bird-$(cat VERSION)*.tar.gz
+ #- apkg install -y pkg/pkgs/*/*/*.rpm
+ artifacts:
+ paths:
+ - pkg/pkgs/*
+ - pkg/srcpkgs/*
+
+
+{% for dist in distros %}
+pkg-{{ dist["name"] }}:
+ <<: *{{ dist["type"] }}
+ needs:
+ - job: build-{{ dist["name"] }}
+ artifacts: false
+ - job: build-release
+ image: registry.nic.cz/labs/bird:{{ dist["name"] }}
+{%- if 'variables' in dist %}
+ variables:
+{{ dist["variables"] | to_yaml | indent(4, true) }}
+{%- endif %}
+{% endfor %}
+
+###################################
+## Non-linux build tests in QEMU ##
+###################################
+.build-birdlab-base: &build-birdlab-base
+ <<: *build-base
+ stage: build
+# script:
+# - export BRANCH=$CI_COMMIT_BRANCH
+# - autoreconf
+# - ./configure $CONFIGURE_OPTIONS
+# - gmake
+# - gmake check
+
+{% for test in birdlab %}
+build-birdlab-{{ test['name'] }}:
+ <<: *build-birdlab-base
+{%- if 'variables' in test %}
+ variables:
+{{ test['variables'] | to_yaml | indent(4, true) }}{%- endif %}
+ tags:
+ - birdlab-{{ test['dist'] if 'dist' in test else test['name'] }}
+ - amd64
+{% endfor %}
+
+#########################
+## Partial build tests ##
+#########################
+
+.build-only: &build-only
+ <<: *build-docker-linux-amd64
+ image: registry.nic.cz/labs/bird:{{ partial_build_image["name"] }}
+ needs:
+ - job: docker-{{ partial_build_image["name"] }}
+ optional: true
+
+{% for test in partial_build %}
+partial-build-linux-{{ test["protocols"] }}:
+ <<: *build-only
+ variables:
+ CONFIGURE_OPTIONS: --with-protocols={{ test["protocols"] }}
+{% endfor %}
+
+################################
+## Netlab functionality tests ##
+################################
+
+build-netlab:
+ <<: *test-job
+ stage: build
+ variables:
+ BDIR: build-netlab
+ tags:
+ - netlab
+ - amd64
+ script:
+ - autoreconf
+ - mkdir $BDIR
+ - cd $BDIR
+ - ../configure
+ - BRANCH=$CI_COMMIT_BRANCH make
+ artifacts:
+ paths:
+ - $BDIR/bird
+ - $BDIR/birdc
+ expire_in: 2 hours
+
+.netlab-test: &test-base
+ <<: *test-job
+ stage: test
+ needs: [build-netlab]
+ tags:
+ - netlab
+ - amd64
+ script:
+ - DIR=$(pwd)
+ - cd $TOOLS_DIR
+ - sudo git clean -fx
+ - git pull --ff-only
+ - "mv $DIR/build-netlab/* netlab/common/"
+ - ln -s $STAYRTR_BINARY netlab/common/stayrtr
+ - cd netlab
+ - sudo ./stop
+ - sudo ./runtest -s v3 -m check $TEST_NAME
+
+{% for test in netlab %}
+test-{{ test["name"] }}:
+ <<: *test-base
+ variables:
+ TEST_NAME: cf-{{ test["name"] }}
+{% endfor %}
#ifndef _BIRD_CONFIG_H_
#define _BIRD_CONFIG_H_
-#define XSTR2(X) #X
-#define XSTR1(X) XSTR2(X)
-
/* BIRD version */
-#ifdef GIT_LABEL
-#define BIRD_VERSION XSTR1(GIT_LABEL)
-#else
-#define BIRD_VERSION "3.0.2"
+#ifndef BIRD_VERSION
+#error "BIRD_VERSION not defined"
#endif
+/* ... is a string literal at least of 4 characters */
+_Static_assert(sizeof(BIRD_VERSION) >= 4, BIRD_VERSION);
+_Static_assert(sizeof(BIRD_VERSION "") == sizeof(BIRD_VERSION), BIRD_VERSION);
+
/* Include parameters determined by configure script */
#include "sysdep/autoconf.h"
# (c) 2005--2022 Ondrej Filip <feela@network.cz>
#
-VERSION=`grep 'BIRD_VERSION \"' sysdep/config.h | sed '/BIRD_VERSION/!d;s/^.*"\(.*\)"$/\1/'`
+#VERSION=`grep 'BIRD_VERSION \"' sysdep/config.h | sed '/BIRD_VERSION/!d;s/^.*"\(.*\)"$/\1/'`
+VERSION=`tools/version`
REL=bird-$VERSION
DREL=bird-doc-$VERSION
T=/tmp/bird
rm -rf autom4te*cache
echo Building $REL
cp -a . $T/$REL
+sed -i 's/^VERSION := .*/VERSION := '${VERSION}'/' $T/$REL/Makefile.in
echo Generating ChangeLog
git log >$T/$REL/ChangeLog
rm -f $T/$REL/bird.conf*
--- /dev/null
+#!/bin/sh
+
+git log --oneline | awk \
+ '{
+ # Ignore two fixups deeply buried inside the history
+ if (index("a54f75f454b7ed8c8ff2c1787a506528f22cbae7", $1) == 1)
+ next;
+ if (index("bea582cbb53e30dd32a5b6829c7443e0e5558d11", $1) == 1)
+ next;
+
+ # Complain about fixups and WIPs
+ if ((index($2, "fixup!") == 1) || (index($2, "WIP") == 1))
+ {
+ if (!bad) print "Branch contains unfinished work!"
+ bad = 1
+ print
+ }
+ }
+ END { if (bad) exit 1 }'
--- /dev/null
+#!/usr/bin/env python3
+
+import io
+import json
+import requests
+import sys
+import zipfile
+
+def load_api_request(name, query):
+ timeout = 5
+ while True:
+ resp = requests.get("https://gitlab.nic.cz/api/v4/projects/labs%2Fbird/" + query)
+ if resp.status_code == 200:
+ return resp.content
+
+ if resp.status_code == 429:
+ print(f"Too many requests for {name}, waiting {timeout} sec")
+ time.sleep(timeout)
+ timeout = int(1.6 * timeout)
+ continue
+
+ raise Exception(f"Failed to load {name} at {query} with code {resp.status_code}: {resp.content}")
+
+def load_paginated(name, query, per_page=100):
+ if query[-1] in "?&":
+ joiner = ""
+ elif "?" in query:
+ joiner = "&"
+ else:
+ joiner = "?"
+
+ output = []
+ pageno = 1
+ while True:
+ p = load_api_request(f"{name} page {pageno}", f"{query}{joiner}per_page={per_page}&page={pageno}")
+ output += (new := json.loads(p))
+ if len(new) < per_page:
+ return output
+
+ pageno += 1
+
+def load_pipelines(sha):
+ return load_paginated("pipelines", f"/pipelines/?sha={sha}")
+
+def load_jobs(pipeline):
+ return load_paginated("jobs", f"/pipelines/{pipeline}/jobs/")
+
+for p in load_pipelines(sys.argv[1]):
+ if p['status'] in ("failed", "cancelled"):
+ print(f"Pipeline {p['id']} {p['status']} at {p['web_url']}")
+ failed = [ job for job in load_jobs(p['id']) if job['status'] == "failed" ]
+ if len(failed) > 0:
+ print(f"\tFailed jobs:")
+ for job in failed:
+ print(f"\t\t{job['name']}")
+ else:
+ print(f"\tNo failed jobs, check gitlab")
+ print()
+ continue
+
+ if p['status'] in ("created", "pending", "running"):
+ print(f"Pipeline {p['id']} has not finished yet: {p['status']}")
+ states = {}
+
+ for job in load_jobs(p['id']):
+ if job['status'] not in states:
+ states[job['status']] = []
+ states[job['status']].append(job)
+
+ for s in states:
+ print(f"\tJobs {s}:")
+ for j in states[s]:
+ print(f"\t\t{j['name']} ({j['id']})")
+
+ continue
+
+ if p['status'] == "success":
+ print(f"Pipeline {p['id']} successful, collecting artifacts")
+ for job in load_jobs(p['id']):
+ if len(job['artifacts']) > 0:
+ print(f"\t{ job['name'] }:")
+ for f in job['artifacts']:
+ if f['file_type'] == 'archive':
+ with zipfile.ZipFile(io.BytesIO(load_api_request("metadata", f"/jobs/{job['id']}/artifacts/"))) as z:
+ z.extractall()
+ exit(0)
+
+print("No suitable pipeline found, tag not OK")
+exit(1)
--- /dev/null
+#!/bin/bash
+
+# Enforce clean repository (it's release time)
+if [ $(git status --porcelain -uno | wc -l) != "0" ]; then
+ echo "Dirty repository, commit or stash!"
+ exit 1
+fi
+
+# Is the current commit a release commit?
+read COMMIT MESSAGE <<< "$(git show -s --oneline --no-decorate --no-abbrev-commit)"
+
+if [ "$MESSAGE" != "NEWS and version update" ]; then
+ echo "This is not a release commit: $COMMIT $MESSAGE"
+ exit 1
+fi
+
+# Are we checking an existing tag?
+if [ -n "$1" ]; then
+ read TAG_COMMIT _ <<< "$(git show -s --oneline --no-abbrev-commit "$1" | grep NEWS)"
+ if [ "$TAG_COMMIT" != "$COMMIT" ]; then
+ echo "Tag $1 not checked out"
+ exit 1
+ fi
+
+ if [ "v$(<VERSION)" != "$1" ]; then
+ echo "Version discrepancy"
+ echo -n "VERSION file: "; cat VERSION
+ echo "Tag: $1"
+ exit 1
+ fi
+fi
+
+# Locally done, report
+echo "Tag locally OK"
--- /dev/null
+#!/bin/bash
+
+case "$1" in
+ master | thread-next | stable-* )
+ exit 0;
+esac
+
+exit 1
--- /dev/null
+#!/bin/bash
+#
+# Generate BIRD distribution tgz
+#
+# (c) 2025 CZ.NIC
+#
+# Based on an older script by Martin Mares and Ondrej Filip
+# and another one by Jakub Ruzicka and Ondrej Zajicek
+
+set -e
+
+# Gather all required information
+VERSION="$($(dirname $0)/version | sed 's/^v//')"
+
+SRCPKG="bird-${VERSION}"
+DOCPKG="bird-doc-${VERSION}"
+
+if [ -z "$ARCHIVE_DOCS" ]; then
+ ARCHIVE_DOCS=true
+fi
+
+# Check that we are running on a clean repository
+if ! git diff-index --quiet HEAD || ! git diff-index --cached --quiet HEAD; then
+ echo 'WARNING: git index has uncommitted changes!'
+fi
+
+# Prepare a tempdir
+T=$(mktemp -d)
+function cleanup_tmpdir() {
+ rm -rf $T
+}
+
+trap cleanup_tmpdir EXIT
+
+# Create a preliminary archive
+echo "Building $VERSION"
+git archive --format=tar --prefix="$SRCPKG/" HEAD -o $T/initial.tgz
+
+# Generate changelog
+echo "Generating changelog"
+mkdir $T/$SRCPKG
+git log > $T/$SRCPKG/ChangeLog
+
+# Unpack the archive
+pushd $T
+ tar xf initial.tgz
+ pushd $SRCPKG
+
+ # Omit historical documents
+ rm -rf rfc doc/slides doc/slt2001 doc/old bird.conf
+
+ # Fix the version string
+ sed -i 's/^VERSION := .*/VERSION := '${VERSION}'/' Makefile.in
+
+ # Run autoconf
+ echo "Running autoreconf"
+ autoreconf -i
+ rm -rf autom4te*cache
+
+ popd
+
+ # Pack sources
+ echo "Packing source package"
+ tar czf $SRCPKG.tar.gz $SRCPKG
+
+ if $ARCHIVE_DOCS; then
+ # Generate documentation
+ pushd $SRCPKG
+ echo "Creating documentation"
+ (./configure --with-protocols= --disable-client && make docs) > build.log 2>build.err || (
+ echo "======== Build log ========"
+ cat build.log
+ echo "======== Error log ========"
+ cat build.err
+ echo "If you wish to not build documentation, set env ARCHIVE_DOCS=false"
+ false
+ )
+ popd
+
+ mkdir ${DOCPKG}{,/doc}
+ cp $SRCPKG/obj/doc/*.{html,pdf} ${DOCPKG}/doc
+
+ # Pack sources
+ echo "Packing docs package"
+ tar czf $DOCPKG.tar.gz $DOCPKG
+ else
+ echo "Skipping documentation build"
+ fi
+
+popd
+
+if $ARCHIVE_DOCS; then
+ mv $T/$DOCPKG.tar.gz .
+fi
+
+mv $T/$SRCPKG.tar.gz .
+echo $SRCPKG.tar.gz
# This a modified version of gendist script which generates development
# archive (tarball) without docs from current sources.
-BIRD_VERSION=`grep 'BIRD_VERSION \"' sysdep/config.h | sed '/BIRD_VERSION/!d;s/^.*"\(.*\)"$/\1/'`
+BIRD_VERSION=$(bash tools/version)
# differentiate dev tarballs from upstream ones
GIT_HASH=$(git rev-parse --short HEAD )
TIMESTAMP=$(date -u +'%s' 2>/dev/null)
--- /dev/null
+#!/bin/bash
+
+set -e
+
+toplevel=$(readlink -f $(dirname $0)/..)
+current_version=$(<$toplevel/VERSION)
+
+pushd $toplevel > /dev/null
+
+# Enforce clean repository (we are going to commit!)
+if [ $(git status --porcelain -uno | wc -l) != "0" ]; then
+ echo "Dirty repository, commit or stash!"
+ exit 1
+fi
+
+# Enforce no fixups and no WIPs
+tools/git-check-commits
+
+# Compute the new version
+case $1 in
+ patch)
+ new_version=$(awk -F. 'OFS="." { $3+=1; print; }' <<<"$current_version")
+ ;;
+ minor)
+ new_version=$(awk -F. 'OFS="." { $2+=1; if ($1 < 3) print $1,$2; else print $1,$2,0; }' <<<"$current_version")
+ ;;
+ *)
+ echo "Usage: $0 (minor|patch)"
+ echo "Commits the version update commit"
+ exit 2
+esac
+
+file=$(mktemp)
+news=$(mktemp)
+function cleanup() {
+ rm -f $file $news
+}
+trap cleanup EXIT ERR
+
+# Prepare the NEWS file
+echo "## Releasing version $new_version ##" >> $file
+echo -n "########################" >> $file
+sed 's/./#/g' <<<"$new_version" >> $file
+echo >> $file
+news_headline="Version $new_version ($(date +%F))"
+echo $news_headline >> $file
+git log --oneline v$current_version..HEAD | sed -r 's/^([^ ]+) (.*)/# commit \1\n o \2/' >> $file
+echo >> $file
+echo "# Empty the file to cancel the commit." >> $file
+echo "# Do not change the Version header." >> $file
+
+# Edit the NEWS file
+$(git var GIT_EDITOR) $file
+
+# Collect the result
+if ! egrep -v '^(#.*)?$' $file > $news; then
+ echo "Release canceled"
+ exit 1
+fi
+
+# Check whether the result is correct
+if [ "$news_headline" != "$(head -n1 $news)" ]; then
+ echo "Garbled headline, got $(head -n1 $news)"
+ exit 1
+fi
+
+badlines=$(tail -n+2 $news | grep -v '^ [o ] ' | wc -l)
+if [ "$badlines" != 0 ]; then
+ echo "Garbled news file, offending lines:"
+ tail -n+2 $news | grep -v '^ [o ] '
+ exit 1
+fi
+
+# Do the changes in the repository: NEWS, bird.spec and VERSION
+echo >> $news
+cat NEWS >> $news
+mv $news NEWS
+
+sed -i "s/^Version: $current_version\$/Version: $new_version/" misc/bird.spec
+
+echo $new_version > VERSION
+
+# Commit!
+git commit -m "NEWS and version update" -- NEWS VERSION misc/bird.spec
--- /dev/null
+#!/bin/sh
+
+set -e
+
+# Get the release version
+toplevel="$(readlink -f $(dirname $0)/../)"
+RELEASE_VERSION=$(cat "$toplevel/VERSION")
+
+# Not in a git repo, or no git installed.
+if ! git status --porcelain > /dev/null; then
+ echo $RELEASE_VERSION
+ exit 0
+fi
+
+# Check VERSION file updates in uncommitted changes
+if git status --porcelain | grep -q '^...VERSION$'; then
+ echo "WARNING: Version file changed and not committed" >&2
+ echo $RELEASE_VERSION
+ exit 0
+fi
+
+# If clean, check VERSION file updates in the current commit
+if [ $(git status --porcelain -uno | wc -l) = "0" ] && [ $(git show -- VERSION | wc -l) != "0" ]; then
+ echo $RELEASE_VERSION
+ exit 0
+fi
+
+# We'll create a development version number, get the hash
+HASH=$(git rev-parse --short=12 HEAD)
+
+# Find the release
+case "$(git tag -l | grep "^v$RELEASE_VERSION\$" | wc -l | sed -r 's/^ *//;s/ +-//')" in
+ "1") # Already tagged
+ RELEASE_COMMIT=v$RELEASE_VERSION
+ ;;
+ "0") # Not yet tagged
+ RELEASE_COMMIT=$(git log --oneline -- VERSION | sed 's/ .*//')
+ ;;
+ *)
+ echo "ERROR: There are too many matching tags in the repository"
+ git tag -l | grep "^v$RELEASE_VERSION\$"
+ git tag -l | grep "^v$RELEASE_VERSION\$" | wc -l
+ exit 1
+ ;;
+esac
+
+# Add branch info if not passed via command line
+if [ -z "${BRANCH}" ]; then
+ # There is also --show-current but it's too new to be portable.
+ BRANCH=$(git branch | sed -n 's/^[*] //p' | grep -v 'HEAD detached' || true)
+fi
+
+# Found a branch
+if [ -n "$BRANCH" ]; then
+ LENGTH=$(git log --oneline $RELEASE_COMMIT..HEAD | wc -l)
+ echo $RELEASE_VERSION+branch.$(echo $BRANCH | sed 's/[^a-zA-Z0-9]/./g').${HASH}
+ exit 0
+fi
+
+echo $RELEASE_VERSION+detached.${HASH}
+exit 0