diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index c6561f68f4..6701d90098 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 @@ -297,6 +306,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 @@ -680,6 +693,7 @@ Preferably use nmcli instead. %else -Ddocs=false \ %endif + -Dqt=false \ %if %{with team} -Dteamdctl=true \ %else @@ -707,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 \ @@ -714,8 +729,11 @@ 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 \ +%else + -Dppp=false \ %endif %if %{with firewalld_zone} -Dfirewalld_zone=true \ @@ -843,6 +861,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 \ @@ -855,7 +874,10 @@ 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}" \ +%else --enable-ppp=yes \ %endif %if %{with firewalld_zone} @@ -914,7 +936,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 @@ -1071,10 +1093,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 diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh index e5a3d84468..590929660a 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:-"%{nil}"}/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/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 \ diff --git a/contrib/scripts/nm-copr-build.sh b/contrib/scripts/nm-copr-build.sh index 89269fae83..28ce4fced5 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 @@ -55,11 +66,12 @@ 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" -./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}/* .