-Summary: Python bingings for Gammu library
-Summary(pl.UTF-8): Wiązania języka Python dla biblioteki Gammu
-Name: python-gammu
-Version: 0.26
-Release: 3
-License: GPL
+%define module python-gammu
+Summary: Python bindings for Gammu library.
+Name: %{module}
+Version: 2.3
+Release: 2
+License: GPL v2
Group: Development/Languages/Python
-Source0: http://dl.cihar.com/python-gammu/latest/%{name}-%{version}.tar.bz2
-# Source0-md5: 886d0484b3eeaa306e61733d85407277
-URL: http://icepick.info/
-BuildRequires: gammu-devel >= 1:1.18.91
-BuildRequires: pkgconfig >= 1:0.21-2
-BuildRequires: python-devel >= 1:2.5
+Source0: http://dl.cihar.com/python-gammu/%{module}-%{version}.tar.bz2
+# Source0-md5: e92b13cb6fa9681c48981340ffadd251
+URL: http://http://wammu.eu/python-gammu/
+BuildRequires: gammu-devel >= 1.34.0
+BuildRequires: python-devel
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
-%pyrequires_eq python-modules
-%requires_eq gammu-libs
+Requires: glibc >= 2.4
+Requires: python-modules
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Python bingings for Gammu library.
-
-%description -l pl.UTF-8
-Wiązania języka Python dla biblioteki Gammu.
+Python bindings for Gammu library.
%prep
-%setup -q
+%setup -q -n %{module}-%{version}
%build
-find -type f -exec sed -i -e 's|#!.*python.*|#!%{_bindir}/python|g' "{}" ";"
+%py_build
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%py_install
-python ./setup.py install --optimize=2 --root=$RPM_BUILD_ROOT
-cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
+%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_postclean
+install examples/data/*.* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/data
+install examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+#install examples/data/*.* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/data
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README AUTHORS
%dir %{py_sitedir}/gammu
%attr(755,root,root) %{py_sitedir}/gammu/*.so
%{py_sitedir}/gammu/*.py[co]
-%{py_sitedir}/*.egg-info
+%{py_sitedir}/python_gammu-%{version}-py*.egg-info
%{_examplesdir}/%{name}-%{version}