p4 - Initial add.
authorRaymond Danks <raymond@edanks.com>
Mon, 24 Jul 2006 16:18:35 +0000 (16:18 +0000)
committerRaymond Danks <raymond@edanks.com>
Mon, 24 Jul 2006 16:18:35 +0000 (16:18 +0000)
packages/p4/.mtn2git_empty [new file with mode: 0644]
packages/p4/p4.inc [new file with mode: 0644]
packages/p4/p4_04.2.bb [new file with mode: 0644]
packages/p4/p4_05.2.bb [new file with mode: 0644]

diff --git a/packages/p4/.mtn2git_empty b/packages/p4/.mtn2git_empty
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/packages/p4/p4.inc b/packages/p4/p4.inc
new file mode 100644 (file)
index 0000000..a473cfe
--- /dev/null
@@ -0,0 +1,81 @@
+# p4 .bb build file
+# Copyright (C) 2006, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see /COPYING)
+
+HOMEPAGE = "http://www.perforce.com"
+DESCRIPTION = "Perforce client and server binaries"
+MAINTAINER = "Raymond Danks <info-linux@geode.amd.com>"
+LICENSE = "Perforce"
+
+def get_kernelmajorversion(p):
+       import re
+       r = re.compile("([0-9]+\.[0-9]+).*")
+       m = r.match(p);
+       if m:
+               return m.group(1)
+       return None
+
+def p4_arch(d):
+       import bb, re
+       arch = bb.data.getVar('TARGET_ARCH', d, 1)
+       os = bb.data.getVar('TARGET_OS', d, 1)
+
+       if re.match("^linux.*$", os):
+               r = re.compile("([0-9]+\.[0-9]+).*")
+               m = r.match(base_read_file(bb.data.expand('${STAGING_KERNEL_DIR}/kernel-abiversion', d)));
+               os = "linux"
+               if m and re.match("^.*86.*$", arch):
+                       os = "linux%s" % m.group(1).replace('.','')
+
+       if re.match("^i.86$", arch):
+               arch = "x86"
+       elif arch == "x86_64":
+               arch = "amd64"
+       elif re.match("^mips.*$", arch):
+               arch = "mips"
+
+       return "%s%s" % (os, arch)
+
+P4ARCH="${@p4_arch(d)}"
+P4BASEURL="http://filehost.perforce.com/perforce/r${PV}/bin.${P4ARCH}"
+S="${WORKDIR}"
+
+#Because these files are all named the same thing, regardless of version or arch
+PREMIRRORS=""
+DL_DIR="${WORKDIR}/${P4ARCH}"
+
+SRC_URI="\
+       ${P4BASEURL}/p4 \
+       ${P4BASEURL}/p4api.tar \
+       ${P4BASEURL}/p4d \
+       ${P4BASEURL}/p4ftpd \
+       ${P4BASEURL}/p4p \
+       ${P4BASEURL}/p4web"
+
+PACKAGES += " ${PN}-server"
+FILES_${PN} = " ${bindir}/p4"
+FILES_${PN}-server = " ${bindir}/p4d ${bindir}/p4ftpd ${bindir}/p4p ${bindir}/p4web"
+
+do_stage() {
+       install -d ${STAGING_INCDIR}/p4api
+       install -m 0644 *.h ${STAGING_INCDIR}/p4api/
+
+       oe_libinstall -a libclient ${STAGING_LIBDIR}
+       oe_libinstall -a librpc ${STAGING_LIBDIR}
+       oe_libinstall -a libsupp ${STAGING_LIBDIR}
+}
+
+do_install() {
+       install -d ${D}${bindir}
+       install -d ${D}${includedir}/p4api
+       install -d ${D}${libdir}
+
+       install -m 0644 *.h ${D}${includedir}/p4api/
+       for p4bin in p4 p4d p4ftpd p4p p4web ; do
+               install -m 0755 $p4bin ${D}${bindir}/
+       done
+
+       oe_libinstall -a libclient ${D}${libdir}/
+       oe_libinstall -a librpc ${D}${libdir}/
+       oe_libinstall -a libsupp ${D}${libdir}/
+}
diff --git a/packages/p4/p4_04.2.bb b/packages/p4/p4_04.2.bb
new file mode 100644 (file)
index 0000000..7e1ac53
--- /dev/null
@@ -0,0 +1,5 @@
+# p4 .bb build file
+# Copyright (C) 2006, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see /COPYING)
+
+include p4.inc
diff --git a/packages/p4/p4_05.2.bb b/packages/p4/p4_05.2.bb
new file mode 100644 (file)
index 0000000..7e1ac53
--- /dev/null
@@ -0,0 +1,5 @@
+# p4 .bb build file
+# Copyright (C) 2006, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see /COPYING)
+
+include p4.inc