File wpa_supplicant.spec of Package wpa_supplicant

# spec file for package wpa_supplicant
# Copyright (c) 2014 SUSE LINUX Products 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

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
BuildRequires:  libnl3-devel
Version:        2.2
Release:        0
Summary:        WPA supplicant implementation
License:        BSD-3-Clause and GPL-2.0+
Group:          Productivity/Networking/Other
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
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       logrotate
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run

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.

    Jouni Malinen <>

%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.

    Jouni Malinen <>

%setup -q -n wpa_supplicant-%{version}
rm -rf wpa_supplicant-%{version}/patches
cp %{SOURCE1} wpa_supplicant/.config
%patch1 -p0
%patch2 -p1

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

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}

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

%service_add_post wpa_supplicant.service

%service_del_preun wpa_supplicant.service

%service_del_postun wpa_supplicant.service

%doc wpa_supplicant/ChangeLog COPYING README wpa_supplicant/todo.txt wpa_supplicant/examples wpa_supplicant/wpa_supplicant.conf
%config %{_sysconfdir}/dbus-1/system.d/%{name}.conf
%config %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/wpa_supplicant
%dir %{_rundir}/%{name}
%if 0%{?suse_version} > 1140
%ghost %{_rundir}/%{name}
%if 0%{?suse_version} > 1230
%dir %{_sysconfdir}/%{name}
%doc %{_mandir}/man8/*
%doc %{_mandir}/man5/*

%files gui