diff mbox

[1/2] pps-tools: new package

Message ID 1413405475-5179-1-git-send-email-matthew.weber@rockwellcollins.com
State Superseded
Headers show

Commit Message

Matt Weber Oct. 15, 2014, 8:37 p.m. UTC
From: Bryan Brinsko <bryan.brinsko@rockwellcollins.com>

Added pps-tools package to add support to the ntpd for a
pps source (requires timepps.h from pps-tools as part of ntpd
build).

Signed-off-by: Bryan Brinsko <bryan.brinsko@rockwellcollins.com>
Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>
---
 package/Config.in              |  1 +
 package/pps-tools/Config.in    |  6 ++++++
 package/pps-tools/pps-tools.mk | 28 ++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 package/pps-tools/Config.in
 create mode 100644 package/pps-tools/pps-tools.mk

Comments

Thomas Petazzoni Oct. 16, 2014, 9:24 a.m. UTC | #1
Dear Matt Weber,

On Wed, 15 Oct 2014 15:37:54 -0500, Matt Weber wrote:

> diff --git a/package/pps-tools/pps-tools.mk b/package/pps-tools/pps-tools.mk
> new file mode 100644
> index 0000000..4ebfb1e
> --- /dev/null
> +++ b/package/pps-tools/pps-tools.mk
> @@ -0,0 +1,28 @@
> +################################################################################
> +#
> +# pps-tools
> +#
> +################################################################################

One empty new line needed here.

> +PPS_TOOLS_VERSION = 0deb9c7e135e9380a6d09e9d2e938a146bb698c8
> +PPS_TOOLS_SITE = https://github.com/ago/pps-tools.git
> +PPS_TOOLS_SITE_METHOD = git
> +PPS_TOOLS_INSTALL_STAGING = YES
> +PPS_TOOLS_LICENSE = GPLv2

License is GPLv2+.

> +PPS_TOOLS_LICENSE_FILES = COPYING
> +
> +define PPS_TOOLS_BUILD_CMDS
> +	$(MAKE) CC=$(TARGET_CC) -C $(@D) all

Use $(TARGET_CONFIGURE_OPTS) instead of CC=$(TARGET_CC), so that CFLAGS
and al. are also passed.

> +endef
> +
> +define PPS_TOOLS_INSTALL_STAGING_CMDS
> +	$(INSTALL) -D -m 0644 $(@D)/timepps.h $(STAGING_DIR)/usr/include/timepps.h
> +endef
> +
> +define PPS_TOOLS_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/ppsctl $(TARGET_DIR)/usr/bin/ppsctl
> +	$(INSTALL) -D -m 0755 $(@D)/ppsfind $(TARGET_DIR)/usr/bin/ppsfind
> +	$(INSTALL) -D -m 0755 $(@D)/ppstest $(TARGET_DIR)/usr/bin/ppstest
> +	$(INSTALL) -D -m 0755 $(@D)/ppswatch $(TARGET_DIR)/usr/bin/ppswatch
> +endef

Use the "make install" target of the pps-tools Makefile instead. There
is just one issue with it in that it doesn't create the destination
directories where it copies the header file and the executable. Fix
this either by adding a patch (which should be submitted upstream),
or doing something like:

	mkdir -p $(TARGET_DIR)/usr/include/sys $(TARGET_DIR)/usr/bin

before doing the make install. And ditto for the staging installation,
of course.

We prefer to use the package built-in "make install" logic so that if
we bump the package version later, we won't forget to install other new
things that the package should now install.

Other than that, I've built-tested your patch with a minimal ARM
configuration, and it worked fine.

Can you fix those issues and resubmit?

Thanks,

Thomas
Ryan Barnett Oct. 16, 2014, 1:44 p.m. UTC | #2
Matt,

On Wed, Oct 15, 2014 at 3:37 PM, Matt Weber
<matthew.weber@rockwellcollins.com> wrote:

[...]

> diff --git a/package/pps-tools/pps-tools.mk b/package/pps-tools/pps-tools.mk
> new file mode 100644
> index 0000000..4ebfb1e
> --- /dev/null
> +++ b/package/pps-tools/pps-tools.mk
> @@ -0,0 +1,28 @@
> +################################################################################
> +#
> +# pps-tools
> +#
> +################################################################################
> +PPS_TOOLS_VERSION = 0deb9c7e135e9380a6d09e9d2e938a146bb698c8
> +PPS_TOOLS_SITE = https://github.com/ago/pps-tools.git
> +PPS_TOOLS_SITE_METHOD = git

Does the github helper work for downloading this package? I think it
is prefer to use the git hub helper as described in the manual at
http://buildroot.org/downloads/manual/manual.html#github-download-url

Thanks,
-Ryan
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 93e148d..8c109a5 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -351,6 +351,7 @@  endif
 	source "package/parted/Config.in"
 	source "package/pciutils/Config.in"
 	source "package/picocom/Config.in"
+	source "package/pps-tools/Config.in"
 	source "package/pifmrds/Config.in"
 	source "package/read-edid/Config.in"
 	source "package/rng-tools/Config.in"
diff --git a/package/pps-tools/Config.in b/package/pps-tools/Config.in
new file mode 100644
index 0000000..83308f4
--- /dev/null
+++ b/package/pps-tools/Config.in
@@ -0,0 +1,6 @@ 
+config BR2_PACKAGE_PPS_TOOLS
+	bool "pps-tools"
+	help
+	  Pulse per second tools. Provides timepps.h and other PPS utilities.
+
+	  https://github.com/ago/pps-tools/
diff --git a/package/pps-tools/pps-tools.mk b/package/pps-tools/pps-tools.mk
new file mode 100644
index 0000000..4ebfb1e
--- /dev/null
+++ b/package/pps-tools/pps-tools.mk
@@ -0,0 +1,28 @@ 
+################################################################################
+#
+# pps-tools
+#
+################################################################################
+PPS_TOOLS_VERSION = 0deb9c7e135e9380a6d09e9d2e938a146bb698c8
+PPS_TOOLS_SITE = https://github.com/ago/pps-tools.git
+PPS_TOOLS_SITE_METHOD = git
+PPS_TOOLS_INSTALL_STAGING = YES
+PPS_TOOLS_LICENSE = GPLv2
+PPS_TOOLS_LICENSE_FILES = COPYING
+
+define PPS_TOOLS_BUILD_CMDS
+	$(MAKE) CC=$(TARGET_CC) -C $(@D) all
+endef
+
+define PPS_TOOLS_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/timepps.h $(STAGING_DIR)/usr/include/timepps.h
+endef
+
+define PPS_TOOLS_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/ppsctl $(TARGET_DIR)/usr/bin/ppsctl
+	$(INSTALL) -D -m 0755 $(@D)/ppsfind $(TARGET_DIR)/usr/bin/ppsfind
+	$(INSTALL) -D -m 0755 $(@D)/ppstest $(TARGET_DIR)/usr/bin/ppstest
+	$(INSTALL) -D -m 0755 $(@D)/ppswatch $(TARGET_DIR)/usr/bin/ppswatch
+endef
+
+$(eval $(generic-package))