summaryrefslogtreecommitdiffstats
path: root/rules/python-protobuf.make
diff options
context:
space:
mode:
authorRobert Schwebel <r.schwebel@pengutronix.de>2015-06-03 11:45:51 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2015-06-03 18:26:52 +0200
commitd67ddd128ae998e4a6a27fe9f6956b31f63df977 (patch)
tree1681e3ab396e0031c71be0887f26611cd8aee5b1 /rules/python-protobuf.make
parent777764becd34a73b425683b598741d37da1d0222 (diff)
downloadptxdist-d67ddd128ae998e4a6a27fe9f6956b31f63df977.tar.gz
ptxdist-d67ddd128ae998e4a6a27fe9f6956b31f63df977.tar.xz
python-protobuf: add new package
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules/python-protobuf.make')
-rw-r--r--rules/python-protobuf.make82
1 files changed, 82 insertions, 0 deletions
diff --git a/rules/python-protobuf.make b/rules/python-protobuf.make
new file mode 100644
index 000000000..9d883c661
--- /dev/null
+++ b/rules/python-protobuf.make
@@ -0,0 +1,82 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2014 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_PYTHON_PROTOBUF) += python-protobuf
+
+#
+# Paths and names
+#
+PYTHON_PROTOBUF_VERSION = $(PROTOBUF_VERSION)
+PYTHON_PROTOBUF_MD5 = $(PROTOBUF_MD5)
+PYTHON_PROTOBUF = python-$(PROTOBUF)
+PYTHON_PROTOBUF_SUFFIX = $(PROTOBUF_SUFFIX)
+PYTHON_PROTOBUF_URL = $(PROTOBUF_URL)
+PYTHON_PROTOBUF_SOURCE = $(SRCDIR)/$(PROTOBUF).$(PYTHON_PROTOBUF_SUFFIX)
+PYTHON_PROTOBUF_DIR = $(BUILDDIR)/$(PYTHON_PROTOBUF)
+PYTHON_PROTOBUF_SUBDIR = python
+PYTHON_PROTOBUF_LICENSE = $(PROTOBUF_LICENSE)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+PYTHON_PROTOBUF_CONF_TOOL := NO
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/python-protobuf.compile:
+ @$(call targetinfo)
+ @cd $(PYTHON_PROTOBUF_DIR)/$(PYTHON_PROTOBUF_SUBDIR) && \
+ $(CROSS_ENV) $(CROSS_PYTHON) \
+ setup.py build
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/python-protobuf.install:
+ @$(call targetinfo)
+ @cd $(PYTHON_PROTOBUF_DIR)/$(PYTHON_PROTOBUF_SUBDIR) && \
+ $(CROSS_ENV) $(CROSS_PYTHON) \
+ setup.py install --root=$(PYTHON_PROTOBUF_PKGDIR) --prefix="/usr"
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/python-protobuf.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, python-protobuf)
+ @$(call install_fixup, python-protobuf,PRIORITY,optional)
+ @$(call install_fixup, python-protobuf,SECTION,base)
+ @$(call install_fixup, python-protobuf,AUTHOR,"Michael Olbrich <m.olbrich@pengutronix.de>")
+ @$(call install_fixup, python-protobuf,DESCRIPTION,missing)
+
+ @for file in `find $(PYTHON_PROTOBUF_PKGDIR)/usr/lib/python$(PYTHON_MAJORMINOR)/site-packages/google \
+ ! -type d ! -name "*.py" -printf "%P\n"`; do \
+ $(call install_copy, python-protobuf, 0, 0, 0644, -, \
+ /usr/lib/python$(PYTHON_MAJORMINOR)/site-packages/google/$$file); \
+ done
+ @$(call install_copy, python-protobuf, 0, 0, 0644, -, \
+ /usr/lib/python$(PYTHON_MAJORMINOR)/site-packages/protobuf-$(PYTHON_PROTOBUF_VERSION)-py$(PYTHON_MAJORMINOR)-nspkg.pth)
+
+ @$(call install_finish, python-protobuf)
+
+ @$(call touch)
+
+# vim: syntax=make