dev-libs/libcli: new package, add 1.10.7

Signed-off-by: YiFei Zhu <zhuyifei1999@gmail.com>
This commit is contained in:
YiFei Zhu
2023-12-25 08:47:12 -08:00
parent 43b3fe5beb
commit 790bd705db
4 changed files with 115 additions and 0 deletions

1
dev-libs/libcli/Manifest Normal file
View File

@@ -0,0 +1 @@
DIST libcli-1.10.7.tar.gz 55713 BLAKE2B bbb156d564dabf5198d99b92b32edc9cd7a34e399a8cc39e57c387ddceda6c3f00d89ee110863d35194c35bf5f93ff6d96c149c65a7e55b39b2bb846fbd1c7eb SHA512 4c341260e554d7e7a4181bbc85fd2e4cd57cb3fd4304cd423af63a407950f394a318ea69588e12b1ffc845e14d836409dc087cd737b29861c62bf2e14c702a63

View File

@@ -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

View File

@@ -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
}

View File

@@ -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>