From 68e7c1cf0c86b61a7671612ea140886ff7e5d6f3 Mon Sep 17 00:00:00 2001 From: Carl George Date: Oct 05 2019 00:04:23 +0000 Subject: Macro overhaul --- diff --git a/python-mimeparse.spec b/python-mimeparse.spec index c7e0755..11c240b 100644 --- a/python-mimeparse.spec +++ b/python-mimeparse.spec @@ -1,46 +1,53 @@ -%global srcname mimeparse +# what it's called on pypi +%global srcname python-mimeparse +# what it's imported as +%global libname mimeparse +# name of egg info directory +%global eggname python_mimeparse +# package name fragment +%global pkgname mimeparse + +%global common_description %{expand: +This module provides basic functions for parsing mime-type names +and matching them against a list of media-ranges.} + -Name: python-%{srcname} +Name: python-%{pkgname} Version: 1.6.0 Release: 10%{?dist} Summary: Python module for parsing mime-type names License: MIT URL: https://github.com/dbtsai/python-mimeparse -Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz +Source0: %pypi_source BuildArch: noarch -%description -This module provides basic functions for parsing mime-type names -and matching them against a list of media-ranges. +%description %{common_description} -%package -n python2-%{srcname} +%package -n python2-%{pkgname} Summary: %{summary} BuildRequires: python2-devel BuildRequires: python2-setuptools -%{?python_provide:%python_provide python2-%{srcname}} +%{?python_provide:%python_provide python2-%{pkgname}} -%description -n python2-%{srcname} -This module provides basic functions for parsing mime-type names -and matching them against a list of media-ranges. +%description -n python2-%{pkgname} %{common_description} -%package -n python%{python3_pkgversion}-%{srcname} +%package -n python%{python3_pkgversion}-%{pkgname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools -%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}} -%description -n python%{python3_pkgversion}-%{srcname} -This module provides basic functions for parsing mime-type names -and matching them against a list of media-ranges. +%description -n python%{python3_pkgversion}-%{pkgname} %{common_description} %prep -%setup -q -n %{name}-%{version} +%setup -q -n %{srcname}-%{version} +rm -rf %{eggname}.egg-info %build @@ -58,16 +65,19 @@ and matching them against a list of media-ranges. %{__python3} -m unittest -v mimeparse_test -%files -n python2-%{srcname} +%files -n python2-%{pkgname} %license LICENSE %doc README.rst -%{python2_sitelib}/* +%{python2_sitelib}/%{libname}.py* +%{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info -%files -n python%{python3_pkgversion}-%{srcname} +%files -n python%{python3_pkgversion}-%{pkgname} %license LICENSE %doc README.rst -%{python3_sitelib}/* +%{python3_sitelib}/%{libname}.py +%{python3_sitelib}/__pycache__/%{libname}.cpython-%{python3_version_nodots}*.py* +%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info %changelog