[python-gitapi] Initial import (#1129902)
Julien Enselme
jujens at fedoraproject.org
Wed Sep 3 15:02:56 UTC 2014
commit ef5a3f9daf019598c7c5c743b58600897cb8f1a0
Author: Julien Enselme <julien.enselme at centrale-marseille.fr>
Date: Wed Sep 3 16:54:46 2014 +0200
Initial import (#1129902)
.gitignore | 1 +
LICENSE | 20 +++++++
python-gitapi-1.0.0-import.patch | 8 +++
python-gitapi-1.0.0-test-suite.patch | 23 ++++++++
python-gitapi.spec | 98 ++++++++++++++++++++++++++++++++++
sources | 1 +
6 files changed, 151 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..404b358 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/gitapi-1.0.0.tar.gz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..e43d482
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
++++ LICENSE 2014-08-29 21:30:05.147827489 +0200
+@@ -0,0 +1,18 @@
++Copyright (c) 2011, Fredrik Håård
++
++Permission is hereby granted, free of charge, to any person obtaining a copy of
++this software and associated documentation files (the "Software"), to deal in
++the Software without restriction, including without limitation the rights to
++use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
++the Software, and to permit persons to whom the Software is furnished to do so,
++subject to the following conditions:
++
++The above copyright notice and this permission notice shall be included in all
++copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
++FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
++COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
++IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/python-gitapi-1.0.0-import.patch b/python-gitapi-1.0.0-import.patch
new file mode 100644
index 0000000..05ad01a
--- /dev/null
+++ b/python-gitapi-1.0.0-import.patch
@@ -0,0 +1,8 @@
+--- gitapi/__init__.py 2014-08-03 19:16:01.357919640 +0200
++++ gitapi/__init__.py 2014-08-03 19:16:15.399067535 +0200
+@@ -1,4 +1,4 @@
+ """Python API to Git
+ """
+-import gitapi.gitapi as _gitapi
++from . import gitapi as _gitapi
+ Repo = _gitapi.Repo
diff --git a/python-gitapi-1.0.0-test-suite.patch b/python-gitapi-1.0.0-test-suite.patch
new file mode 100644
index 0000000..ef8ff5e
--- /dev/null
+++ b/python-gitapi-1.0.0-test-suite.patch
@@ -0,0 +1,23 @@
+--- a/gitapi/testgitapi.py 2013-09-05 15:05:25.000000000 +0200
++++ b/gitapi/testgitapi.py 2014-08-14 10:30:20.406218981 +0200
+@@ -48,6 +48,9 @@ class TestGitAPI(unittest.TestCase):
+ def test_005_Init(self):
+ self.repo.git_init()
+ self.assertTrue(os.path.exists("test/.git"))
++ # Configure a default user to avoid the 'Please tell me who you are.' error.
++ self.repo.git_command('config', 'user.email', 'test at example.com')
++ self.repo.git_command('config', 'user.name', 'Testuser')
+
+
+ def test_020_Add(self):
+@@ -210,6 +213,10 @@ class TestGitAPI(unittest.TestCase):
+ with open("./test-clone/cities/ghent.txt", "w") as out:
+ out.write("gent")
+ self.clone.git_add('cities')
++ # Configure a default user
++ self.clone.git_command('config', 'user.email', 'test at example.com')
++ self.clone.git_command('config', 'user.name', 'Testuser')
++ # Commit
+ message = "[CLONE] Added one file."
+ self.clone.git_commit(message)
+ self.clone.git_push("../test-clone-bare")
diff --git a/python-gitapi.spec b/python-gitapi.spec
new file mode 100644
index 0000000..7561bef
--- /dev/null
+++ b/python-gitapi.spec
@@ -0,0 +1,98 @@
+Name: python-gitapi
+Version: 1.0.0
+Release: 4%{?dist}
+Summary: Pure-Python API to git, which uses the command-line interface
+
+License: MIT
+URL: https://bitbucket.org/haard/gitapi
+Source0: https://pypi.python.org/packages/source/g/gitapi/gitapi-%{version}.tar.gz
+# Correct an import error in the test suite (solved upstreamed).
+Patch0: python-gitapi-1.0.0-import.patch
+# Avoid the 'Please tell me who you are.' git error during mock tests.
+Patch1: python-gitapi-1.0.0-test-suite.patch
+# Ask upstream to include license in a separate file here:
+# https://bitbucket.org/haard/gitapi/issue/3/include-the-license-in-a-separate-file
+Patch2: LICENSE
+
+BuildArch: noarch
+BuildRequires: python2-devel python-setuptools git
+Requires: git
+
+%description
+Pure-Python API to git, which uses the command-line interface.
+
+%package -n python3-gitapi
+Summary: Pure-Python API to git, which uses the command-line interface
+BuildRequires: python3-devel python3-setuptools
+Requires: git
+
+%description -n python3-gitapi
+Pure-Python API to git, which uses the command-line interface.
+
+%prep
+%setup -q -n gitapi-%{version}
+# Remove egg
+rm -r gitapi.egg-info
+# Apply patches
+sed -i 's/\r$//' gitapi/__init__.py
+%patch0
+sed -i 's/\r$//' gitapi/testgitapi.py
+%patch1 -p1
+touch LICENSE
+%patch2 -p0
+# Correct end of line encoding for README.rst
+sed -i 's/\r$//' README.rst
+# Prep python3
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+
+%build
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+
+%{__python2} setup.py build
+
+
+%install
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+popd
+
+%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+
+
+%check
+pushd %{py3dir}
+%{__python3} setup.py test
+popd
+
+%{__python2} setup.py test
+
+
+%files
+%doc README.rst LICENSE
+%{python2_sitelib}/gitapi-%{version}-py%{python2_version}.egg-info
+%{python2_sitelib}/gitapi/
+
+%files -n python3-gitapi
+%doc README.rst LICENSE
+%{python3_sitelib}/gitapi-%{version}-py%{python3_version}.egg-info
+%{python3_sitelib}/gitapi/
+
+%changelog
+* Fri Aug 29 2014 Julien Enselme <jujens at jujens.eu> - 1.0.0-4
+- Fix the wrong-file-end-of-line-encoding error in README.rst.
+- Fix the summary-not-capitalized error.
+- Add the license file.
+
+* Thu Aug 14 2014 Julien Enselme <jujens at jujens.eu> - 1.0.0-3
+- Don't duplicate the BR of gitapi.
+- Remove egg-info from upstream.
+
+* Thu Aug 14 2014 Julien Enselme <jujens at jujens.eu> - 1.0.0-2
+- Add git as a BuildRequires. The git command is required to complete the tests.
+- Add patch1 to configure author in the git repos to avoid the 'Please tell me who you are.' git error.
+
+* Sun Aug 03 2014 Julien Enselme <jujens at jujens.eu> - 1.0.0-1
+- Initial packaging.
diff --git a/sources b/sources
index e69de29..e285ae7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+f645609bf005efcef37edeeddf6b0566 gitapi-1.0.0.tar.gz
More information about the scm-commits
mailing list