forked from omab/django-social-auth
-
Notifications
You must be signed in to change notification settings - Fork 1
/
django-social-auth.spec
108 lines (80 loc) · 3.06 KB
/
django-social-auth.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
Name: %(%{__python} setup.py --name)
Version: %(%{__python} setup.py --version)
Release: 1%{?dist}
Summary: %(%{__python} setup.py --description)
Group: Development/Libraries
License: BSD
URL: %(%{__python} setup.py --url)
Source0: http://pypi.python.org/packages/source/d/django-social-auth/%{name}-%{version}.tar.gz
Source1: LICENSE
Source2: LICENSE.django-openid-auth
Source3: COPYRIGHT.django-twitter-oauth
Source4: doc-example.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel
# Needs python-sphinx-1.0.7 which is not available in RHEL-6
%if 0%{?rhel} > 6 || 0%{?fedora} > 12
BuildRequires: python-sphinx
%endif
# NB: update this when updating requirements.txt
Requires: Django >= 1.2.5
Requires: python-oauth2 >= 1.5.167
Requires: python-openid >= 2.2
%description
Django Social Auth is an easy to setup social authentication/authorization
mechanism for Django projects.
This application provides user registration and login using social sites
supporting OpenID, OAuth and OAuth2 such as Google, Yahoo, Twitter, Facebook,
LiveJournal, Orkut, LinkedIn, Foursquare, GitHub, DropBox, Flickr, Fedora.
%package docs
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
%description docs
This package contains the documentation and example for %{name}
%prep
%setup -q
# extract doc/ and example/
tar -xzf %{SOURCE4}
%build
%{__python} setup.py build
# build the docs if we have
%if 0%{?rhel} > 6 || 0%{?fedora} >= 12
make html -C doc/
%endif
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
mkdir -p %{buildroot}/%{_docdir}/%{name}-%{version}
install -m 0644 %{SOURCE1} %{buildroot}/%{_docdir}/%{name}-%{version}
install -m 0644 %{SOURCE2} %{buildroot}/%{_docdir}/%{name}-%{version}
install -m 0644 %{SOURCE3} %{buildroot}/%{_docdir}/%{name}-%{version}
# If it's rhel6+ or any Fedora over 12 build docs
%if 0%{?rhel} > 6 || 0%{?fedora} >= 12
# build documentation
(cd docs && make html)
%else
cp -r doc/ %{buildroot}/%{_docdir}/%{name}-%{version}
%endif
cp -r example/ %{buildroot}/%{_docdir}/%{name}-%{version}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}-%{version}/LICENSE*
%doc %{_docdir}/%{name}-%{version}/COPYRIGHT*
%{python_sitelib}/social_auth/*
# Leaving these since people may want to rebuild on lower dists
%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6
%{python_sitelib}/*.egg-info
%endif
%files docs
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}-%{version}/doc
%doc %{_docdir}/%{name}-%{version}/example
%changelog
* Fri Jan 20 2011 Alexander Todorov <[email protected]> - 0.6.1-1
- initial package