]> git.pld-linux.org Git - packages/python-objgraph.git/blobdiff - python-objgraph.spec
BR: graphviz for tests
[packages/python-objgraph.git] / python-objgraph.spec
index 0b9057a525ef8f66bc772d32111a8e71ea319a55..b8dada5179c39bcd83bd4d761012ea19d1ee085a 100644 (file)
@@ -1,74 +1,97 @@
 #
 # Conditional build:
 %bcond_without tests   # do not perform "make test"
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
 
 %define        module  objgraph
 Summary:       Draws Python object reference graphs with graphviz
 Summary(pl.UTF-8):     Rysuje referencje pomiedzy obiektamiy przy uzyciu graphviz
 Name:          python-objgraph
-Version:       1.7.1
+Version:       3.4.0
 Release:       1
 License:       MIT
 Group:         Development/Languages/Python
-# http://pypi.python.org/packages/source/o/objgraph/objgraph-1.7.1.tar.gz#md5=f6c501b68239e3063b05ca01041652d0
-Source0:       http://pypi.python.org/packages/source/o/%{module}/%{module}-%{version}.tar.gz
-# Source0-md5: f6c501b68239e3063b05ca01041652d0
+Source0:       https://files.pythonhosted.org/packages/source/o/%{module}/%{module}-%{version}.tar.gz
+# Source0-md5: cbe527c7dc095a41458d86cab2059591
 URL:           http://mg.pov.lt/objgraph/
-BuildRequires: python-devel
-BuildRequires: python-distribute
 BuildRequires: rpm-pythonprov
-# remove BR: python-devel for 'noarch' packages.
-# if py_postclean is used
-BuildRequires: rpmbuild(macros) >= 1.219
-#Requires:             python-libs
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with python2}
+BuildRequires: python-setuptools
+%endif
+%if %{with python3}
+BuildRequires: python3-setuptools
+%endif
+%if %{with tests}
+BuildRequires: graphviz
+%endif
 Requires:      python-modules
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%description
-Module that lets you visually explore Python object graphs.
+# optional dependency
+%define _noautoreq pythonegg.graphviz python3egg.graphviz
 
+%description
+Module that lets you visually explore Python object graphs and debug
+memory leaks.
 
 %description -l pl.UTF-8
-Moduł do wizualizacji grafów pythonowych obiektów.
+Moduł do wizualizacji grafów pythonowych obiektów i debugowania
+wycieków pamięci.
+
+%package -n python3-%{module}
+Summary:       Draws Python object reference graphs with graphviz
+Summary(pl.UTF-8):     Rysuje referencje pomiedzy obiektamiy przy uzyciu graphviz
+Group:         Development/Languages/Python
+Requires:      python3-modules
+
+%description -n python3-%{module}
+Module that lets you visually explore Python object graphs and debug
+memory leaks.
+
+%description -n python3-%{module} -l pl.UTF-8
+Moduł do wizualizacji grafów pythonowych obiektów i debugowania
+wycieków pamięci.
 
 %prep
 %setup -q -n %{module}-%{version}
 
-# fix #!%{_bindir}/env python -> #!%{__python}:
-# %{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
-
 %build
-# CC/CFLAGS is only for arch packages - remove on noarch packages
-# CC="%{__cc}" \
-# %py_build
+%if %{with python2}
+%py_build %{?with_tests:test}
+%endif
 
-%{?with_tests:%{__python} setup.py test}
+%if %{with python3}
+%py3_build %{?with_tests:test}
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%py_install
 
-# install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-# cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%if %{with python2}
+%py_install
 
-# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
-%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
-%py_comp $RPM_BUILD_ROOT%{py_sitedir}
 %py_postclean
+%endif
 
-%clean
-rm -rf $RPM_BUILD_ROOT
+%if %{with python3}
+%py3_install
+%endif
 
 %files
 %defattr(644,root,root,755)
-# %doc AUTHORS CREDITS ChangeLog NEWS README THANKS TODO
-# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
-# %{py_sitedir}/*.py[co]
-%{py_sitescriptdir}/*.py[co]
-
-# %attr(755,root,root) %{py_sitedir}/*.so
-%if "%{py_ver}" > "2.4"
-%{py_sitescriptdir}/%{module}-*.egg-info
-%endif
-# %{_examplesdir}/%{name}-%{version}
+%doc CHANGES.rst README.rst docs
+%{py_sitescriptdir}/%{module}.py*
+%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
+
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc CHANGES.rst README.rst docs
+%{py3_sitescriptdir}/%{module}.py
+%{py3_sitescriptdir}/__pycache__/%{module}.*
+%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+
+%clean
+rm -rf $RPM_BUILD_ROOT
This page took 0.118975 seconds and 4 git commands to generate.