Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/canlock/files/, net-libs/canlock/
Date: Sun, 09 Feb 2020 18:50:27
Message-Id: 1581274185.3ada0824ef15d33b4347b84cfafc1dd96404eb2f.soap@gentoo
1 commit: 3ada0824ef15d33b4347b84cfafc1dd96404eb2f
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 9 18:49:45 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 9 18:49:45 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ada0824
7
8 net-libs/canlock: Port to EAPI 7
9
10 Package-Manager: Portage-2.3.88, Repoman-2.3.20
11 Signed-off-by: David Seifert <soap <AT> gentoo.org>
12
13 net-libs/canlock/canlock-2b.ebuild | 36 ++++++++----------
14 net-libs/canlock/files/canlock-2b-make.patch | 56 +++++++++++++++-------------
15 2 files changed, 47 insertions(+), 45 deletions(-)
16
17 diff --git a/net-libs/canlock/canlock-2b.ebuild b/net-libs/canlock/canlock-2b.ebuild
18 index 9d58b0a2dc6..d54ed58f370 100644
19 --- a/net-libs/canlock/canlock-2b.ebuild
20 +++ b/net-libs/canlock/canlock-2b.ebuild
21 @@ -1,43 +1,39 @@
22 -# Copyright 1999-2017 Gentoo Foundation
23 +# Copyright 1999-2020 Gentoo Authors
24 # Distributed under the terms of the GNU General Public License v2
25
26 -EAPI=4
27 +EAPI=7
28
29 -inherit eutils multilib toolchain-funcs
30 +inherit toolchain-funcs
31
32 MY_P="${P/-/_}"
33 +
34 DESCRIPTION="A library for creating and verifying Usenet cancel locks"
35 HOMEPAGE="https://packages.qa.debian.org/c/canlock.html"
36 -SRC_URI="mirror://debian/pool/main/c/${PN}/${MY_P}.orig.tar.gz
37 +SRC_URI="
38 + mirror://debian/pool/main/c/${PN}/${MY_P}.orig.tar.gz
39 mirror://debian/pool/main/c/${PN}/${MY_P}-6.diff.gz"
40
41 LICENSE="BSD MIT"
42 SLOT="0"
43 KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
44 -IUSE="static-libs"
45 -
46 -S=${WORKDIR}/${P/-/}
47
48 -src_prepare() {
49 - epatch "${WORKDIR}"/${MY_P}-6.diff \
50 - "${FILESDIR}"/${P}-make.patch
51 -}
52 +S="${WORKDIR}/${P/-/}"
53
54 -src_compile() {
55 - local targets="shared"
56 - if use static-libs || use test ; then
57 - targets+=" static"
58 - fi
59 +PATCHES=(
60 + "${WORKDIR}"/${MY_P}-6.diff
61 + "${FILESDIR}"/${P}-make.patch
62 +)
63
64 - emake CC="$(tc-getCC)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" ${targets}
65 +src_configure() {
66 + tc-export CC
67 }
68
69 src_install() {
70 - use static-libs && dolib.a src/libcanlock.a
71 dolib.so src/libcanlock.so.2.0.0
72 dosym libcanlock.so.2.0.0 /usr/$(get_libdir)/libcanlock.so.2
73 dosym libcanlock.so.2.0.0 /usr/$(get_libdir)/libcanlock.so
74 - insinto /usr/include
75 - doins include/canlock.h
76 +
77 + doheader include/canlock.h
78 +
79 dodoc CHANGES README doc/HOWTO
80 }
81
82 diff --git a/net-libs/canlock/files/canlock-2b-make.patch b/net-libs/canlock/files/canlock-2b-make.patch
83 index 492b88bee14..da90c738af6 100644
84 --- a/net-libs/canlock/files/canlock-2b-make.patch
85 +++ b/net-libs/canlock/files/canlock-2b-make.patch
86 @@ -1,30 +1,30 @@
87 ---- canlock2b/Makefile
88 -+++ canlock2b/Makefile
89 -@@ -1,33 +1,35 @@
90 +--- a/Makefile
91 ++++ b/Makefile
92 +@@ -1,38 +1,39 @@
93 -CFLAGS = -Iinclude
94 -LDFLAGS = -L. -lcanlock
95 -+CFLAGS += -Iinclude
96 -+LIBS = -L. -lcanlock
97 - CC = gcc
98 +-CC = gcc
99 -STATIC_LIB = libcanlock.a
100 ++CPPFLAGS += -Iinclude
101 ++LDLIBS = -L./src -lcanlock
102
103 -all: hmactest canlocktest $(STATIC_LIB)
104 -+all: shared static
105 ++all: shared
106
107 -sha1test: t/sha1test.c $(STATIC_LIB)
108 - $(CC) $(CFLAGS) t/$@.c -o $@ $(LDFLAGS)
109 +sha1test: t/sha1test.c shared
110 -+ $(CC) $(CFLAGS) t/$@.c -o $@ $(LIBS) $(LDFLAGS)
111 ++ $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) t/$@.c -o $@ $(LDLIBS)
112
113 -hmactest: t/hmactest.c $(STATIC_LIB)
114 - $(CC) $(CFLAGS) t/$@.c -o $@ $(LDFLAGS)
115 +hmactest: t/hmactest.c shared
116 -+ $(CC) $(CFLAGS) t/$@.c -o $@ $(LIBS) $(LDFLAGS)
117 ++ $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) t/$@.c -o $@ $(LDLIBS)
118
119 -canlocktest: t/canlocktest.c $(STATIC_LIB)
120 - $(CC) $(CFLAGS) t/$@.c -o $@ $(LDFLAGS)
121 +canlocktest: t/canlocktest.c shared
122 -+ $(CC) $(CFLAGS) t/$@.c -o $@ $(LIBS) $(LDFLAGS)
123 ++ $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) t/$@.c -o $@ $(LDLIBS)
124
125 -$(STATIC_LIB):
126 - cd src && make
127 @@ -49,20 +49,25 @@
128 -
129 -test: all
130 +
131 -+test: hmactest canlocktest
132 ++check: hmactest canlocktest
133 @echo "hmactest: "
134 - @./hmactest > t/hmactest.out || echo hmm
135 +- @./hmactest > t/hmactest.out || echo hmm
136 ++ @LD_LIBRARY_PATH=src/ ./hmactest > t/hmactest.out || echo hmm
137 @diff t/hmactest.shouldbe t/hmactest.out && echo " Pass." || (echo " **FAIL**" ; exit 1)
138 ---- canlock2b/src/Makefile
139 -+++ canlock2b/src/Makefile
140 -@@ -1,9 +1,11 @@
141 + @echo "=-=-=-="
142 + @echo "canlocktest: "
143 +- @./canlocktest > t/canlocktest.out
144 ++ @LD_LIBRARY_PATH=src/ ./canlocktest > t/canlocktest.out
145 + @diff t/canlocktest.shouldbe t/canlocktest.out && echo " Pass." || (echo " **FAIL**" ; exit 1)
146 + @echo "=-=-=-="
147 +--- a/src/Makefile
148 ++++ b/src/Makefile
149 +@@ -1,32 +1,35 @@
150 -LIBOBJS = base64.lo canlock.lo hmac_sha1.lo sha1.lo
151 - CC = gcc
152 -+AR = ar
153 -+RANLIB = ranlib
154 +-CC = gcc
155 LIBTOOL = libtool
156 -CFLAGS = -I../include
157 -+CFLAGS += -I../include
158 ++CPPFLAGS += -I../include
159 SOURCES = base64.c canlock.c hmac_sha1.c sha1.c
160 -OBJS = base64.o canlock.o hmac_sha1.o sha1.o
161 +OBJS := $(SOURCES:.c=.o)
162 @@ -70,8 +75,10 @@
163 SHARELINKFLAGS = -Wl,-soname -Wl,libcanlock.so.2
164 SHAREDFLAGS = -fPIC -DPIC
165 LIBS = libcanlock.a libcanlock.so.2.0.0
166 -@@ -11,22 +13,25 @@
167 + INSTALL = install
168
169 ++.SUFFIXES: .c .o .h .lo
170 ++
171 all: $(LIBS)
172
173 -libcanlock.a:
174 @@ -83,11 +90,8 @@
175 -libcanlock.so.2.0.0:
176 - $(CC) $(CFLAGS) $(SHAREDFLAGS) -c $(SOURCES)
177 - $(CC) -shared $(OBJS) $(SHARELINKFLAGS) -o libcanlock.so.2.0.0
178 -+%.o: %.c
179 -+ $(CC) $(CFLAGS) -c -o $@ $<
180 -+
181 -+%.lo: %.c
182 -+ $(CC) $(CFLAGS) $(SHAREDFLAGS) -c -o $@ $<
183 ++.c.lo:
184 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(SHAREDFLAGS) -c -o $@ $<
185 +
186 +libcanlock.a: $(OBJS)
187 + $(AR) cru libcanlock.a $(OBJS)
188 @@ -95,6 +99,8 @@
189 +
190 +libcanlock.so.2.0.0: $(LIBOBJS)
191 + $(CC) -shared $(LIBOBJS) $(LDFLAGS) $(SHARELINKFLAGS) -o libcanlock.so.2.0.0
192 ++ ln -s libcanlock.so.2.0.0 libcanlock.so
193 ++ ln -s libcanlock.so.2.0.0 libcanlock.so.2
194
195 install: all
196 $(INSTALL) libcanlock.so.2.0.0 $(DESTDIR)/usr/lib