diff --git a/tigervnc-https.firewalld b/tigervnc-https.firewalld
new file mode 100644
index 0000000..253fe79
--- /dev/null
+++ b/tigervnc-https.firewalld
@@ -0,0 +1,7 @@
+
+
+ VNC over HTTPS
+ The xvnc-novnc servers a web-based VNC viewer over HTTPS. Allows accessing VNC using any modern browser. It displays VNC display :1.
+
+
+
diff --git a/tigervnc.changes b/tigervnc.changes
index c8bba3a..a19639b 100644
--- a/tigervnc.changes
+++ b/tigervnc.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Wed Feb 28 12:19:52 UTC 2018 - msrb@suse.com
+
+- Replace SuSEFirewall2 by firewalld. (bnc#1081952)
+
-------------------------------------------------------------------
Mon Dec 18 16:44:20 UTC 2017 - dimstar@opensuse.org
diff --git a/tigervnc.firewalld b/tigervnc.firewalld
new file mode 100644
index 0000000..316e35e
--- /dev/null
+++ b/tigervnc.firewalld
@@ -0,0 +1,7 @@
+
+
+ VNC display :1
+ VNC is protocol for remote desktop. The TigerVNC service and the vncmanager service use VNC display number :1.
+
+
+
diff --git a/tigervnc.spec b/tigervnc.spec
index dd1be90..8ba7fca 100644
--- a/tigervnc.spec
+++ b/tigervnc.spec
@@ -1,7 +1,7 @@
#
# spec file for package tigervnc
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,6 +24,12 @@
%define _unitdir %{_prefix}/lib/systemd/system
+%if 0%{?suse_version} >= 1500
+%define use_firewalld 1
+%else
+%define use_firewalld 0
+%endif
+
Name: tigervnc
Version: 1.8.0
Release: 0
@@ -106,8 +112,8 @@ License: GPL-2.0 and MIT
Group: System/X11/Servers/XF86_4
Source1: https://github.com/TigerVNC/tigervnc/archive/v%{version}.tar.gz
Source4: 10-libvnc.conf
-Source5: vnc-server.firewall
-Source6: vnc-httpd.firewall
+Source5: vnc-server.susefirewall
+Source6: vnc-httpd.susefirewall
Source7: vnc.reg
Source8: vncpasswd.arg
Source9: vnc.pam
@@ -118,6 +124,8 @@ Source13: xvnc@.service
Source14: xvnc.socket
Source15: xvnc-novnc.service
Source16: xvnc-novnc.socket
+Source17: tigervnc.firewalld
+Source18: tigervnc-https.firewalld
Patch1: tigervnc-newfbsize.patch
Patch2: tigervnc-clean-pressed-key-on-exit.patch
@@ -290,8 +298,15 @@ popd
%ifnarch s390x
install -D -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/X11/xorg.conf.d/10-libvnc.conf
%endif
-install -D -m 644 %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/vnc-server
-install -D -m 644 %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/vnc-httpd
+
+%if %{use_firewalld}
+install -D -m 644 %{SOURCE17} $RPM_BUILD_ROOT%{_libexecdir}/firewalld/services/tigervnc.xml
+install -D -m 644 %{SOURCE18} $RPM_BUILD_ROOT%{_libexecdir}/firewalld/services/tigervnc-https.xml
+%else
+install -D -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/vnc-server
+install -D -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/vnc-httpd
+%endif
+
install -D -m 644 %{SOURCE7} $RPM_BUILD_ROOT/etc/slp.reg.d/vnc.reg
install -D -m 755 %{SOURCE8} $RPM_BUILD_ROOT%{_bindir}/vncpasswd.arg
install -D -m 644 %{SOURCE9} $RPM_BUILD_ROOT/etc/pam.d/vnc
@@ -435,8 +450,15 @@ usermod -G shadow -a %{vncuser} || :
%exclude /var/lib/xkb/compiled/README.compiled
+%if %{use_firewalld}
+%dir %{_libexecdir}/firewalld
+%dir %{_libexecdir}/firewalld/services
+%{_libexecdir}/firewalld/services/tigervnc.xml
+%{_libexecdir}/firewalld/services/tigervnc-https.xml
+%else
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/vnc-server
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/vnc-httpd
+%endif
%ifnarch s390 s390x
%config(noreplace) /etc/X11/xorg.conf.d/10-libvnc.conf
diff --git a/vnc-httpd.firewall b/vnc-httpd.susefirewall
similarity index 100%
rename from vnc-httpd.firewall
rename to vnc-httpd.susefirewall
diff --git a/vnc-server.firewall b/vnc-server.susefirewall
similarity index 100%
rename from vnc-server.firewall
rename to vnc-server.susefirewall