cfa235a
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
cfa235a
cfa235a
Name:           pygpgme
cfa235a
Version:        0.1
dc0e76b
Release:        10.20090121bzr54%{?dist}
cfa235a
Summary:        Python module for working with OpenPGP messages
cfa235a
cfa235a
Group:          Development/Languages
8c57028
License:        LGPLv2+
cfa235a
URL:            http://cheeseshop.python.org/pypi/pygpgme/0.1
dc0e76b
# pygpgme is being developed for Ubuntu and built for Ubuntu out of
dc0e76b
# launchpad's source control.  So we need to create snapshots.
dc0e76b
# At this time, updated packages from launchpad have fixed tests and support
dc0e76b
# for generating keys
dc0e76b
#
dc0e76b
# Steps to create snapshot:
dc0e76b
# bzr branch lp:pygpgme -r54
dc0e76b
# cd pygpgme
dc0e76b
# patch -p0 < ../pygpgme-examples.patch
dc0e76b
# python setup.py sdist
dc0e76b
# tarball is in dist/pygpgme-0.1.tar.gz
dc0e76b
Source0:        pygpgme-0.1.tar.gz
dc0e76b
#Source0:        http://cheeseshop.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
ac0369a
Patch0:         pygpgme-0.1-py23.patch
dc0e76b
# Patch to make generating a tarball (sdist) work.  Applied prior to creating
dc0e76b
# the Source0.
dc0e76b
Patch100:       pygpgme-examples.patch
cfa235a
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
cfa235a
BuildRequires:  python-devel
cfa235a
BuildRequires:  gpgme-devel
cfa235a
cfa235a
%description
cfa235a
PyGPGME is a Python module that lets you sign, verify, encrypt and decrypt
cfa235a
files using the OpenPGP format.  It is built on top of GNU Privacy Guard and
cfa235a
the GPGME library.
cfa235a
cfa235a
%prep
cfa235a
%setup -q
cfa235a
ac0369a
# Patch necessary for python version 2.3 and below.
ac0369a
%patch0 -p1 -b .py23
ac0369a
cfa235a
%build
cfa235a
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
cfa235a
cfa235a
cfa235a
%install
cfa235a
rm -rf $RPM_BUILD_ROOT
dc0e76b
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
dc0e76b
chmod 0755 $RPM_BUILD_ROOT%{python_sitearch}/gpgme/_gpgme.so
cfa235a
cfa235a
%clean
cfa235a
rm -rf $RPM_BUILD_ROOT
cfa235a
dc0e76b
### Can't enable the tests because they depend on importing a private key.
dc0e76b
# gpg2 on which our gpgme library depends does not import private keys so this
dc0e76b
# won't work.  The issue in the real world is not so big as we  don't
dc0e76b
# manipulate private keys outside of a keyring that often.
dc0e76b
#%check
dc0e76b
# Use the installed gpgme because it has the built compiled module
dc0e76b
#mv gpgme gpgme.bak
dc0e76b
#ln -s $RPM_BUILD_ROOT%{python_sitearch}/gpgme .
dc0e76b
#python test_all.py
cfa235a
cfa235a
%files
cfa235a
%defattr(-,root,root,-)
cfa235a
%doc README PKG-INFO
1c07e7a
%{python_sitearch}/*
dc0e76b
# No need to ship the tests
dc0e76b
%exclude %{python_sitearch}/gpgme/tests/
dc0e76b
cfa235a
cfa235a
%changelog
dc0e76b
* Wed Jan 21 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.1-10.20090121bzr54
dc0e76b
- Update to upstream snapshot.
dc0e76b
982c3ab
* Fri Nov 28 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.1-9
982c3ab
- Rebuild for Python 2.6
982c3ab
3d4bf67
* Fri Feb 8 2008 Toshio Kuratomi <toshio@fedoraproject.org> - 0.1-8
3d4bf67
- Rebuild for new gcc.
3d4bf67
1c07e7a
* Thu Jan 3 2008 Toshio Kuratomi <toshio@fedoraproject.org> - 0.1-7
1c07e7a
- Include egg-info files.
1c07e7a
0bdedae
* Fri May 18 2007 Toshio Kuratomi <toshio@tiki-lounge.com> - 0.1-6
0bdedae
- Rebuild to pick up enhancements from gcc on F-8.
0bdedae
- Update licensing to conform to new guidelines.
0bdedae
3b8d695
* Fri May 18 2007 Toshio Kuratomi <toshio@tiki-lounge.com> - 0.1-5
3b8d695
- Rebuild because of a bug in linking to an early version of the python-2.5
3b8d695
  package,
3b8d695
4da14f5
* Mon Oct 23 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 0.1-4
4da14f5
- Bump and rebuild for python 2.5 on devel.
4da14f5
ac0369a
* Mon Oct 23 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 0.1-3
ac0369a
- Add a patch to work under Python 2.3.
ac0369a
- Stop shipping the tests as they are useless to the end user.
ac0369a
cfa235a
* Fri Oct 13 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 0.1-2
cfa235a
- Change URL to cheeseshop
cfa235a
cfa235a
* Sun Oct 08 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 0.1-1
cfa235a
- Initial build for Fedora Extras.