Blob Blame History Raw
%global with_python3 1
%global pkgname dj_database_url
%global commit 5a4754924747e65a22655be5cb25ba2e83e8f69f
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name:           python-django-database-url
Version:        0.4.0
Release:        1%{?dist}
Summary:        Use Database URLs in your Django Application

Group:          Development/Languages
License:        BSD
URL:            https://github.com/kennethreitz/dj-database-url
Source0:        https://github.com/kennethreitz/dj-database-url/archive/v%{version}.tar.gz
BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
%if 0%{?with_python3}
BuildRequires:  python3-devel
%endif

%description
This simple Django utility allows you to utilize the 12factor inspired
DATABASE_URL environment variable to configure your Django application.

%package -n python2-django-database-url
Summary:        Use Database URLs in your Django Application
Group:          Development/Languages
Requires:       python-django
%{?python_provide:%python_provide python2-django-database-url}

%description -n python2-django-database-url
This simple Django utility allows you to utilize the 12factor inspired
DATABASE_URL environment variable to configure your Django application.

%if 0%{?with_python3}
%package -n python3-django-database-url
Summary:        Use Database URLs in your Django Application
Group:          Development/Languages
Requires:       python3-django
%{?python_provide:%python_provide python3-django-database-url}

%description -n python3-django-database-url
This simple Django utility allows you to utilize the 12factor inspired
DATABASE_URL environment variable to configure your Django application.

%endif

%prep
%autosetup -n dj-database-url-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%py2_build
%if 0%{?with_python3}
pushd %{py3dir}
%py3_build
popd
%endif

%install
%py2_install
%if 0%{?with_python3}
pushd %{py3dir}
%py3_install
popd
%endif

%check
%make_build test

%files -n python2-django-database-url
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{pkgname}.py*
%{python2_sitelib}/%{pkgname}-%{version}-py*.egg-info

%if 0%{?with_python3}
%files -n python3-django-database-url
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{pkgname}.py*
%{python3_sitelib}/__pycache__/%{pkgname}.cpython-*.py*
%{python3_sitelib}/%{pkgname}-%{version}-py*.egg-info
%endif

%changelog
* Thu Feb 04 2016 Juan Orti Alcaine <jorti@fedoraproject.org> - 0.4.0-1
- Version 0.4.0

* Wed Nov 18 2015 Juan Orti Alcaine <jorti@fedoraproject.org> - 0.3.0-7
- Use python_provide macro
- Substitute some commands with macros

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-6
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Apr 09 2015 Juan Orti Alcaine <jorti@fedoraproject.org> - 0.3.0-4
- Use license macro

* Thu Dec 11 2014 Juan Orti <jorti@fedoraproject.org> - 0.3.0-3
- Add Python3 support
- Change Source0 to GitHub
- Run tests

* Wed Dec 03 2014 Juan Orti <jorti@fedoraproject.org> - 0.3.0-2
- Spec file cleanup

* Mon May 26 2014 Didier Fabert <didier.fabert@gmail.com> 0.3.0-1
- Initial RPM release