Add patch to fix cross build
Fix runtime with systemd

Release notes
https://github.com/iptraf-ng/iptraf-ng/releases/tag/v1.2.0
https://github.com/iptraf-ng/iptraf-ng/releases/tag/v1.2.1

Signed-off-by: Khem Raj <[email protected]>
---
 .../0001-Fix-printd-formatting-strings.patch  | 54 ------------------
 .../0001-make-Make-CC-weak-assignment.patch   | 35 ++++++++++++
 .../iptraf/iptraf-ng/iptraf-ng-tmpfiles.conf  |  1 +
 .../iptraf/iptraf-ng/ncurses-config.patch     | 55 +++++++++++--------
 ...{iptraf-ng_1.1.4.bb => iptraf-ng_1.2.1.bb} | 22 ++++++--
 5 files changed, 85 insertions(+), 82 deletions(-)
 delete mode 100644 
meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-Fix-printd-formatting-strings.patch
 create mode 100644 
meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-make-Make-CC-weak-assignment.patch
 create mode 100644 
meta-oe/recipes-devtools/iptraf/iptraf-ng/iptraf-ng-tmpfiles.conf
 rename meta-oe/recipes-devtools/iptraf/{iptraf-ng_1.1.4.bb => 
iptraf-ng_1.2.1.bb} (66%)

diff --git 
a/meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-Fix-printd-formatting-strings.patch
 
b/meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-Fix-printd-formatting-strings.patch
deleted file mode 100644
index 5b9afd9616..0000000000
--- 
a/meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-Fix-printd-formatting-strings.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 86b4d398dbb95e2437b70eba3b30e995ec9be505 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Thu, 31 Aug 2017 20:47:50 -0700
-Subject: [PATCH] Fix printd formatting strings
-
-Fixes
-error: format string is not a string literal (potentially insecure) 
[-Werror,-Wformat-security]
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <[email protected]>
----
- src/ipfilter.c | 2 +-
- src/othptab.c  | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/ipfilter.c b/src/ipfilter.c
-index eb17ec7..8c76e4c 100644
---- a/src/ipfilter.c
-+++ b/src/ipfilter.c
-@@ -146,7 +146,7 @@ void gethostparams(struct hostparams *data, char 
*init_saddr, char *init_smask,
-                               snprintf(msgstr, 60,
-                                        "Invalid protocol input at or near 
token \"%s\"",
-                                        bptr);
--                              tui_error(ANYKEY_MSG, msgstr);
-+                              tui_error(ANYKEY_MSG, "%s", msgstr);
-                               doagain = 1;
-                       } else
-                               doagain = 0;
-diff --git a/src/othptab.c b/src/othptab.c
-index 142c9c2..fe395c2 100644
---- a/src/othptab.c
-+++ b/src/othptab.c
-@@ -410,7 +410,7 @@ void printothpentry(struct othptable *table, struct 
othptabent *entry,
-                               break;
-                       }
- 
--                      sprintf(scratchpad, rarp_mac_addr);
-+                      sprintf(scratchpad, "%s", rarp_mac_addr);
-                       strcat(msgstring, scratchpad);
-                       wattrset(table->othpwin, ARPATTR);
-                       break;
-@@ -485,7 +485,7 @@ void printothpentry(struct othptable *table, struct 
othptabent *entry,
-               wattrset(table->othpwin, UNKNIPATTR);
-               protptr = getprotobynumber(entry->protocol);
-               if (protptr != NULL) {
--                      sprintf(protname, protptr->p_aliases[0]);
-+                      sprintf(protname, "%s", protptr->p_aliases[0]);
-               } else {
-                       sprintf(protname, "IP protocol");
-                       unknown = 1;
--- 
-2.14.1
-
diff --git 
a/meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-make-Make-CC-weak-assignment.patch
 
b/meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-make-Make-CC-weak-assignment.patch
new file mode 100644
index 0000000000..625989a14a
--- /dev/null
+++ 
b/meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-make-Make-CC-weak-assignment.patch
@@ -0,0 +1,35 @@
+From 223de708552b1ab00ac1a119e82e13deed573036 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 30 Oct 2021 10:22:38 -0700
+Subject: [PATCH] make: Make CC weak assignment
+
+This ensures that if environment overrrides it then its respected, this
+helps cross-compiling cases
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -25,7 +25,7 @@ ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) $(IPT
+ ALL_LDFLAGS = $(LDFLAGS)
+ STRIP ?= strip
+ 
+-prefix = $(HOME)
++prefix ?= $(HOME)
+ sbindir_relative = sbin
+ sbindir = $(prefix)/$(sbindir_relative)
+ mandir = $(prefix)/share/man
+@@ -39,7 +39,7 @@ pathsep = :
+ 
+ export prefix bindir sharedir sysconfdir gitwebdir localedir
+ 
+-CC = cc
++CC ?= cc
+ RM = rm -f
+ INSTALL = install
+ RPMBUILD = rpmbuild
diff --git a/meta-oe/recipes-devtools/iptraf/iptraf-ng/iptraf-ng-tmpfiles.conf 
b/meta-oe/recipes-devtools/iptraf/iptraf-ng/iptraf-ng-tmpfiles.conf
new file mode 100644
index 0000000000..1c79f0d8c3
--- /dev/null
+++ b/meta-oe/recipes-devtools/iptraf/iptraf-ng/iptraf-ng-tmpfiles.conf
@@ -0,0 +1 @@
+d /run/iptraf-ng 0755 root root -
diff --git a/meta-oe/recipes-devtools/iptraf/iptraf-ng/ncurses-config.patch 
b/meta-oe/recipes-devtools/iptraf/iptraf-ng/ncurses-config.patch
index 65b92dade2..8704310406 100644
--- a/meta-oe/recipes-devtools/iptraf/iptraf-ng/ncurses-config.patch
+++ b/meta-oe/recipes-devtools/iptraf/iptraf-ng/ncurses-config.patch
@@ -2,11 +2,9 @@ Use pkg-config to search for ncurses libraries
 
 Signed-off-by: Khem Raj <[email protected]>
 Upstream-Status: Pending
-Index: iptraf-ng-1.1.4/Makefile
-===================================================================
---- iptraf-ng-1.1.4.orig/Makefile
-+++ iptraf-ng-1.1.4/Makefile
-@@ -205,8 +205,8 @@ endif
+--- a/Makefile
++++ b/Makefile
+@@ -201,8 +201,8 @@ endif
  
  ifndef NCURSES_LDFLAGS
  ifdef NEEDS_NCURSES5
@@ -17,7 +15,7 @@ Index: iptraf-ng-1.1.4/Makefile
        ifndef NO_PANEL
                NCURSES_LDFLAGS += -lpanel
        endif
-@@ -215,8 +215,8 @@ endif
+@@ -211,8 +211,8 @@ endif
  
  ifndef NCURSES_LDFLAGS
  ifdef NEEDS_NCURSESW5
@@ -26,9 +24,9 @@ Index: iptraf-ng-1.1.4/Makefile
 +      NCURSES_CFLAGS := $(shell p[k-config ncursesw --cflags 2>/dev/null)
 +      NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null)
        ifndef NO_PANEL
-               NCURSES_LDFLAGS += -lpanel
+               NCURSES_LDFLAGS += -lpanelw
        endif
-@@ -225,8 +225,8 @@ endif
+@@ -221,8 +221,8 @@ endif
  
  ifndef NCURSES_LDFLAGS
  ifdef NEEDS_NCURSES6
@@ -39,7 +37,7 @@ Index: iptraf-ng-1.1.4/Makefile
        ifndef NO_PANEL
                NCURSES_LDFLAGS += -lpanel
        endif
-@@ -235,8 +235,8 @@ endif
+@@ -231,8 +231,8 @@ endif
  
  ifndef NCURSES_LDFLAGS
  ifdef NEEDS_NCURSESW6
@@ -48,34 +46,45 @@ Index: iptraf-ng-1.1.4/Makefile
 +      NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 2>/dev/null)
 +      NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null)
        ifndef NO_PANEL
