* [gentoo-commits] gentoo-x86 commit in dev-libs/libntru/files: libntru-0.3-Allow-building-and-installing-static-lib.patch libntru-0.3-Make-the-lib-target-depend-on-the-libntru.so-target.patch libntru-0.3-Update-VERSION-in-Makefiles.patch
@ 2014-11-17 22:32 Julian Ospald (hasufell)
0 siblings, 0 replies; only message in thread
From: Julian Ospald (hasufell) @ 2014-11-17 22:32 UTC (permalink / raw
To: gentoo-commits
hasufell 14/11/17 22:32:35
Added:
libntru-0.3-Allow-building-and-installing-static-lib.patch
libntru-0.3-Make-the-lib-target-depend-on-the-libntru.so-target.patch
libntru-0.3-Update-VERSION-in-Makefiles.patch
Log:
version bump
(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key BDEED020)
Revision Changes Path
1.1 dev-libs/libntru/files/libntru-0.3-Allow-building-and-installing-static-lib.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libntru/files/libntru-0.3-Allow-building-and-installing-static-lib.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libntru/files/libntru-0.3-Allow-building-and-installing-static-lib.patch?rev=1.1&content-type=text/plain
Index: libntru-0.3-Allow-building-and-installing-static-lib.patch
===================================================================
From 5cb48a5a1bf43c5d4811295aa3fb25744c4c254d Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@hasufell.de>
Date: Mon, 17 Nov 2014 23:25:31 +0100
Subject: [PATCH 3/6] Allow building and installing static lib
Refactored the install rules a bit, so that installing the static
lib optionally becomes a bit more convenient.
---
Makefile.linux | 36 ++++++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)
diff --git a/Makefile.linux b/Makefile.linux
index dbc4957..218162c 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -1,4 +1,5 @@
CC?=gcc
+AR?=ar
CFLAGS?=-g -O2
CFLAGS+=-Wall -Wextra -Wno-unused-parameter
LIBS+=-lrt
@@ -24,24 +25,47 @@ all: lib
lib: libntru.so
+static-lib: libntru.a
+
libntru.so: $(LIB_OBJS_PATHS)
$(CC) $(CFLAGS) $(CPPFLAGS) -shared -Wl,-soname,libntru.so -o libntru.so $(LIB_OBJS_PATHS) $(LDFLAGS) $(LIBS)
-install: lib
- test -d "$(DESTDIR)$(INST_PFX)" || mkdir -p "$(DESTDIR)$(INST_PFX)"
- test -d "$(DESTDIR)$(INST_LIBDIR)" || mkdir "$(DESTDIR)$(INST_LIBDIR)"
- test -d "$(DESTDIR)$(INST_INCLUDE)" || mkdir -p "$(DESTDIR)$(INST_INCLUDE)"
- test -d "$(DESTDIR)$(INST_DOCDIR)" || mkdir -p "$(DESTDIR)$(INST_DOCDIR)"
+libntru.a: $(LIB_OBJS_PATHS)
+ $(AR) cru libntru.a $(LIB_OBJS_PATHS)
+
+install: install-lib install-doc install-headers
+
+install-lib: lib
+ test -d "$(DESTDIR)$(INST_LIBDIR)" || mkdir -p "$(DESTDIR)$(INST_LIBDIR)"
install -m 0755 libntru.so "$(DESTDIR)$(INST_LIBDIR)/libntru.so"
+
+install-static-lib: static-lib
+ test -d "$(DESTDIR)$(INST_LIBDIR)" || mkdir -p "$(DESTDIR)$(INST_LIBDIR)"
+ install -m 0755 libntru.a "$(DESTDIR)$(INST_LIBDIR)/libntru.a"
+
+install-doc:
+ test -d "$(DESTDIR)$(INST_DOCDIR)" || mkdir -p "$(DESTDIR)$(INST_DOCDIR)"
install -m 0644 README.md "$(DESTDIR)$(INST_DOCDIR)/README.md"
+
+install-headers:
+ test -d "$(DESTDIR)$(INST_INCLUDE)" || mkdir -p "$(DESTDIR)$(INST_INCLUDE)"
for header in $(INST_HEADERS) ; do \
install -m 0644 "$(SRCDIR)/$$header" "$(DESTDIR)$(INST_INCLUDE)/" ; \
done
-uninstall:
+uninstall: uninstall-lib uninstall-doc uninstall-headers
+
+uninstall-lib:
rm -f "$(DESTDIR)$(INST_LIBDIR)/libntru.so"
+
+uninstall-static-lib:
+ rm -f "$(DESTDIR)$(INST_LIBDIR)/libntru.a"
+
+uninstall-doc:
rm -f "$(DESTDIR)$(INST_DOCDIR)/README.md"
rmdir "$(DESTDIR)$(INST_DOCDIR)/"
+
+uninstall-headers:
for header in $(INST_HEADERS) ; do \
rm "$(DESTDIR)$(INST_INCLUDE)/$$header" ; \
done
--
2.1.3
1.1 dev-libs/libntru/files/libntru-0.3-Make-the-lib-target-depend-on-the-libntru.so-target.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libntru/files/libntru-0.3-Make-the-lib-target-depend-on-the-libntru.so-target.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libntru/files/libntru-0.3-Make-the-lib-target-depend-on-the-libntru.so-target.patch?rev=1.1&content-type=text/plain
Index: libntru-0.3-Make-the-lib-target-depend-on-the-libntru.so-target.patch
===================================================================
From 38e454b12c707a0d6870fb5541fad64ece17f78d Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@hasufell.de>
Date: Mon, 17 Nov 2014 22:27:39 +0100
Subject: [PATCH 1/4] Make the "lib" target depend on the "libntru.so" target
Depending on the old "lib" target caused a rebuild of libntru.so on any
such target (e.g. installation), because "lib" is in .PHONY
and not an expected file name.
Fixing this helps with distro policies which require to not do
compilation processes during installation phase.
---
Makefile.linux | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.linux b/Makefile.linux
index b699998..dbc4957 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -22,7 +22,9 @@ MAKEFILENAME=$(lastword $(MAKEFILE_LIST))
all: lib
-lib: $(LIB_OBJS_PATHS)
+lib: libntru.so
+
+libntru.so: $(LIB_OBJS_PATHS)
$(CC) $(CFLAGS) $(CPPFLAGS) -shared -Wl,-soname,libntru.so -o libntru.so $(LIB_OBJS_PATHS) $(LDFLAGS) $(LIBS)
install: lib
--
2.1.3
1.1 dev-libs/libntru/files/libntru-0.3-Update-VERSION-in-Makefiles.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libntru/files/libntru-0.3-Update-VERSION-in-Makefiles.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libntru/files/libntru-0.3-Update-VERSION-in-Makefiles.patch?rev=1.1&content-type=text/plain
Index: libntru-0.3-Update-VERSION-in-Makefiles.patch
===================================================================
From e434656449d0797a2f6e14e33b6a0114371d0e16 Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@hasufell.de>
Date: Mon, 17 Nov 2014 22:58:29 +0100
Subject: [PATCH 3/4] Update VERSION in Makefiles
---
Makefile.linux | 2 +-
Makefile.osx | 2 +-
Makefile.win | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile.linux b/Makefile.linux
index fabf8d5..3248ba8 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -7,7 +7,7 @@ SRCDIR=src
TESTDIR=tests
LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o
TEST_OBJS=test_bitstring.o test_hash.o test_idxgen.o test_key.o test_ntru.o test.o test_poly.o test_util.o
-VERSION=0.2
+VERSION=0.3
INST_PFX=/usr
INST_LIBDIR=$(INST_PFX)/lib
INST_INCLUDE=$(INST_PFX)/include/libntru
diff --git a/Makefile.osx b/Makefile.osx
index ccbdf3e..a0f67d3 100644
--- a/Makefile.osx
+++ b/Makefile.osx
@@ -4,7 +4,7 @@ SRCDIR=src
TESTDIR=tests
LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o
TEST_OBJS=test_bitstring.o test_hash.o test_idxgen.o test_key.o test_ntru.o test.o test_poly.o test_util.o
-VERSION=0.2
+VERSION=0.3
INST_PFX=/usr
INST_LIBDIR=$(INST_PFX)/lib
INST_INCLUDE=$(INST_PFX)/include/libntru
diff --git a/Makefile.win b/Makefile.win
index 7a93144..ffa7225 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -6,7 +6,7 @@ SRCDIR=src
TESTDIR=tests
LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o
TEST_OBJS=test_bitstring.o test_hash.o test_idxgen.o test_key.o test_ntru.o test.o test_poly.o test_util.o
-VERSION=0.2
+VERSION=0.3
INST_PFX=%PROGRAMFILES%
INST_LIBDIR=$(INST_PFX)\libntru
INST_INCLUDE=$(INST_PFX)\libntru\include
--
2.1.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-11-17 22:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-17 22:32 [gentoo-commits] gentoo-x86 commit in dev-libs/libntru/files: libntru-0.3-Allow-building-and-installing-static-lib.patch libntru-0.3-Make-the-lib-target-depend-on-the-libntru.so-target.patch libntru-0.3-Update-VERSION-in-Makefiles.patch Julian Ospald (hasufell)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox