* [gentoo-commits] repo/proj/guru:master commit in: dev-libs/libcli/files/, dev-libs/libcli/
@ 2023-12-27 20:23 David Roman
0 siblings, 0 replies; only message in thread
From: David Roman @ 2023-12-27 20:23 UTC (permalink / raw
To: gentoo-commits
commit: 790bd705db98c8a7eb3f626b9a0e70e2de9c05e6
Author: YiFei Zhu <zhuyifei1999 <AT> gmail <DOT> com>
AuthorDate: Mon Dec 25 16:47:12 2023 +0000
Commit: David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Mon Dec 25 17:35:54 2023 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=790bd705
dev-libs/libcli: new package, add 1.10.7
Signed-off-by: YiFei Zhu <zhuyifei1999 <AT> gmail.com>
dev-libs/libcli/Manifest | 1 +
dev-libs/libcli/files/libcli-1.10.7-makefile.patch | 65 ++++++++++++++++++++++
dev-libs/libcli/libcli-1.10.7.ebuild | 38 +++++++++++++
dev-libs/libcli/metadata.xml | 11 ++++
4 files changed, 115 insertions(+)
diff --git a/dev-libs/libcli/Manifest b/dev-libs/libcli/Manifest
new file mode 100644
index 0000000000..40b1ba8803
--- /dev/null
+++ b/dev-libs/libcli/Manifest
@@ -0,0 +1 @@
+DIST libcli-1.10.7.tar.gz 55713 BLAKE2B bbb156d564dabf5198d99b92b32edc9cd7a34e399a8cc39e57c387ddceda6c3f00d89ee110863d35194c35bf5f93ff6d96c149c65a7e55b39b2bb846fbd1c7eb SHA512 4c341260e554d7e7a4181bbc85fd2e4cd57cb3fd4304cd423af63a407950f394a318ea69588e12b1ffc845e14d836409dc087cd737b29861c62bf2e14c702a63
diff --git a/dev-libs/libcli/files/libcli-1.10.7-makefile.patch b/dev-libs/libcli/files/libcli-1.10.7-makefile.patch
new file mode 100644
index 0000000000..78e803176b
--- /dev/null
+++ b/dev-libs/libcli/files/libcli-1.10.7-makefile.patch
@@ -0,0 +1,65 @@
+From 2e86f55dd594dd176c1ade2ce58918900e011391 Mon Sep 17 00:00:00 2001
+From: YiFei Zhu <zhuyifei1999@gmail.com>
+Date: Mon, 25 Dec 2023 08:40:21 -0800
+Subject: [PATCH] Gentoo Makefile changes
+
+- Apply $(LIBSUBDIR) instead of hardcoding "lib"
+- Use env vars for $(CC) $(AR) and $(PREFIX)
+- Delete $(DEBUG) $(OPTIM); we don't want package to override CFLAGS
+ in make.conf
+---
+ Makefile | 19 +++++++++----------
+ 1 file changed, 9 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d365952..951fc85 100644
+--- a/Makefile
++++ b/Makefile
+@@ -7,7 +7,8 @@ TESTS ?= 1
+
+ UNAME = $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ DESTDIR =
+-PREFIX = /usr/local
++PREFIX ?= /usr/local
++LIBSUBDIR ?= lib
+
+ MAJOR = 1
+ MINOR = 10
+@@ -15,12 +16,10 @@ REVISION = 7
+ LIB = libcli.so
+ LIB_STATIC = libcli.a
+
+-CC = gcc
+-AR = ar
++CC ?= gcc
++AR ?= ar
+ ARFLAGS = rcs
+-DEBUG = -g
+-OPTIM = -O3
+-override CFLAGS += $(DEBUG) $(OPTIM) -Wall -std=c99 -pedantic -Wformat-security -Wno-format-zero-length -Werror -Wwrite-strings -Wformat -fdiagnostics-show-option -Wextra -Wsign-compare -Wcast-align -Wno-unused-parameter
++override CFLAGS += -Wall -std=c99 -pedantic -Wformat-security -Wno-format-zero-length -Werror -Wwrite-strings -Wformat -fdiagnostics-show-option -Wextra -Wsign-compare -Wcast-align -Wno-unused-parameter
+ override LDFLAGS += -shared
+ override LIBPATH += -L.
+
+@@ -64,14 +63,14 @@ clean:
+ rm -f *.o $(LIB)* $(LIB_STATIC) clitest libcli-$(MAJOR).$(MINOR).$(REVISION).tar.gz
+
+ install: $(TARGET_LIBS)
+- install -d $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib
++ install -d $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/$(LIBSUBDIR)
+ install -m 0644 libcli.h $(DESTDIR)$(PREFIX)/include
+ ifeq (1,$(STATIC_LIB))
+- install -m 0644 $(LIB_STATIC) $(DESTDIR)$(PREFIX)/lib
++ install -m 0644 $(LIB_STATIC) $(DESTDIR)$(PREFIX)/$(LIBSUBDIR)
+ endif
+ ifeq (1,$(DYNAMIC_LIB))
+- install -m 0755 $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(DESTDIR)$(PREFIX)/lib
+- cd $(DESTDIR)$(PREFIX)/lib && \
++ install -m 0755 $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(DESTDIR)$(PREFIX)/$(LIBSUBDIR)
++ cd $(DESTDIR)$(PREFIX)/$(LIBSUBDIR) && \
+ ln -fs $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(LIB).$(MAJOR).$(MINOR) && \
+ ln -fs $(LIB).$(MAJOR).$(MINOR) $(LIB)
+ endif
+--
+2.43.0
+
diff --git a/dev-libs/libcli/libcli-1.10.7.ebuild b/dev-libs/libcli/libcli-1.10.7.ebuild
new file mode 100644
index 0000000000..c144ff0d84
--- /dev/null
+++ b/dev-libs/libcli/libcli-1.10.7.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Shared C library to include Cisco-like CLI into other software"
+HOMEPAGE="https://dparrish.com/pages/libcli"
+SRC_URI="https://github.com/dparrish/${PN}/archive/V${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="test static-libs"
+
+# Test disabled for being an interactive test
+# RESTRICT="!test? ( test )"
+RESTRICT="test"
+
+DEPEND="virtual/libcrypt:="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/libcli-1.10.7-makefile.patch
+)
+
+src_configure() {
+ tc-export CC AR
+ export LIBSUBDIR="$(get_libdir)"
+ export PREFIX=/usr
+ export STATIC_LIB="$(usex static-libs 1 0)"
+ export TESTS="$(usex test 1 0)"
+}
+
+src_test() {
+ LD_LIBRARY_PATH=. ./clitest
+}
diff --git a/dev-libs/libcli/metadata.xml b/dev-libs/libcli/metadata.xml
new file mode 100644
index 0000000000..d0501cd328
--- /dev/null
+++ b/dev-libs/libcli/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>zhuyifei1999@gmail.com</email>
+ <name>YiFei Zhu</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">dparrish/libcli</remote-id>
+ </upstream>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-27 20:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-27 20:23 [gentoo-commits] repo/proj/guru:master commit in: dev-libs/libcli/files/, dev-libs/libcli/ David Roman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox