Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] Misc patches (branch yem/pw2)
@ 2015-01-25 17:57 Yann E. MORIN
  2015-01-25 17:57 ` [Buildroot] [PATCH 1/2] benejson: new package Yann E. MORIN
  2015-01-25 17:57 ` [Buildroot] [PATCH 2/2] cgic: " Yann E. MORIN
  0 siblings, 2 replies; 5+ messages in thread
From: Yann E. MORIN @ 2015-01-25 17:57 UTC (permalink / raw)
  To: buildroot

Hello All!

Two patches initially by David, with some cleanups.

Regards,
Yann E. MORIN.


The following changes since commit c1f4413de6ec4f1484a5111b5c7aa98dd400d56e:

  docs: fixup the website symlink (2015-01-25 15:30:08 +0100)

are available in the git repository at:

  git://git.busybox.net/~ymorin/git/buildroot yem/pw2

for you to fetch changes up to 107e8470c800b7f83b91795000895086302f385b:

  cgic: new package (2015-01-25 18:56:50 +0100)

----------------------------------------------------------------
David Bender (2):
      benejson: new package
      cgic: new package

 package/Config.in                                  |  2 +
 package/benejson/Config.in                         | 11 +++++
 package/benejson/benejson.hash                     |  2 +
 package/benejson/benejson.mk                       | 52 ++++++++++++++++++++
 package/cgic/0001-prepare_makefile.patch           | 44 +++++++++++++++++
 package/cgic/0002-file_enhancements.patch          | 56 ++++++++++++++++++++++
 .../0003-restore-cgiFormFileGetTempfileName.patch  | 43 +++++++++++++++++
 package/cgic/Config.in                             |  6 +++
 package/cgic/cgic.hash                             |  2 +
 package/cgic/cgic.mk                               | 25 ++++++++++
 10 files changed, 243 insertions(+)
 create mode 100644 package/benejson/Config.in
 create mode 100644 package/benejson/benejson.hash
 create mode 100644 package/benejson/benejson.mk
 create mode 100644 package/cgic/0001-prepare_makefile.patch
 create mode 100644 package/cgic/0002-file_enhancements.patch
 create mode 100644 package/cgic/0003-restore-cgiFormFileGetTempfileName.patch
 create mode 100644 package/cgic/Config.in
 create mode 100644 package/cgic/cgic.hash
 create mode 100644 package/cgic/cgic.mk

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] benejson: new package
  2015-01-25 17:57 [Buildroot] [PATCH 0/2] Misc patches (branch yem/pw2) Yann E. MORIN
