Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 15eb447178560595321623cced41ca4c > files > 2

python-llvmpy-0.12.0-7.fc18.src.rpm

%global upname llvmpy
%global with_python3 1

Name: python-%{upname}
Version: 0.12.0
Release: 7%{?dist}
Summary: Python bindings for LLVM
License: BSD

URL: http://www.llvmpy.org/
# I'd better have a pypi link here, but it's outdated
# https://github.com/llvmpy/llvmpy/issues/84
Source0: https://github.com/llvmpy/llvmpy/archive/%{version}.tar.gz

# bz #1005869 (arm)
# bz #1011697 (s390)
ExcludeArch: %{arm} s390 s390x
BuildRequires: python2-devel llvm-devel zlib-devel
BuildRequires: python-sphinx python-nose

%description
llvmpy is a Python wrapper around the llvm C++ library which allows simple 
access to compiler tools. 

# we don't want to provide private python extension libs
%global __provides_exclude_from ^(%{python_sitearch}|%{python3_sitearch})/.*\\.so$

%if 0%{?with_python3}
%package -n python3-%{upname}
Summary: Python bindings for LLVM
BuildRequires: python3-devel llvm-devel zlib-devel
BuildRequires: python3-sphinx python3-nose

%description -n python3-%{upname}
llvmpy is a Python wrapper around the llvm C++ library which allows simple 
access to compiler tools. 
%endif # with_python3

%prep
%setup -qn %{upname}-%{version}
# Remove some shebangs
pushd llpython
for i in $(grep -l -r "/usr/bin/env"); do
   sed -i -e '1d' $i;
   done
popd

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3

find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'

%build
CFLAGS="%{optflags}" %{__python} setup.py build
make %{?_smp_mflags} html -C docs
# Empty file
rm docs/_build/html/.buildinfo

%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="%{optflags}" %{__python3} setup.py build
make %{?_smp_mflags} html -C docs
# Empty file
rm docs/_build/html/.buildinfo
popd
# workaround to bz 563622
cp -r %{py3dir}/docs docs-py3
%endif # with_python3

%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
 pushd %{buildroot}%{python3_sitearch}
  find -name "*.so" | xargs chmod 755
 popd
popd
%endif # with_python3

%{__python} setup.py install --skip-build --root %{buildroot}
pushd %{buildroot}%{python_sitearch}
 find -name "*.so" | xargs chmod 755
popd

%check
pushd %{buildroot}%{python_sitearch}
%{__python} -c "import llvm; llvm.test()"
popd

%if 0%{?with_python3}
pushd %{buildroot}%{python3_sitearch}
%{__python3} -c "import llvm; llvm.test()"
popd
%endif # with_python3

%files
%doc CHANGELOG README_LLVM_CBUILDER.md LICENSE README.rst docs/_build/html
%{python_sitearch}/llpython
%{python_sitearch}/llvm
%{python_sitearch}/llvmpy
%{python_sitearch}/llvm_array
%{python_sitearch}/llvm_cbuilder
%{python_sitearch}/llvmpy-tag_.%{version}-py2.7.egg-info

%if 0%{?with_python3}
%files -n python3-%{upname}
%doc CHANGELOG README_LLVM_CBUILDER.md LICENSE README.rst docs-py3/_build/html
%{python3_sitearch}/llpython
%{python3_sitearch}/llvm
%{python3_sitearch}/llvmpy
%{python3_sitearch}/llvm_array
%{python3_sitearch}/llvm_cbuilder
%{python3_sitearch}/llvmpy-tag_.%{version}-py3.3.egg-info
%endif # with_python3

%changelog
* Tue Sep 24 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.12.0-7
- Added s390(x) tracker bug

* Tue Sep 24 2013 Dan Horák <dan[at]danny.cz> - 0.12.0-6
- Exclude s390(x)

* Mon Sep 16 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.12.0-5
- Support Python3

* Mon Sep 09 2013 Sergio Pascual <sergiopr at fedoraproject.org> - 0.12.0-4
- Use arm macro

* Mon Sep 09 2013 Sergio Pascual <sergiopr at fedoraproject.org> - 0.12.0-3
- Exclude arm for now, it breaks the tests

* Sun Sep 08 2013 Sergio Pascual <sergiopr at fedoraproject.org> - 0.12.0-2
- Add check

* Wed Sep 04 2013 Sergio Pascual <sergiopr at fedoraproject.org> - 0.12.0-1
- New upstream source (0.12.0) with LLVM 3.3 support

* Fri May 24 2013 Sergio Pascual <sergiopr at fedoraproject.org> - 0.11.2-1
- Initial spec file