File hostapd.spec of Package hostapd.openSUSE_Leap_42.3_Update

#
# spec file for package hostapd
#
# 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
# 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 https://bugs.opensuse.org/
#


Name:           hostapd
BuildRequires:  libnl3-devel
BuildRequires:  openssl-devel
BuildRequires:  pkg-config
BuildRequires:  sqlite3-devel
BuildRequires:  pkgconfig(libnl-3.0) >= 3.0
BuildRequires:  pkgconfig(systemd)
Summary:        Turns Your WLAN Card into a WPA capable Access Point
License:        GPL-2.0-only OR BSD-3-Clause
Group:          Hardware/Wifi
Version:        2.6
Release:        0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://w1.fi/
Source:         http://w1.fi/releases/hostapd-%{version}.tar.gz
Source1:        hostapd.service
Patch0:         hostapd-2.6-defconfig.patch
Patch1:         rebased-v2.6-0001-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
Patch2:         rebased-v2.6-0002-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
Patch3:         rebased-v2.6-0003-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
Patch4:         rebased-v2.6-0004-Prevent-installation-of-an-all-zero-TK.patch
Patch5:         rebased-v2.6-0005-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
Patch6:         rebased-v2.6-0006-TDLS-Reject-TPK-TK-reconfiguration.patch
Patch7:         rebased-v2.6-0008-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
Patch8:         rebased-v2.6-0001-WPA-Ignore-unauthenticated-encrypted-EAPOL-Key-data.patch
%{?systemd_requires}

%description
hostapd is a user space daemon for access point and authentication
servers. It implements IEEE 802.11 access point management, IEEE
802.1X/WPA/WPA2/EAP Authenticators, RADIUS client, EAP server, and
RADIUS authentication server. Currently, hostapd supports HostAP,
madwifi, and prism54 drivers. It also supports wired IEEE 802.1X
authentication via any ethernet driver.


%prep
%setup -q -n hostapd-%{version}
%patch0
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1

cd hostapd
cp defconfig .config

%build
cd hostapd
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE $(getconf LFS_CFLAGS)" CC="%{__cc}" make  %{?_smp_mflags} V=1

%install
cd hostapd
mkdir -p %{buildroot}/%{_sbindir}
mkdir %{buildroot}/etc
mkdir -p %{buildroot}/%{_mandir}/man8
install -m 755 hostapd %{buildroot}/%{_sbindir}
ln -s /usr/sbin/service %{buildroot}/%{_sbindir}/rchostapd
install -m 755 hostapd_cli %{buildroot}/%{_sbindir}
install -m 600 hostapd.conf %{buildroot}/etc
install -m 644 hostapd.accept %{buildroot}/etc
install -m 644 hostapd.deny %{buildroot}/etc
install -m 600 hostapd.eap_user %{buildroot}/etc
install -m 600 hostapd.radius_clients %{buildroot}/etc
install -m 644 hostapd.sim_db %{buildroot}/etc
install -m 644 hostapd.vlan %{buildroot}/etc
install -m 600 hostapd.wpa_psk %{buildroot}/etc
install -m 644 hostapd.8 %{buildroot}/%{_mandir}/man8
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/hostapd.service

%pre
%service_add_pre hostapd.service

%post
%service_add_post hostapd.service

%preun
%service_del_preun hostapd.service

%postun
%service_del_postun hostapd.service

%files
%defattr(-,root,root)
%config(noreplace) /etc/hostapd.*
%{_sbindir}/*
%doc hostapd/ChangeLog COPYING hostapd/README hostapd/wired.conf hostapd/hostapd.conf
%doc %{_mandir}/man8/*
%{_unitdir}/hostapd.service

%changelog
openSUSE Build Service is sponsored by