aboutsummaryrefslogtreecommitdiffstats
path: root/community/hermes
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-11-02 11:21:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-11-07 16:46:14 +0000
commitc73ebd0b30af62b42fa3860020a8c90f78aae3e5 (patch)
tree81056e56466f3fdef685db4bd8b0a596782ab0c6 /community/hermes
parent0e6777bb846a0805f9dd57db627a82ca93d2aeee (diff)
downloadaports-c73ebd0b30af62b42fa3860020a8c90f78aae3e5.tar.bz2
aports-c73ebd0b30af62b42fa3860020a8c90f78aae3e5.tar.xz
community/hermes: rebuild against openssl 1.1
Diffstat (limited to 'community/hermes')
-rw-r--r--community/hermes/APKBUILD11
-rw-r--r--community/hermes/openssl-1.1.patch34
2 files changed, 41 insertions, 4 deletions
diff --git a/community/hermes/APKBUILD b/community/hermes/APKBUILD
index 4fd858a120..d0f71faa9d 100644
--- a/community/hermes/APKBUILD
+++ b/community/hermes/APKBUILD
@@ -2,15 +2,17 @@
# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
pkgname=hermes
pkgver=1.9
-pkgrel=4
+pkgrel=5
pkgdesc="Hermes is an anti-spam transparent SMTP proxy"
url="https://hermes-project.com/"
arch="all"
license="GPL"
-makedepends="libspf2-dev sqlite-dev perl gettext-dev libressl-dev doxygen"
+makedepends="libspf2-dev sqlite-dev perl gettext-dev openssl-dev doxygen"
subpackages="$pkgname-doc"
source="https://hermes-project.com/files/${pkgname}-${pkgver}.tar.bz2
- Utils.cpp.patch"
+ Utils.cpp.patch
+ openssl-1.1.patch
+ "
builddir=${srcdir}/${pkgname}-${pkgver}
@@ -31,4 +33,5 @@ package() {
}
sha512sums="9861177cee7d4936e2221f3ff9f60c030385d6c2ab1cbc320f4e03880220117c580a11188e011f9051c79691e1ab8399c03be8cbbc4f18519a1a9b966bf767b9 hermes-1.9.tar.bz2
-ac5859bed41c5b484adf8b42d66d69cf49966df84e664f9f6978d3c4fa6200858ea024c6631c2f1fd02c09d7f95e6102b3fce68b3f92f5223c4f8a253fd57d0c Utils.cpp.patch"
+ac5859bed41c5b484adf8b42d66d69cf49966df84e664f9f6978d3c4fa6200858ea024c6631c2f1fd02c09d7f95e6102b3fce68b3f92f5223c4f8a253fd57d0c Utils.cpp.patch
+07a76a139dd6eae044aac4e2fd1e072185b9b1f94d4d31a18aae7e9a0ec3f29d97edaad861e0383688c4b76731d36f893085712eaba7fd52016bdcef2084fa43 openssl-1.1.patch"
diff --git a/community/hermes/openssl-1.1.patch b/community/hermes/openssl-1.1.patch
new file mode 100644
index 0000000000..85034a34fe
--- /dev/null
+++ b/community/hermes/openssl-1.1.patch
@@ -0,0 +1,34 @@
+diff --git a/src/hermes.cpp b/src/hermes.cpp
+index edfe833..35b4062 100644
+--- a/src/hermes.cpp
++++ b/src/hermes.cpp
+@@ -63,12 +63,14 @@ __thread unsigned long connection_id;
+ list<unsigned long> children;
+
+ #ifdef HAVE_SSL
+-pthread_mutex_t ssl_locks[CRYPTO_NUM_LOCKS]={PTHREAD_MUTEX_INITIALIZER};
++#define CRYPTO_NUM_LOCKS 100
++pthread_mutex_t *ssl_locks;
+
+ void ssl_locking_function(int mode,int n,const char *file,int line)
+ {
+- if(n>CRYPTO_NUM_LOCKS)
+- throw Exception(_("Error, "+Utils::inttostr(n)+" is bigger than CRYPTO_NUM_LOCKS("+Utils::inttostr(CRYPTO_NUM_LOCKS)+")"),__FILE__,__LINE__);
++ int num_locks = CRYPTO_num_locks();
++ if(n>num_locks)
++ throw Exception(_("Error, "+Utils::inttostr(n)+" is bigger than CRYPTO_NUM_LOCKS("+Utils::inttostr(num_locks)+")"),__FILE__,__LINE__);
+ if(mode&CRYPTO_LOCK)
+ pthread_mutex_lock(&ssl_locks[n]);
+ else
+@@ -94,6 +96,11 @@ main
+ */
+
+ #ifdef HAVE_SSL
++ int num_locks=CRYPTO_num_locks();
++ ssl_locks = (pthread_mutex_t *)calloc(num_locks, sizeof (*ssl_locks));
++ for (int i=0; i< num_locks; i++)
++ pthread_mutex_init(&ssl_locks[i], NULL);
++
+ CRYPTO_set_locking_callback(ssl_locking_function);
+ #ifndef WIN32 //getpid() returns different values for threads on windows, therefor this is not needed
+ CRYPTO_set_id_callback(pthread_self);