diff mbox series

[v2,1/2] package/bootpc: new package

Message ID 20230526175506.1071354-2-colin.foster@in-advantage.com
State New
Headers show
Series package: bootpc: add bootpc and bootp interface configuration | expand

Commit Message

Colin Foster May 26, 2023, 5:55 p.m. UTC
Add the ability to select, build, and run bootpc - a client program for
BOOTP requests.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---

v2:
  * Fix all check-package warnings
  * Add patch messages referencing upstream status
  * Add hashes
  * Add license references

---
 package/Config.in                             |  1 +
 package/bootpc/0001-main-fix-build.patch      | 49 +++++++++++++++++++
 ...Makefile-remove-strip-from-the-build.patch | 33 +++++++++++++
 package/bootpc/Config.in                      |  4 ++
 package/bootpc/bootpc.hash                    |  3 ++
 package/bootpc/bootpc.mk                      | 21 ++++++++
 6 files changed, 111 insertions(+)
 create mode 100644 package/bootpc/0001-main-fix-build.patch
 create mode 100644 package/bootpc/0002-Makefile-remove-strip-from-the-build.patch
 create mode 100644 package/bootpc/Config.in
 create mode 100644 package/bootpc/bootpc.hash
 create mode 100644 package/bootpc/bootpc.mk
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index 420ebaa370..4581455c2a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2273,6 +2273,7 @@  endif
 	source "package/bmon/Config.in"
 	source "package/bmx7/Config.in"
 	source "package/boinc/Config.in"
+	source "package/bootpc/Config.in"
 	source "package/brcm-patchram-plus/Config.in"
 	source "package/bridge-utils/Config.in"
 	source "package/bwm-ng/Config.in"
diff --git a/package/bootpc/0001-main-fix-build.patch b/package/bootpc/0001-main-fix-build.patch
new file mode 100644
index 0000000000..5c0bc22d16
--- /dev/null
+++ b/package/bootpc/0001-main-fix-build.patch
@@ -0,0 +1,49 @@ 
+From e957c19edebf256d77c2d9ddaba76147208f978e Mon Sep 17 00:00:00 2001
+From: Colin Foster <colin.foster@in-advantage.com>
+Date: Mon, 20 Mar 2023 11:18:13 -0700
+Subject: [PATCH] main: fix build
+
+When buildroot attempts to compile bootpc, it comes across the following
+error:
+
+main.c:24:18: error: initializer element is not constant
+   24 | FILE * logfile = stderr ;
+      |                  ^~~~~~
+
+Fix this error by removing logfile entirely, and simply use stderr in
+all fprintf() calls.
+
+Upstream: N/A Has been sent to main developer, but project seems stale.
+Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
+---
+ main.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/main.c b/main.c
+index 6774cf1..0aa3767 100644
+--- a/main.c
++++ b/main.c
+@@ -21,8 +21,6 @@
+ 
+ #include "bootpc.h"
+ 
+-FILE * logfile = stderr ;
+-
+ int main(int argc,
+ 	 char *argv[])
+ {
+@@ -159,8 +157,8 @@ void doLogMessage(char * s, ...) {
+     va_list args;
+ 
+     va_start(args, s);
+-    fprintf(logfile, "* ");
+-    vfprintf(logfile, s, args);
+-    fprintf(logfile, "\n");
++    fprintf(stderr, "* ");
++    vfprintf(stderr, s, args);
++    fprintf(stderr, "\n");
+     va_end(args);
+ }
+-- 
+2.25.1
+
diff --git a/package/bootpc/0002-Makefile-remove-strip-from-the-build.patch b/package/bootpc/0002-Makefile-remove-strip-from-the-build.patch
new file mode 100644
index 0000000000..43efc5dd80
--- /dev/null
+++ b/package/bootpc/0002-Makefile-remove-strip-from-the-build.patch
@@ -0,0 +1,33 @@ 
+From 93ea730f4a6b9c6c786bbdad98213ddccc668986 Mon Sep 17 00:00:00 2001
+From: Colin Foster <colin.foster@in-advantage.com>
+Date: Mon, 20 Mar 2023 11:35:12 -0700
+Subject: [PATCH] Makefile: remove strip from the build
+
+Stripping of binary symbols should be an optional step after a build,
+not forced during every build.
+
+Upstream: N/A Has been sent to main developer, but project seems stale.
+Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
+---
+ Makefile | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4189648..54562ba 100644
+--- a/Makefile
++++ b/Makefile
+@@ -33,11 +33,9 @@ clean:
+ 
+ ${PROG}: ${OBJS}
+ 	${CC} -o ${PROG} ${CFLAGS} ${OBJS}
+-	strip ${PROG}
+ 
+ ${PROG}-static: ${OBJS}
+ 	${CC} -static -o ${PROG} ${CFLAGS} ${OBJS}
+-	strip ${PROG}
+ 
+ # Make up a distribution file from the bits we want people to see
+ distrib:  $(CFILES) $(CHEADS) $(MISC)
+-- 
+2.25.1
+
diff --git a/package/bootpc/Config.in b/package/bootpc/Config.in
new file mode 100644
index 0000000000..59c6a6e739
--- /dev/null
+++ b/package/bootpc/Config.in
@@ -0,0 +1,4 @@ 
+config BR2_PACKAGE_BOOTPC
+	bool "bootpc"
+	help
+	  Application to perform BOOTP
diff --git a/package/bootpc/bootpc.hash b/package/bootpc/bootpc.hash
new file mode 100644
index 0000000000..cfa7f49944
--- /dev/null
+++ b/package/bootpc/bootpc.hash
@@ -0,0 +1,3 @@ 
+sha256  b3ec94a1881f5dc4f7ad7832448bc5bd028bb413eac7032b481f2d8713910ba8  bootpc-80c0811dc69f9f3923661be4f9f9c09a44313f62-br1.tar.gz
+sha256  91df39d1816bfb17a4dda2d3d2c83b1f6f2d38d53e53e41e8f97ad5ac46a0cad  LICENCE
+sha256  a31e61b9fc2de25c229bb9f1baa3138ed5e66ece7d5e203c5847f46d867cc1dd  NOTICE
diff --git a/package/bootpc/bootpc.mk b/package/bootpc/bootpc.mk
new file mode 100644
index 0000000000..200ed24872
--- /dev/null
+++ b/package/bootpc/bootpc.mk
@@ -0,0 +1,21 @@ 
+################################################################################
+#
+# bootpc package
+#
+################################################################################
+
+BOOTPC_VERSION = 80c0811dc69f9f3923661be4f9f9c09a44313f62
+BOOTPC_SITE = https://salsa.debian.org/debian/bootpc.git
+BOOTPC_SITE_METHOD = git
+BOOTPC_LICENSE = GPL-2.0-or-later
+BOOTPC_LICENSE_FILES = LICENSE NOTICE
+
+define BOOTPC_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) all
+endef
+
+define BOOTPC_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bootpc $(TARGET_DIR)/sbin
+endef
+
+$(eval $(generic-package))