From 43a4069756e277390803f215cd7ed070c46cf192 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: May 31 2015 17:21:07 +0000 Subject: Update to 1.0.1 - Add python3 build --- diff --git a/.gitignore b/.gitignore index cb35025..380a52c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ GitPython-0.2.0-beta1.tar.gz /GitPython-0.3.2.RC1.tar.gz +/GitPython-1.0.1.tar.gz diff --git a/0001-GPG-signature-support-on-commit-object.patch b/0001-GPG-signature-support-on-commit-object.patch deleted file mode 100644 index 60ff4e0..0000000 --- a/0001-GPG-signature-support-on-commit-object.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff -uNr GitPython-0.3.2.RC1.orig/git/objects/commit.py GitPython-0.3.2.RC1/git/objects/commit.py ---- GitPython-0.3.2.RC1.orig/git/objects/commit.py 2011-06-14 02:31:14.000000000 +0400 -+++ GitPython-0.3.2.RC1/git/objects/commit.py 2013-12-07 13:19:10.111948329 +0400 -@@ -57,12 +57,12 @@ - __slots__ = ("tree", - "author", "authored_date", "author_tz_offset", - "committer", "committed_date", "committer_tz_offset", -- "message", "parents", "encoding") -+ "message", "parents", "encoding", "gpgsig") - _id_attribute_ = "binsha" - - def __init__(self, repo, binsha, tree=None, author=None, authored_date=None, author_tz_offset=None, - committer=None, committed_date=None, committer_tz_offset=None, -- message=None, parents=None, encoding=None): -+ message=None, parents=None, encoding=None, gpgsig=None): - """Instantiate a new Commit. All keyword arguments taking None as default will - be implicitly set on first query. - -@@ -120,6 +120,7 @@ - self.parents = parents - if encoding is not None: - self.encoding = encoding -+ self.gpgsig = gpgsig - - @classmethod - def _get_intermediate_items(cls, commit): -@@ -394,6 +395,11 @@ - if self.encoding != self.default_encoding: - write("encoding %s\n" % self.encoding) - -+ if self.gpgsig: -+ write("gpgsig") -+ for sigline in self.gpgsig.rstrip("\n").split("\n"): -+ write(" "+sigline+"\n") -+ - write("\n") - - # write plain bytes, be sure its encoded according to our encoding -@@ -429,14 +435,26 @@ - # now we can have the encoding line, or an empty line followed by the optional - # message. - self.encoding = self.default_encoding -- # read encoding or empty line to separate message -- enc = readline() -- enc = enc.strip() -- if enc: -- self.encoding = enc[enc.find(' ')+1:] -- # now comes the message separator -- readline() -- # END handle encoding -+ # read headers -+ buf = readline().strip() -+ while buf != "": -+ if buf[0:10] == "encoding ": -+ self.encoding = buf[buf.find(' ')+1:] -+ elif buf[0:7] == "gpgsig ": -+ sig = buf[buf.find(' ')+1:] + "\n" -+ is_next_header = False -+ while True: -+ sigbuf = readline() -+ if sigbuf == "": break -+ if sigbuf[0:1] != " ": -+ buf = sigbuf.strip() -+ is_next_header = True -+ break -+ sig += sigbuf[1:] -+ self.gpgsig = sig.rstrip("\n") -+ if is_next_header: -+ continue -+ buf = readline().strip() - - # decode the authors name - try: diff --git a/GitPython.spec b/GitPython.spec index 274b21b..624e532 100644 --- a/GitPython.spec +++ b/GitPython.spec @@ -1,21 +1,26 @@ -# sitelib for noarch packages, sitearch for others (remove the unneeded one) -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +f 0%{?fedora} > 12 +%global with_python3 1 +%else +%if 0%{?rhel} && 0%{?rhel} <= 7 +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%else +%global with_python3 1 +%endif +%endif Name: GitPython -Version: 0.3.2 -Release: 0.7.RC1%{?dist} +Version: 1.0.1 +Release: 1%{?dist} Summary: Python Git Library Group: Development/Languages License: BSD URL: http://pypi.python.org/pypi/GitPython/ -# http://pypi.python.org/packages/source/G/GitPython/GitPython-0.3.2.RC1.tar.gz#md5=849082fe29adc653a3621465213cab96 -Source0: http://pypi.python.org/packages/source/G/GitPython/GitPython-0.3.2.RC1.tar.gz -Patch1: 0001-GPG-signature-support-on-commit-object.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Source0: http://pypi.python.org/packages/source/G/%{name}/%{name}-%{version}.tar.gz BuildArch: noarch -BuildRequires: python-devel python-setuptools +BuildRequires: python2-devel python-setuptools Requires: git Requires: python-gitdb @@ -29,33 +34,68 @@ trees, blobs, etc. GitPython is a port of the grit library in Ruby created by Tom Preston-Werner and Chris Wanstrath. +%if %{with python3} +%package -n python3-GitPython +Summary: Python3 Git Library +Requires: git +Requires: python3-gitdb +BuildRequires: python3-devel python3-setuptools + +%description -n python3-GitPython +%{description} +%endif %prep -%setup -q -n %{name}-%{version}.RC1 -%patch1 -p1 +%setup -qc +mv %{name}-%{version} python2 -%build -%{__python} setup.py build +%if 0%{?with_python3} +cp -a python2 python3 +find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif # with_python3 +find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' -%install -rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%build +pushd python2 +%{__python2} setup.py build +popd - -%clean -rm -rf $RPM_BUILD_ROOT +%if %{with python3} +pushd python3 +%{__python3} setup.py build +popd +%endif +%install +pushd python2 +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} +popd +%if %{with python3} +pushd python3 +%{__python3} setup.py install -O1 --skip-build --root %{buildroot} +popd +%endif %files -%defattr(-,root,root,-) -%doc CHANGES LICENSE AUTHORS -# For noarch packages: sitelib -%{python_sitelib}/GitPython-%{version}.RC1-py*.egg-info -%{python_sitelib}/git - +%license LICENSE +%doc CHANGES AUTHORS +%{python2_sitelib}/GitPython-%{version}-py?.?.egg-info +%{python2_sitelib}/git/ + +%if %{with python3} +%files -n python3-GitPython +%license LICENSE +%doc CHANGES AUTHORS +%{python3_sitelib}/GitPython-%{version}-py?.?.egg-info +%{python3_sitelib}/git/ +%endif %changelog +* Sun May 31 2015 Dennis Gilmore - 1.0.1-1 +- Update to 1.0.1 +- Add python3 build + * Fri Jun 06 2014 Fedora Release Engineering - 0.3.2-0.7.RC1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild diff --git a/sources b/sources index ec1d4c0..110f399 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -849082fe29adc653a3621465213cab96 GitPython-0.3.2.RC1.tar.gz +4659644b42c41e5e5170c0cd83ed6422 GitPython-1.0.1.tar.gz