summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorkyechou2023-11-20 21:32:12 -0600
committerkyechou2023-11-20 21:32:12 -0600
commitb4b916f3296e622e06608b3582680e0e75c9a517 (patch)
tree5200580b69f7cf50a9fb00b5a7c3fe587c250925
parent2b717e04f9e62cc76eb07a8efac70b0e99aecd44 (diff)
downloadaur-mininet-git.tar.gz
Fix the strlcpy compile issue
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD18
-rw-r--r--fix-openflow-strlcpy.patch26
3 files changed, 41 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8984dcc43d1e..fa7ddc8aae59 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = mininet-git
pkgdesc = Emulator for rapid prototyping of Software Defined Networks
- pkgver = 2.3.0.r0.gd7f399d
+ pkgver = 2.3.1b4.r13.g6eb8973
pkgrel = 1
url = https://github.com/mininet/mininet
install = mininet.install
@@ -27,8 +27,9 @@ pkgbase = mininet-git
conflicts = mininet
source = mininet-git::git+https://github.com/mininet/mininet
source = git+https://github.com/mininet/openflow
+ source = fix-openflow-strlcpy.patch
sha256sums = SKIP
sha256sums = SKIP
+ sha256sums = 0a85f8a5ce2dd900d4f874849b28301aa47d7b9d7b03ed405c973d917d98383a
pkgname = mininet-git
-
diff --git a/PKGBUILD b/PKGBUILD
index 7534fefd6b14..f83b97de94cd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Kuan-Yen Chou <kuanyenchou@gmail.com>
pkgname=mininet-git
-pkgver=2.3.0.r0.gd7f399d
+pkgver=2.3.1b4.r13.g6eb8973
pkgrel=1
pkgdesc='Emulator for rapid prototyping of Software Defined Networks'
depends=('python' 'iproute2' 'net-tools' 'iputils' 'inetutils' 'iperf' 'ethtool'
@@ -18,9 +18,11 @@ provides=('mininet')
conflicts=('mininet')
install=mininet.install
source=("$pkgname"::'git+https://github.com/mininet/mininet'
- 'git+https://github.com/mininet/openflow') # for UserSwitch
+ 'git+https://github.com/mininet/openflow' # for UserSwitch
+ 'fix-openflow-strlcpy.patch')
sha256sums=('SKIP'
- 'SKIP')
+ 'SKIP'
+ '0a85f8a5ce2dd900d4f874849b28301aa47d7b9d7b03ed405c973d917d98383a')
pkgver() {
cd "$srcdir/$pkgname"
@@ -36,10 +38,13 @@ prepare() {
sed '/^include debian\/automake.mk/d' -i Makefile.am
# Patch controller to handle more than 16 switches
patch -Np1 -i "$srcdir/$pkgname/util/openflow-patches/controller.patch"
+ patch -Np1 -i "$srcdir/fix-openflow-strlcpy.patch"
cd "$srcdir/$pkgname"
- sed 's:PREFIX ?= /usr:PREFIX ?= "$(DESTDIR)"/usr:' -i Makefile
- sed '/^[[:space:]]*$(PYTHON) /d' -i Makefile
+ # shellcheck disable=SC2016
+ sed -i Makefile \
+ -e 's:PREFIX ?= /usr:PREFIX ?= "$(DESTDIR)"/usr:' \
+ -e '/^[[:space:]]*$(PYTHON) /d'
}
build() {
@@ -50,6 +55,7 @@ build() {
cd "$srcdir/$pkgname"
make mnexec man
+ python setup.py build
}
package() {
@@ -58,7 +64,7 @@ package() {
cd "$srcdir/$pkgname"
make DESTDIR="${pkgdir}" install
- python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
+ python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/mininet/LICENSE"
}
diff --git a/fix-openflow-strlcpy.patch b/fix-openflow-strlcpy.patch
new file mode 100644
index 000000000000..3a007cff28b5
--- /dev/null
+++ b/fix-openflow-strlcpy.patch
@@ -0,0 +1,26 @@
+diff --git a/lib/util.c b/lib/util.c
+index 21cc28d..67ba765 100644
+--- a/lib/util.c
++++ b/lib/util.c
+@@ -138,7 +138,7 @@ xasprintf(const char *format, ...)
+ return s;
+ }
+
+-void
++size_t
+ strlcpy(char *dst, const char *src, size_t size)
+ {
+ if (size > 0) {
+diff --git a/lib/util.h b/lib/util.h
+index fde681f..efb0df9 100644
+--- a/lib/util.h
++++ b/lib/util.h
+@@ -106,7 +106,7 @@ char *xvasprintf(const char *format, va_list) PRINTF_FORMAT(1, 0) MALLOC_LIKE;
+ void *x2nrealloc(void *p, size_t *n, size_t s);
+
+ #ifndef HAVE_STRLCPY
+-void strlcpy(char *dst, const char *src, size_t size);
++size_t strlcpy(char *dst, const char *src, size_t size);
+ #endif
+
+ void ofp_fatal(int err_no, const char *format, ...)