agl-wireless-monitor: add libcgic 67/29267/4
authorYan <yanxk.fnst@fujitsu.com>
Sun, 8 Oct 2023 00:31:16 +0000 (08:31 +0800)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Mon, 16 Oct 2023 11:46:17 +0000 (11:46 +0000)
cgic library is now added, test cgi deployed onto board.
this library would play a build time dependency role later on.

Bug-AGL: SPEC-4838
Signed-off-by: Yan <yanxk.fnst@fujitsu.com>
Change-Id: I16d67e2bacabb12bd36f2c439eeee91ef786e7c5

meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-modify-conf-file-matching-AGL-system.patch
meta-agl-wireless-monitor/recipes-component/libcgic/files/0001-modify-makefile-for-cross-build.patch [new file with mode: 0644]
meta-agl-wireless-monitor/recipes-component/libcgic/libcgic_2.0.8.bb [new file with mode: 0644]
meta-agl-wireless-monitor/recipes-core/incar-wireless-monitor/incar-wireless-monitor.bb

index ce46d4e..52f32eb 100644 (file)
@@ -1,20 +1,21 @@
-From c2396f1a329f954f37aa59d5eabda819c06e954e Mon Sep 17 00:00:00 2023
+From 6b227adac5dbabc958ef215f15637d3c4d21d759 Mon Sep 17 00:00:00 2001
 From: Yan <yanxk.fnst@fujitsu.com>
-Date: Fri, 25 Aug 2023 09:44:01 +0800
+Date: Sat, 7 Oct 2023 18:27:42 +0800
 Subject: [PATCH] boa: modify conf file matching AGL system
 
 set boa and boa_index working path to /usr/bin
 error log and access log are re-directed to /var/log/
 default index reset to homepage
+cgi-bin folder to /usr/bin/cgi-bin
 
 Upstream-Status: Pending
 Signed-off-by: Yan <yanxk.fnst@fujitsu.com>
 ---
- boa.conf | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ boa.conf | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
 
 diff --git a/boa.conf b/boa.conf
-index e3775db..77c9f9b 100644
+index e3775db..4da9983 100644
 --- a/boa.conf
 +++ b/boa.conf
 @@ -59,7 +59,7 @@ Group nogroup
@@ -61,5 +62,13 @@ index e3775db..77c9f9b 100644
  
  # DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker
  # has been commented out, the the on-the-fly indexing of Boa can be used
---
+@@ -190,5 +190,5 @@ Alias /doc /usr/doc
+ # ScriptAlias: Maps a virtual path to a directory for serving scripts
+ # Example: ScriptAlias /htbin/ /www/htbin/
+-ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
++ScriptAlias /cgi-bin/ /usr/bin/cgi-bin/
+-- 
 2.25.1
+
diff --git a/meta-agl-wireless-monitor/recipes-component/libcgic/files/0001-modify-makefile-for-cross-build.patch b/meta-agl-wireless-monitor/recipes-component/libcgic/files/0001-modify-makefile-for-cross-build.patch
new file mode 100644 (file)
index 0000000..a88d69d
--- /dev/null
@@ -0,0 +1,47 @@
+From b1ad0a4560ff3fecc45bf54c64688ffa6a43c714 Mon Sep 17 00:00:00 2001
+From: Yan <yanxk.fnst@fujitsu.com>
+Date: Fri, 6 Oct 2023 14:03:50 +0800
+Subject: [PATCH] modify makefile for cross build
+
+remove static cc ar ranlib
+add cflag and ldflag to build command
+
+Upstream Status: Pending
+Signed-off-by: Yan <yanxk.fnst@fujitsu.com>
+---
+ Makefile | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8be64c3..4659342 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,4 @@
+ CFLAGS=-g -Wall
+-CC=gcc
+-AR=ar
+-RANLIB=ranlib
+ LIBS=-L./ -lcgic
+ all: libcgic.a cgictest.cgi capture
+@@ -19,14 +16,14 @@ 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) $(CFLAGS) $(LDFLAGS) cgictest.o -o cgictest.cgi ${LIBS}
+ capture: capture.o libcgic.a
+-      gcc capture.o -o capture ${LIBS}
++      $(CC) $(CFLAGS) $(LDFLAGS) capture.o -o capture ${LIBS}
+ clean:
+       rm -f *.o *.a cgictest.cgi capture cgicunittest
+ test:
+-      gcc -D UNIT_TEST=1 cgic.c -o cgicunittest
++      $(CC) -D UNIT_TEST=1 cgic.c -o cgicunittest
+       ./cgicunittest
+-- 
+2.25.1
+
diff --git a/meta-agl-wireless-monitor/recipes-component/libcgic/libcgic_2.0.8.bb b/meta-agl-wireless-monitor/recipes-component/libcgic/libcgic_2.0.8.bb
new file mode 100644 (file)
index 0000000..7b470ef
--- /dev/null
@@ -0,0 +1,22 @@
+SUMMARY = "CGIC library"
+HOMEPAGE = "https://github.com/boutell/cgic"
+DESCRIPTION = "An ANSI C library for CGI Programming."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://license.txt;md5=1ef0cf0c9e6e61f326fd48746179cf38"
+
+SRCREV = "a3490b7612f194f029b6e7a7fc602ad962bc33e2"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://github.com/boutell/cgic.git;protocol=https;branch=master \
+           file://0001-modify-makefile-for-cross-build.patch \
+"
+
+EXTRA_OEMAKE = "LDFLAGS='${LDFLAGS}'"
+
+do_install() {
+    install -d ${D}/usr/bin/cgi-bin
+    install -m 0755 ${S}/capture ${D}/usr/bin/cgi-bin
+    install -m 0755 ${S}/cgictest.cgi ${D}/usr/bin/cgi-bin
+}
index 4172602..db8582c 100644 (file)
@@ -14,6 +14,7 @@ SRCREV = "927829c95bac0874b07b0aaee1663f42f5e59530"
 
 RDEPENDS:${PN} += "boa"
 RDEPENDS:${PN} += "mjpg-streamer"
+RDEPENDS:${PN} += "libcgic"
 
 do_install() {
     install -d ${D}/etc/boa/www/