From fccade908ac0e7cdf5bf4df08e3db427f520c360 Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Jun 23 2020 03:36:03 +0000 Subject: actual initial version posted for review --- diff --git a/0001-don-t-assume-DESTDIR-ends-in-a-slash.patch b/0001-don-t-assume-DESTDIR-ends-in-a-slash.patch deleted file mode 100644 index ebb5f33..0000000 --- a/0001-don-t-assume-DESTDIR-ends-in-a-slash.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e2e828d9637eda675233df461dd71c8ac686d4d1 Mon Sep 17 00:00:00 2001 -From: Dan Callaghan -Date: Mon, 26 Nov 2018 10:22:18 +1000 -Subject: [PATCH 1/4] don't assume DESTDIR ends in a slash - -Conventionally it doesn't. ---- - makefile | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/makefile b/makefile -index fcbca78..ee5761b 100644 ---- a/makefile -+++ b/makefile -@@ -8,14 +8,14 @@ CEXAMPLES := $(SOURCES2:%.c=%) - CPPEXAMPLES := $(SOURCES3:%.cc=%) - - ifeq ($(OS), FreeBSD) --DESTDIR = / --PREFIX = usr/local -+DESTDIR = -+PREFIX = /usr/local - INCLUDEDIR = $(PREFIX)/include/ - LIBDIR = $(PREFIX)/lib/ - PKGCONFIGDIR = $(PREFIX)/libdata/pkgconfig/ - else --DESTDIR = / --PREFIX = usr -+DESTDIR = -+PREFIX = /usr - INCLUDEDIR = $(PREFIX)/include/ - LIBDIR = $(PREFIX)/lib/ - PKGCONFIGDIR = $(LIBDIR)/pkgconfig/ --- -2.19.2 - diff --git a/0001-tests-disable-timeout-test.patch b/0001-tests-disable-timeout-test.patch new file mode 100644 index 0000000..e7d1372 --- /dev/null +++ b/0001-tests-disable-timeout-test.patch @@ -0,0 +1,28 @@ +From c6eeba4570efa2fe9dbe6358c79d7ffd3f1dc4d7 Mon Sep 17 00:00:00 2001 +From: Dan Callaghan +Date: Fri, 15 Nov 2019 16:34:56 +1000 +Subject: [PATCH] tests: disable timeout test + +This fails (ConnectionError is thrown instead of TimeoutError) if the +tests are run in an isolated network namespace. +--- + test/test2.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/test/test2.cc b/test/test2.cc +index 43b9a40..83871b6 100644 +--- a/test/test2.cc ++++ b/test/test2.cc +@@ -30,7 +30,8 @@ TEST(CONNECTION, RECONNECT) { + } + + TEST(CONNECTION, FAILURE) { +- ASSERT_THROW(Client borked("example.org", 3000, 1.0), TimeoutException); ++ // Fails in mock due to isolated network ++ //ASSERT_THROW(Client borked("example.org", 3000, 1.0), TimeoutException); + return 0; + } + +-- +2.21.0 + diff --git a/0002-headers-and-.pc-file-should-not-be-executable.patch b/0002-headers-and-.pc-file-should-not-be-executable.patch deleted file mode 100644 index eaef139..0000000 --- a/0002-headers-and-.pc-file-should-not-be-executable.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 4a7092d07d8bbc2a75497fb777f787d4738b665a Mon Sep 17 00:00:00 2001 -From: Dan Callaghan -Date: Mon, 26 Nov 2018 10:26:11 +1000 -Subject: [PATCH 2/4] headers and .pc file should not be executable - ---- - makefile | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/makefile b/makefile -index ee5761b..ddb3dfe 100644 ---- a/makefile -+++ b/makefile -@@ -87,8 +87,8 @@ beanstalkcpp.o: beanstalk.cc beanstalk.hpp makefile - - install: $(SHAREDLIB) $(STATICLIB) - install -d $(DESTDIR)$(INCLUDEDIR) -- install beanstalk.h $(DESTDIR)$(INCLUDEDIR) -- install beanstalk.hpp $(DESTDIR)$(INCLUDEDIR) -+ install -m 0644 beanstalk.h $(DESTDIR)$(INCLUDEDIR) -+ install -m 0644 beanstalk.hpp $(DESTDIR)$(INCLUDEDIR) - - install -d $(DESTDIR)$(LIBDIR) - install -m 0644 $(SHAREDLIB) $(DESTDIR)$(LIBDIR)/$(SHAREDLIB).$(VERSION) -@@ -100,7 +100,7 @@ install: $(SHAREDLIB) $(STATICLIB) - ln $(LNOPTS) $(STATICLIB).$(VERSION) $(DESTDIR)$(LIBDIR)/$(STATICLIB) - - install -d $(DESTDIR)$(PKGCONFIGDIR) -- install beanstalk-client.pc $(DESTDIR)$(PKGCONFIGDIR)/libbeanstalk.pc -+ install -m 0644 beanstalk-client.pc $(DESTDIR)$(PKGCONFIGDIR)/libbeanstalk.pc - sed -i -e 's/@VERSION@/$(VERSION)/' $(DESTDIR)$(PKGCONFIGDIR)/libbeanstalk.pc - sed -i -e 's,@prefix@,$(PREFIX),' $(DESTDIR)$(PKGCONFIGDIR)/libbeanstalk.pc - sed -i -e 's,@libdir@,$(LIBDIR),' $(DESTDIR)$(PKGCONFIGDIR)/libbeanstalk.pc --- -2.19.2 - diff --git a/0003-.so-file-should-be-executable.patch b/0003-.so-file-should-be-executable.patch deleted file mode 100644 index c1eaca3..0000000 --- a/0003-.so-file-should-be-executable.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8c0748c3ee45fe32f57404ac3c7f771035f14ded Mon Sep 17 00:00:00 2001 -From: Dan Callaghan -Date: Mon, 3 Dec 2018 13:10:25 +1000 -Subject: [PATCH 3/4] .so file should be executable - ---- - makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/makefile b/makefile -index ddb3dfe..31796f5 100644 ---- a/makefile -+++ b/makefile -@@ -91,7 +91,7 @@ install: $(SHAREDLIB) $(STATICLIB) - install -m 0644 beanstalk.hpp $(DESTDIR)$(INCLUDEDIR) - - install -d $(DESTDIR)$(LIBDIR) -- install -m 0644 $(SHAREDLIB) $(DESTDIR)$(LIBDIR)/$(SHAREDLIB).$(VERSION) -+ install -m 0755 $(SHAREDLIB) $(DESTDIR)$(LIBDIR)/$(SHAREDLIB).$(VERSION) - ln $(LNOPTS) $(SHAREDLIB).$(VERSION) $(DESTDIR)$(LIBDIR)/$(SHAREDLIB).1 - ln $(LNOPTS) $(SHAREDLIB).$(VERSION) $(DESTDIR)$(LIBDIR)/$(SHAREDLIB) - --- -2.19.2 - diff --git a/0004-make-it-possible-to-override-CFLAGS-and-LDFLAGS.patch b/0004-make-it-possible-to-override-CFLAGS-and-LDFLAGS.patch deleted file mode 100644 index 3349905..0000000 --- a/0004-make-it-possible-to-override-CFLAGS-and-LDFLAGS.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 5bb2009b7dd1658e80c141148dfbad394b60917b Mon Sep 17 00:00:00 2001 -From: Dan Callaghan -Date: Mon, 26 Nov 2018 12:38:14 +1000 -Subject: [PATCH 4/4] make it possible to override CFLAGS and LDFLAGS - ---- - makefile | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/makefile b/makefile -index 31796f5..ee32d94 100644 ---- a/makefile -+++ b/makefile -@@ -39,8 +39,8 @@ LNOPTS = -sfT - endif - - STATICLIB = libbeanstalk.a --CFLAGS = -Wall -Wno-sign-compare -g -I. --LDFLAGS = -L. -lbeanstalk -+CFLAGS ?= -g -+CFLAGS += -Wall -Wno-sign-compare -I. - CC ?= gcc - CXX ?= g++ - -@@ -50,22 +50,22 @@ test: $(TESTS) - test/run-all - - $(TESTS): test/%:test/%.o $(SHAREDLIB) -- $(CXX) -o $@ $< $(LDFLAGS) -lgtest -lpthread -+ $(CXX) -o $@ $< $(LDFLAGS) -L. -lbeanstalk -lgtest -lpthread - - test/%.o: test/%.cc - $(CXX) $(CFLAGS) -c -o $@ $< - - benchmark: benchmark.cc $(SHAREDLIB) -- $(CXX) $(CFLAGS) -o benchmark benchmark.cc $(LDFLAGS) -lpthread -+ $(CXX) $(CFLAGS) -o benchmark benchmark.cc $(LDFLAGS) -L. -lbeanstalk -lpthread - - $(CEXAMPLES): examples/c/%:examples/c/%.o $(SHAREDLIB) -- $(CC) -o $@ $< $(LDFLAGS) -+ $(CC) -o $@ $< $(LDFLAGS) -L. -lbeanstalk - - examples/c/%.o: examples/c/%.c - $(CC) $(CFLAGS) -c -o $@ $< - - $(CPPEXAMPLES): examples/cpp/%:examples/cpp/%.o $(SHAREDLIB) -- $(CXX) -o $@ $< $(LDFLAGS) -+ $(CXX) -o $@ $< $(LDFLAGS) -L. -lbeanstalk - - examples/cpp/%.o: examples/cpp/%.cc - $(CXX) $(CFLAGS) -c -o $@ $< -@@ -75,7 +75,7 @@ $(STATICLIB): beanstalk.o beanstalkcpp.o - ar -cq $@ $^ - - $(SHAREDLIB): beanstalk.o beanstalkcpp.o -- $(CXX) $(LINKER) -o $(SHAREDLIB) beanstalk.o beanstalkcpp.o -+ $(CXX) $(CFLAGS) $(LINKER) $(LDFLAGS) -o $(SHAREDLIB) beanstalk.o beanstalkcpp.o - rm -f $(SHAREDLIB).1 - ln -s $(SHAREDLIB) $(SHAREDLIB).1 - --- -2.19.2 - diff --git a/beanstalk-client.spec b/beanstalk-client.spec index a96b946..228a8e1 100644 --- a/beanstalk-client.spec +++ b/beanstalk-client.spec @@ -1,17 +1,15 @@ -%global commit ccff6e66ce12327905a44ca701f23f61cc451a99 +%global commit d012ba8216a965f81df5363c0f14d5ec6bf25627 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: beanstalk-client -Version: 1.3.0 -Release: 1.20181111gitccff6e6%{?dist} +Version: 1.4.0 +Release: 1%{?dist} Summary: C/C++ client for the beanstalkd work queue License: BSD URL: https://github.com/deepfryed/beanstalk-client Source0: https://github.com/deepfryed/beanstalk-client/archive/%{commit}/%{name}-%{shortcommit}.tar.gz -Patch1: 0001-don-t-assume-DESTDIR-ends-in-a-slash.patch -Patch2: 0002-headers-and-.pc-file-should-not-be-executable.patch -Patch3: 0003-.so-file-should-be-executable.patch -Patch4: 0004-make-it-possible-to-override-CFLAGS-and-LDFLAGS.patch +# Not upstreamable: disables tests which require networking, they fail in mock +Patch100: 0001-tests-disable-timeout-test.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gtest-devel @@ -28,7 +26,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Development files for %{name}. %prep -%autosetup -n %{name}-%{commit} +%autosetup -n %{name}-%{commit} -p1 %build %set_build_flags @@ -55,5 +53,5 @@ kill %1 %{_libdir}/pkgconfig/libbeanstalk.pc %changelog -* Mon Nov 26 2018 Dan Callaghan - 1.3.0-1 +* Fri Nov 15 2019 Dan Callaghan - 1.4.0-1 - initial version