%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 Name: pymacs Version: 0.23 Release: 1%{?dist} Summary: Emacs and Python integration framework Group: Development/Libraries License: GPLv2 URL: http://pymacs.progiciels-bpi.ca/ # git clone https://github.com/pinard/Pymacs.git # git archive --prefix="pymacs-0.23/" --format=tar v0.23 | xz > pymacs-0.23.tar.xz Source0: %{name}-%{version}.tar.xz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools # to generate pdf BuildRequires: python-docutils BuildRequires: texlive-latex # for tests BuildRequires: emacs Requires: python2 Requires: emacs %description Pymacs is a powerful tool which, once started from Emacs, allows both-way communication between Emacs Lisp and Python. Pymacs aims Python as an extension language for Emacs rather than the other way around, and this asymmetry is reflected in some design choices. Within Emacs Lisp code, one may load and use Python modules. Python functions may themselves use Emacs services, and handle Emacs Lisp objects kept in Emacs Lisp space. %prep %setup -q # make sure we are using right interpreter to build sed -i 's:PYSETUP =.*:PYSETUP=%{__python} setup.py:g' Makefile sed -i 's:rst2latex.py:rst2latex:' Makefile # remove shebangs from library sed -i '/#!.*/ {d}' Pymacs/pymacs.py __init__.py.in # remove executable bits from docs chmod -x contrib/rebox/rebox %build make %{?_smp_mflags} all pymacs.pdf %check make check %install %{__python} setup.py install --skip-build --root %{buildroot} install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/emacs/site-lisp/ install -pm 644 %{name}.el $RPM_BUILD_ROOT/%{_datadir}/emacs/site-lisp/ %files %doc COPYING README THANKS contrib TODO ChangeLog pymacs.pdf pymacs.rst %{python_sitelib}/Pymacs/ %{python_sitelib}/*.egg-info %{_datadir}/emacs/site-lisp/%{name}.el %changelog * Wed May 4 2011 Stanislav Ochotnicky - 0.23-1 - Initial version of the package