aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-11-07 07:43:46 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-11-07 16:46:16 +0000
commit0225c0e1f5612c8875ff117e2eb41552805efcf1 (patch)
tree3baa605acb2e8a2fe726a6bcc85c5722a8d37d3d
parentb918059bb6d27960bc6a726b3860061e33292ad2 (diff)
downloadaports-0225c0e1f5612c8875ff117e2eb41552805efcf1.tar.gz
aports-0225c0e1f5612c8875ff117e2eb41552805efcf1.tar.bz2
aports-0225c0e1f5612c8875ff117e2eb41552805efcf1.tar.xz
testing/nut: rebuild against openssl 1.1
-rw-r--r--testing/nut/APKBUILD30
-rw-r--r--testing/nut/openssl-1.1.patch70
2 files changed, 88 insertions, 12 deletions
diff --git a/testing/nut/APKBUILD b/testing/nut/APKBUILD
index 9e1949a8ea..d16783838e 100644
--- a/testing/nut/APKBUILD
+++ b/testing/nut/APKBUILD
@@ -3,23 +3,29 @@
# Maintainer: Kozak Ivan <kozak-iv@yandex.ru>
pkgname=nut
pkgver=2.7.4
-pkgrel=5
+pkgrel=6
pkgdesc="Network UPS tools"
url="http://www.networkupstools.org"
arch="all"
license="GPL"
-depends_dev="libressl-dev libusb-compat-dev net-snmp-dev neon-dev"
+depends_dev="openssl-dev libusb-compat-dev net-snmp-dev neon-dev"
makedepends="$depends_dev libtool autoconf automake"
pkgusers=$pkgname
pkggroups=$pkgname
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-dev"
source="http://www.networkupstools.org/source/2.7/$pkgname-$pkgver.tar.gz
+ openssl-1.1.patch
upsd.initd
upsmon.initd
"
builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ default_prepare
+ autoreconf -vif
+}
+
build() {
cd "$builddir"
./configure \
@@ -46,9 +52,8 @@ build() {
--sysconfdir=/etc/nut \
--with-statepath=/var/run/nut \
--with-altpidpath=/var/run/nut \
- --with-openssl \
- || return 1
- make || return 1
+ --with-openssl
+ make
}
check() {
@@ -56,19 +61,20 @@ check() {
}
package() {
- make -C "$builddir" DESTDIR="$pkgdir" install || return 1
- install -Dm755 "$srcdir"/upsd.initd "$pkgdir"/etc/init.d/nut-upsd || return 1
- install -Dm755 "$srcdir"/upsmon.initd "$pkgdir"/etc/init.d/nut-upsmon || return 1
- install -d -o $pkgname -g $pkgname "$pkgdir"/var/lib/$pkgname || return 1
+ make -C "$builddir" DESTDIR="$pkgdir" install
+ install -Dm755 "$srcdir"/upsd.initd "$pkgdir"/etc/init.d/nut-upsd
+ install -Dm755 "$srcdir"/upsmon.initd "$pkgdir"/etc/init.d/nut-upsmon
+ install -d -o $pkgname -g $pkgname "$pkgdir"/var/lib/$pkgname
local file;
for file in "$pkgdir"/etc/nut/*.sample; do
- chmod 640 $file || return 1
- chown root:$pkgname $file || return 1
- mv $file ${file%.sample} || return 1
+ chmod 640 $file
+ chown root:$pkgname $file
+ mv $file ${file%.sample}
done
}
sha512sums="320c4aff85d8a370c5eff77d33924fdfc3caf6a250620693cdd5bf3336b3a80d8a207488eee841bcf8b72fbad68fda4c074e63b99c56e7886716fc934122d11a nut-2.7.4.tar.gz
+2b6f5df0c7084a0e86474b36d4c567b995c76e2f8fda788a7dffa6d8ecd6b41698ca8376ac228cdbfd805e3406611e7f003e4492d98c74658ed785d7320ab866 openssl-1.1.patch
f470da96f9d324173e9bd241146284793738f99f2314dfe41c3ac3d56234394609b47d7e593ce9940ec7ce74a26a8483d0911161a16402cd3cc25023ba991d4b upsd.initd
32470ae473fc363131787cd57f13d40763898947d56d032790ba7f3a5eaa8038b602f7e395ca44f6c5adce8ee5ec496e30ca0eaadb3c78a38015677aea751e12 upsmon.initd"
diff --git a/testing/nut/openssl-1.1.patch b/testing/nut/openssl-1.1.patch
new file mode 100644
index 0000000000..e7a2884583
--- /dev/null
+++ b/testing/nut/openssl-1.1.patch
@@ -0,0 +1,70 @@
+From fcbf18c92918ce5e81d0aab62a7aed5c2245ea4d Mon Sep 17 00:00:00 2001
+From: Eneas U de Queiroz <cote2004-github@yahoo.com>
+Date: Fri, 1 Jun 2018 11:17:28 -0300
+Subject: [PATCH] Add compatibility with openssl 1.1.0
+
+Minor adjustments were needed:
+* Openssl 1.1 libs do not need to be initialized.
+* TLSv*_method became TLS_*_method.
+
+Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
+---
+ clients/upsclient.c | 5 ++++-
+ m4/nut_check_libopenssl.m4 | 2 +-
+ server/netssl.c | 7 +++++--
+ 3 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/clients/upsclient.c b/clients/upsclient.c
+index b90587b00..053d60fb0 100644
+--- a/clients/upsclient.c
++++ b/clients/upsclient.c
+@@ -316,10 +316,13 @@ int upscli_init(int certverify, const char *certpath,
+
+ #ifdef WITH_OPENSSL
+
++# if OPENSSL_VERSION_NUMBER < 0x10100000L
+ SSL_library_init();
+ SSL_load_error_strings();
++# define TLS_client_method TLSv1_client_method
++# endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+
+- ssl_method = TLSv1_client_method();
++ ssl_method = TLS_client_method();
+
+ if (!ssl_method) {
+ return 0;
+diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4
+index 1b875077b..7eb401cd9 100644
+--- a/m4/nut_check_libopenssl.m4
++++ b/m4/nut_check_libopenssl.m4
+@@ -58,7 +58,7 @@ if test -z "${nut_have_libopenssl_seen}"; then
+
+ dnl check if openssl is usable
+ AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT])
+- AC_CHECK_FUNCS(SSL_library_init, [], [nut_have_openssl=no])
++ AC_CHECK_FUNCS(SSL_CTX_new, [], [nut_have_openssl=no])
+
+ if test "${nut_have_openssl}" = "yes"; then
+ nut_with_ssl="yes"
+diff --git a/server/netssl.c b/server/netssl.c
+index c2f409899..0289e296f 100644
+--- a/server/netssl.c
++++ b/server/netssl.c
+@@ -387,12 +387,15 @@ void ssl_init(void)
+
+ #ifdef WITH_OPENSSL
+
++# if OPENSSL_VERSION_NUMBER < 0x10100000L
+ SSL_load_error_strings();
+ SSL_library_init();
++# define TLS_server_method TLSv1_server_method
++# endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+
+- if ((ssl_method = TLSv1_server_method()) == NULL) {
++ if ((ssl_method = TLS_server_method()) == NULL) {
+ ssl_debug();
+- fatalx(EXIT_FAILURE, "TLSv1_server_method failed");
++ fatalx(EXIT_FAILURE, "TLS_server_method failed");
+ }
+
+ if ((ssl_ctx = SSL_CTX_new(ssl_method)) == NULL) {