@ 2015-01-25 17:57 ` Yann E. MORIN
  2015-01-25 18:59   ` Thomas Petazzoni
  2015-01-25 17:57 ` [Buildroot] [PATCH 2/2] cgic: " Yann E. MORIN
  1 sibling, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2015-01-25 17:57 UTC (permalink / raw)
  To: buildroot

From: David Bender <codehero@yahoo.com>

Added C/C++ JSON parsing package benejson.

Signed-off-by: Dave Bender <bender@benegon.com>
Signed-off-by: David Bender <codehero@gmail.com>
[yann.morin.1998 at free.fr: fix static/shared install; enhance help entry;
 fix extra space; add hash]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 package/Config.in              |  1 +
 package/benejson/Config.in     | 11 +++++++++
 package/benejson/benejson.hash |  2 ++
 package/benejson/benejson.mk   | 52 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+)
 create mode 100644 package/benejson/Config.in
 create mode 100644 package/benejson/benejson.hash
 create mode 100644 package/benejson/benejson.mk

diff --git a/package/Config.in b/package/Config.in
index 5f6ebc2..0f6addc 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -763,6 +763,7 @@ menu "Javascript"
 endmenu
 
 menu "JSON/XML"
+	source "package/benejson/Config.in"
 	source "package/cjson/Config.in"
 	source "package/expat/Config.in"
 	source "package/ezxml/Config.in"
diff --git a/package/benejson/Config.in b/package/benejson/Config.in
new file mode 100644
index 0000000..4e8ee2c
--- /dev/null
+++ b/package/benejson/Config.in
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_BENEJSON
+	bool "benejson"
+	help
+	  benejson is a buffering SAX-style JSON parser library.
+	  The library package contains 3 major components:
+
+	  - benejson.js: SAX-style parser written in Javascript
+	  - PullParser: A C++ class for JSON pull parsing
+	  - Core: The parsing core with minimal dependencies
+
+	  https://codehero.github.io/benejson/
diff --git a/package/benejson/benejson.hash b/package/benejson/benejson.hash
new file mode 100644
index 0000000..1dfda90
--- /dev/null
+++ b/package/benejson/benejson.hash
@@ -0,0 +1,2 @@
+# Localy computed
+sha256  2ce5f3c2323500bdf651e7fcaecbd1011997141e6067567b8d2caa4cf7182f4a  benejson-0.9.7.tar.gz
diff --git a/package/benejson/benejson.mk b/package/benejson/benejson.mk
new file mode 100644
index 0000000..375c86e
--- /dev/null
+++ b/package/benejson/benejson.mk
@@ -0,0 +1,52 @@
+################################################################################
+#
+# benejson
+#
+################################################################################
+
+BENEJSON_VERSION = 0.9.7
+BENEJSON_SITE = $(call github,codehero,benejson,$(BENEJSON_VERSION))
+BENEJSON_LICENSE = MIT
+BENEJSON_LICENSE_FILES = LICENSE
+BENEJSON_INSTALL_STAGING = YES
+
+BENEJSON_DEPENDENCIES = host-scons
+
+BENEJSON_SCONS_ENV = $(TARGET_CONFIGURE_OPTS) CROSS=$(TARGET_CROSS)
+
+define BENEJSON_BUILD_CMDS
+	(cd $(@D); \
+	 $(BENEJSON_SCONS_ENV) \
+	 $(SCONS) \
+	 $(BENEJSON_SCONS_OPTS) \
+	)
+endef
+
+ifeq ($(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
+define BENEJSON_INSTALL_STATIC_LIB
+	$(INSTALL) -D -m 0644 $(@D)/lib/libbenejson.a \
+		$(1)/usr/lib/libbenejson.a
+endef
+endif # Static enabled
+
+ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
+define BENEJSON_INSTALL_SHARED_LIB
+	$(INSTALL) -D -m 0644 $(@D)/lib/libbenejson.so \
+		$(1)/usr/lib/libbenejson.so
+endef
+endif # Shared enabled
+
+define BENEJSON_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/include/benejson/benejson.h \
+		$(STAGING_DIR)/usr/include/benejson/benejson.h; \
+	$(INSTALL) -D -m 0644 $(@D)/include/benejson/pull.hh \
+		$(STAGING_DIR)/usr/include/benejson/pull.hh
+	$(call BENEJSON_INSTALL_STATIC_LIB,$(STAGING_DIR))
+	$(call BENEJSON_INSTALL_SHARED_LIB,$(STAGING_DIR))
+endef
+
+define BENEJSON_INSTALL_TARGET_CMDS
+	$(call BENEJSON_INSTALL_SHARED_LIB,$(TARGET_DIR))
+endef
+
+$(eval $(generic-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] cgic: new package
  2015-01-25 17:57 [Buildroot] [PATCH 0/2] Misc patches (branch yem/pw2) Yann E. MORIN
  2015-01-25 17:57 ` [Buildroot] [PATCH 1/2] benejson: new package Yann E. MORIN
@ 2015-01-25 17:57 ` Yann E. MORIN
  2015-01-25 19:02   ` Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2015-01-25 17:57 UTC (permalink / raw)
  To: buildroot

From: David Bender <codehero@gmail.com>

Added cgic library.