-               NCURSES_LDFLAGS += -lpanel
+               NCURSES_LDFLAGS += -lpanelw
        endif
-@@ -246,17 +246,17 @@ endif
+@@ -241,27 +241,27 @@ endif
+ 
  # try find ncuses by autodetect
  ifndef NCURSES_LDFLAGS
-       ifneq ($(shell ncursesw6-config --libs 2>/dev/null),)
+-      ifneq ($(shell ncursesw6-config --libs 2>/dev/null),)
 -              NCURSES_CFLAGS := $(shell ncursesw6-config --cflags 2>/dev/null)
 -              NCURSES_LDFLAGS := $(shell ncursesw6-config --libs 2>/dev/null)
++      ifneq ($(shell pkg-config ncursesw --libs 2>/dev/null),)
++              NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 
2>/dev/null)
++              NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 
2>/dev/null)
+               ifndef NO_PANEL
+                       NCURSES_LDFLAGS += -lpanelw
+               endif
 -      else ifneq ($(shell ncurses6-config --libs 2>/dev/null),)
 -              NCURSES_CFLAGS := $(shell ncurses6-config --cflags 2>/dev/null)
 -              NCURSES_LDFLAGS := $(shell ncurses6-config --libs 2>/dev/null)
++      else ifneq ($(shell pkg-config ncursesw --libs 2>/dev/null),)
++              NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 
2>/dev/null)
++              NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 
2>/dev/null)
+               ifndef NO_PANEL
+                       NCURSES_LDFLAGS += -lpanel
+               endif
 -      else ifneq ($(shell ncursesw5-config --libs 2>/dev/null),)
 -              NCURSES_CFLAGS := $(shell ncursesw5-config --cflags 2>/dev/null)
 -              NCURSES_LDFLAGS := $(shell ncursesw5-config --libs 2>/dev/null)
