!2 add yaml spec patch source files of python-pygraphviz

From: @ls39938477 
Reviewed-by: @davidhan008 
Signed-off-by: @davidhan008
This commit is contained in:
openeuler-ci-bot 2024-08-08 06:52:19 +00:00 committed by Gitee
commit f5d39ae8e8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 124 additions and 0 deletions

BIN
pygraphviz-1.6.tar.gz Normal file

Binary file not shown.

29
pygraphviz-swig.patch Normal file
View File

@ -0,0 +1,29 @@
--- a/pygraphviz/graphviz.i.orig 2018-09-10 16:07:12.000000000 -0600
+++ b/pygraphviz/graphviz.i 2018-10-11 11:11:44.010380342 -0600
@@ -162,7 +162,7 @@ int agisstrict(Agraph_t * g);
/* nodes */
Agnode_t *agnode(Agraph_t *g, char *name, int createflag);
-Agnode_t *agidnode(Agraph_t * g, unsigned long id, int createflag);
+Agnode_t *agidnode(Agraph_t * g, IDTYPE id, int createflag);
Agnode_t *agsubnode(Agraph_t *g, Agnode_t *n, int createflag);
Agnode_t *agfstnode(Agraph_t *g);
Agnode_t *agnxtnode(Agraph_t *g, Agnode_t *n);
@@ -175,7 +175,7 @@ Agnode_t *agprvnode(Agraph_t * g, Agnode
Agedge_t *agedge(Agraph_t * g, Agnode_t * t, Agnode_t * h,
char *name, int createflag);
Agedge_t *agidedge(Agraph_t * g, Agnode_t * t, Agnode_t * h,
- unsigned long id, int createflag);
+ IDTYPE id, int createflag);
Agedge_t *agsubedge(Agraph_t * g, Agedge_t * e, int createflag);
Agedge_t *agfstin(Agraph_t * g, Agnode_t * n);
Agedge_t *agnxtin(Agraph_t * g, Agedge_t * e);
@@ -235,7 +235,7 @@ int agsafeset(void *obj, char *name
/* styled from gv.cpp in Graphviz to handle <> html data in label */
%inline %{
- int agattr_label(Agraph_t *g, int kind, char *name, char *val)
+ Agsym_t *agattr_label(Agraph_t *g, int kind, char *name, char *val)
{
int len;
char *hs;

90
python-pygraphviz.spec Normal file
View File

@ -0,0 +1,90 @@
Name: python-pygraphviz
Version: 1.6
Release: 1%{?dist}
Summary: Create and Manipulate Graphs and Networks
License: BSD
URL: http://networkx.lanl.gov/pygraphviz/
Source0: https://github.com/pygraphviz/pygraphviz/archive/pygraphviz-%{version}.tar.gz
# Fix a few types in the swig interface
# https://github.com/pygraphviz/pygraphviz
Patch0: pygraphviz-swig.patch
BuildRequires: make
BuildRequires: gcc
BuildRequires: python3-devel
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(mock)
BuildRequires: graphviz-devel
BuildRequires: swig
%global _description %{expand:
PyGraphviz is a Python interface to the Graphviz graph layout and
visualization package. With PyGraphviz you can create, edit, read,
write, and draw graphs using Python to access the Graphviz graph data
structure and layout algorithms. PyGraphviz is independent from
NetworkX but provides a similar programming interface.}
%description %_description
%package -n python3-pygraphviz
Summary: %{summary}
%{?python_provide:%python_provide python3-pygraphviz}
%description -n python3-pygraphviz %_description
%package doc
Summary: Documentation for pygraphviz
Provides: bundled(jquery)
BuildArch: noarch
%description doc
Documentation for PyGraphViz.
%prep
%autosetup -p1 -n pygraphviz-pygraphviz-%{version}
# Regenerate the swig-generated files
swig -python pygraphviz/graphviz.i
# Fix the shebangs in the examples
for fil in examples/*.py; do
sed -i.orig 's,%{_bindir}/env python,%{__python3},' $fil
touch -r $fil.orig $fil
rm $fil.orig
done
%build
%py3_build
# docs
%make_build -C doc html PYTHONPATH=$PWD/build/lib.%{python3_platform}-%{python3_version}
%install
%py3_install
mv %{buildroot}%{_docdir}/pygraphviz-* %{buildroot}%{_pkgdocdir}
rm %{buildroot}%{_pkgdocdir}/INSTALL.txt
cp -p README.rst %{buildroot}%{_pkgdocdir}
rm doc/build/html/.buildinfo
cp -av doc/build/html %{buildroot}%{_pkgdocdir}/
chmod g-w %{buildroot}%{python3_sitearch}/pygraphviz/_graphviz.*.so
%global _docdir_fmt %{name}
%files -n python3-pygraphviz
%{python3_sitearch}/pygraphviz*
%exclude %{python3_sitearch}/pygraphviz/graphviz_wrap.c
%doc %dir %{_pkgdocdir}
%doc %{_pkgdocdir}/README.rst
%license LICENSE
%files doc
%doc %dir %{_pkgdocdir}
%doc %{_pkgdocdir}/html
%doc %{_pkgdocdir}/examples
%license LICENSE
%changelog
* Fri Jul 05 2024 ls <liushuai136@h-partners.com> - 1.6-1
- Init for openeuler 22.03-LTS-SP4

5
python-pygraphviz.yaml Normal file
View File

@ -0,0 +1,5 @@
version_control: github
src_repo:
tag_prefix:
separator:
url: https://github.com/pygraphviz/pygraphviz/