Small code cleanup.
[wammu.git] / wammu.spec
blobaa551bfb7324d495f41397474b1e32ebd9d3fc7e
1 %define name wammu
2 %define version 0.20
3 %define release 1
5 %define python_gammu_req 0.20
7 %if %{!?py_ver:1}0 == 10
8 %define py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
9 %endif
11 %define py_minver %py_ver
12 %define py_maxver %(python -c "import sys; a,b=sys.version_info[:2]; print '%%d.%%d'%%(a,b+1)" 2>/dev/null || echo PYTHON-NOT-FOUND)
14 Summary: Mobile phone manager
15 Name: %{name}
16 Version: %{version}
17 Release: %{release}
18 Source0: %{name}-%{version}.tar.bz2
19 License: GPL
20 %if %_vendor == "suse"
21 Group: Hardware/Mobile
22 %else
23 Group: Applications/Communications
24 %endif
25 Packager: Michal Cihar <michal@cihar.com>
26 Vendor: Michal Cihar <michal@cihar.com>
27 Prefix: %{_prefix}
29 # /usr/bin/pycrust is here for make vendor independant dependancy on wxPython.
30 # If you know better way, please let me know.
31 Requires: /usr/bin/pycrust, python-gammu >= %{python_gammu_req}
32 BuildRequires: python, python-devel
33 Requires: python >= %py_minver, python < %py_maxver
35 Url: http://wammu.eu/
36 Buildroot: %{_tmppath}/%name-%version-root
38 %description
39 Mobile phone manager using Gammu as it's backend. It works with any phone Gammu
40 supports - many Nokias, Siemens, Alcatel, ... Written using wxGTK.
42 %prep
43 %setup
45 %build
46 CFLAGS="$RPM_OPT_FLAGS" python setup.py build --skip-deps
48 %install
49 python setup.py install --skip-deps --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
50 sed -i '/man1/ D' INSTALLED_FILES
51 %if %_vendor == "redhat"
52 # Dirty hack: on Fedora, the .pyo files don't get written to
53 # INSTALLED_FILES, so put them there manually (this should also be
54 # safe on systems where this works correctly, as we remove
55 # duplicates).
56 grep '\.pyc$' INSTALLED_FILES | sed 's/\.pyc/.pyo/g' >> INSTALLED_FILES.tmp
57 cat INSTALLED_FILES >> INSTALLED_FILES.tmp
58 sort -u INSTALLED_FILES.tmp > INSTALLED_FILES
59 rm -f INSTALLED_FILES.tmp
60 # End dirty hack
61 %endif
63 %clean
64 rm -rf $RPM_BUILD_ROOT
66 %files -f INSTALLED_FILES
67 %defattr(-,root,root)
68 %doc README AUTHORS FAQ COPYING NEWS
69 %doc %{_mandir}/man1/*