From 13a6e6ba6902f7bd14e2030502276e9e135d56d3ff6c82f563795635e2a0a670 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 12 Oct 2011 13:23:57 +0000 Subject: [PATCH] Accepting request 87488 from home:lnussel:branches:Base:System - update to version 0.7.3 - don't use /tmp for dump file in default config - verbose build - fix build for older distros - enable driver 'none' for radius only mode - add init script OBS-URL: https://build.opensuse.org/request/show/87488 OBS-URL: https://build.opensuse.org/package/show/Base:System/hostapd?expand=0&rev=12 --- git-commit-eb1f744.diff | 45 ------------------- hostapd-0.6.10.tar.gz | 3 -- hostapd-0.7.3.tar.gz | 3 ++ hostapd-tmp.diff | 13 ++++++ hostapd.changes | 10 +++++ hostapd.dif | 36 ++++++++++----- hostapd.init | 99 +++++++++++++++++++++++++++++++++++++++++ hostapd.spec | 48 ++++++++++++++------ 8 files changed, 185 insertions(+), 72 deletions(-) delete mode 100644 git-commit-eb1f744.diff delete mode 100644 hostapd-0.6.10.tar.gz create mode 100644 hostapd-0.7.3.tar.gz create mode 100644 hostapd-tmp.diff create mode 100644 hostapd.init diff --git a/git-commit-eb1f744.diff b/git-commit-eb1f744.diff deleted file mode 100644 index dbde24f..0000000 --- a/git-commit-eb1f744.diff +++ /dev/null @@ -1,45 +0,0 @@ -commit eb1f7446b5b86cceb1508f060f5e66e5dd791a4d -Author: Jouni Malinen -Date: Thu Mar 12 21:57:08 2009 +0200 - - Move DTIM period configuration into Beacon set operation - - This is needed to make mac80211 work with multi-BSS configuration. The - previous design ended up setting DTIM period for secondary BSSes before - setting the Beacon and driver_nl80211.c was not really prepared for - that. Eventually, the Beacon configuration routines should be combined - into a single driver operation, but for now, just moving this call is - the simplest workaround. - -diff --git a/hostapd/beacon.c b/hostapd/beacon.c -index b7eb86a..8ccfa12 100644 ---- a/hostapd/beacon.c -+++ b/hostapd/beacon.c -@@ -434,6 +434,10 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd) - os_free(tail); - os_free(head); - -+ if (hostapd_set_dtim_period(hapd, hapd->conf->dtim_period)) -+ wpa_printf(MSG_ERROR, "Could not set DTIM period for kernel " -+ "driver"); -+ - if (hostapd_set_cts_protect(hapd, cts_protection)) - wpa_printf(MSG_ERROR, "Failed to set CTS protect in kernel " - "driver"); -diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c -index 308d816..8531d0a 100644 ---- a/hostapd/hostapd.c -+++ b/hostapd/hostapd.c -@@ -1292,12 +1292,6 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) - return -1; - } - -- if (hostapd_set_dtim_period(hapd, hapd->conf->dtim_period)) { -- wpa_printf(MSG_ERROR, "Could not set DTIM period for kernel " -- "driver"); -- return -1; -- } -- - /* Set SSID for the kernel driver (to be used in beacon and probe - * response frames) */ - if (set_ssid && hostapd_set_ssid(hapd, (u8 *) conf->ssid.ssid, diff --git a/hostapd-0.6.10.tar.gz b/hostapd-0.6.10.tar.gz deleted file mode 100644 index de9623f..0000000 --- a/hostapd-0.6.10.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:53cb165d5fec821f186b811beb2fcb212964b1a8ea84cc8cfcf229227989581b -size 1100734 diff --git a/hostapd-0.7.3.tar.gz b/hostapd-0.7.3.tar.gz new file mode 100644 index 0000000..8fb3f2e --- /dev/null +++ b/hostapd-0.7.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31eb2781f37e1a4c27969d1594f8019c0ca87779349c099ab812833289961567 +size 1138869 diff --git a/hostapd-tmp.diff b/hostapd-tmp.diff new file mode 100644 index 0000000..e4bee29 --- /dev/null +++ b/hostapd-tmp.diff @@ -0,0 +1,13 @@ +Index: hostapd-0.7.3/hostapd/hostapd.conf +=================================================================== +--- hostapd-0.7.3.orig/hostapd/hostapd.conf ++++ hostapd-0.7.3/hostapd/hostapd.conf +@@ -52,7 +52,7 @@ logger_stdout=-1 + logger_stdout_level=2 + + # Dump file for state information (on SIGUSR1) +-dump_file=/tmp/hostapd.dump ++dump_file=/var/run/hostapd.dump + + # Interface for separate control program. If this is specified, hostapd + # will create this directory and a UNIX domain socket for listening to requests diff --git a/hostapd.changes b/hostapd.changes index bfae7fc..b02e9b2 100644 --- a/hostapd.changes +++ b/hostapd.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Oct 12 08:46:43 UTC 2011 - lnussel@suse.de + +- update to version 0.7.3 +- don't use /tmp for dump file in default config +- verbose build +- fix build for older distros +- enable driver 'none' for radius only mode +- add init script + ------------------------------------------------------------------- Fri Sep 30 15:22:48 UTC 2011 - uli@suse.com diff --git a/hostapd.dif b/hostapd.dif index cb8d8d2..e3d9821 100644 --- a/hostapd.dif +++ b/hostapd.dif @@ -1,6 +1,8 @@ ---- defconfig.orig 2010-06-09 01:28:31.000000000 +0200 -+++ defconfig 2010-06-09 01:34:34.000000000 +0200 -@@ -13,17 +13,17 @@ +Index: hostapd-0.7.3/hostapd/defconfig +=================================================================== +--- hostapd-0.7.3.orig/hostapd/defconfig ++++ hostapd-0.7.3/hostapd/defconfig +@@ -13,14 +13,14 @@ CONFIG_DRIVER_HOSTAP=y # Driver interface for wired authenticator @@ -11,17 +13,22 @@ #CONFIG_DRIVER_MADWIFI=y #CFLAGS += -I../../madwifi # change to the madwifi source directory - # Driver interface for Prism54 driver --#CONFIG_DRIVER_PRISM54=y -+CONFIG_DRIVER_PRISM54=y - # Driver interface for drivers using the nl80211 kernel interface -#CONFIG_DRIVER_NL80211=y +CONFIG_DRIVER_NL80211=y # driver_nl80211.c requires a rather new libnl (version 1.1) which may not be # shipped with your distribution yet. If that is the case, you need to build # newer libnl version and point the hostapd build to use it. -@@ -76,7 +76,7 @@ +@@ -36,7 +36,7 @@ CONFIG_DRIVER_HOSTAP=y + #LIBS_c += -L/usr/local/lib + + # Driver interface for no driver (e.g., RADIUS server only) +-#CONFIG_DRIVER_NONE=y ++CONFIG_DRIVER_NONE=y + + # IEEE 802.11F/IAPP + CONFIG_IAPP=y +@@ -75,7 +75,7 @@ CONFIG_EAP_GTC=y CONFIG_EAP_TTLS=y # EAP-SIM for the integrated EAP server @@ -30,7 +37,7 @@ # EAP-AKA for the integrated EAP server #CONFIG_EAP_AKA=y -@@ -86,10 +86,10 @@ +@@ -85,10 +85,10 @@ CONFIG_EAP_TTLS=y #CONFIG_EAP_AKA_PRIME=y # EAP-PAX for the integrated EAP server @@ -43,7 +50,7 @@ # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y -@@ -123,7 +123,7 @@ +@@ -122,7 +122,7 @@ CONFIG_PKCS12=y # RADIUS authentication server. This provides access to the integrated EAP # server from external hosts using RADIUS. @@ -52,3 +59,12 @@ # Build IPv6 support for RADIUS operations CONFIG_IPV6=y +@@ -135,7 +135,7 @@ CONFIG_IPV6=y + #CONFIG_DRIVER_RADIUS_ACL=y + + # IEEE 802.11n (High Throughput) support +-#CONFIG_IEEE80211N=y ++CONFIG_IEEE80211N=y + + # Remove debugging code that is printing out debug messages to stdout. + # This can be used to reduce the size of the hostapd considerably if debugging diff --git a/hostapd.init b/hostapd.init new file mode 100644 index 0000000..fc776df --- /dev/null +++ b/hostapd.init @@ -0,0 +1,99 @@ +#!/bin/sh +# +# SUSE system startup script for hostapd +# Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc. +# Copyright (C) 2011 SUSE Linux Products GmbH +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or (at +# your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, +# USA. +# +# /etc/init.d/hostapd +# and its symbolic link +# /usr/sbin/rchostapd +# +### BEGIN INIT INFO +# Provides: hostapd +# Required-Start: $syslog $remote_fs +# Required-Stop: $syslog $remote_fs +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: hostap deamon +# Description: IEEE 802.11 access point and authenticator +### END INIT INFO + +HOSTAPD_BIN=/usr/sbin/hostapd +HOSTAPD_PID=/var/run/hostapd.pid +HOSTAPD_ARGS="-B -P $HOSTAPD_PID" +HOSTAPD_CONF=/etc/hostapd.conf + +sysconf=/etc/sysconfig/hostapd +if [ -e $sysconf ]; then + . $sysconf +fi + +. /etc/rc.status + +rc_reset +case "$1" in + start) + echo -n "Starting hostapd " + /sbin/start_daemon -p $HOSTAPD_PID $HOSTAPD_BIN $HOSTAPD_ARGS $HOSTAPD_CONF + rc_status -v + ;; + stop) + echo -n "Shutting down hostapd " + /sbin/killproc $HOSTAPD_BIN + rc_status -v + ;; + try-restart|condrestart) + $0 status + if test $? = 0; then + $0 restart + else + rc_reset + fi + rc_status + ;; + restart) + $0 stop + $0 start + rc_status + ;; + force-reload) + echo -n "Reload service hostapd " + /sbin/killproc -HUP $HOSTAPD_BIN + touch $HOSTAPD_PID + rc_status -v + ;; + reload) + echo -n "Reload service hostapd " + /sbin/killproc -HUP $HOSTAPD_BIN + touch $HOSTAPD_PID + rc_status -v + ;; + status) + echo -n "Checking for service hostapd " + /sbin/checkproc $HOSTAPD_BIN + rc_status -v + ;; + probe) + test $HOSTAPD_CONF -nt $HOSTAPD_PID && echo reload + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" + exit 1 + ;; +esac +rc_exit diff --git a/hostapd.spec b/hostapd.spec index 044094d..45a52ef 100644 --- a/hostapd.spec +++ b/hostapd.spec @@ -19,21 +19,24 @@ Name: hostapd -BuildRequires: libnl-1_1-devel openssl-devel +%if 0%{?suse_version} > 1140 +BuildRequires: libnl-1_1-devel +%else +BuildRequires: libnl-devel +%endif +BuildRequires: openssl-devel Summary: Turns Your WLAN Card into a WPA capable Access Point -Version: 0.6.10 -Release: 4 +Version: 0.7.3 +Release: 0 Group: Hardware/Wifi License: BSD3c ; GPLv2+ BuildRoot: %{_tmppath}/%{name}-%{version}-build -#Provides: -#Requires: -#Conflicts: Url: http://hostap.epitest.fi/ -AutoReqProv: on -Source: hostapd-%{version}.tar.gz +PreReq: %insserv_prereq +Source: http://hostap.epitest.fi/releases/hostapd-%{version}.tar.gz +Source1: hostapd.init Patch: hostapd.dif -Patch1: git-commit-eb1f744.diff +Patch1: hostapd-tmp.diff %description hostapd is a user space daemon for access point and authentication @@ -50,19 +53,25 @@ Authors: Jouni Malinen %prep -%setup -n hostapd-%{version}/hostapd -%patch -p0 -%patch1 -p2 +%setup -n hostapd-%{version} +%patch -p1 +%patch1 -p1 + +cd hostapd cp defconfig .config %build -CFLAGS="$RPM_OPT_FLAGS" CC="%{__cc}" make %{?_smp_mflags} +cd hostapd +CFLAGS="$RPM_OPT_FLAGS" 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} +install -D -m 755 %{SOURCE1} %{buildroot}/etc/init.d/hostapd +ln -s /etc/init.d/hostapd %{buildroot}/%{_sbindir}/rchostapd install -m 755 hostapd_cli %{buildroot}/%{_sbindir} install -m 644 hostapd.conf %{buildroot}/etc install -m 644 hostapd.accept %{buildroot}/etc @@ -74,14 +83,25 @@ install -m 644 hostapd.vlan %{buildroot}/etc install -m 644 hostapd.wpa_psk %{buildroot}/etc install -m 644 hostapd.8 %{buildroot}/%{_mandir}/man8 +%post +%insserv_cleanup + +%preun +%{stop_on_removal hostapd} + +%postun +%{restart_on_update hostapd} +%insserv_cleanup + %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %config(noreplace) /etc/* +/etc/init.d/hostapd %{_sbindir}/* -%doc ChangeLog ../COPYING README wired.conf +%doc hostapd/ChangeLog COPYING hostapd/README hostapd/wired.conf hostapd/hostapd.conf %doc %{_mandir}/man8/* %changelog