-%define nmversion %{version}
+#
+# Conditional build:
+%bcond_with appindicator # application indicators instead of xembed systray support
+%bcond_with libnm_gtk # build deprecated libnm-gtk lib (depends on libnm-glib dropped in NetworkManager 1.20)
+#
+%define nmversion 2:1.8
Summary: Network Manager for GNOME
Summary(pl.UTF-8): Zarządca sieci dla GNOME
Name: NetworkManager-applet
-Version: 0.7.999
+Version: 1.16.0
Release: 1
License: GPL v2
Group: X11/Applications
-Source0: http://ftp.gnome.org/pub/GNOME/sources/network-manager-applet/0.7/network-manager-applet-%{version}.tar.bz2
-# Source0-md5: 078fe62813a5ac3b96cd90f1f92dde60
-URL: http://projects.gnome.org/NetworkManager/
-BuildRequires: GConf2-devel >= 2.20.0
+Source0: http://ftp.gnome.org/pub/GNOME/sources/network-manager-applet/1.16/network-manager-applet-%{version}.tar.xz
+# Source0-md5: 9652c2757e85d6caba657405cf794fbd
+URL: https://wiki.gnome.org/Projects/NetworkManager
+BuildRequires: ModemManager-devel >= 1.0.0
BuildRequires: NetworkManager-devel >= %{nmversion}
-BuildRequires: autoconf >= 2.52
-BuildRequires: automake
+%if %{with libnm_gtk}
+BuildRequires: NetworkManager-devel < 2:1.20
+%endif
BuildRequires: dbus-devel >= 1.2.6
BuildRequires: dbus-glib-devel >= 0.74
-BuildRequires: gettext-devel
-BuildRequires: gnome-keyring-devel >= 2.20.0
-BuildRequires: gtk+2-devel >= 2:2.14.0
-BuildRequires: intltool >= 0.36.2
-BuildRequires: libglade2-devel
-BuildRequires: libiw-devel >= 1:28-0.pre9.1
-BuildRequires: libnotify-devel >= 0.4.3
-BuildRequires: libtool
-BuildRequires: libuuid-devel
+BuildRequires: gcr-devel >= 3.14
+BuildRequires: gcr-ui-devel >= 3.14
+BuildRequires: gettext-tools >= 0.19.8
+BuildRequires: glib2-devel >= 1:2.38
+BuildRequires: gobject-introspection-devel >= 0.9.6
+BuildRequires: gtk+3-devel >= 3.10
+BuildRequires: gtk-doc >= 1.0
+BuildRequires: iso-codes
+BuildRequires: jansson-devel >= 2.7
+%{?with_appindicator:BuildRequires: libappindicator-gtk3-devel >= 0.1}
+%{?with_appindicator:BuildRequires: libdbusmenu-gtk3-devel >= 16.04.0}
+BuildRequires: libnma-devel >= 1.8.27
+BuildRequires: libnotify-devel >= 0.7.0
+BuildRequires: libsecret-devel >= 0.18
+BuildRequires: libselinux-devel
+BuildRequires: meson >= 0.46.0
+BuildRequires: mobile-broadband-provider-info-devel
+BuildRequires: ninja
BuildRequires: pkgconfig
-BuildRequires: polkit-devel
-BuildRequires: rpmbuild(macros) >= 1.311
-Requires(post,postun): gtk+2
-Requires(post,postun): hicolor-icon-theme
-Requires(post,preun): GConf2
+BuildRequires: rpmbuild(macros) >= 1.736
+BuildRequires: tar >= 1:1.22
+BuildRequires: udev-glib-devel >= 1:147
+BuildRequires: xz
+Requires(post,postun): glib2 >= 1:2.38
+Requires(post,postun): gtk-update-icon-cache
Requires: NetworkManager >= %{nmversion}
-Requires: PolicyKit-gnome
Requires: dbus >= 1.2.6
+Requires: dbus-glib >= 0.74
+Requires: glib2 >= 1:2.38
+Requires: hicolor-icon-theme
+Requires: jansson >= 2.7
+Requires: libnma >= 1.8.27
+Requires: libsecret >= 0.18
+Requires: mobile-broadband-provider-info
+Requires: polkit-gnome
Suggests: dbus(org.freedesktop.Notifications)
Obsoletes: NetworkManager-applet-devel
+Obsoletes: gnome-bluetooth-plugin-nma < 1.2.2
# sr@Latn vs. sr@latin
Conflicts: glibc-misc < 6:2.7
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%setup -q -n network-manager-applet-%{version}
%build
-%{__intltoolize}
-%{__libtoolize}
-%{__aclocal}
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-%configure
-%{__make}
+%meson build \
+ -Dappindicator=%{?with_appindicator:yes}%{!?with_appindicator:no} \
+ -Dgtk_doc=true \
+ -Dlibnm_gtk=%{__true_false libnm_gtk}
+%ninja_build -C build
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_datadir}/gnome-vpn-properties
-%{__make} install \
- DESTDIR=$RPM_BUILD_ROOT
-
-[ -d $RPM_BUILD_ROOT%{_datadir}/locale/sr@latin ] || \
- mv -f $RPM_BUILD_ROOT%{_datadir}/locale/sr@{Latn,latin}
+%ninja_install -C build
%find_lang %{name} --with-gnome --all-name
%post
%update_icon_cache hicolor
-%gconf_schema_install nm-applet.schemas
-
-%preun
-%gconf_schema_uninstall nm-applet.schemas
+%glib_compile_schemas
%postun
%update_icon_cache hicolor
+if [ "$1" = "0" ]; then
+ %glib_compile_schemas
+fi
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc AUTHORS CONTRIBUTING ChangeLog NEWS README
+%doc AUTHORS CONTRIBUTING ChangeLog
%attr(755,root,root) %{_bindir}/nm-applet
%attr(755,root,root) %{_bindir}/nm-connection-editor
-%{_sysconfdir}/gconf/schemas/nm-applet.schemas
+%{_datadir}/GConf/gsettings/nm-applet.convert
%dir %{_datadir}/gnome-vpn-properties
-%{_datadir}/nm-applet
+%{_datadir}/metainfo/nm-connection-editor.appdata.xml
%{_sysconfdir}/xdg/autostart/nm-applet.desktop
+%{_desktopdir}/nm-applet.desktop
%{_desktopdir}/nm-connection-editor.desktop
-%{_iconsdir}/hicolor/*/apps/*.png
-%{_iconsdir}/hicolor/*/apps/*.svg
-%config(noreplace) %verify(not md5 mtime size) /etc/dbus-1/system.d/nm-applet.conf
+%{_mandir}/man1/nm-applet.1*
+%{_mandir}/man1/nm-connection-editor.1*
+%{_iconsdir}/hicolor/*x*/apps/nm-*.png
+%{_iconsdir}/hicolor/scalable/apps/nm-*.svg