# sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: pytomcrypt Version: 0.19 Release: 1%{?dist} Summary: A ctypes Python wrapper for LibTomCrypt Group: Development/Languages License: Public Domain URL: http://www.seanet.com/~bugbee/crypto/pyTomCrypt Source0: http://dev.laptop.org/~coderanger/pyTomCrypt-v0.19.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Patch0: pytomcrypt-0.19-makefile.patch BuildRequires: python-devel BuildRequires: libtomcrypt-devel BuildRequires: tomsfastmath-devel %description A ctypes Python wrapper for LibTomCrypt. See http://libtom.org/. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %setup -q -n pyTomCrypt-v%{version} %patch0 -p1 -b .makefile %build export CFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/tomcrypt" make %{?_smp_flags} LIBPATH="$RPM_BUILD_ROOT/%{_libdir}" INCPATH="$RPM_BUILD_ROOT/%{_includedir}/tomcryptplus" -f makefile.plus %{__python} setup.py build %install rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT export INSTALL_USER=$(id -un) export INSTALL_GROUP=$(id -gn) make -f makefile.plus install LIBPATH="$RPM_BUILD_ROOT/%{_libdir}" INCPATH="$RPM_BUILD_ROOT/%{_includedir}/tomcryptplus" PREFIX=$RPM_BUILD_ROOT/usr find $RPM_BUILD_ROOT -name '*.h' -exec chmod 644 {} ';' mv $RPM_BUILD_ROOT/%{_libdir}/libtomcrypt_plus.so $RPM_BUILD_ROOT/%{_libdir}/libtomcrypt_plus.so.0.0.19 ln -s libtomcrypt_plus.so.0.0.19 $RPM_BUILD_ROOT/%{_libdir}/libtomcrypt_plus.so ln -s libtomcrypt_plus.so.0.0.19 $RPM_BUILD_ROOT/%{_libdir}/libtomcrypt_plus.so.0 %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc README.txt %{python_sitelib}/pyTomCrypt.py* %{_libdir}/libtomcrypt_plus.so %{_libdir}/libtomcrypt_plus.so.0 %{_libdir}/libtomcrypt_plus.so.0.0.19 %files devel %defattr(-,root,root,-) %{_includedir}/tomcryptplus/tomcrypt_plus.h %changelog * Thu Aug 16 2007 Noah Kantrowitz - 0.19-1 - Initial version of this spec.