net-misc/networkmanager: make polkit optional
authorMike Gilbert <floppym@gentoo.org>
Sat, 27 May 2017 21:56:48 +0000 (17:56 -0400)
committerMike Gilbert <floppym@gentoo.org>
Sat, 27 May 2017 21:57:46 +0000 (17:57 -0400)
Bug: https://bugs.gentoo.org/498388
Package-Manager: Portage-2.3.6_p1, Repoman-2.3.2_p69

net-misc/networkmanager/networkmanager-1.8.0.ebuild

index 1ce1cc72ebb54ef1adc5740a49622843e32cb279..3a9b9dc5ad74dfaa27a2adf40ea64ab7717ab9cc 100644 (file)
@@ -16,7 +16,7 @@ HOMEPAGE="https://wiki.gnome.org/Projects/NetworkManager"
 LICENSE="GPL-2+"
 SLOT="0" # add subslot if libnm-util.so.2 or libnm-glib.so.4 bumps soname version
 
-IUSE="audit bluetooth connection-sharing consolekit +dhclient elogind gnutls +introspection json kernel_linux +nss +modemmanager ncurses ofono +ppp resolvconf selinux systemd teamd test vala +wext +wifi"
+IUSE="audit bluetooth connection-sharing consolekit +dhclient elogind gnutls +introspection json kernel_linux +nss +modemmanager ncurses ofono policykit +ppp resolvconf selinux systemd teamd test vala +wext +wifi"
 
 REQUIRED_USE="
        modemmanager? ( ppp )
@@ -36,7 +36,7 @@ COMMON_DEPEND="
        >=dev-libs/dbus-glib-0.100[${MULTILIB_USEDEP}]
        >=dev-libs/glib-2.37.6:2[${MULTILIB_USEDEP}]
        >=dev-libs/libnl-3.2.8:3=[${MULTILIB_USEDEP}]
-       >=sys-auth/polkit-0.106
+       policykit? ( >=sys-auth/polkit-0.106 )
        net-libs/libndp
        net-misc/curl
        net-misc/iputils
@@ -195,6 +195,12 @@ multilib_src_configure() {
                $(multilib_native_use_enable wifi)
        )
 
+       if multilib_is_native_abi && use policykit; then
+               myconf+=( --enable-polkit=yes )
+       else
+               myconf+=( --enable-polkit=disabled )
+       fi
+
        # Same hack as net-dialup/pptpd to get proper plugin dir for ppp, bug #519986
        if use ppp; then
                local PPPD_VER=`best_version net-dialup/ppp`
@@ -294,25 +300,6 @@ pkg_postinst() {
                ewarn "After doing so, you can remove ${EROOT}etc/NetworkManager/nm-system-settings.conf"
        fi
 
-       # The polkit rules file moved to /usr/share
-       old_rules="${EROOT}etc/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules"
-       if [[ -f "${old_rules}" ]]; then
-               case "$(md5sum ${old_rules})" in
-                 574d0cfa7e911b1f7792077003060240* )
-                       # Automatically delete the old rules.d file if the user did not change it
-                       elog
-                       elog "Removing old ${old_rules} ..."
-                       rm -f "${old_rules}" || eerror "Failed, please remove ${old_rules} manually"
-                       ;;
-                 * )
-                       elog "The ${old_rules}"
-                       elog "file moved to /usr/share/polkit-1/rules.d/ in >=networkmanager-0.9.4.0-r4"
-                       elog "If you edited ${old_rules}"
-                       elog "without changing its behavior, you may want to remove it."
-                       ;;
-               esac
-       fi
-
        # NM fallbacks to plugin specified at compile time (upstream bug #738611)
        # but still show a warning to remember people to have cleaner config file
        if [[ -e "${EROOT}etc/NetworkManager/NetworkManager.conf" ]]; then