Signed-off-by: Dave Bender <bender@benegon.com>
Signed-off-by: David Bender <codehero@gmail.com>
[yann.morin.1998 at free.fr: simplify rules to use -C $(@D); do not install
 in target/ ; add description to patches; split patches into independent
 changes; add hash]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 package/Config.in                                  |  1 +
 package/cgic/0001-prepare_makefile.patch           | 44 +++++++++++++++++
 package/cgic/0002-file_enhancements.patch          | 56 ++++++++++++++++++++++
 .../0003-restore-cgiFormFileGetTempfileName.patch  | 43 +++++++++++++++++
 package/cgic/Config.in                             |  6 +++
 package/cgic/cgic.hash                             |  2 +
 package/cgic/cgic.mk                               | 25 ++++++++++
 7 files changed, 177 insertions(+)
 create mode 100644 package/cgic/0001-prepare_makefile.patch
 create mode 100644 package/cgic/0002-file_enhancements.patch
 create mode 100644 package/cgic/0003-restore-cgiFormFileGetTempfileName.patch
 create mode 100644 package/cgic/Config.in
 create mode 100644 package/cgic/cgic.hash
 create mode 100644 package/cgic/cgic.mk

diff --git a/package/Config.in b/package/Config.in
index 0f6addc..043a350 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -819,6 +819,7 @@ menu "Networking"
 	source "package/agentpp/Config.in"
 	source "package/c-ares/Config.in"
 	source "package/canfestival/Config.in"
+	source "package/cgic/Config.in"
 	source "package/cppzmq/Config.in"
 	source "package/czmq/Config.in"
 	source "package/filemq/Config.in"
