%global pypi_name python-dotenv %global srcname dotenv Name: python-%{srcname} Version: 0.8.2 Release: 3%{?dist} Summary: Add .env support to your django/flask apps in development and deployments License: BSD URL: http://github.com/theskumar/python-dotenv Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel python3-devel BuildRequires: python2-setuptools python3-setuptools %description Reads the key/value pair from .env file and adds them to environment variable. %package -n python2-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} Reads the key/value pair from .env file and adds them to environment variable. %package -n python3-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} Reads the key/value pair from .env file and adds them to environment variable. %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %py3_build %install %py2_install cp %{buildroot}/%{_bindir}/dotenv %{buildroot}/%{_bindir}/dotenv-%{python2_version} ln -s %{_bindir}/dotenv-%{python2_version} %{buildroot}/%{_bindir}/dotenv-2 %py3_install cp %{buildroot}/%{_bindir}/dotenv %{buildroot}/%{_bindir}/dotenv-%{python3_version} ln -s %{_bindir}/dotenv-%{python3_version} %{buildroot}/%{_bindir}/dotenv-3 rm %{buildroot}/%{_bindir}/dotenv %files -n python2-%{srcname} %license LICENSE %doc README.md %{_bindir}/dotenv-2 %{_bindir}/dotenv-%{python2_version} %{python2_sitelib}/dotenv %{python2_sitelib}/python_dotenv-%{version}-py?.?.egg-info %files -n python3-%{srcname} %license LICENSE %doc README.md %{_bindir}/dotenv-3 %{_bindir}/dotenv-%{python3_version} %{python3_sitelib}/dotenv %{python3_sitelib}/python_dotenv-%{version}-py?.?.egg-info %changelog * Thu May 03 2018 Fernando dos Santos - 0.8.2-3 - fixed summary macro, License: BSD and scaped the changelog macro by %% * Thu May 03 2018 Fernando dos Santos - 0.8.2-2 - %%{_bindir}/dotenv removed and added BSD License * Tue May 01 2018 Fernando dos Santos - 0.8.2 - First time packaging