Skip to content

Commit

Permalink
www/apt-cacher-ng: Fix build with openssl3
Browse files Browse the repository at this point in the history
- Update version 3.2=>3.2.1 as upstream no longer hosts 3.2 version

Approved by:	portmgr (blanket)
Sponsored by:	The FreeBSD Foundation
  • Loading branch information
5u623l20 committed Aug 2, 2023
1 parent 3787035 commit 9585000
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 27 deletions.
11 changes: 8 additions & 3 deletions www/apt-cacher-ng/Makefile
@@ -1,6 +1,5 @@
PORTNAME= apt-cacher-ng
PORTVERSION= 3.2
PORTREVISION= 2
PORTVERSION= 3.2.1
CATEGORIES= www
MASTER_SITES= DEBIAN_POOL/apt-cacher-ng
DISTFILES= ${PORTNAME}_${PORTVERSION}.orig${EXTRACT_SUFX}
Expand Down Expand Up @@ -42,6 +41,12 @@ FUSE_DESC= FUSE support for interfacing with the proxy via acngfs
FUSE_CMAKE_BOOL= USE_FUSE
FUSE_USES= fuse pkgconfig

.include <bsd.port.pre.mk>

#.if ( ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400092 && ${SSL_DEFAULT} == base ) || ${SSL_DEFAULT:Mopenssl3*}
#CXXFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L
#.endif

post-install:
${MV} ${STAGEDIR}${ETCDIR}/acng.conf ${STAGEDIR}${ETCDIR}/acng.conf.sample
${MV} ${STAGEDIR}${ETCDIR}/security.conf ${STAGEDIR}${ETCDIR}/security.conf.sample
Expand All @@ -53,4 +58,4 @@ post-install:
${MKDIR} ${STAGEDIR}/var/cache/apt-cacher-ng \
${STAGEDIR}/var/log/apt-cacher-ng

.include <bsd.port.mk>
.include <bsd.port.post.mk>
6 changes: 3 additions & 3 deletions www/apt-cacher-ng/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1543055307
SHA256 (apt-cacher-ng_3.2.orig.tar.xz) = 405de837becb9ce89e0fb068565bdf4a49d8742be067f8d91da36742702f5acd
SIZE (apt-cacher-ng_3.2.orig.tar.xz) = 319036
TIMESTAMP = 1691009781
SHA256 (apt-cacher-ng_3.2.1.orig.tar.xz) = 9da88292d36e3f95918a96b5057b49f7e3057a4799ec64a890817e3cddb368b6
SIZE (apt-cacher-ng_3.2.1.orig.tar.xz) = 320392
12 changes: 6 additions & 6 deletions www/apt-cacher-ng/files/patch-CMakeLists.txt
@@ -1,4 +1,4 @@
--- CMakeLists.txt.orig 2018-09-07 13:02:18 UTC
--- CMakeLists.txt.orig 2020-02-03 18:54:57 UTC
+++ CMakeLists.txt
@@ -26,20 +26,20 @@ INCLUDE(CheckSymbolExists)
INCLUDE(FindPkgConfig)
Expand Down Expand Up @@ -44,8 +44,8 @@
+if(NOT DEFINED RUNDIR)
set(RUNDIR "/run")
endif()

@@ -71,7 +71,7 @@ endmacro()
set(SOCKET_PATH "${RUNDIR}/${PACKAGE}/socket")
@@ -73,7 +73,7 @@ endmacro()

INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "include")

Expand All @@ -54,7 +54,7 @@
FILE(READ "${CMAKE_SOURCE_DIR}/VERSION" ACVERSION)
string(REPLACE "\n" "" ACVERSION ${ACVERSION})
#MESSAGE(STATUS "Version: ${ACVERSION}")
@@ -308,7 +308,9 @@ SET(CMAKE_REQUIRED_LIBRARIES "")
@@ -310,7 +310,9 @@ SET(CMAKE_REQUIRED_LIBRARIES "")
set(HAVE_CHECKSUM on)

