#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (C) 2015-2016, 2026 InterGenJLU
#
# dbus-pass2 1.16.2 — Message bus (pass 2 with doxygen API docs + AppArmor)
# Rebuilds dbus with -Ddoxygen_docs=enabled and -Dapparmor=enabled now that
# doxygen and apparmor are available (both tier-after-ch8). Supersedes the
# pass 1 (tier:core, ch8) build at install time via migrate-pkm-supersedes.sh.

configure() {
    set -e
    mkdir -p build
    cd build
    meson setup ..            \
          --prefix=/usr       \
          --libdir=/usr/lib   \
          --sysconfdir=/etc   \
          --localstatedir=/var \
          --buildtype=release \
          -Ddoxygen_docs=enabled \
          -Dapparmor=enabled
}

build() {
    set -e
    cd build
    ninja
}

do_install() {
    set -e
    cd build
    DESTDIR="$DESTDIR" ninja install
}
