From a2bd5ebaba789822ae73e9059171c46ed6b8f574 Mon Sep 17 00:00:00 2001 From: d3x0r Date: Thu, 6 Jul 2017 01:49:43 -0700 Subject: use GNUInstallDirs from cmake to specify install paths. Primarily this is to select whether 'lib64' or 'lib' is used on linux type systems. --- CMakeLists.txt | 1 + apps/nc/CMakeLists.txt | 4 ++-- apps/ocspcheck/CMakeLists.txt | 4 ++-- apps/openssl/CMakeLists.txt | 4 ++-- crypto/CMakeLists.txt | 4 ++-- include/CMakeLists.txt | 2 +- man/CMakeLists.txt | 4 ++-- ssl/CMakeLists.txt | 4 ++-- tls/CMakeLists.txt | 4 ++-- 9 files changed, 16 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 570e0ef..dfb3d53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ include(CheckTypeSize) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH}) include(cmake_export_symbol) +include(GNUInstallDirs) project (LibreSSL C) diff --git a/apps/nc/CMakeLists.txt b/apps/nc/CMakeLists.txt index c8757a6..be38146 100644 --- a/apps/nc/CMakeLists.txt +++ b/apps/nc/CMakeLists.txt @@ -53,8 +53,8 @@ add_executable(nc ${NC_SRC}) target_link_libraries(nc tls ${OPENSSL_LIBS}) if(ENABLE_NC) - install(TARGETS nc DESTINATION bin) - install(FILES nc.1 DESTINATION share/man/man1) + install(TARGETS nc DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES nc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) endif() endif() diff --git a/apps/ocspcheck/CMakeLists.txt b/apps/ocspcheck/CMakeLists.txt index a14485e..478f232 100644 --- a/apps/ocspcheck/CMakeLists.txt +++ b/apps/ocspcheck/CMakeLists.txt @@ -36,7 +36,7 @@ endif() add_executable(ocspcheck ${OCSPCHECK_SRC}) target_link_libraries(ocspcheck tls ${OPENSSL_LIBS}) -install(TARGETS ocspcheck DESTINATION bin) -install(FILES ocspcheck.8 DESTINATION share/man/man8) +install(TARGETS ocspcheck DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) endif() diff --git a/apps/openssl/CMakeLists.txt b/apps/openssl/CMakeLists.txt index 9512065..2e47840 100644 --- a/apps/openssl/CMakeLists.txt +++ b/apps/openssl/CMakeLists.txt @@ -76,8 +76,8 @@ endif() add_executable(openssl ${OPENSSL_SRC}) target_link_libraries(openssl ${OPENSSL_LIBS}) -install(TARGETS openssl DESTINATION bin) -install(FILES openssl.1 DESTINATION share/man/man1) +install(TARGETS openssl DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES openssl.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) if(NOT "${OPENSSLDIR}" STREQUAL "") set(CONF_DIR "${OPENSSLDIR}") diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index f8c5684..eca9d1c 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -829,9 +829,9 @@ if (BUILD_SHARED) ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX}) set_target_properties(crypto-shared PROPERTIES VERSION ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION}) - install(TARGETS crypto crypto-shared DESTINATION lib) + install(TARGETS crypto crypto-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) else() add_library(crypto STATIC ${CRYPTO_SRC}) - install(TARGETS crypto DESTINATION lib) + install(TARGETS crypto DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 110caa5..ccb6589 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,5 +1,5 @@ install(DIRECTORY . - DESTINATION include + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "CMakeLists.txt" EXCLUDE PATTERN "compat" EXCLUDE PATTERN "Makefile*" EXCLUDE) diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 5923f58..454b1ee 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -1,9 +1,9 @@ install(DIRECTORY . - DESTINATION share/man/man3 + DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 FILES_MATCHING PATTERN "*.3" ) install(DIRECTORY . - DESTINATION share/man/man1 + DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 FILES_MATCHING PATTERN "*.1" ) diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index bc2fea4..5403942 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt @@ -60,8 +60,8 @@ if (BUILD_SHARED) ARCHIVE_OUTPUT_NAME ssl${SSL_POSTFIX}) set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION} SOVERSION ${SSL_MAJOR_VERSION}) - install(TARGETS ssl ssl-shared DESTINATION lib) + install(TARGETS ssl ssl-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) else() add_library(ssl STATIC ${SSL_SRC}) - install(TARGETS ssl DESTINATION lib) + install(TARGETS ssl DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt index b71fb37..c3e6336 100644 --- a/tls/CMakeLists.txt +++ b/tls/CMakeLists.txt @@ -39,9 +39,9 @@ if (BUILD_SHARED) ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX}) set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION} SOVERSION ${TLS_MAJOR_VERSION}) - install(TARGETS tls tls-shared DESTINATION lib) + install(TARGETS tls tls-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) else() add_library(tls STATIC ${TLS_SRC}) - install(TARGETS tls DESTINATION lib) + install(TARGETS tls DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() -- cgit v1.2.3-55-g6feb From 1f7777169d9399fdb5b00e29d868abd2535f3a14 Mon Sep 17 00:00:00 2001 From: kinichiro Date: Fri, 7 Jul 2017 00:46:48 +0900 Subject: update netcat patch --- patches/netcat.c.patch | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch index 1088249..7160d4c 100644 --- a/patches/netcat.c.patch +++ b/patches/netcat.c.patch @@ -1,16 +1,16 @@ ---- apps/nc/netcat.c.orig Sat Jun 3 19:34:23 2017 -+++ apps/nc/netcat.c Sat Jun 3 19:51:37 2017 -@@ -65,7 +65,9 @@ - #define POLL_NETIN 2 - #define POLL_STDOUT 3 - #define BUFSIZE 16384 +--- apps/nc/netcat.c.orig 2017-07-07 00:10:09.009409624 +0900 ++++ apps/nc/netcat.c 2017-07-07 00:30:32.380088772 +0900 +@@ -66,7 +66,9 @@ + #define POLL_NETIN 2 + #define POLL_STDOUT 3 + #define BUFSIZE 16384 +#ifndef DEFAULT_CA_FILE - #define DEFAULT_CA_FILE "/etc/ssl/cert.pem" + #define DEFAULT_CA_FILE "/etc/ssl/cert.pem" +#endif #define TLS_ALL (1 << 1) #define TLS_NOVERIFY (1 << 2) -@@ -93,9 +95,13 @@ +@@ -94,9 +96,13 @@ int zflag; /* Port Scan Flag */ int Dflag; /* sodebug */ int Iflag; /* TCP receive buffer size */ int Oflag; /* TCP send buffer size */ @@ -24,7 +24,7 @@ int usetls; /* use TLS */ char *Cflag; /* Public cert file */ -@@ -264,12 +270,14 @@ +@@ -265,12 +271,14 @@ main(int argc, char *argv[]) case 'u': uflag = 1; break; @@ -39,7 +39,7 @@ case 'v': vflag = 1; break; -@@ -316,9 +324,11 @@ +@@ -317,9 +325,11 @@ main(int argc, char *argv[]) case 'o': oflag = optarg; break; @@ -51,7 +51,7 @@ case 'T': errstr = NULL; errno = 0; -@@ -342,9 +352,11 @@ +@@ -343,9 +353,11 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; @@ -63,7 +63,7 @@ if (family == AF_UNIX) { if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) -@@ -889,7 +901,10 @@ +@@ -888,7 +900,10 @@ int remote_connect(const char *host, const char *port, struct addrinfo hints) { struct addrinfo *res, *res0; @@ -75,7 +75,7 @@ if ((error = getaddrinfo(host, port, &hints, &res0))) errx(1, "getaddrinfo for host \"%s\" port %s: %s", host, -@@ -904,8 +919,10 @@ +@@ -903,8 +918,10 @@ remote_connect(const char *host, const c if (sflag || pflag) { struct addrinfo ahints, *ares; @@ -86,7 +86,7 @@ memset(&ahints, 0, sizeof(struct addrinfo)); ahints.ai_family = res->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; -@@ -976,7 +993,10 @@ +@@ -975,7 +992,10 @@ int local_listen(char *host, char *port, struct addrinfo hints) { struct addrinfo *res, *res0; @@ -98,7 +98,7 @@ int error; /* Allow nodename to be null. */ -@@ -997,9 +1017,11 @@ +@@ -996,9 +1016,11 @@ local_listen(char *host, char *port, str res->ai_protocol)) < 0) continue; @@ -110,7 +110,7 @@ set_common_sockopts(s, res->ai_family); -@@ -1455,11 +1477,13 @@ +@@ -1454,11 +1476,13 @@ set_common_sockopts(int s, int af) { int x = 1; @@ -124,7 +124,7 @@ if (Dflag) { if (setsockopt(s, SOL_SOCKET, SO_DEBUG, &x, sizeof(x)) == -1) -@@ -1470,9 +1494,16 @@ +@@ -1469,9 +1493,16 @@ set_common_sockopts(int s, int af) IP_TOS, &Tflag, sizeof(Tflag)) == -1) err(1, "set IP ToS"); @@ -141,7 +141,7 @@ } if (Iflag) { if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, -@@ -1496,13 +1527,17 @@ +@@ -1495,13 +1526,17 @@ set_common_sockopts(int s, int af) } if (minttl != -1) { @@ -160,7 +160,7 @@ } } -@@ -1710,14 +1745,22 @@ +@@ -1709,14 +1744,22 @@ help(void) \t-P proxyuser\tUsername for proxy authentication\n\ \t-p port\t Specify local port for remote connects\n\ \t-R CAfile CA bundle\n\ -- cgit v1.2.3-55-g6feb From 322b82367d75fa190bb98094d97f9f93c83e8f9a Mon Sep 17 00:00:00 2001 From: kinichiro Date: Fri, 7 Jul 2017 01:40:35 +0900 Subject: fix tests/tlstest.bat --- tests/tlstest.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tlstest.bat b/tests/tlstest.bat index 4650d96..b7b1ecf 100644 --- a/tests/tlstest.bat +++ b/tests/tlstest.bat @@ -9,7 +9,7 @@ if "%srcdir%"=="" ( set srcdir=. ) -%tlstest_bin% %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem +%tlstest_bin% %srcdir%\ca.pem %srcdir%\server.pem %srcdir%\server.pem if !errorlevel! neq 0 ( exit /b 1 ) -- cgit v1.2.3-55-g6feb