152a1a8
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
1985a70
1985a70
Name:           python-wifi
152a1a8
Version:        0.5.0
6b83366
Release:        8%{?dist}
1985a70
Summary:        Python binding for the wireless extensions
1985a70
1985a70
Group:          Development/Libraries
589bb22
#python-wifi is licensed under LGPLv2+, however, the examples
589bb22
#(e.g. iwconfig.py and iwlist.py) are licensed under GPLv2+
589bb22
License:        LGPLv2+ and GPLv2+
1985a70
URL:            https://developer.berlios.de/projects/pythonwifi/
589bb22
Source0:        http://download.berlios.de/pythonwifi/%{name}-%{version}.tar.bz2
1985a70
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1985a70
BuildArch:      noarch
1985a70
152a1a8
BuildRequires:  python-devel
152a1a8
BuildRequires:  python-setuptools
1985a70
1985a70
1985a70
%description
1985a70
Python-Wifi is a Python library that provides access to information about a
1985a70
W-LAN card's capabilities, like the wireless extensions written in C.
1985a70
1985a70
1985a70
%prep
1985a70
%setup -q
589bb22
#Remove shebang
589bb22
sed -i -e '/^#!\//, 1d' {tests/output_diff.sh,examples/*.py}
589bb22
#Fix permissions
589bb22
chmod -x {tests/output_diff.sh,examples/*.py}
589bb22
# Convert to utf-8
589bb22
for file in docs/AUTHORS; do
589bb22
    mv $file timestamp
589bb22
    iconv -f ISO-8859-1 -t UTF-8 -o $file timestamp
589bb22
    touch -r timestamp $file
589bb22
done
1985a70
1985a70
%build
152a1a8
%{__python} setup.py build
1985a70
1985a70
1985a70
%install
1985a70
rm -rf %{buildroot}
589bb22
%{__python} setup.py install --skip-build --root="%{buildroot}"
589bb22
#Delete the doc files, wrong location
589bb22
rm %{buildroot}/usr/{INSTALL,README}
589bb22
rm %{buildroot}/usr/docs/{AUTHORS,BUGS,ChangeLog,DEVEL.txt,LICENSE*,NEWS,ROADMAP,TODO,VERSION}
589bb22
#Move the examples
589bb22
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-%{version}/examples/
589bb22
mv %{buildroot}/usr/examples/{iwconfig.py,iwlist.py} \
589bb22
    %{buildroot}%{_defaultdocdir}/%{name}-%{version}/examples/
589bb22
#Move the man pages
589bb22
mkdir -p %{buildroot}%{_mandir}/man8/
589bb22
mv %{buildroot}/usr/man/man8/iw*  %{buildroot}%{_mandir}/man8/
589bb22
#Move the doc files to the right directory
589bb22
mv %{buildroot}/usr/docs/*.txt %{buildroot}%{_defaultdocdir}/%{name}-%{version}/
589bb22
#Delete the logos
589bb22
rm %{buildroot}/usr/docs/logos/*
1985a70
1985a70
1985a70
%clean
1985a70
rm -rf %{buildroot}
1985a70
1985a70
1985a70
%files
1985a70
%defattr(-,root,root,-)
152a1a8
%doc README docs/AUTHORS docs/BUGS docs/ChangeLog
152a1a8
%doc docs/LICENSE* docs/NEWS docs/ROADMAP docs/TODO docs/VERSION 
152a1a8
%doc examples/ tests/
589bb22
%{_mandir}/man*/iw*.*
1985a70
%{python_sitelib}/pythonwifi/
1985a70
%{python_sitelib}/python_wifi*.egg-info
1985a70
1985a70
1985a70
%changelog
6b83366
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-8
6b83366
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
6b83366
ca5c2f4
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-7
ca5c2f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
ca5c2f4
7e2c151
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-6
7e2c151
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
7e2c151
3ac4e5a
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-5
3ac4e5a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
3ac4e5a
6dd2063
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-4
6dd2063
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
6dd2063
ff0c8be
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.5.0-3
ff0c8be
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
ff0c8be
589bb22
* Thu Dec 24 2009 Fabian Affolter <fabian@bernewireless.net> - 0.5.0-2
fb1c969
- Updated the convert to utf-8 part
fb1c969
- Fixed permissions
589bb22
- Added license for examples
589bb22
- Fixed tarball URL
589bb22
- Added man pages
589bb22
152a1a8
* Wed Dec 23 2009 Fabian Affolter <fabian@bernewireless.net> - 0.5.0-1
152a1a8
- Updated docs
152a1a8
- Updated BR
152a1a8
- Updated to new upstream version 0.5.0
152a1a8
b192a75
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-3
b192a75
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
b192a75
1985a70
* Wed Feb 18 2009 Fabian Affolter <fabian@bernewireless.net> - 0.3.1-2
1985a70
- Changes acc. to bug #478300
1985a70
1985a70
* Sat Dec 27 2008 Fabian Affolter <fabian@bernewireless.net> - 0.3.1-1
1985a70
- Initial spec for Fedora