pipeline {
  agent none
  stages {
    stage('Build') {
      parallel {
        stage('MacOS') {
          agent { label 'macos' }
          stages {
            stage('autoreconf') {
              steps {
                sh 'autoreconf --force --install'
              }
            }
            stage('configure') {
              steps {
                sh './configure --with-openssl --with-nss --with-p11-kit --with-libical --with-keychain --with-ldns --with-unbound'
              }
            } 
            stage('make') {
              steps {
                sh 'make'
              }
            }
            stage('make dist') {
              steps {
                sh 'make dist'
              }
            }
          }
        }
        stage('RHEL9') {
          agent { label 'rhel-9-x86_64' }
          stages {
            stage('autoreconf') {
              steps {
                sh 'autoreconf --force --install'
              }
            }
            stage('configure') {
              steps {
                sh './configure --with-openssl --with-nss --with-p11-kit --with-libical --with-ldns --with-unbound'
              }
            }
            stage('make') {
              steps {
                sh 'make'
              }
            }
            stage('make dist') {
              steps {
                sh 'make dist'
              }
            }
          }
        }
        stage('FedoraRawhide') {
          agent { label 'fedora-rawhide-x86_64' }
          stages {
            stage('autoreconf') {
              steps {
                sh 'autoreconf --force --install'
              }
            }
            stage('configure') {
              steps {
                sh './configure --with-openssl --with-nss --with-p11-kit --with-libical --with-ldns --with-unbound'
              }
            }
            stage('make') {
              steps {
                sh 'make'
              }
            }
            stage('make dist') {
              steps {
                sh 'make dist'
              }
            }
          }
        }
        stage('Debian12') {
          agent { label 'debian-12-x86_64' }
          stages {
            stage('autoreconf') {
              steps {
                sh 'autoreconf --force --install'
              }
            }
            stage('configure') {
              steps {
                sh './configure --with-openssl --with-nss --with-p11-kit --with-libical --with-ldns --with-unbound'
              }
            }
            stage('make') {
              steps {
                sh 'make'
              }
            }
            stage('make dist') {
              steps {
                sh 'make dist'
              }
            }
          }
        }
      }
    }
  }
}