mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Juergen Beisert <jbe@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH 5/5] Python/pyserial: add serial/UART module feature
Date: Sun, 25 Dec 2011 19:20:43 +0100	[thread overview]
Message-ID: <1324837243-10542-6-git-send-email-jbe@pengutronix.de> (raw)
In-Reply-To: <1324837243-10542-1-git-send-email-jbe@pengutronix.de>

Add operating system independent UART handling to the Python interpreter.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
 rules/pyserial.in   |   41 +++++++++++++++++++
 rules/pyserial.make |  111 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 152 insertions(+), 0 deletions(-)
 create mode 100644 rules/pyserial.in
 create mode 100644 rules/pyserial.make

diff --git a/rules/pyserial.in b/rules/pyserial.in
new file mode 100644
index 0000000..c67a69b
--- /dev/null
+++ b/rules/pyserial.in
@@ -0,0 +1,41 @@
+## SECTION=python
+
+menuconfig PYSERIAL
+	tristate
+	select PYTHON
+	prompt "pyserial                      "
+	help
+	  This module encapsulates the access for the serial port. It provides
+	  backends for Python running on Windows, Linux, BSD (possibly any
+	  POSIX compliant system), Jython and IronPython (.NET and Mono). The
+	  module named "serial" automatically selects the appropriate backend.
+
+	  - Project Homepage: http://pyserial.sourceforge.net
+	  - Project page on SourceForge: http://sourceforge.net/projects/pyserial/
+	  - SVN repository: http://sourceforge.net/svn/?group_id=46487
+	  - Download Page: http://sourceforge.net/project/showfiles.php?group_id=46487
+
+if PYSERIAL
+
+config PYSERIAL_MINITERM
+	bool
+	prompt "Install 'miniterm'"
+	help
+	  Install the miniterm script coming with this package.
+
+config PYSERIAL_EXAMPLES
+	bool
+	prompt "Install usage examples"
+	help
+	  Install the examples coming with this package (for example a serial
+	  to network forwarder).
+
+config PYSERIAL_TESTS
+	bool
+	prompt "Install test scripts"
+	help
+	  Install the test scripts coming with this package. They could be useful
+	  to check if the installation is complete and working. So, they are
+	  more for development or debugging. Nothing really required.
+
+endif
diff --git a/rules/pyserial.make b/rules/pyserial.make
new file mode 100644
index 0000000..3100129
--- /dev/null
+++ b/rules/pyserial.make
@@ -0,0 +1,111 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2011 by Juergen Beisert <jbe@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_PYSERIAL) += pyserial
+
+#
+# Paths and names
+#
+PYSERIAL_VERSION	:= 2.6
+PYSERIAL_MD5		:= cde799970b7c1ce1f7d6e9ceebe64c98
+PYSERIAL		:= pyserial-$(PYSERIAL_VERSION)
+PYSERIAL_SUFFIX		:= tar.gz
+PYSERIAL_URL		:= http://pypi.python.org/packages/source/p/pyserial/$(PYSERIAL).$(PYSERIAL_SUFFIX)
+PYSERIAL_SOURCE		:= $(SRCDIR)/$(PYSERIAL).$(PYSERIAL_SUFFIX)
+PYSERIAL_DIR		:= $(BUILDDIR)/$(PYSERIAL)
+PYSERIAL_LICENSE	:= BSD
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+PYSERIAL_PATH		:= PATH=$(CROSS_PATH)
+PYSERIAL_CONF_TOOL	:= NO
+PYSERIAL_MAKE_ENV	:= $(CROSS_ENV)
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/pyserial.compile:
+	@$(call targetinfo)
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Instal
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/pyserial.install:
+	@$(call targetinfo)
+	@cd $(PYSERIAL_DIR) && \
+		$(PYSERIAL_PATH) $(PYSERIAL_MAKE_ENV) \
+		python setup.py install --root=$(PYSERIAL_PKGDIR) --prefix=/usr
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/pyserial.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, pyserial)
+	@$(call install_fixup, pyserial,PRIORITY,optional)
+	@$(call install_fixup, pyserial,SECTION,base)
+	@$(call install_fixup, pyserial,AUTHOR,"Juergen Beisert <jbe@pengutronix.de>")
+	@$(call install_fixup, pyserial,DESCRIPTION, "Serial Communication for Python")
+
+	@$(call install_copy, pyserial, 0, 0, 0755, $(PYTHON_SITEPACKAGES))
+	@$(call install_copy, pyserial, 0, 0, 0755, $(PYTHON_SITEPACKAGES)/serial)
+	@$(call install_copy, pyserial, 0, 0, 0755, $(PYTHON_SITEPACKAGES)/serial/tools)
+	@$(call install_copy, pyserial, 0, 0, 0755, $(PYTHON_SITEPACKAGES)/serial/urlhandler)
+
+	@for file in $(shell cd $(PYSERIAL_PKGDIR) && find . -name "*.pyc"); \
+	do \
+		$(call install_copy, pyserial, 0, 0, 0644, -, /$$file); \
+	done
+
+# note: the setup.py also installs the miniterm.py script, but with a really
+# broken path to the python interpreter. As a workaround we use the plain script
+# from the build directory instead
+ifdef PTXCONF_PYSERIAL_MINITERM
+	$(call install_copy, pyserial, 0, 0, 0755, \
+		$(PYSERIAL_DIR)/serial/tools/miniterm.py, /usr/bin/miniterm.py)
+endif
+
+# there are some examples that could be useful to check and understand this package
+ifdef PTXCONF_PYSERIAL_EXAMPLES
+	@for file in run_all_tests.py test_high_load.py test.py test_url.py \
+		test_advanced.py test_iolib.py test_readline.py; \
+		do \
+			$(call install_copy, pyserial, 0, 0, 0755, \
+			$(PYSERIAL_DIR)/test/$$file, /usr/bin/$$file); \
+		done
+endif
+
+# there are some test scripts that could be useful to check the installation
+ifdef PTXCONF_PYSERIAL_TESTS
+	@for file in enhancedserial.py scanlinux.py setup-miniterm-py2exe.py \
+		tcp_serial_redirect.py port_publisher.py scan.py \
+		setup-rfc2217_server-py2exe.py wxSerialConfigDialog.py \
+		rfc2217_server.py scanwin32.py setup-wxTerminal-py2exe.py; \
+		do \
+			$(call install_copy, pyserial, 0, 0, 0755, \
+			$(PYSERIAL_DIR)/examples/$$file, /usr/bin/$$file); \
+		done
+endif
+	@$(call install_finish, pyserial)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
1.7.7.3


-- 
ptxdist mailing list
ptxdist@pengutronix.de

      parent reply	other threads:[~2011-12-25 18:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-25 18:20 [ptxdist] [PATCH] Re-work the Python menu a little bit Juergen Beisert
2011-12-25 18:20 ` [ptxdist] [PATCH 1/5] Python: just add some help text Juergen Beisert
2011-12-25 18:20 ` [ptxdist] [PATCH 2/5] Python: prepare to collect all modules at one single place Juergen Beisert
2011-12-25 18:20 ` [ptxdist] [PATCH 3/5] Python/Modules: move modules to the single menu Juergen Beisert
2011-12-25 18:20 ` [ptxdist] [PATCH 4/5] Fix the Python based 'flup' package Juergen Beisert
2011-12-25 18:20 ` Juergen Beisert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324837243-10542-6-git-send-email-jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox