From d281e2cab7e18357a5f2968051b99f7359f880540501af35e490736a825ac48f Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Wed, 2 Feb 2011 12:49:39 +0000 Subject: [PATCH] Accepting request 59191 from home:saschpe OBS-URL: https://build.opensuse.org/request/show/59191 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pygit2?expand=0&rev=1 --- .gitattributes | 23 +++++++ .gitignore | 1 + pygit2-0.1-libgit2-updates.patch | 111 +++++++++++++++++++++++++++++++ pygit2-0.1.tar.bz2 | 3 + python-pygit2.changes | 17 +++++ python-pygit2.spec | 69 +++++++++++++++++++ 6 files changed, 224 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 pygit2-0.1-libgit2-updates.patch create mode 100644 pygit2-0.1.tar.bz2 create mode 100644 python-pygit2.changes create mode 100644 python-pygit2.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/pygit2-0.1-libgit2-updates.patch b/pygit2-0.1-libgit2-updates.patch new file mode 100644 index 0000000..2941ecc --- /dev/null +++ b/pygit2-0.1-libgit2-updates.patch @@ -0,0 +1,111 @@ +diff --git a/pygit2.c b/pygit2.c +index 9dd5a4b..deae605 100644 +--- a/pygit2.c ++++ b/pygit2.c +@@ -26,13 +26,8 @@ + */ + + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++ + + typedef struct { + PyObject_HEAD +@@ -559,11 +554,11 @@ Commit_get_commit_time(Commit *commit) { + + static PyObject * + Commit_get_committer(Commit *commit) { +- git_person *committer; +- committer = (git_person*)git_commit_committer(commit->commit); +- return build_person(git_person_name(committer), +- git_person_email(committer), +- git_person_time(committer)); ++ const git_signature *committer = git_commit_committer(commit->commit); ++ ++ return build_person(committer->name, ++ committer->email, ++ committer->when.time); + } + + static int +@@ -572,17 +567,22 @@ Commit_set_committer(Commit *commit, PyObject *value) { + long long time; + if (!parse_person(value, &name, &email, &time)) + return -1; +- git_commit_set_committer(commit->commit, name, email, time); ++ ++ git_signature *signature = git_signature_new(name, email, time, 0); ++ if ( signature == NULL) ++ return -1; ++ ++ git_commit_set_committer(commit->commit, signature); + return 0; + } + + static PyObject * + Commit_get_author(Commit *commit) { +- git_person *author; +- author = (git_person*)git_commit_author(commit->commit); +- return build_person(git_person_name(author), +- git_person_email(author), +- git_person_time(author)); ++ const git_signature *author = git_commit_author(commit->commit); ++ ++ return build_person(author->name, ++ author->email, ++ author->when.time); + } + + static int +@@ -591,7 +591,11 @@ Commit_set_author(Commit *commit, PyObject *value) { + long long time; + if (!parse_person(value, &name, &email, &time)) + return -1; +- git_commit_set_author(commit->commit, name, email, time); ++ git_signature *signature = git_signature_new(name, email, time, 0); ++ if ( signature == NULL) ++ return -1; ++ ++ git_commit_set_author(commit->commit, signature); + return 0; + } + +@@ -1138,13 +1142,12 @@ Tag_set_name(Tag *self, PyObject *py_name) { + + static PyObject * + Tag_get_tagger(Tag *tag) { +- git_person *tagger; +- tagger = (git_person*)git_tag_tagger(tag->tag); ++ const git_signature *tagger = git_tag_tagger(tag->tag); + if (!tagger) + Py_RETURN_NONE; +- return build_person(git_person_name(tagger), +- git_person_email(tagger), +- git_person_time(tagger)); ++ return build_person(tagger->name, ++ tagger->email, ++ tagger->when.time); + } + + static int +@@ -1153,7 +1156,12 @@ Tag_set_tagger(Tag *tag, PyObject *value) { + long long time; + if (!parse_person(value, &name, &email, &time)) + return -1; +- git_tag_set_tagger(tag->tag, name, email, time); ++ ++ git_signature *signature = git_signature_new(name, email, time, 0); ++ if ( signature == NULL) ++ return -1; ++ ++ git_tag_set_tagger(tag->tag, signature); + return 0; + } + diff --git a/pygit2-0.1.tar.bz2 b/pygit2-0.1.tar.bz2 new file mode 100644 index 0000000..2242660 --- /dev/null +++ b/pygit2-0.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:337482703b1d8a3f90c6ac437c571368b8df62f02a04f117e9948034c9a9cd14 +size 19176 diff --git a/python-pygit2.changes b/python-pygit2.changes new file mode 100644 index 0000000..020c70d --- /dev/null +++ b/python-pygit2.changes @@ -0,0 +1,17 @@ +------------------------------------------------------------------- +Wed Jan 26 17:26:21 UTC 2011 - saschpe@gmx.de + +- Removed SUSE-specific --record-rpm for file lists + +------------------------------------------------------------------- +Tue Jan 18 21:49:47 UTC 2011 - saschpe@gmx.de + +- Install documentation (README.md and COPYING) +- Fix install section for other distros + +------------------------------------------------------------------- +Tue Jan 18 20:48:40 UTC 2011 - saschpe@gmx.de + +- Initial commit (0.1) +- Added patch include recent libgit2 changes + diff --git a/python-pygit2.spec b/python-pygit2.spec new file mode 100644 index 0000000..d83dbc9 --- /dev/null +++ b/python-pygit2.spec @@ -0,0 +1,69 @@ +# +# spec file for package python-pygit2 +# +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} + +%define mod_name pygit2 + +Name: python-%{mod_name} +Version: 0.1 +Release: 0 +Url: http://github.com/dborowitz/pygit2 +Summary: Python bindings for libgit2 +License: Apache 2.0 +Group: Development/Languages/Python +Source: %{mod_name}-%{version}.tar.bz2 +Patch0: %{mod_name}-%{version}-libgit2-updates.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: python-devel libgit2-devel +%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version} +BuildRequires: openssl-devel +%else +BuildRequires: libopenssl-devel +%endif +%if 0%{?suse_version} +%py_requires +%endif + +%description +Bindings for libgit2, a linkable C library for the Git version-control system. + +%prep +export CFLAGS="%{optflags}" +%setup -n %{mod_name} +%patch0 -p1 +# Adjust include/lib paths to local system +sed -i 's|/usr/local/include|%{_includedir}|' setup.py +sed -i 's|/usr/local/lib|%{_libdir}|' setup.py + +%build +python setup.py build + +%install +python setup.py install --prefix=%{_prefix} --root=%{buildroot} + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc README.md COPYING +%python_sitearch/%{mod_name}* + +%changelog