if(USE_SSL)
Expand All @@ -65,7 +65,7 @@
if(openssl_FOUND)
set(HAVE_SSL on)
_append(ACNG_COMPFLAGS ${openssl_CFLAGS})
@@ -388,18 +390,22 @@ add_subdirectory(systemd)
@@ -390,18 +392,22 @@ add_subdirectory(systemd)
###
### Extra install rules for static files
###
Expand All @@ -92,7 +92,7 @@
set(AVAHIDIR "${SYSCONFDIR}/avahi/services")
endif()
install(FILES contrib/apt-cacher-ng.service DESTINATION ${AVAHIDIR})
@@ -414,4 +420,5 @@ DOCDIR: ${DOCDIR}
@@ -416,4 +422,5 @@ DOCDIR: ${DOCDIR}
SYSCONFDIR: ${SYSCONFDIR}
CFGDIR: ${CFGDIR}
SBINDIR: ${SBINDIR}
Expand Down
6 changes: 3 additions & 3 deletions www/apt-cacher-ng/files/patch-conf_acng.conf.in
@@ -1,14 +1,14 @@
--- conf/acng.conf.in.orig 2018-09-07 13:02:18 UTC
--- conf/acng.conf.in.orig 2020-02-03 18:54:57 UTC
+++ conf/acng.conf.in
@@ -69,6 +69,7 @@ Remap-epel: file:epel_mirrors # Fedora
@@ -69,6 +69,7 @@ Remap-epel: file:epel_mirrors # Fedora EPEL
Remap-slrep: file:sl_mirrors # Scientific Linux
Remap-gentoo: file:gentoo_mirrors.gz /gentoo ; file:backends_gentoo # Gentoo Archives
Remap-secdeb: security.debian.org ; security.debian.org deb.debian.org/debian-security
+Remap-FreeBSD: file:freebsd_mirrors ; file:backends_freebsd # FreeBSD Archives

# Virtual page accessible in a web browser to see statistics and status
# information, i.e. under http://localhost:3142/acng-report.html
@@ -365,6 +366,7 @@ LocalDirs: acng-doc @DOCDIR@
@@ -366,6 +367,7 @@ LocalDirs: acng-doc @DOCDIR@
# in /etc/hosts.allow or /etc/hosts.deny files.
#
# UseWrap: 0
Expand Down
29 changes: 19 additions & 10 deletions www/apt-cacher-ng/files/patch-source_acngtool.cc
@@ -1,13 +1,22 @@
--- source/acngtool.cc.orig 2018-09-07 13:02:18 UTC
--- source/acngtool.cc.orig 2020-02-03 18:54:57 UTC
+++ source/acngtool.cc
@@ -562,8 +562,10 @@ int maint_job()
if (!ids.send(m_conFd))
return;

@@ -579,8 +579,10 @@ struct TUdsFactory : public ::acng::IDlConFactory
udsconnection() : tcpconnect(nullptr)
{
// some static and dummy parameters, and invalidate SSL for sure
+#ifdef HAVE_SSL
m_ssl = nullptr;
m_bio = nullptr;
m_ssl = nullptr;
m_bio = nullptr;
+#endif
// better match the TCP socket parameters
m_sHostName = "localhost";
m_sPort = sDefPortHTTP;
m_sHostName = FAKE_UDS_HOSTNAME;
m_sPort = cfg::port;

@@ -1006,7 +1008,7 @@ std::unordered_map<string, parm> parms = {
}
}
},
- {
+ {
"patch",
{
3, 3, [](LPCSTR p)
14 changes: 12 additions & 2 deletions www/apt-cacher-ng/files/patch-source_tcpconnect.cc
@@ -1,6 +1,6 @@
--- source/tcpconnect.cc.orig 2018-09-07 13:02:18 UTC
--- source/tcpconnect.cc.orig 2020-02-03 18:54:57 UTC
+++ source/tcpconnect.cc
@@ -41,13 +41,13 @@ atomic_int nConCount(0), nDisconCount(0)
@@ -41,13 +41,13 @@ atomic_int nConCount(0), nDisconCount(0), nReuseCount(
#include <openssl/crypto.h>
#include <openssl/x509_vfy.h>
#include <openssl/x509v3.h>
Expand All @@ -15,3 +15,13 @@

namespace acng
{
@@ -626,7 +626,9 @@ void globalSslInit()
return;
inited = true;
SSL_load_error_strings();
+#if OPENSSL_VERSION_NUMBER < 0x30000000L
ERR_load_BIO_strings();
+#endif
ERR_load_crypto_strings();
ERR_load_SSL_strings();
OpenSSL_add_all_algorithms();

0 comments on commit 9585000

Please sign in to comment.