++      else ifneq ($(shell pkg-config ncursesw --libs 2>/dev/null),)
++              NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 
2>/dev/null)
++              NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 
2>/dev/null)
+               ifndef NO_PANEL
+                       NCURSES_LDFLAGS += -lpanelw
+               endif
 -      else ifneq ($(shell ncurses5-config --libs 2>/dev/null),)
 -              NCURSES_CFLAGS := $(shell ncurses5-config --cflags 2>/dev/null)
 -              NCURSES_LDFLAGS := $(shell ncurses5-config --libs 2>/dev/null)
-+              NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 
2>/dev/null)
-+              NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 
2>/dev/null)
-+      else ifneq ($(shell pkg-config ncurses --libs 2>/dev/null),)
-+              NCURSES_CFLAGS := $(shell pkg-config ncurses --cflags 
2>/dev/null)
-+              NCURSES_LDFLAGS := $(shell pkg-config ncurses --libs 
2>/dev/null)
 +      else ifneq ($(shell pkg-config ncursesw --libs 2>/dev/null),)
 +              NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 
2>/dev/null)
 +              NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 
2>/dev/null)
-+      else ifneq ($(shell pkg-config ncurses --libs 2>/dev/null),)
-+              NCURSES_CFLAGS := $(shell pkg-config ncurses --cflags 
2>/dev/null)
-+              NCURSES_LDFLAGS := $(shell pkg-config ncurses --libs 
2>/dev/null)
-       endif
- 
-       ifneq ($(NCURSES_LDFLAGS),)
+               ifndef NO_PANEL
+                       NCURSES_LDFLAGS += -lpanel
+               endif
diff --git a/meta-oe/recipes-devtools/iptraf/iptraf-ng_1.1.4.bb 
b/meta-oe/recipes-devtools/iptraf/iptraf-ng_1.2.1.bb
similarity index 66%
rename from meta-oe/recipes-devtools/iptraf/iptraf-ng_1.1.4.bb
rename to meta-oe/recipes-devtools/iptraf/iptraf-ng_1.2.1.bb
index 6b18953b30..115bbf082b 100644
--- a/meta-oe/recipes-devtools/iptraf/iptraf-ng_1.1.4.bb
+++ b/meta-oe/recipes-devtools/iptraf/iptraf-ng_1.2.1.bb
@@ -24,17 +24,29 @@ LICENSE = "GPL-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=e2b3850593b899b1a17594ed4cc4c731"
 DEPENDS = "ncurses"
 
-SRC_URI = 
"http://pkgs.fedoraproject.org/repo/pkgs/iptraf-ng/iptraf-ng-1.1.4.tar.gz/e0f8df3b7baf2b5106709abc4f8c029a/${BP}.tar.gz
 \
+SRC_URI = 
"https://src.fedoraproject.org/repo/pkgs/iptraf-ng/v${PV}.tar.gz/sha512/44d36fc92cdbf379f62cb63638663c3ee610225b9c28d60ee55e62e358f398a6b0db281129327b3472e45fb553ee3dd605af09c129f2233f8839ae3dbd799384/v${PV}.tar.gz
 \
+           file://iptraf-ng-tmpfiles.conf \
            file://ncurses-config.patch \
-           file://0001-Fix-printd-formatting-strings.patch \
+           file://0001-make-Make-CC-weak-assignment.patch \
            "
-SRC_URI[md5sum] = "e0f8df3b7baf2b5106709abc4f8c029a"
-SRC_URI[sha256sum] = 
"16b9b05bf5d3725d86409b901696639ad46944d02de6def87b1ceae5310dd35c"
+SRC_URI[sha256sum] = 
"9f5cef584065420dea1ba32c86126aede1fa9bd25b0f8362b0f9fd9754f00870"
 
-inherit autotools-brokensep pkgconfig
+inherit pkgconfig
 
 CFLAGS += "-D_GNU_SOURCE"
 
+do_compile() {
+    oe_runmake
+}
+
+do_install() {
+    oe_runmake DESTDIR=${D} install
+    install -d -m 0755 ${D}${localstatedir}/{log,lib}/iptraf-ng
+    install -D -m 0644 -p ${S}/iptraf-ng-logrotate.conf 
${D}${sysconfdir}/logrotate.d/iptraf-ng
+    install -Dm 0644 ${WORKDIR}/iptraf-ng-tmpfiles.conf 
${D}${libdir}/tmpfiles.d/iptraf-ng-tmpfiles.conf
+}
+
+FILES:${PN} += "${libdir}/tmpfiles.d"
 PROVIDES = "iptraf"
 RPROVIDES:${PN} += "iptraf"
 RREPLACES:${PN} += "iptraf"
-- 
2.33.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#93676): 
https://lists.openembedded.org/g/openembedded-devel/message/93676
Mute This Topic: https://lists.openembedded.org/mt/86704002/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to