contrib/fedora: add --meson option to build_clean

This allows the script user to complete the entire build only using meson instead of autotools.
This commit is contained in:
Jan Vaclav
2023-12-07 13:32:54 +01:00
parent 7502787959
commit 95f7c8e128

View File

@@ -19,8 +19,9 @@ usage() {
echo " -c|--clean: run \`git-clean -fdx :/\` before build"
echo " -S|--srpm: only build the SRPM"
echo " -g|--git: create tarball from current git HEAD (skips make dist)"
echo " -Q|--quick: only run \`make dist\` instead of \`make distcheck\`"
echo " -Q|--quick: only create the distribution tarball, without running checks"
echo " -N|--no-dist: skip creating the source tarball if you already did \`make dist\`"
echo " -m|--meson: use meson to create the source tarball"
echo " -w|--with \$OPTION: pass --with \$OPTION to rpmbuild. For example --with debug"
echo " -W|--without \$OPTION: pass --without \$OPTION to rpmbuild. For example --without debug"
echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)"
@@ -97,6 +98,10 @@ while [[ $# -gt 0 ]]; do
IGNORE_DIRTY=1
SOURCE_FROM_GIT=1
;;
-m|--meson)
USE_MESON=1
WITH_LIST=("${WITH_LIST[@]}" "--with" "meson")
;;
-Q|--quick)
QUICK=1
;;
@@ -188,45 +193,87 @@ if [[ $IGNORE_DIRTY != 1 ]]; then
fi
fi
get_version_meson() {
meson introspect "$GITDIR/build" --projectinfo | jq -r .version
}
if [[ $NO_DIST != 1 ]]; then
./autogen.sh \
--with-runstatedir=/run \
--program-prefix= \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
\
--disable-dependency-tracking \
--enable-gtk-doc \
--enable-introspection \
--enable-ifcfg-rh \
--enable-ifupdown \
--with-config-logging-backend-default=syslog \
--with-config-wifi-backend-default=wpa_supplicant \
--with-libaudit=yes-disabled-by-default \
--enable-polkit=yes \
--with-nm-cloud-setup=yes \
--with-config-dhcp-default=internal \
--with-config-dns-rc-manager-default=auto \
\
--with-iptables=/usr/sbin/iptables \
--with-nft=/usr/sbin/nft \
\
|| die "Error autogen.sh"
if [[ $QUICK == 1 ]]; then
make dist -j 7 || die "Error make dist"
if [[ $USE_MESON = 1 ]]; then
meson setup "$GITDIR/build" \
--prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
-Ddocs=true \
-Dintrospection=true \
-Difcfg_rh=true \
-Difupdown=true \
-Dconfig_logging_backend_default=syslog \
-Dconfig_wifi_backend_default=wpa_supplicant \
-Dlibaudit=yes-disabled-by-default \
-Dpolkit=true \
-Dnm_cloud_setup=true \
-Dconfig_dhcp_default=internal \
-Dconfig_dns_rc_manager_default=auto \
-Diptables=/usr/sbin/iptables \
-Dnft=/usr/bin/nft \
|| die "Error meson setup"
VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}"
if [[ $QUICK == 1 ]]; then
meson dist --allow-dirty -C "$GITDIR/build/" --no-tests || die "Error meson dist"
else
meson dist --allow-dirty -C "$GITDIR/build/" || die "Error meson dist with tests"
fi
export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
else
make distcheck -j 7 || die "Error make distcheck"
./autogen.sh \
--with-runstatedir=/run \
--program-prefix= \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
\
--disable-dependency-tracking \
--enable-gtk-doc \
--enable-introspection \
--enable-ifcfg-rh \
--enable-ifupdown \
--with-config-logging-backend-default=syslog \
--with-config-wifi-backend-default=wpa_supplicant \
--with-libaudit=yes-disabled-by-default \
--enable-polkit=yes \
--with-nm-cloud-setup=yes \
--with-config-dhcp-default=internal \
--with-config-dns-rc-manager-default=auto \
\
--with-iptables=/usr/sbin/iptables \
--with-nft=/usr/sbin/nft \
\
|| die "Error autogen.sh"
if [[ $QUICK == 1 ]]; then
make dist -j 7 || die "Error make dist"
else
make distcheck -j 7 || die "Error make distcheck"
fi
fi
fi