File wpa_supplicant.spec of Package wpa_supplicant.5882

#
# spec file for package wpa_supplicant
#
# Copyright (c) 2017 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           wpa_supplicant
BuildRequires:  dbus-1-devel
BuildRequires:  libqt4
BuildRequires:  libqt4-devel
BuildRequires:  openssl-devel
BuildRequires:  pkg-config
BuildRequires:  readline-devel
%if 0%{?suse_version} > 1230
BuildRequires:  systemd-rpm-macros
%systemd_requires
%endif
BuildRequires:  libnl3-devel
Url:            http://hostap.epitest.fi/wpa_supplicant/
Version:        2.2
Release:        0
Summary:        WPA supplicant implementation
License:        BSD-3-Clause and GPL-2.0+
Group:          Productivity/Networking/Other
Source:         http://hostap.epitest.fi/releases/wpa_supplicant-%{version}.tar.gz
Source1:        config
Source2:        %{name}.conf
Source3:        fi.epitest.hostap.WPASupplicant.service
Source4:        logrotate.wpa_supplicant
Source5:        fi.w1.wpa_supplicant1.service
Source6:        wpa_supplicant.service
# wpa_supplicant-flush-debug-output.patch won't go upstream as it might
# change timings
Patch1:         wpa_supplicant-flush-debug-output.patch
# wpa_supplicant-sigusr1-changes-debuglevel.patch won't go upstream as it
# is not portable
Patch2:         wpa_supplicant-sigusr1-changes-debuglevel.patch
# CVE-2014-3686
Patch3:         0001-Add-os_exec-helper-to-run-external-programs.patch
Patch4:         0002-wpa_cli-Use-os_exec-for-action-script-execution.patch
# CVE-2015-0210
Patch5:         0013-rh1178263-CVE-2015-0210-domain_match.patch
Patch6:         0014-rh1178263-CVE-2015-0210-cert_in_cb.patch
# CVE-2015-1863
Patch7:         0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch
# PATCH-FIX-UPSTREAM 0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch bnc#930077
Patch8:         0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
# PATCH-FIX-UPSTREAM 0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch bnc#930078
Patch9:         0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch
# PATCH-FIX-UPSTREAM 0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch bnc#930079
Patch10:        0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch
# PATCH-FIX-UPSTREAM 0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch bnc#930079
Patch11:        0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch
# PATCH-FIX-UPSTREAM 0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch bnc#930079
Patch12:        0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch
# PATCH-FIX-UPSTREAM 0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch bnc#930079
Patch13:        0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch
# PATCH-FIX-UPSTREAM 0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch bnc#930079
Patch14:        0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch
# PATCH-FIX-UPSTREAM 0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch bnc#937419
Patch15:        0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch
# PATCH-FIX-UPSTREAM 0001-WNM-sleep-gtk-CVE-2015-5130.patch bnc#952254
Patch16:        0001-WNM-sleep-gtk-CVE-2015-5130.patch
Patch22:        0002-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
Patch23:        0003-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
Patch24:        0004-Prevent-installation-of-an-all-zero-TK.patch
Patch25:        0005-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
Patch26:        0006-TDLS-Reject-TPK-TK-reconfiguration.patch
Patch27:        0007-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
Patch28:        0008-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       logrotate
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif

%description
wpa_supplicant is an implementation of the WPA Supplicant component,
i.e., the part that runs in the client stations. It implements key
negotiation with a WPA Authenticator and it controls the roaming and
IEEE 802.11 authentication/association of the wlan driver.


Authors:
--------
    Jouni Malinen <jkmaline@cc.hut.fi>

%package gui
Summary:        WPA supplicant graphical front-end
Group:          System/Monitoring
Requires:       wpa_supplicant

%description gui
This package contains a graphical front-end to wpa_supplicant, an
implementation of the WPA Supplicant component.


Authors:
--------
    Jouni Malinen <jkmaline@cc.hut.fi>

%prep
%setup -q -n wpa_supplicant-%{version}
rm -rf wpa_supplicant-%{version}/patches
cp %{SOURCE1} wpa_supplicant/.config
%patch1 -p0
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1

%build
cd wpa_supplicant
CFLAGS="$RPM_OPT_FLAGS" make V=1 %{?_smp_mflags}
cd wpa_gui-qt4
qmake QMAKE_CXXFLAGS="$RPM_OPT_FLAGS" QMAKE_CFLAGS="$RPM_OPT_FLAGS"
make %{?_smp_mflags}

%install
install -d %{buildroot}/%{_sbindir}
install -m 0755 wpa_supplicant/wpa_cli %{buildroot}%{_sbindir}
install -m 0755 wpa_supplicant/wpa_passphrase %{buildroot}%{_sbindir}
install -m 0755 wpa_supplicant/wpa_supplicant %{buildroot}%{_sbindir}
install -d %{buildroot}%{_sysconfdir}/dbus-1/system.d
install -m 0644 wpa_supplicant/dbus/dbus-wpa_supplicant.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/wpa_supplicant.conf
install -d %{buildroot}/%{_sysconfdir}/%{name}
install -m 0600 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name}
install -d %{buildroot}/%{_datadir}/dbus-1/system-services
install -m 0644 %{SOURCE3} %{buildroot}/%{_datadir}/dbus-1/system-services
install -m 0644 %{SOURCE5} %{buildroot}/%{_datadir}/dbus-1/system-services
install -d %{buildroot}/%{_sysconfdir}/logrotate.d/
install -m 644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/logrotate.d/wpa_supplicant
install -d %{buildroot}/%{_rundir}/%{name}
install -d %{buildroot}%{_mandir}/man{5,8}
install -m 0644 wpa_supplicant/doc/docbook/*.8 %{buildroot}%{_mandir}/man8
install -m 0644 wpa_supplicant/doc/docbook/*.5 %{buildroot}%{_mandir}/man5
install -m 755 wpa_supplicant/wpa_gui-qt4/wpa_gui %{buildroot}%{_sbindir}
%if 0%{?suse_version} > 1230
install -d %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}
%endif

%if 0%{?suse_version} > 1230
%pre
%service_add_pre wpa_supplicant.service

%post
%service_add_post wpa_supplicant.service

%preun
%service_del_preun wpa_supplicant.service

%postun
%service_del_postun wpa_supplicant.service
%endif

%files
%defattr(-,root,root)
%doc wpa_supplicant/ChangeLog COPYING README wpa_supplicant/todo.txt wpa_supplicant/examples wpa_supplicant/wpa_supplicant.conf
%{_sbindir}/wpa_cli
%{_sbindir}/wpa_passphrase
%{_sbindir}/wpa_supplicant
%config %{_sysconfdir}/dbus-1/system.d/%{name}.conf
%{_datadir}/dbus-1/system-services
%config %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/wpa_supplicant
%dir %{_rundir}/%{name}
%if 0%{?suse_version} > 1140
%ghost %{_rundir}/%{name}
%endif
%if 0%{?suse_version} > 1230
%{_unitdir}/wpa_supplicant.service
%endif
%dir %{_sysconfdir}/%{name}
%doc %{_mandir}/man8/*
%doc %{_mandir}/man5/*

%files gui
%defattr(-,root,root)
/usr/sbin/wpa_gui

%changelog
openSUSE Build Service is sponsored by