summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2020-02-09 19:49:45 +0100
committerDavid Seifert <soap@gentoo.org>2020-02-09 19:49:45 +0100
commit3ada0824ef15d33b4347b84cfafc1dd96404eb2f (patch)
tree13edb9890aa2db3ae903af6a98533477a7bb96a4 /net-libs/canlock
parentnet-libs/libmrss: Port to EAPI 7 (diff)
downloadgentoo-3ada0824ef15d33b4347b84cfafc1dd96404eb2f.tar.gz
gentoo-3ada0824ef15d33b4347b84cfafc1dd96404eb2f.tar.bz2
gentoo-3ada0824ef15d33b4347b84cfafc1dd96404eb2f.zip
net-libs/canlock: Port to EAPI 7
Package-Manager: Portage-2.3.88, Repoman-2.3.20 Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'net-libs/canlock')
-rw-r--r--net-libs/canlock/canlock-2b.ebuild36
-rw-r--r--net-libs/canlock/files/canlock-2b-make.patch56
2 files changed, 47 insertions, 45 deletions
diff --git a/net-libs/canlock/canlock-2b.ebuild b/net-libs/canlock/canlock-2b.ebuild
index 9d58b0a2dc63..d54ed58f3701 100644
--- a/net-libs/canlock/canlock-2b.ebuild
+++ b/net-libs/canlock/canlock-2b.ebuild
@@ -1,43 +1,39 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=4
+EAPI=7
-inherit eutils multilib toolchain-funcs
+inherit toolchain-funcs
MY_P="${P/-/_}"
+
DESCRIPTION="A library for creating and verifying Usenet cancel locks"
HOMEPAGE="https://packages.qa.debian.org/c/canlock.html"
-SRC_URI="mirror://debian/pool/main/c/${PN}/${MY_P}.orig.tar.gz
+SRC_URI="
+ mirror://debian/pool/main/c/${PN}/${MY_P}.orig.tar.gz
mirror://debian/pool/main/c/${PN}/${MY_P}-6.diff.gz"
LICENSE="BSD MIT"
SLOT="0"
KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
-IUSE="static-libs"
-
-S=${WORKDIR}/${P/-/}
-src_prepare() {
- epatch "${WORKDIR}"/${MY_P}-6.diff \
- "${FILESDIR}"/${P}-make.patch
-}
+S="${WORKDIR}/${P/-/}"
-src_compile() {
- local targets="shared"
- if use static-libs || use test ; then
- targets+=" static"
- fi
+PATCHES=(
+ "${WORKDIR}"/${MY_P}-6.diff
+ "${FILESDIR}"/${P}-make.patch
+)
- emake CC="$(tc-getCC)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" ${targets}
+src_configure() {
+ tc-export CC
}
src_install() {
- use static-libs && dolib.a src/libcanlock.a
dolib.so src/libcanlock.so.2.0.0
dosym libcanlock.so.2.0.0 /usr/$(get_libdir)/libcanlock.so.2
dosym libcanlock.so.2.0.0 /usr/$(get_libdir)/libcanlock.so
- insinto /usr/include
- doins include/canlock.h
+
+ doheader include/canlock.h
+
dodoc CHANGES README doc/HOWTO
}
diff --git a/net-libs/canlock/files/canlock-2b-make.patch b/net-libs/canlock/files/canlock-2b-make.patch
index 492b88bee143..da90c738af69 100644
--- a/net-libs/canlock/files/canlock-2b-make.patch
+++ b/net-libs/canlock/files/canlock-2b-make.patch
@@ -1,30 +1,30 @@
---- canlock2b/Makefile
-+++ canlock2b/Makefile
-@@ -1,33 +1,35 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,38 +1,39 @@
-CFLAGS = -Iinclude
-LDFLAGS = -L. -lcanlock
-+CFLAGS += -Iinclude
-+LIBS = -L. -lcanlock
- CC = gcc
+-CC = gcc
-STATIC_LIB = libcanlock.a
++CPPFLAGS += -Iinclude
++LDLIBS = -L./src -lcanlock
-all: hmactest canlocktest $(STATIC_LIB)
-+all: shared static
++all: shared
-sha1test: t/sha1test.c $(STATIC_LIB)
- $(CC) $(CFLAGS) t/$@.c -o $@ $(LDFLAGS)
+sha1test: t/sha1test.c shared
-+ $(CC) $(CFLAGS) t/$@.c -o $@ $(LIBS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) t/$@.c -o $@ $(LDLIBS)
-hmactest: t/hmactest.c $(STATIC_LIB)
- $(CC) $(CFLAGS) t/$@.c -o $@ $(LDFLAGS)
+hmactest: t/hmactest.c shared
-+ $(CC) $(CFLAGS) t/$@.c -o $@ $(LIBS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) t/$@.c -o $@ $(LDLIBS)
-canlocktest: t/canlocktest.c $(STATIC_LIB)
- $(CC) $(CFLAGS) t/$@.c -o $@ $(LDFLAGS)
+canlocktest: t/canlocktest.c shared
-+ $(CC) $(CFLAGS) t/$@.c -o $@ $(LIBS) $(LDFLAGS)
++ $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) t/$@.c -o $@ $(LDLIBS)
-$(STATIC_LIB):
- cd src && make
@@ -49,20 +49,25 @@
-
-test: all
+
-+test: hmactest canlocktest
++check: hmactest canlocktest
@echo "hmactest: "
- @./hmactest > t/hmactest.out || echo hmm
+- @./hmactest > t/hmactest.out || echo hmm
++ @LD_LIBRARY_PATH=src/ ./hmactest > t/hmactest.out || echo hmm
@diff t/hmactest.shouldbe t/hmactest.out && echo " Pass." || (echo " **FAIL**" ; exit 1)
---- canlock2b/src/Makefile
-+++ canlock2b/src/Makefile
-@@ -1,9 +1,11 @@
+ @echo "=-=-=-="
+ @echo "canlocktest: "
+- @./canlocktest > t/canlocktest.out
++ @LD_LIBRARY_PATH=src/ ./canlocktest > t/canlocktest.out
+ @diff t/canlocktest.shouldbe t/canlocktest.out && echo " Pass." || (echo " **FAIL**" ; exit 1)
+ @echo "=-=-=-="
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -1,32 +1,35 @@
-LIBOBJS = base64.lo canlock.lo hmac_sha1.lo sha1.lo
- CC = gcc
-+AR = ar
-+RANLIB = ranlib
+-CC = gcc
LIBTOOL = libtool
-CFLAGS = -I../include
-+CFLAGS += -I../include
++CPPFLAGS += -I../include
SOURCES = base64.c canlock.c hmac_sha1.c sha1.c
-OBJS = base64.o canlock.o hmac_sha1.o sha1.o
+OBJS := $(SOURCES:.c=.o)
@@ -70,8 +75,10 @@
SHARELINKFLAGS = -Wl,-soname -Wl,libcanlock.so.2
SHAREDFLAGS = -fPIC -DPIC
LIBS = libcanlock.a libcanlock.so.2.0.0
-@@ -11,22 +13,25 @@
+ INSTALL = install
++.SUFFIXES: .c .o .h .lo
++
all: $(LIBS)
-libcanlock.a:
@@ -83,11 +90,8 @@
-libcanlock.so.2.0.0:
- $(CC) $(CFLAGS) $(SHAREDFLAGS) -c $(SOURCES)
- $(CC) -shared $(OBJS) $(SHARELINKFLAGS) -o libcanlock.so.2.0.0
-+%.o: %.c
-+ $(CC) $(CFLAGS) -c -o $@ $<
-+
-+%.lo: %.c
-+ $(CC) $(CFLAGS) $(SHAREDFLAGS) -c -o $@ $<
++.c.lo:
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(SHAREDFLAGS) -c -o $@ $<
+
+libcanlock.a: $(OBJS)
+ $(AR) cru libcanlock.a $(OBJS)
@@ -95,6 +99,8 @@
+
+libcanlock.so.2.0.0: $(LIBOBJS)
+ $(CC) -shared $(LIBOBJS) $(LDFLAGS) $(SHARELINKFLAGS) -o libcanlock.so.2.0.0
++ ln -s libcanlock.so.2.0.0 libcanlock.so
++ ln -s libcanlock.so.2.0.0 libcanlock.so.2
install: all
$(INSTALL) libcanlock.so.2.0.0 $(DESTDIR)/usr/lib