Blob Blame Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:           python-wifi
Version:        0.5.0
Release:        2%{?dist}
Summary:        Python binding for the wireless extensions

Group:          Development/Libraries
#python-wifi is licensed under LGPLv2+, however, the examples
#(e.g. and are licensed under GPLv2+
License:        LGPLv2+ and GPLv2+
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch

BuildRequires:  python-devel
BuildRequires:  python-setuptools

Python-Wifi is a Python library that provides access to information about a
W-LAN card's capabilities, like the wireless extensions written in C.

%setup -q
#Remove shebang
sed -i -e '/^#!\//, 1d' {tests/,examples/*.py}
#Fix permissions
chmod -x {tests/,examples/*.py}
# Convert to utf-8
for file in docs/AUTHORS; do
    mv $file timestamp
    iconv -f ISO-8859-1 -t UTF-8 -o $file timestamp
    touch -r timestamp $file

%{__python} build

rm -rf %{buildroot}
%{__python} install --skip-build --root="%{buildroot}"
#Delete the doc files, wrong location
rm %{buildroot}/usr/{INSTALL,README}
rm %{buildroot}/usr/docs/{AUTHORS,BUGS,ChangeLog,DEVEL.txt,LICENSE*,NEWS,ROADMAP,TODO,VERSION}
#Move the examples
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-%{version}/examples/
mv %{buildroot}/usr/examples/{,} \
#Move the man pages
mkdir -p %{buildroot}%{_mandir}/man8/
mv %{buildroot}/usr/man/man8/iw*  %{buildroot}%{_mandir}/man8/
#Move the doc files to the right directory
mv %{buildroot}/usr/docs/*.txt %{buildroot}%{_defaultdocdir}/%{name}-%{version}/
#Delete the logos
rm %{buildroot}/usr/docs/logos/*

rm -rf %{buildroot}

%doc README docs/AUTHORS docs/BUGS docs/ChangeLog
%doc docs/LICENSE* docs/NEWS docs/ROADMAP docs/TODO docs/VERSION 
%doc examples/ tests/

* Thu Dec 24 2009 Fabian Affolter <> - 0.5.0-2
- Updated the convert to utf-8 part
- Fixed permissions
- Added license for examples
- Fixed tarball URL
- Added man pages

* Wed Dec 23 2009 Fabian Affolter <> - 0.5.0-1
- Updated docs
- Updated BR
- Updated to new upstream version 0.5.0

* Sun Jul 26 2009 Fedora Release Engineering <> - 0.3.1-3
- Rebuilt for

* Wed Feb 18 2009 Fabian Affolter <> - 0.3.1-2
- Changes acc. to bug #478300

* Sat Dec 27 2008 Fabian Affolter <> - 0.3.1-1
- Initial spec for Fedora