mpaladin a14cef
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
mpaladin a14cef
%global with_python3 1
mpaladin a14cef
%endif
mpaladin a14cef
%if 0%{?rhel} == 5
mpaladin a14cef
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
mpaladin a14cef
%endif
mpaladin a14cef
mpaladin a14cef
%global srcname auth.credential
mpaladin a14cef
mpaladin a14cef
Name:		python-auth-credential
Massimo 2231f8
Version:	1.0
64805b
Release:	4%{?dist}
mpaladin a14cef
Summary:	Python abstraction of a credential
mpaladin a14cef
mpaladin a14cef
Group:		Development/Libraries
mpaladin a14cef
License:	ASL 2.0
Massimo 7f4acf
URL:		https://github.com/cern-mig/%{name}
mpaladin a14cef
Source0:	http://pypi.python.org/packages/source/a/%{srcname}/%{srcname}-%{version}.tar.gz
mpaladin a14cef
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
mpaladin a14cef
mpaladin a14cef
BuildArch:	noarch
mpaladin a14cef
BuildRequires:	python2-devel
mpaladin a14cef
%if 0%{?with_python3}
mpaladin a14cef
BuildRequires:	python3-devel
mpaladin a14cef
%endif # if with_python3
mpaladin a14cef
mpaladin a14cef
%description
mpaladin a14cef
This module offers an abstraction of a credential, i.e. something that
mpaladin a14cef
can be used to authenticate. It allows the creation and manipulation of
mpaladin a14cef
credentials. In particular, it defines a standard string representation
mpaladin a14cef
(so that credentials can be given to external programs as command line
mpaladin a14cef
options), a standard structured representation (so that credentials can
mpaladin a14cef
be stored in structured configuration files or using JSON) and
mpaladin a14cef
"preparators" that can transform credentials into ready-to-use data for
mpaladin a14cef
well known targets.
mpaladin a14cef
mpaladin a14cef
The python module auth.credential is compatible with the Perl
mpaladin a14cef
module Authen::Credential.
mpaladin a14cef
mpaladin a14cef
%if 0%{?with_python3}
mpaladin a14cef
%package -n python3-auth.credential
mpaladin a14cef
Summary:	Python abstraction of a credential
mpaladin a14cef
Group:		Development/Libraries
mpaladin a14cef
mpaladin a14cef
%description -n python3-auth.credential
mpaladin a14cef
This module offers an abstraction of a credential, i.e. something that
mpaladin a14cef
can be used to authenticate. It allows the creation and manipulation of
mpaladin a14cef
credentials. In particular, it defines a standard string representation
mpaladin a14cef
(so that credentials can be given to external programs as command line
mpaladin a14cef
options), a standard structured representation (so that credentials can
mpaladin a14cef
be stored in structured configuration files or using JSON) and
mpaladin a14cef
"preparators" that can transform credentials into ready-to-use data for
mpaladin a14cef
well known targets.
mpaladin a14cef
mpaladin a14cef
The python module auth.credential is compatible with the Perl
mpaladin a14cef
module Authen::Credential.
mpaladin a14cef
%endif # with_python3
mpaladin a14cef
mpaladin a14cef
%prep
mpaladin a14cef
%setup -q -n auth.credential-%{version}
mpaladin a14cef
mpaladin a14cef
%if 0%{?with_python3}
mpaladin a14cef
rm -rf %{py3dir}
mpaladin a14cef
cp -a . %{py3dir}
mpaladin a14cef
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
mpaladin a14cef
%endif # with_python3
mpaladin a14cef
mpaladin a14cef
%build 
mpaladin a14cef
%{__python} setup.py build
mpaladin a14cef
mpaladin a14cef
%if 0%{?with_python3}
mpaladin a14cef
pushd %{py3dir}
mpaladin a14cef
%{__python3} setup.py build
mpaladin a14cef
popd
mpaladin a14cef
%endif # with_python3
mpaladin a14cef
mpaladin a14cef
%install
mpaladin a14cef
rm -rf $RPM_BUILD_ROOT
mpaladin a14cef
mpaladin a14cef
%if 0%{?with_python3}
mpaladin a14cef
pushd %{py3dir}
mpaladin a14cef
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
mpaladin a14cef
popd
mpaladin a14cef
%endif # with_python3
mpaladin a14cef
mpaladin a14cef
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
mpaladin a14cef
mpaladin a14cef
%check
mpaladin a14cef
%{__python} setup.py test
mpaladin a14cef
# And remove compiled documentation.
mpaladin a14cef
rm -f test/*.pyc
mpaladin a14cef
mpaladin a14cef
%if 0%{?with_python3}
mpaladin a14cef
pushd %{py3dir}
mpaladin a14cef
%{__python3} setup.py test
mpaladin a14cef
rm -f test/*.pyc
mpaladin a14cef
popd
mpaladin a14cef
%endif # with_python3
mpaladin a14cef
mpaladin a14cef
%clean
mpaladin a14cef
rm -rf $RPM_BUILD_ROOT
mpaladin a14cef
mpaladin a14cef
%files
mpaladin a14cef
%defattr(-,root,root)
Massimo eb94ec
%doc LICENSE README.rst CHANGES
mpaladin a14cef
%{python_sitelib}/auth/
mpaladin a14cef
%if 0%{?rhel} != 5
mpaladin a14cef
%{python_sitelib}/%{srcname}-%{version}-py?.?.egg-info
mpaladin a14cef
%endif
mpaladin a14cef
mpaladin a14cef
%if 0%{?with_python3}
mpaladin a14cef
%files -n python3-auth.credential
Massimo eb94ec
%doc LICENSE README.rst CHANGES
mpaladin a14cef
%{python3_sitelib}/auth/
mpaladin a14cef
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info
mpaladin a14cef
%endif # with_python3
mpaladin a14cef
mpaladin a14cef
%changelog
64805b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-4
64805b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
64805b
d44713
* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 1.0-3
d44713
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
d44713
518bbf
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
518bbf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
518bbf
Massimo 2231f8
* Mon Mar 04 2013 Massimo Paladin <massimo.paladin@gmail.com> - 1.0-1
Massimo 2231f8
- Upgrading to upstream version 1.0.
Massimo 2231f8
f212f5
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-4
f212f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
f212f5
59e000
* Fri Aug 03 2012 David Malcolm <dmalcolm@redhat.com> - 0.6-3
59e000
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
59e000
1d228d
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-2
1d228d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
1d228d
mpaladin ec87c6
* Tue Apr 17 2012 Massimo Paladin <massimo.paladin@gmail.com> - 0.6-1
mpaladin ec87c6
- Upgrading to latest upstream version 0.6.
mpaladin ec87c6
mpaladin a14cef
* Mon Feb 20 2012 Massimo Paladin <massimo.paladin@cern.ch> - 0.5-2
mpaladin a14cef
- Making it compliant with guidelines.
mpaladin a14cef
mpaladin a14cef
* Mon Jan 23 2012 Massimo Paladin <massimo.paladin@cern.ch> - 0.5-1
mpaladin a14cef
- Initial packaging.
mpaladin a14cef