svn commit: r460728 - in head/devel/py-p4python: . files
Alan Somers
asomers at FreeBSD.org
Fri Feb 2 19:11:20 UTC 2018
Author: asomers (src committer)
Date: Fri Feb 2 19:11:18 2018
New Revision: 460728
URL: https://svnweb.freebsd.org/changeset/ports/460728
Log:
devel/py-p4python: new port
Reviewed by: brd
Approved by: brd (ports)
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D10825
Added:
head/devel/py-p4python/
head/devel/py-p4python/Makefile (contents, props changed)
head/devel/py-p4python/distinfo (contents, props changed)
head/devel/py-p4python/files/
head/devel/py-p4python/files/patch-setup.py (contents, props changed)
head/devel/py-p4python/pkg-descr (contents, props changed)
Added: head/devel/py-p4python/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/py-p4python/Makefile Fri Feb 2 19:11:18 2018 (r460728)
@@ -0,0 +1,24 @@
+# $FreeBSD$
+
+PORTNAME= p4python
+PORTVERSION= 2016.1.1447008
+CATEGORIES= devel python
+MASTER_SITES= CHEESESHOP
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= asomers at FreeBSD.org
+COMMENT= Python bindings for the Perforce API
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+
+BUILD_DEPENDS+= ${LOCALBASE}/lib/perforce/libclient.a:devel/p4api
+RUN_DEPENDS:= ${BUILD_DEPENDS}
+
+USES= dos2unix python
+USE_PYTHON= distutils autoplist
+
+post-patch:
+ @${REINPLACE_CMD} -e 's:%%LOCALBASE%%:${LOCALBASE}:' ${WRKSRC}/setup.py
+
+.include <bsd.port.mk>
Added: head/devel/py-p4python/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/py-p4python/distinfo Fri Feb 2 19:11:18 2018 (r460728)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1517419395
+SHA256 (p4python-2016.1.1447008.tar.gz) = 1907f3c7ace54763651c1ccf20b92e6e9e72de58b240c591d6291ebb24ef0f1b
+SIZE (p4python-2016.1.1447008.tar.gz) = 84231
Added: head/devel/py-p4python/files/patch-setup.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/py-p4python/files/patch-setup.py Fri Feb 2 19:11:18 2018 (r460728)
@@ -0,0 +1,73 @@
+--- setup.py.orig 2018-02-02 16:50:17 UTC
++++ setup.py
+@@ -102,7 +102,12 @@ class P4APIFtp:
+
+ elif system == "FreeBSD":
+ platform_str += "freebsd"
+- release = uname.release
++ if sys.version_info.major == 3:
++ release = uname.release
++ elif sys.version_info.major == 2:
++ release = uname[2]
++ else:
++ raise Exception("Unknown python version %s" % sys.version)
+
+ value = int(''.join(itertools.takewhile(lambda s: s.isdigit(), release)))
+
+@@ -217,6 +222,8 @@ class VersionInfo:
+ verFile = os.path.join(p4ApiDir, "sample", "Version")
+ if not os.path.exists(verFile):
+ verFile = os.path.join(p4ApiDir, "Version")
++ if not os.path.exists(verFile):
++ verFile = os.path.join(p4ApiDir, "share", "examples", "p4api", "Version")
+ input = open(verFile)
+ for line in input:
+ for pattern, handler in self.patterns:
+@@ -398,9 +405,16 @@ class PlatformInfo:
+ arch = self.architecture(unameOut[4])
+ elif unameOut[0] == 'FreeBSD':
+ unix = "FREEBSD"
+- release = unameOut[2][0]
+- if release == '5':
+- release += unameOut[2][2]
++ if sys.version_info.major == 3:
++ release = unameOut.release.split(".")[0]
++ if release == '5':
++ release += unameOut.release.split(".")[1]
++ elif sys.version_info.major == 2:
++ release = unameOut[2].split(".")[0]
++ if release == '5':
++ release += unameOut[2].split(".")[1]
++ else:
++ raise Exception("Unknown python version %s" % sys.version)
+
+ arch = self.architecture(unameOut[4])
+ elif unameOut[0] == 'CYGWIN_NT-5.1':
+@@ -475,8 +489,16 @@ def do_setup(p4_api_dir, ssl):
+ else:
+ print ("API Release %s.%s" % (ryear, rversion))
+
+- inc_path = [p4_api_dir, os.path.join(p4_api_dir, "include", "p4")]
+- lib_path = [p4_api_dir, os.path.join(p4_api_dir, "lib")]
++ inc_dir = os.path.join(p4_api_dir, "include", "p4")
++ if not os.path.exists(inc_dir):
++ inc_dir = os.path.join(p4_api_dir, "include", "perforce")
++
++ lib_dir = os.path.join(p4_api_dir, "lib", "perforce")
++ if not os.path.exists(lib_dir):
++ lib_dir = os.path.join(p4_api_dir, "lib")
++
++ inc_path = [p4_api_dir, inc_dir]
++ lib_path = [p4_api_dir, lib_dir]
+ if ssl:
+ lib_path.append( ssl )
+
+@@ -608,7 +630,7 @@ if __name__ == "__main__":
+ if os.path.exists(distdir):
+ shutil.rmtree(distdir, False, force_remove_file)
+
+- p4_api_dir = get_api_dir()
++ p4_api_dir = "%%LOCALBASE%%"
+
+ ssl = None
+ if '--ssl' in sys.argv:
Added: head/devel/py-p4python/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/py-p4python/pkg-descr Fri Feb 2 19:11:18 2018 (r460728)
@@ -0,0 +1,4 @@
+The Python bindings for the Perforce Client API provide convenient classes
+within Python for communicating with Perforce SCM servers.
+
+WWW: https://www.perforce.com/perforce/doc.current/manuals/p4script/03_python.html
More information about the svn-ports-head
mailing list