From 1d2d24c22f4d25ec61e7d40b7c3fa7943902b122 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 23 Jan 2023 16:12:28 +0100 Subject: [PATCH 01/12] contrib/fedora: explicitly set "pppd" path in configure script We have "BuildRequires: ppp-devel". While in Fedora 37 that has a dependency on "ppp" package, that is not the case on Centos7. I didn't test others, but the point is it's not always there. "/usr/sbin/pppd" is provided by "ppp" package, and we might not have it installed via the build requirements. But we only need it to detect the path, which is not necessary on RHEL/Fedora. Just set the path explicitly with the respective configure option. (cherry picked from commit a9cb294b7334e99454401b3dc41b9523c5bad31d) --- contrib/fedora/rpm/NetworkManager.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index c6561f68f4..1670bc26dc 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -714,7 +714,8 @@ Preferably use nmcli instead. -Difcfg_rh=true \ -Difupdown=false \ %if %{with ppp} - -Dpppd_plugin_dir=%{_libdir}/pppd/%{ppp_version} \ + -Dpppd_plugin_dir="%{_libdir}/pppd/%{ppp_version}" \ + -Dpppd="%{_sbindir}/pppd" \ -Dppp=true \ %endif %if %{with firewalld_zone} @@ -855,8 +856,9 @@ autoreconf --install --force --enable-ifcfg-rh=yes \ --enable-ifupdown=no \ %if %{with ppp} - --with-pppd-plugin-dir=%{_libdir}/pppd/%{ppp_version} \ --enable-ppp=yes \ + --with-pppd="%{_sbindir}/pppd" \ + --with-pppd-plugin-dir="%{_libdir}/pppd/%{ppp_version}" \ %endif %if %{with firewalld_zone} --enable-firewalld-zone=yes \ From ae793b2472a6729e795eb1387a5638a170795bbf Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 23 Jan 2023 17:53:37 +0100 Subject: [PATCH 02/12] contrib/fedora: disable "qt" build of examples for spec file Otherwise, we require a C++ compiler, but our build requirements don't install g++. So build will fail. (cherry picked from commit ea16997c4abf08333ebb33f4372b87e32b61acad) --- contrib/fedora/rpm/NetworkManager.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 1670bc26dc..97e602b518 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -680,6 +680,7 @@ Preferably use nmcli instead. %else -Ddocs=false \ %endif + -Dqt=false \ %if %{with team} -Dteamdctl=true \ %else From a433426c6aab8b8ce0dd5ef52a25fbada452c801 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 23 Jan 2023 21:28:51 +0100 Subject: [PATCH 03/12] contrib/fedora: install "python36-gobject" when building with meson on centos7 With the meson build configuration, there is obviously python3 installed and in the path. The build script will pick that up as preferred python. However, we will also need working pygobject to build the documentation. But we only have that for python2 installed. Fix that, by installing "python36-gobject". (cherry picked from commit 128c000f0c1237c48a731e5b28cb23b54f114907) --- contrib/fedora/rpm/NetworkManager.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 97e602b518..c5b8fbf4b9 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -297,6 +297,10 @@ BuildRequires: python2 BuildRequires: pygobject3-base BuildRequires: dbus-python BuildRequires: pexpect +%if 0%{?rhel} >= 7 && %{with meson} +BuildRequires: python36-dbus +BuildRequires: python36-gobject +%endif %endif BuildRequires: libselinux-devel BuildRequires: polkit-devel From 965f2fcea139d46913a63f2eed2e37a53a0eb3a2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 24 Jan 2023 08:46:08 +0100 Subject: [PATCH 04/12] contrib: support disabling "LTO" in "nm-copr-build.sh" The "nm-copr-build.sh" script is run by our copr to generate the SRPM of NetworkManager (via `curl ... | bash`). Building with LTO takes a long time, for testing it can be nice to disable that. Add an environment variable for that. It can be used when manually building an RPM in copr. (cherry picked from commit 0566e9dc63fbd7cffd9d1c738b67a7a3d0b9e870) --- contrib/scripts/nm-copr-build.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/contrib/scripts/nm-copr-build.sh b/contrib/scripts/nm-copr-build.sh index 89269fae83..ed3fad8ef4 100755 --- a/contrib/scripts/nm-copr-build.sh +++ b/contrib/scripts/nm-copr-build.sh @@ -2,7 +2,10 @@ # environment variables: # - GIT_REF: the ref that should be build. Can be "main" or a git sha. -# - DEBUG: set to 1 to build "--with debug". +# - DEBUG: set to 1 to build "--with debug". Otherwise the default is a release +# build. +# - LTO: set to 1/0 to build "--with/--without lto", otherwise the default depends +# on the distribution. # - NM_GIT_BUNDLE: set to a HTTP url where to fetch the nm-git-bundle-*.noarch.rpm # from. Set to empty to skip it. By default, it fetches the bundle from copr. @@ -14,6 +17,14 @@ else DEBUG="--without debug" fi +if [ "$LTO" = 0 ]; then + LTO='--without -lto' +elif [ "$LTO" = 1 ]; then + LTO='--with -lto' +else + LTO= +fi + if [[ -z "$GIT_REF" ]]; then echo "\$GIT_REF is not set!" exit 1 @@ -59,7 +70,7 @@ GIT_SHA="$(git show-ref --verify --hash "$GIT_REF" 2>/dev/null || git checkout -b tmp "$GIT_SHA" -./contrib/fedora/rpm/build_clean.sh -g -S -w test $DEBUG -s copr +./contrib/fedora/rpm/build_clean.sh -g -S -w test $DEBUG $LTO -s copr popd mv ./NetworkManager/contrib/fedora/rpm/latest/{SOURCES,SPECS}/* . From 2fd7841f131d12f0d47e22d5637dc2ac4013085f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 24 Jan 2023 10:29:35 +0100 Subject: [PATCH 05/12] contrib/fedora: make "lto" in the spec file configurable When we build a copr image, we run the "nm-copr-build.sh" script. That script, should honor "LTO=0|1|" to explicitly enable/disable LTO. Since the copr script only builds a SRPM, which then gets build we need that the default LTO flag in the SRPM is templated. Fixes: 0566e9dc63fb ('contrib: support disabling "LTO" in "nm-copr-build.sh"') (cherry picked from commit 096b9955d67d3c915c1a9599446aaff7fae60b99) --- contrib/fedora/rpm/NetworkManager.spec | 9 +++++++++ contrib/fedora/rpm/build.sh | 5 +++++ contrib/fedora/rpm/build_clean.sh | 15 +++++++++++++++ contrib/scripts/nm-copr-build.sh | 4 ++-- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index c5b8fbf4b9..2f7a2d36ec 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -19,6 +19,7 @@ %global snapshot __SNAPSHOT__ %global git_sha __COMMIT__ %global bcond_default_debug __BCOND_DEFAULT_DEBUG__ +%global bcond_default_lto __BCOND_DEFAULT_LTO__ %global bcond_default_test __BCOND_DEFAULT_TEST__ %global obsoletes_device_plugins 1:0.9.9.95-1 @@ -69,11 +70,19 @@ %else %bcond_with test %endif +%if %{bcond_default_lto} == '' %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %bcond_without lto %else %bcond_with lto %endif +%else +%if %{bcond_default_lto} +%bcond_without lto +%else +%bcond_with lto +%endif +%endif %bcond_with sanitizer %if 0%{?fedora} %bcond_without connectivity_fedora diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh index e5a3d84468..777f9c4a53 100755 --- a/contrib/fedora/rpm/build.sh +++ b/contrib/fedora/rpm/build.sh @@ -25,6 +25,7 @@ # SIGN_SOURCE= # DO_RELEASE= # BCOND_DEFAULT_DEBUG= +# BCOND_DEFAULT_LTO= # BCOND_DEFAULT_TEST= die() { @@ -119,6 +120,7 @@ COMMIT_FULL="${COMMIT_FULL:-$(git rev-parse --verify HEAD || die "Error reading COMMIT="${COMMIT:-$(printf '%s' "$COMMIT_FULL" | sed 's/^\(.\{10\}\).*/\1/' || die "Error reading HEAD revision")}" BCOND_DEFAULT_DEBUG="${BCOND_DEFAULT_DEBUG:-0}" BCOND_DEFAULT_TEST="${BCOND_DEFAULT_TEST:-0}" +BCOND_DEFAULT_LTO="${BCOND_DEFAULT_LTO}" USERNAME="${USERNAME:-"$(git config user.name) <$(git config user.email)>"}" SPECFILE="$(abs_path "$SPECFILE" "$SCRIPTDIR/NetworkManager.spec")" || die "invalid \$SPECFILE argument" SOURCE_FROM_GIT="$(coerce_bool "$SOURCE_FROM_GIT" "")" @@ -174,12 +176,14 @@ LOG "SOURCE_README_IFCFG_FILES=$SOURCE_README_IFCFG_FILES" LOG "BUILDTYPE=$BUILDTYPE" LOG "NM_RPMBUILD_ARGS=$NM_RPMBUILD_ARGS" LOG "BCOND_DEFAULT_DEBUG=$BCOND_DEFAULT_DEBUG" +LOG "BCOND_DEFAULT_LTO=$BCOND_DEFAULT_LTO" LOG "BCOND_DEFAULT_TEST=$BCOND_DEFAULT_TEST" LOG "" LOG "UUID=$UUID" LOG "BASEDIR=$TEMP" in_set "$BCOND_DEFAULT_DEBUG" 0 1 || die "Invalid value for \$BCOND_DEFAULT_DEBUG: \"$BCOND_DEFAULT_DEBUG\"" +in_set "$BCOND_DEFAULT_LTO" '' 0 1 || die "Invalid value for \$BCOND_DEFAULT_LTO: \"$BCOND_DEFAULT_LTO\"" in_set "$BCOND_DEFAULT_TEST" 0 1 || die "Invalid value for \$BCOND_DEFAULT_TEST: \"$BCOND_DEFAULT_TEST\"" ln -snf "$TEMPBASE" ./latest0 @@ -209,6 +213,7 @@ sed -e "s/__VERSION__/$VERSION/g" \ -e "s/__SNAPSHOT__/$SNAPSHOT/g" \ -e "s/__SOURCE1__/$(basename "$SOURCE")/g" \ -e "s/__BCOND_DEFAULT_DEBUG__/$BCOND_DEFAULT_DEBUG/g" \ + -e "s/__BCOND_DEFAULT_LTO__/$BCOND_DEFAULT_LTO/g" \ -e "s/__BCOND_DEFAULT_TEST__/$BCOND_DEFAULT_TEST/g" \ "$SPECFILE" | sed -e "/^__CHANGELOG__$/ \ diff --git a/contrib/fedora/rpm/build_clean.sh b/contrib/fedora/rpm/build_clean.sh index 7c221d69a5..6ba202674e 100755 --- a/contrib/fedora/rpm/build_clean.sh +++ b/contrib/fedora/rpm/build_clean.sh @@ -26,6 +26,7 @@ usage() { echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)" echo " -r|--release: built a release tarball (this option must be alone)" echo " --default-for-debug \$OPTION: set the default for "debug" option in the generated spec file" + echo " --default-for-lto \$OPTION: set the default for "lto" option in the generated spec file" echo " --default-for-test \$OPTION: set the default for "test" option in the generated spec file" } @@ -56,6 +57,7 @@ SOURCE_FROM_GIT=0 SNAPSHOT="$NM_BUILD_SNAPSHOT" DO_RELEASE=0 unset BCOND_DEFAULT_DEBUG +unset BCOND_DEFAULT_LTO unset BCOND_DEFAULT_TEST ADD_WITH_TEST=1 @@ -110,6 +112,9 @@ while [[ $# -gt 0 ]]; do debug) [[ -z ${BCOND_DEFAULT_DEBUG+.} ]] && BCOND_DEFAULT_DEBUG=1 ;; + lto) + [[ -z ${BCOND_DEFAULT_LTO+.} ]] && BCOND_DEFAULT_LTO=1 + ;; test) ADD_WITH_TEST=0 [[ -z ${BCOND_DEFAULT_TEST+.} ]] && BCOND_DEFAULT_TEST=1 @@ -124,6 +129,9 @@ while [[ $# -gt 0 ]]; do debug) [[ -z ${BCOND_DEFAULT_DEBUG+.} ]] && BCOND_DEFAULT_DEBUG=0 ;; + lto) + [[ -z ${BCOND_DEFAULT_LTO+.} ]] && BCOND_DEFAULT_LTO=0 + ;; test) ADD_WITH_TEST=0 [[ -z ${BCOND_DEFAULT_TEST+.} ]] && BCOND_DEFAULT_TEST=0 @@ -145,6 +153,12 @@ while [[ $# -gt 0 ]]; do BCOND_DEFAULT_DEBUG="$1" shift ;; + --default-for-lto) + [[ $# -gt 0 ]] || die "Missing argument to $A" + in_set "$1" "" 0 1 || die "invalid argument $A \"$1\"" + BCOND_DEFAULT_LTO="$1" + shift + ;; --default-for-test) [[ $# -gt 0 ]] || die "Missing argument to $A" in_set "$1" "" 0 1 || die "invalid argument $A \"$1\"" @@ -226,6 +240,7 @@ export NM_RPMBUILD_ARGS="${WITH_LIST[@]}" export SNAPSHOT export DO_RELEASE export BCOND_DEFAULT_DEBUG="$BCOND_DEFAULT_DEBUG" +export BCOND_DEFAULT_LTO="$BCOND_DEFAULT_LTO" export BCOND_DEFAULT_TEST="$BCOND_DEFAULT_TEST" "$SCRIPTDIR"/build.sh diff --git a/contrib/scripts/nm-copr-build.sh b/contrib/scripts/nm-copr-build.sh index ed3fad8ef4..d16465b838 100755 --- a/contrib/scripts/nm-copr-build.sh +++ b/contrib/scripts/nm-copr-build.sh @@ -18,9 +18,9 @@ else fi if [ "$LTO" = 0 ]; then - LTO='--without -lto' + LTO='--without lto' elif [ "$LTO" = 1 ]; then - LTO='--with -lto' + LTO='--with lto' else LTO= fi From 304489da374f175dbc2bc5f03d9166bc86e12391 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 24 Jan 2023 11:24:06 +0100 Subject: [PATCH 06/12] contrib/rpm: fix condition in "NetworkManager.spec" Fixes: 096b9955d67d ('contrib/fedora: make "lto" in the spec file configurable') (cherry picked from commit 7a62845424c443e705cee647ad0f6d316230c66a) --- contrib/fedora/rpm/NetworkManager.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 2f7a2d36ec..df84255997 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -70,7 +70,7 @@ %else %bcond_with test %endif -%if %{bcond_default_lto} == '' +%if "%{bcond_default_lto}" == "" %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %bcond_without lto %else From 8b04b47755803451a4ff2483654c2feb17b87419 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 24 Jan 2023 11:46:28 +0100 Subject: [PATCH 07/12] contrib/rpm: fix condition in "NetworkManager.spec" (2) Fixes: 096b9955d67d ('contrib/fedora: make "lto" in the spec file configurable') Fixes: 7a62845424c4 ('contrib/rpm: fix condition in "NetworkManager.spec"') (cherry picked from commit 13dfdaf3a090f01930c7fa2cf7a8cb3a071de947) --- contrib/fedora/rpm/NetworkManager.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index df84255997..832b2019ce 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -70,7 +70,7 @@ %else %bcond_with test %endif -%if "%{bcond_default_lto}" == "" +%if "%{?bcond_default_lto}" == "" %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %bcond_without lto %else From 4a2ab850343dfc390717866616f8773fdfb9a25f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 24 Jan 2023 12:29:04 +0100 Subject: [PATCH 08/12] contrib/rpm: fix condition in "NetworkManager.spec" (3) Fixes: 096b9955d67d ('contrib/fedora: make "lto" in the spec file configurable') Fixes: 7a62845424c4 ('contrib/rpm: fix condition in "NetworkManager.spec"') (cherry picked from commit 36ad5cbb3bb4b60dd0e701d2eba4a4fbee87a6f5) --- contrib/fedora/rpm/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh index 777f9c4a53..590929660a 100755 --- a/contrib/fedora/rpm/build.sh +++ b/contrib/fedora/rpm/build.sh @@ -213,7 +213,7 @@ sed -e "s/__VERSION__/$VERSION/g" \ -e "s/__SNAPSHOT__/$SNAPSHOT/g" \ -e "s/__SOURCE1__/$(basename "$SOURCE")/g" \ -e "s/__BCOND_DEFAULT_DEBUG__/$BCOND_DEFAULT_DEBUG/g" \ - -e "s/__BCOND_DEFAULT_LTO__/$BCOND_DEFAULT_LTO/g" \ + -e "s/__BCOND_DEFAULT_LTO__/${BCOND_DEFAULT_LTO:-"%{nil}"}/g" \ -e "s/__BCOND_DEFAULT_TEST__/$BCOND_DEFAULT_TEST/g" \ "$SPECFILE" | sed -e "/^__CHANGELOG__$/ \ From b7bdd08af6221b789044d4733115eb66dfdddfbd Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 24 Jan 2023 14:58:47 +0100 Subject: [PATCH 09/12] contrib/copr: better detect git-ref in "nm-copr-build.sh" (cherry picked from commit fce8e572d0e9c6f5e26dea93a524abf2268d24ca) --- contrib/scripts/nm-copr-build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/scripts/nm-copr-build.sh b/contrib/scripts/nm-copr-build.sh index d16465b838..28ce4fced5 100755 --- a/contrib/scripts/nm-copr-build.sh +++ b/contrib/scripts/nm-copr-build.sh @@ -66,6 +66,7 @@ git remote remove nm-git-bundle || true GIT_SHA="$(git show-ref --verify --hash "$GIT_REF" 2>/dev/null || git show-ref --verify --hash "refs/remotes/origin/$GIT_REF" 2>/dev/null || + git rev-parse --verify "refs/remotes/origin/$GIT_REF" 2>/dev/null || git rev-parse --verify "$GIT_REF^{commit}" 2>/dev/null)" git checkout -b tmp "$GIT_SHA" From e57b64c882dbe54d9c05ff5b45aa185372acd250 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 30 Jan 2023 08:56:36 +0100 Subject: [PATCH 10/12] contrib/release.sh: add hint about publishing documentation on website (cherry picked from commit 00affc7b6f268d54f0205e325806ba9ab7e3da22) --- contrib/fedora/rpm/release.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/contrib/fedora/rpm/release.sh b/contrib/fedora/rpm/release.sh index e653509869..c896a8ed0f 100755 --- a/contrib/fedora/rpm/release.sh +++ b/contrib/fedora/rpm/release.sh @@ -55,7 +55,14 @@ echo_color() { print_usage() { echo "Usage:" - echo " $BASH_SOURCE [devel|rc1|rc|major|major-post|minor] [--no-test] [--no-find-backports] [--no-cleanup] [--allow-local-branches] [--no-check-gitlab] [--no-check-news]" + echo " $BASH_SOURCE [devel|rc1|rc|major|major-post|minor]" + echo " [--no-test] \\" + echo " [--no-find-backports] \\" + echo " [--no-cleanup] \\" + echo " [--allow-local-branches] \\" + echo " [--no-check-gitlab] \\" + echo " [--no-check-news] \\" + echo " [--no-warn-publish-docs] \\" } die_help() { @@ -204,6 +211,7 @@ FIND_BACKPORTS=1 ALLOW_LOCAL_BRANCHES=0 HELP_AND_EXIT=1 CHECK_GITLAB=1 +WARN_PUBLISH_DOCS=1 CHECK_NEWS=1 while [ "$#" -ge 1 ]; do A="$1" @@ -228,6 +236,9 @@ while [ "$#" -ge 1 ]; do --no-check-gitlab) CHECK_GITLAB=0 ;; + --no-warn-publish-docs) + WARN_PUBLISH_DOCS=0 + ;; --no-check-news) CHECK_NEWS=0 ;; @@ -366,6 +377,24 @@ if ! check_news "$RELEASE_MODE" "@{VERSION_ARR[@]}" ; then echo "WARNING: NEWS file needs update to mention stable release (test skipped with --no-check-news)" fi +if [ "$RELEASE_MODE" = major -o "$RELEASE_MODE" = minor ]; then + echo + latest= + if [ "$RELEASE_MODE" = major ]; then + echo "Note that after the new major you have to publish the new documentation on" + latest=" -l" + else + echo "Note that after the stable release you maybe should publish the new documentation on" + fi + echo "$(echo_color 36 -n "https://gitlab.freedesktop.org/NetworkManager/networkmanager.pages.freedesktop.org.git") by running" + echo " \`$(echo_color 36 -n "./scripts/import-docs.sh ${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1)).0$latest")\`" + echo + if [ $WARN_PUBLISH_DOCS = 1 ]; then + echo "Avoid this prompt via \"--no-warn-publish-docs\"" + read -p "Please confirm that you know [ENTER] " + fi +fi + if [ $FIND_BACKPORTS = 1 ]; then git show "$ORIGIN/main:contrib/scripts/find-backports" > ./.git/nm-find-backports \ && chmod +x ./.git/nm-find-backports \ From 2f69bf7aa4fbefb5e4d4783f5f9982dd006995bb Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sun, 8 Jan 2023 14:04:52 -0500 Subject: [PATCH 11/12] contrib/rpm: fix flatpak build https://src.fedoraproject.org/rpms/NetworkManager/pull-request/13 (cherry picked from commit 42cd422f18bc9293314c88c60ee83d11e40119b8) --- contrib/fedora/rpm/NetworkManager.spec | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 832b2019ce..07084455cd 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -721,6 +721,7 @@ Preferably use nmcli instead. %endif -Dsession_tracking=systemd \ -Dsuspend_resume=systemd \ + -Dsystemdsystemunitdir=%{_unitdir} \ -Dsystem_ca_path=/etc/pki/tls/cert.pem \ -Ddbus_conf_dir=%{dbus_sys_dir} \ -Dtests=yes \ @@ -858,6 +859,7 @@ autoreconf --install --force --with-ebpf=%{ebpf_enabled} \ --with-session-tracking=systemd \ --with-suspend-resume=systemd \ + --with-systemdsystemunitdir=%{_unitdir} \ --with-system-ca-path=/etc/pki/tls/cert.pem \ --with-dbus-sys-dir=%{dbus_sys_dir} \ --with-tests=yes \ @@ -930,7 +932,7 @@ rm -f %{buildroot}%{nmplugindir}/*.la # Ensure the documentation timestamps are constant to avoid multilib conflicts find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference configure.ac '{}' \+ -%if 0%{?__debug_package} +%if 0%{?__debug_package} && ! 0%{?flatpak} mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version} cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version} %endif @@ -1087,10 +1089,10 @@ fi %{_mandir}/man1/* %{_mandir}/man5/* %{_mandir}/man7/nmcli-examples.7* -%{_mandir}/man8/nm-initrd-generator.8.gz -%{_mandir}/man8/NetworkManager.8.gz -%{_mandir}/man8/NetworkManager-dispatcher.8.gz -%{_mandir}/man8/NetworkManager-wait-online.service.8.gz +%{_mandir}/man8/nm-initrd-generator.8* +%{_mandir}/man8/NetworkManager.8* +%{_mandir}/man8/NetworkManager-dispatcher.8* +%{_mandir}/man8/NetworkManager-wait-online.service.8* %dir %{_localstatedir}/lib/NetworkManager %dir %{_sysconfdir}/sysconfig/network-scripts %{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service From 7ff297db2438408547afa9367ba6ce54fd1051f5 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Mon, 25 Oct 2021 20:32:48 +0000 Subject: [PATCH 12/12] contrib/rpm: fix building without ppp We need to explicitly say we don't want PPP as the default is that we do want to build with PPP. https://src.fedoraproject.org/rpms/NetworkManager/pull-request/13 (cherry picked from commit 2598ec3a1fd231793e9dd243db3d8d633e1782aa) --- contrib/fedora/rpm/NetworkManager.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 07084455cd..6701d90098 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -732,6 +732,8 @@ Preferably use nmcli instead. -Dpppd_plugin_dir="%{_libdir}/pppd/%{ppp_version}" \ -Dpppd="%{_sbindir}/pppd" \ -Dppp=true \ +%else + -Dppp=false \ %endif %if %{with firewalld_zone} -Dfirewalld_zone=true \ @@ -875,6 +877,8 @@ autoreconf --install --force --enable-ppp=yes \ --with-pppd="%{_sbindir}/pppd" \ --with-pppd-plugin-dir="%{_libdir}/pppd/%{ppp_version}" \ +%else + --enable-ppp=yes \ %endif %if %{with firewalld_zone} --enable-firewalld-zone=yes \