diff --git a/package/cgic/0001-prepare_makefile.patch b/package/cgic/0001-prepare_makefile.patch
new file mode 100644
index 0000000..15adc4c
--- /dev/null
+++ b/package/cgic/0001-prepare_makefile.patch
@@ -0,0 +1,44 @@
+Makefile: fix for cross-compilation
+
+Probably-Signed-off-by: Dave Bender <bender@benegon.com>
+[yann.morin.1998 at free.fr: patch was made by Dave, but he
+ forgot his SoB line, so I added it]
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+diff -rupN cgic206/Makefile cgic206-br/Makefile
+--- cgic206/Makefile	2014-03-16 18:17:11.000000000 -0400
++++ cgic206-br/Makefile	2015-01-16 11:18:03.714874000 -0500
+@@ -1,15 +1,14 @@
+-CFLAGS=-g -Wall
+-CC=gcc
+-AR=ar
+-RANLIB=ranlib
+ LIBS=-L./ -lcgic
+ 
+ all: libcgic.a cgictest.cgi capture
+ 
+ install: libcgic.a
+-	cp libcgic.a /usr/local/lib
+-	cp cgic.h /usr/local/include
+-	@echo libcgic.a is in /usr/local/lib. cgic.h is in /usr/local/include.
++	cp libcgic.a $(PREFIX)/usr/lib
++	cp cgic.h $(PREFIX)/usr/include
++	@echo libcgic.a is in $(PREFIX)/usr/lib. cgic.h is in $(PREFIX)/usr/include.
++
++cgi.o: cgic.c cgic.h
++	$(CC) $(CFLAGS) cgic.c -o cgic.o
+ 
+ libcgic.a: cgic.o cgic.h
+ 	rm -f libcgic.a
+@@ -19,10 +18,10 @@ libcgic.a: cgic.o cgic.h
+ #mingw32 and cygwin users: replace .cgi with .exe
+ 
+ cgictest.cgi: cgictest.o libcgic.a
+-	gcc cgictest.o -o cgictest.cgi ${LIBS}
++	$(CC) cgictest.o -o cgictest.cgi ${LIBS}
+ 
+ capture: capture.o libcgic.a
+-	gcc capture.o -o capture ${LIBS}
++	$(CC) capture.o -o capture ${LIBS}
+ 
+ clean:
+ 	rm -f *.o *.a cgictest.cgi capture
diff --git a/package/cgic/0002-file_enhancements.patch b/package/cgic/0002-file_enhancements.patch
new file mode 100644
index 0000000..5dd4ab9
--- /dev/null
+++ b/package/cgic/0002-file_enhancements.patch
@@ -0,0 +1,56 @@
+Create better temporary files.
+
+Probably-Signed-off-by: Dave Bender <bender@benegon.com>
+[yann.morin.1998 at free.fr: patch was made by Dave, but he
+ forgot his SoB line, so I added it; split the ptch in two
+  indpeendent fixes]
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff -rupN cgic206/cgic.c cgic206_tempfile/cgic.c
+--- cgic206/cgic.c	2014-03-16 18:17:11.000000000 -0400
++++ cgic206_tempfile/cgic.c	2015-01-21 11:58:45.436384908 -0500
+@@ -22,6 +22,8 @@
+ #define CGICDEBUGEND
+ #endif /* CGICDEBUG */
+ 
++#define _GNU_SOURCE
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
+@@ -34,11 +36,11 @@
+ #include <io.h>
+ 
+ /* cgic 2.01 */
+-#include <fcntl.h>
+ 
+ #else
+ #include <unistd.h>
+ #endif /* WIN32 */
++#include <fcntl.h>
+ #include "cgic.h"
+ 
+ #define cgiStrEq(a, b) (!strcmp((a), (b)))
+@@ -636,16 +638,17 @@ static cgiParseResultType getTempFileNam
+ 		window between the file's creation and the
+ 		chmod call (glibc 2.0.6 and lower might
+ 		otherwise have allowed this). */
++	mode_t umode;
+ 	int outfd; 
++	umode = umask(0600);
+ 	strcpy(tfileName, cgicTempDir "/cgicXXXXXX");
+-	outfd = mkstemp(tfileName);
++	outfd = mkostemp(tfileName, O_CLOEXEC | O_NOATIME);
++	umask(umode);
+ 	if (outfd == -1) {
+ 		return cgiParseIO;
+ 	}
+-	close(outfd);
+-	/* Fix the permissions */
+-	if (chmod(tfileName, 0600) != 0) {
+-		unlink(tfileName);
++
++	if (close(outfd)) {
+ 		return cgiParseIO;
+ 	}
+ #else
diff --git a/package/cgic/0003-restore-cgiFormFileGetTempfileName.patch b/package/cgic/0003-restore-cgiFormFileGetTempfileName.patch
new file mode 100644
index 0000000..f66227b
--- /dev/null
+++ b/package/cgic/0003-restore-cgiFormFileGetTempfileName.patch
@@ -0,0 +1,43 @@
+Restore lost functionality
+
+Probably-Signed-off-by: Dave Bender <bender@benegon.com>
+[yann.morin.1998 at free.fr: patch was made by Dave, but he
+ forgot his SoB line, so I added it]
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff -rupN cgic206/cgic.c cgic206_tempfile/cgic.c
+--- cgic206/cgic.c	2014-03-16 18:17:11.000000000 -0400
++++ cgic206_tempfile/cgic.c	2015-01-21 11:58:45.436384908 -0500
+@@ -1278,6 +1278,20 @@ cgiFormResultType cgiFormFileContentType
+ 	}
+ }
+ 
++const char* cgiFormFileGetTempfileName(
++	char* name)
++{
++	cgiFormEntry *e;
++	e = cgiFormEntryFindFirst(name);
++	if (!e) {
++		return NULL;
++	} else if (!strlen(e->tfileName)) {
++		return NULL;
++	} else {
++		return e->tfileName;
++	}
++}
++
+ cgiFormResultType cgiFormFileSize(
+ 	char *name, int *sizeP)
+ {
+diff -rupN cgic206/cgic.h cgic206_tempfile/cgic.h
+--- cgic206/cgic.h	2014-03-16 18:17:11.000000000 -0400
++++ cgic206_tempfile/cgic.h	2015-01-21 11:53:02.915148026 -0500
+@@ -141,6 +141,8 @@ extern cgiFormResultType cgiFormRadio(
+ 	char *name, char **valuesText, int valuesTotal, 
+ 	int *result, int defaultV);	
+ 
++extern const char* cgiFormFileGetTempfileName(char* name);
++
+ /* The paths returned by this function are the original names of files
+ 	as reported by the uploading web browser and shoult NOT be
+ 	blindly assumed to be "safe" names for server-side use! */
diff --git a/package/cgic/Config.in b/package/cgic/Config.in
new file mode 100644
index 0000000..402460d
--- /dev/null
+++ b/package/cgic/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_CGIC
+	bool "cgic"
+	help
+	  C CGI library
+
+	  http://www.boutell.com/cgic/
diff --git a/package/cgic/cgic.hash b/package/cgic/cgic.hash
new file mode 100644
index 0000000..6c0fee6
--- /dev/null
+++ b/package/cgic/cgic.hash
@@ -0,0 +1,2 @@
+# Localy computed
+sha256  9562e0b6af59ebc2090107eab5946ce0788a1de36146ad181970cf53e9be7a33  cgic206.tar.gz
diff --git a/package/cgic/cgic.mk b/package/cgic/cgic.mk
new file mode 100644
index 0000000..f07c62e
--- /dev/null
+++ b/package/cgic/cgic.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# cgic
+#
+################################################################################
+
+CGIC_VERSION = 2.06
+CGIC_SOURCE = cgic206.tar.gz
+CGIC_SITE = http://boutell.com/cgic
+CGIC_LICENSE = Custom
+CGIC_LICENSE_FILES = license.txt
+
+# Installs only a static library and a header file
+CGIC_INSTALL_STAGING = YES
+CGIC_INSTALL_TARGET = NO
+
+define CGIC_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) libcgic.a
+endef
+
+define CGIC_INSTALL_STAGING_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) PREFIX=$(STAGING_DIR) -C $(@D) install
+endef
+
+$(eval $(generic-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] benejson: new package
  2015-01-25 17:57 ` [Buildroot] [PATCH 1/2] benejson: new package Yann E. MORIN
@ 2015-01-25 18:59   ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-01-25 18:59 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sun, 25 Jan 2015 18:57:42 +0100, Yann E. MORIN wrote:
> From: David Bender <codehero@yahoo.com>
> 
> Added C/C++ JSON parsing package benejson.
> 
> Signed-off-by: Dave Bender <bender@benegon.com>
> Signed-off-by: David Bender <codehero@gmail.com>
> [yann.morin.1998 at free.fr: fix static/shared install; enhance help entry;
>  fix extra space; add hash]
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

Thanks, applied after doing minor changes (see below).

> +BENEJSON_VERSION = 0.9.7
> +BENEJSON_SITE = $(call github,codehero,benejson,$(BENEJSON_VERSION))
> +BENEJSON_LICENSE = MIT
> +BENEJSON_LICENSE_FILES = LICENSE
> +BENEJSON_INSTALL_STAGING = YES
> +
> +BENEJSON_DEPENDENCIES = host-scons
> +
> +BENEJSON_SCONS_ENV = $(TARGET_CONFIGURE_OPTS) CROSS=$(TARGET_CROSS)

This variable is only used once, so I just removed its definition, and
used its value where it was used.

> +
> +define BENEJSON_BUILD_CMDS
> +	(cd $(@D); \
> +	 $(BENEJSON_SCONS_ENV) \
> +	 $(SCONS) \
> +	 $(BENEJSON_SCONS_OPTS) \

Indentation of one tab + one space is a bit weird, so I changed that to
two tabs. I also removed the reference to BENEJSON_SCONS_OPTS since
this variable was never defined.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] cgic: new package
  2015-01-25 17:57 ` [Buildroot] [PATCH 2/2] cgic: " Yann E. MORIN
@ 2015-01-25 19:02   ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-01-25 19:02 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sun, 25 Jan 2015 18:57:43 +0100, Yann E. MORIN wrote:

> +Probably-Signed-off-by: Dave Bender <bender@benegon.com>
> +[yann.morin.1998 at free.fr: patch was made by Dave, but he
> + forgot his SoB line, so I added it; split the ptch in two
> +  indpeendent fixes]

Some typos there fixed.

Other than that, applied, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-25 19:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-25 17:57 [Buildroot] [PATCH 0/2] Misc patches (branch yem/pw2) Yann E. MORIN
2015-01-25 17:57 ` [Buildroot] [PATCH 1/2] benejson: new package Yann E. MORIN
2015-01-25 18:59   ` Thomas Petazzoni
2015-01-25 17:57 ` [Buildroot] [PATCH 2/2] cgic: " Yann E. MORIN
2015-01-25 19:02   ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox