lkundrak / rpms / hostapd

Forked from rpms/hostapd 4 years ago
Clone
616d7d9
Name:           hostapd
John W. Linville 6b003fc
Version:        1.0
e775a92
Release:        4%{?dist}
616d7d9
Summary:        IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
616d7d9
Group:          System Environment/Daemons
616d7d9
License:        BSD
616d7d9
URL:            http://w1.fi/hostapd
616d7d9
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)  
John W. Linville 1118fe3
Source0:        http://w1.fi/releases/%{name}-%{version}.tar.gz
b0c3b13
Source1:        %{name}.service
616d7d9
Source2:        %{name}.conf
616d7d9
Source3:        %{name}.sysconfig
616d7d9
Patch0:         hostapd-RPM_OPT_FLAGS.patch
John W. Linville 11cd48b
Patch1:         hostapd-EAP-TLS-server-Fix-TLS-Message-Length-validation.patch
616d7d9
616d7d9
BuildRequires:  libnl-devel >= 1.1
616d7d9
BuildRequires:  openssl-devel
John W. Linville 2983da3
BuildRequires:  systemd-units
616d7d9
b0c3b13
#Requires(post): chkconfig
b0c3b13
#Requires(preun): chkconfig
b0c3b13
## This is for /sbin/service
b0c3b13
#Requires(preun): initscripts
b0c3b13
Requires(post): systemd-units
b0c3b13
Requires(preun): systemd-units
b0c3b13
Requires(postun): systemd-units
616d7d9
616d7d9
%description
616d7d9
hostapd is a user space daemon for access point and authentication
616d7d9
servers.  It implements IEEE 802.11 access point management, IEEE
616d7d9
802.1X/WPA/WPA2/EAP Authenticators and RADIUS authentication server.
616d7d9
616d7d9
hostapd is designed to be a "daemon" program that runs in the back-
616d7d9
ground and acts as the backend component controlling authentication.
616d7d9
hostapd supports separate frontend programs and an example text-based
616d7d9
frontend, hostapd_cli, is included with hostapd.
616d7d9
616d7d9
%package logwatch
616d7d9
Summary: Logwatch scripts for hostapd
616d7d9
Requires: %{name} = %{version}-%{release} logwatch perl
616d7d9
%description logwatch
616d7d9
Logwatch scripts for hostapd
616d7d9
616d7d9
616d7d9
%prep
616d7d9
%setup -q
616d7d9
616d7d9
# Hack Makefile to allow use of RPM_OPT_FLAGS
616d7d9
%patch0 -p1
616d7d9
John W. Linville 11cd48b
# git://w1.fi/srv/git/hostap.git
John W. Linville 11cd48b
# 	commit 586c446e0ff42ae00315b014924ec669023bd8de
John W. Linville 11cd48b
%patch1 -p1
John W. Linville 11cd48b
John W. Linville 72a6d75
# Prepare default config file
John W. Linville 72a6d75
cat %{SOURCE2} | sed -e 's/HOSTAPD_VERSION/'%{version}'/' > hostapd.conf
John W. Linville 72a6d75
616d7d9
616d7d9
%build
616d7d9
cd hostapd
616d7d9
cat defconfig | sed -e '/^#CONFIG_DRIVER_NL80211=y/s/^#//' \
John W. Linville 1118fe3
                        -e '/^#CONFIG_RADIUS_SERVER=y/s/^#//' \
John W. Linville 1118fe3
                        -e '/^#CONFIG_DRIVER_WIRED=y/s/^#//' \
John W. Linville 1118fe3
                        -e '/^#CONFIG_DRIVER_NONE=y/s/^#//' \
John W. Linville 1118fe3
                        -e '/^#CONFIG_IEEE80211N=y/s/^#//' > .config
616d7d9
make %{?_smp_mflags} EXTRA_CFLAGS="$RPM_OPT_FLAGS"
616d7d9
616d7d9
616d7d9
%install
616d7d9
rm -rf %{buildroot}
616d7d9
616d7d9
# init scripts
b0c3b13
install -d %{buildroot}/%{_unitdir}
b0c3b13
install -pm 0755 %{SOURCE1} %{buildroot}/%{_unitdir}/hostapd.service
616d7d9
616d7d9
# logwatch files
616d7d9
install -d %{buildroot}/%{_sysconfdir}/logwatch/conf/services
616d7d9
install -pm 0644 hostapd/logwatch/hostapd.conf  \
616d7d9
        %{buildroot}/%{_sysconfdir}/logwatch/conf/services/hostapd.conf
616d7d9
install -d %{buildroot}/%{_sysconfdir}/logwatch/scripts/services
616d7d9
install -pm 0755 hostapd/logwatch/hostapd \
616d7d9
        %{buildroot}/%{_sysconfdir}/logwatch/scripts/services/hostapd
616d7d9
616d7d9
# config files
616d7d9
install -d %{buildroot}/%{_sysconfdir}/%{name}
John W. Linville 48be616
install -pm 0600 hostapd.conf %{buildroot}/%{_sysconfdir}/%{name}/hostapd.conf
616d7d9
616d7d9
install -d %{buildroot}/%{_sysconfdir}/sysconfig
616d7d9
install -pm 0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/sysconfig/hostapd
616d7d9
616d7d9
# binaries
616d7d9
install -d %{buildroot}/%{_sbindir}
616d7d9
install -pm 0755 hostapd/hostapd %{buildroot}%{_sbindir}/hostapd
616d7d9
install -pm 0755 hostapd/hostapd_cli %{buildroot}%{_sbindir}/hostapd_cli
616d7d9
616d7d9
# man pages
616d7d9
install -d %{buildroot}%{_mandir}/man{1,8}
9ad39f4
install -pm 0644 hostapd/hostapd_cli.1 %{buildroot}%{_mandir}/man1
9ad39f4
install -pm 0644 hostapd/hostapd.8 %{buildroot}%{_mandir}/man8
616d7d9
616d7d9
# prepare docs
616d7d9
cp hostapd/README ./README.hostapd
John W. Linville 72a6d75
cp hostapd/README-WPS ./README-WPS.hostapd
616d7d9
cp hostapd/logwatch/README ./README.logwatch
616d7d9
616d7d9
616d7d9
%clean
616d7d9
rm -rf %{buildroot}
616d7d9
616d7d9
616d7d9
%files
616d7d9
%defattr(-,root,root,-)
John W. Linville 72a6d75
%doc COPYING README README.hostapd README-WPS.hostapd
616d7d9
%doc hostapd/hostapd.conf hostapd/wired.conf
616d7d9
%doc hostapd/hostapd.accept hostapd/hostapd.deny
616d7d9
%doc hostapd/hostapd.eap_user hostapd/hostapd.radius_clients
616d7d9
%doc hostapd/hostapd.vlan hostapd/hostapd.wpa_psk
616d7d9
%config(noreplace) %{_sysconfdir}/%{name}/hostapd.conf
616d7d9
%config(noreplace) %{_sysconfdir}/sysconfig/hostapd
John W. Linville 2983da3
%{_unitdir}/hostapd.service
616d7d9
%{_sbindir}/hostapd
616d7d9
%{_sbindir}/hostapd_cli
616d7d9
%dir %{_sysconfdir}/%{name}
616d7d9
%{_mandir}/man1/*
616d7d9
%{_mandir}/man8/*
616d7d9
616d7d9
%files logwatch
616d7d9
%defattr(-,root,root,-)
616d7d9
%doc hostapd/logwatch/README
616d7d9
%config(noreplace) %{_sysconfdir}/logwatch/conf/services/hostapd.conf
616d7d9
%{_sysconfdir}/logwatch/scripts/services/hostapd
616d7d9
616d7d9
616d7d9
%post
b0c3b13
#/sbin/chkconfig --add %{name}
b0c3b13
if [ $1 -eq 1 ] ; then 
b0c3b13
    # Initial installation 
b0c3b13
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
b0c3b13
fi
616d7d9
616d7d9
%preun
b0c3b13
#if [ $1 = 0 ]; then
b0c3b13
#        /sbin/service %{name} stop >/dev/null 2>&1
b0c3b13
#        /sbin/chkconfig --del %{name}
b0c3b13
#fi
b0c3b13
if [ $1 -eq 0 ] ; then
b0c3b13
    # Package removal, not upgrade
b0c3b13
    /bin/systemctl --no-reload disable hostapd.service > /dev/null 2>&1 || :
b0c3b13
    /bin/systemctl stop hostapd.service > /dev/null 2>&1 || :
b0c3b13
fi
b0c3b13
b0c3b13
%postun
b0c3b13
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
b0c3b13
if [ $1 -ge 1 ] ; then
b0c3b13
    # Package upgrade, not uninstall
b0c3b13
    /bin/systemctl try-restart hostapd.service >/dev/null 2>&1 || :
616d7d9
fi
616d7d9
b0c3b13
%triggerun -- hostapd < 0.7.3-5
b0c3b13
# Save the current service runlevel info
b0c3b13
# User must manually run systemd-sysv-convert --apply hostapd
b0c3b13
# to migrate them to systemd targets
b0c3b13
/usr/bin/systemd-sysv-convert --save hostapd >/dev/null 2>&1 ||:
b0c3b13
b0c3b13
# Run these because the SysV package being removed won't do them
b0c3b13
/sbin/chkconfig --del hostapd >/dev/null 2>&1 || :
b0c3b13
/bin/systemctl try-restart hostapd.service >/dev/null 2>&1 || :
b0c3b13
616d7d9
616d7d9
%changelog
e775a92
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-4
e775a92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
e775a92
John W. Linville 11cd48b
* Mon Oct  8 2012 John W. Linville <linville@redhat.com> - 1.0-3
John W. Linville 11cd48b
- EAP-TLS: Add extra validation for TLS Message Length
John W. Linville 11cd48b
438eb5e
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
438eb5e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
438eb5e
John W. Linville 6b003fc
* Fri Jun  8 2012 John W. Linville <linville@redhat.com> - 1.0-1
John W. Linville 6b003fc
- Update to version 1.0 from upstream
John W. Linville 6b003fc
John W. Linville d283ee2
* Fri Jun  8 2012 John W. Linville <linville@redhat.com> - 0.7.3-9
John W. Linville d283ee2
- Remove hostapd-specific runtime state directory
John W. Linville d283ee2
John W. Linville 05a3aac
* Wed Jun  6 2012 John W. Linville <linville@redhat.com> - 0.7.3-8
John W. Linville 05a3aac
- Fixup typo in pid file path in hostapd.service
John W. Linville 05a3aac
John W. Linville 2983da3
* Wed May 30 2012 John W. Linville <linville@redhat.com> - 0.7.3-7
John W. Linville 2983da3
- Add BuildRequires for systemd-units
John W. Linville 2983da3
John W. Linville 48be616
* Fri May 25 2012 John W. Linville <linville@redhat.com> - 0.7.3-6
John W. Linville 48be616
- Fixup typo in configuration file path in hostapd.service
John W. Linville 48be616
- Tighten-up default permissions for hostapd.conf
John W. Linville 48be616
b0c3b13
* Tue Feb 28 2012 Jon Ciesla <limburgher@gmail.com> - 0.7.3-5
b0c3b13
- Migrate to systemd, BZ 770310.
b0c3b13
John W. Linville 72a6d75
* Wed Jan 18 2012 John W. Linville <linville@redhat.com> - 0.7.3-4
John W. Linville 72a6d75
- Add reference to sample hostapd.conf in the default installed version
John W. Linville 72a6d75
- Include README-WPS from the hostapd distribution as part of the docs
John W. Linville 72a6d75
8b8bf7e
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.3-3
8b8bf7e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
8b8bf7e
e444920
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.3-2
e444920
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
e444920
John W. Linville 41e739b
* Thu Dec 23 2010 John W. Linville <linville@redhat.com> - 0.7.3-1
John W. Linville 41e739b
- Update to version 0.7.3
John W. Linville 41e739b
John W. Linville 1118fe3
* Wed Nov 24 2010 John W. Linville <linville@redhat.com> - 0.6.10-3
John W. Linville 1118fe3
- Use ghost directive for /var/run/hostapd
John W. Linville 1118fe3
- Remove some rpmlint warnings
John W. Linville 1118fe3
4f1cc14
* Thu May 27 2010 John W. Linville <linville@redhat.com> - 0.6.10-2
4f1cc14
- Move DTIM period configuration into Beacon set operation
4f1cc14
98ff3a3
* Mon May 10 2010 John W. Linville <linville@redhat.com> - 0.6.10-1
98ff3a3
- Update to version 0.6.10
98ff3a3
9ad39f4
* Tue Jan 19 2010 John W. Linville <linville@redhat.com> - 0.6.9-8
9ad39f4
- Do not compress man pages manually in spec file
9ad39f4
- Correct date of previous changelog entry
9ad39f4
9ad39f4
* Thu Jan 14 2010 John W. Linville <linville@redhat.com> - 0.6.9-7
c452e45
- Enable 802.11n support
c452e45
616d7d9
* Thu Dec 17 2009 John W. Linville <linville@redhat.com> - 0.6.9-6
616d7d9
- Enable RADIUS server
616d7d9
- Enable "wired" and "none" drivers
616d7d9
- Use BSD license option
616d7d9
616d7d9
* Wed Dec 16 2009 John W. Linville <linville@redhat.com> - 0.6.9-5
616d7d9
- Use openssl instead of gnutls (broken)
616d7d9
616d7d9
* Wed Dec 16 2009 John W. Linville <linville@redhat.com> - 0.6.9-4
John W. Linville 1118fe3
- Remove wired.conf from doc (not in chosen configuration)
616d7d9
- Use $RPM_OPT_FLAGS
John W. Linville 1118fe3
- Add dist tag
616d7d9
616d7d9
* Wed Dec 16 2009 John W. Linville <linville@redhat.com> - 0.6.9-3
616d7d9
- Use gnutls instead of openssl
616d7d9
- Turn-off internal EAP server (broken w/ gnutls)
John W. Linville 1118fe3
- Remove doc files not applicable to chosen configuration
616d7d9
- Un-mangle README filename for logwatch sub-package
616d7d9
616d7d9
* Wed Dec 16 2009 John W. Linville <linville@redhat.com> - 0.6.9-2
616d7d9
- Initial build
616d7d9
- Start release at 2 to avoid conflicts w/ previous attempts by others