From 948a1c19cdcc142d3c567e361a95c50a77682b58 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sat, 21 Sep 2019 19:00:28 +0200 Subject: [PATCH] - cleaned up the mess; release 3 --- python-ipython_genutils.spec | 107 +++++++++++++++++------------------ 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/python-ipython_genutils.spec b/python-ipython_genutils.spec index cf48087..7456b52 100644 --- a/python-ipython_genutils.spec +++ b/python-ipython_genutils.spec @@ -1,85 +1,93 @@ +# # Conditional build: -%bcond_with doc # don't build doc -%bcond_with tests # do not perform "make test" +%bcond_without tests # unit tests %bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module %define module ipython_genutils Summary: IPython vestigial utilities -# Summary(pl.UTF-8): - +Summary(pl.UTF-8): Pozostałe narzędzia IPythona Name: python-%{module} Version: 0.2.0 -Release: 2 +Release: 3 License: BSD Group: Libraries/Python +#Source0Download: https://github.com/ipython/ipython_genutils/releases +# TODO: https://github.com/ipython/ipython_genutils/archive/%{version}/%{module}-%{version}.tar.gz Source0: https://github.com/ipython/ipython_genutils/archive/%{version}.tar.gz # Source0-md5: 477e596a0e6e2f74ec08ec09687eeb6c URL: https://github.com/ipython/ipython_genutils -BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.714 +%if %(locale -a | grep -q '^C\.utf8$'; echo $?) +BuildRequires: glibc-localedb-all +%endif %if %{with python2} -BuildRequires: python-modules +BuildRequires: python-modules >= 1:2.7 BuildRequires: python-setuptools +%if %{with tests} +BuildRequires: python-nose +%endif %endif %if %{with python3} -BuildRequires: python3-modules +BuildRequires: python3-modules >= 1:3.3 BuildRequires: python3-setuptools +%if %{with tests} +BuildRequires: python3-nose +%endif %endif -# when using /usr/bin/env or other in-place substitutions -#BuildRequires: sed >= 4.0 -# replace with other requires if defined in setup.py -Requires: python-modules +BuildRequires: rpm-pythonprov +BuildRequires: rpmbuild(macros) >= 1.714 +Requires: python-modules >= 1:2.7 BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description This package shouldn't exist. It contains some common utilities shared -by Jupyter and IPython projects during The Big Split™. As soon as +by Jupyter and IPython projects during The Big Split(TM). As soon as possible, those packages will remove their dependency on this. -# %%description -l pl.UTF-8 +%description -l pl.UTF-8 +Ten pakiet nie powinien istnieć. Zawiera kilka wspólnych narzędzi +współdzielonych przez projekty Jupyter i IPython podczas Wielkiego +Podziału(TM). Projekty te będą miały usuniętą tę zależność w +najbliższym możliwym czasie. %package -n python3-%{module} -Summary: - -Summary(pl.UTF-8): - +Summary: IPython vestigial utilities +Summary(pl.UTF-8): Pozostałe narzędzia IPythona Group: Libraries/Python -Requires: python3-modules +Requires: python3-modules >= 1:3.3 %description -n python3-%{module} This package shouldn't exist. It contains some common utilities shared -by Jupyter and IPython projects during The Big Split™. As soon as -possible, those packages will remove their dependency on this. - -# %%description -n python3-%{module} -l pl.UTF-8 +by Jupyter and IPython projects during The Big Split(TM). As soon as +possible, those packages will remove their dependency on this and this +package will go away. -%package apidocs -Summary: %{module} API documentation -Summary(pl.UTF-8): Dokumentacja API %{module} -Group: Documentation - -%description apidocs -API documentation for %{module}. - -%description apidocs -l pl.UTF-8 -Dokumentacja API %{module}. +%description -n python3-%{module} -l pl.UTF-8 +Ten pakiet nie powinien istnieć. Zawiera kilka wspólnych narzędzi +współdzielonych przez projekty Jupyter i IPython podczas Wielkiego +Podziału(TM). Projekty te będą miały usuniętą tę zależność w +najbliższym możliwym czasie, a ten pakiet przestanie istnieć. %prep %setup -q -n %{module}-%{version} -#%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py %build %if %{with python2} -%py_build %{?with_tests:test} +%py_build + +%if %{with tests} +LC_ALL=C.UTF-8 \ +nosetests-%{py_ver} ipython_genutils +%endif %endif %if %{with python3} -%py3_build %{?with_tests:test} -%endif +%py3_build -%if %{with doc} -cd docs -%{__make} -j1 html -rm -rf _build/html/_sources +%if %{with tests} +nosetests-%{py3_ver} ipython_genutils +%endif %endif %install @@ -88,9 +96,6 @@ rm -rf $RPM_BUILD_ROOT %if %{with python2} %py_install -%py_ocomp $RPM_BUILD_ROOT%{py_sitedir} -%py_comp $RPM_BUILD_ROOT%{py_sitedir} - %py_postclean %endif @@ -104,21 +109,15 @@ rm -rf $RPM_BUILD_ROOT %if %{with python2} %files %defattr(644,root,root,755) -%doc README.md -%{py_sitescriptdir}/%{module} -%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info +%doc COPYING.md README.md +%{py_sitescriptdir}/ipython_genutils +%{py_sitescriptdir}/ipython_genutils-%{version}-py*.egg-info %endif %if %{with python3} %files -n python3-%{module} %defattr(644,root,root,755) -%doc README.md -%{py3_sitescriptdir}/%{module} -%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info -%endif - -%if %{with doc} -%files apidocs -%defattr(644,root,root,755) -%doc docs/_build/html/* +%doc COPYING.md README.md +%{py3_sitescriptdir}/ipython_genutils +%{py3_sitescriptdir}/ipython_genutils-%{version}-py*.egg-info %endif -- 2.44.0