%global svn_snapshot_date 20101105 Name: llvm-py Version: 0.7 Release: 0.1.20101105svn%{?dist} Summary: Python bindings for LLVM Group: System Environment/Libraries License: BSD URL: http://www.mdevan.org/llvm-py/download.html %if "%{?svn_snapshot_date}" != "%{nil}" Source0: llvm-py-%{svn_snapshot_date}svn.tar.bz2 %else Source0: http://%{name}.googlecode.com/files/%{name}-%{version}.tar.bz2 %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: llvm-devel python2-devel python3-devel # Note that we aren't actually using Python 3, as upstream doesn't yet support # it, but we need /etc/rpm/macros.pybytecompile from python3-devel %if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %description llvm-py provides Python bindings for LLVM. It’s goal is to expose enough of LLVM APIs to implement a compiler backend or a VM in pure Python. llvm-py consists of Python and C modules that wrap over the native C++/C bindings of LLVM, and does not use / have dependencies on "glue utilities" like Boost.Python, swig etc. %package doc Summary: Example programs showing the use of llvm-py Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Example programs showing the use of llvm-py, the Python bindings for LLVM. %prep %setup -q %build %{__python} setup.py build %check cd test PYTHONPATH=`ls -d ../build/lib.linux-*/` python testall.py ## Unfortunately simple globbing like the following doesn't seem to work ## due perhaps to the agressive quoting rpmbuild is doing around the path #PYTHONPATH=../build/lib.linux-*/ python testall.py %install rm -rf %{buildroot} %{__python} setup.py install --root %{buildroot} %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %{python_sitearch}/llvm/ %{python_sitearch}/llvm_py-*.egg-info %doc README LICENSE CHANGELOG %files doc %defattr(-,root,root,-) %doc test/README %doc test/*.py %changelog * Sun Jan 02 2011 Eric Smith - 0.7-0.1.20101105svn - update to prerelease Subverison snapshot upstream, necessary to support LLVM 2.8 * Mon Sep 06 2010 Eric Smith - 0.6-1 - initial version