From 01cb1df8882b9fbac492b6fbd28a6848f5012194 Mon Sep 17 00:00:00 2001 From: Jeroen Roovers Date: Wed, 29 May 2019 11:31:02 +0200 Subject: net-misc/apt-cacher-ng: Fix CFLAGS/LDFLAGS/openssl Package-Manager: Portage-2.3.67, Repoman-2.3.13 Bug: https://bugs.gentoo.org/show_bug.cgi?id=686608 Signed-off-by: Jeroen Roovers --- .../apt-cacher-ng/apt-cacher-ng-3.2_p2-r1.ebuild | 129 +++++++++++++++++++++ net-misc/apt-cacher-ng/apt-cacher-ng-3.2_p2.ebuild | 126 -------------------- .../files/apt-cacher-ng-3.2-flags.patch | 112 ++++++++++++++++++ 3 files changed, 241 insertions(+), 126 deletions(-) create mode 100644 net-misc/apt-cacher-ng/apt-cacher-ng-3.2_p2-r1.ebuild delete mode 100644 net-misc/apt-cacher-ng/apt-cacher-ng-3.2_p2.ebuild create mode 100644 net-misc/apt-cacher-ng/files/apt-cacher-ng-3.2-flags.patch (limited to 'net-misc') diff --git a/net-misc/apt-cacher-ng/apt-cacher-ng-3.2_p2-r1.ebuild b/net-misc/apt-cacher-ng/apt-cacher-ng-3.2_p2-r1.ebuild new file mode 100644 index 000000000000..c66c11d82fa8 --- /dev/null +++ b/net-misc/apt-cacher-ng/apt-cacher-ng-3.2_p2-r1.ebuild @@ -0,0 +1,129 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit cmake-utils toolchain-funcs user + +DESCRIPTION="Yet another caching HTTP proxy for Debian/Ubuntu software packages" +HOMEPAGE=" + https://www.unix-ag.uni-kl.de/~bloch/acng/ + https://packages.qa.debian.org/a/apt-cacher-ng.html +" +LICENSE="BSD-4 ZLIB public-domain" +SLOT="0" +SRC_URI=" + mirror://debian/pool/main/a/${PN}/${PN}_${PV/_*}.orig.tar.xz + mirror://debian/pool/main/a/${PN}/${PN}_${PV/_p/-}.debian.tar.xz +" + +KEYWORDS="~amd64 ~x86" +IUSE="doc fuse systemd tcpd" + +COMMON_DEPEND=" + app-arch/bzip2 + app-arch/xz-utils + dev-libs/openssl:* + sys-libs/zlib + systemd? ( + sys-apps/systemd + ) +" +BDEPEND=" + ${COMMON_DEPEND} + dev-util/cmake + >sys-devel/gcc-4.8 + virtual/pkgconfig +" +RDEPEND=" + ${COMMON_DEPEND} + dev-lang/perl + fuse? ( sys-fs/fuse ) + tcpd? ( sys-apps/tcp-wrappers ) +" +PATCHES=( + "${WORKDIR}"/debian/patches/debian-changes + "${FILESDIR}"/${PN}-3.2-flags.patch +) +S=${WORKDIR}/${P/_*} + +pkg_pretend() { + if [[ $(gcc-major-version) -lt 4 ]]; then + die "GCC 4.8 or greater is required but you have $(gcc-major-version).$(gcc-minor-version)" + elif [[ $(gcc-major-version) = 4 ]] && [[ $(gcc-minor-version) -lt 8 ]]; then + die "GCC 4.8 or greater is required but you have $(gcc-major-version).$(gcc-minor-version)" + fi +} + +pkg_setup() { + # add new user & group for daemon + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} +} + +src_configure(){ + mycmakeargs=( + "-DCMAKE_INSTALL_PREFIX=/usr" + ) + if use fuse; then + mycmakeargs+=( "-DHAVE_FUSE_25=yes" ) + else + mycmakeargs+=( "-DHAVE_FUSE_25=no" ) + fi + if use tcpd; then + mycmakeargs=( "-DHAVE_LIBWRAP=yes" ) + else + mycmakeargs=( "-DHAVE_LIBWRAP=no" ) + fi + + cmake-utils_src_configure +} + +src_install() { + pushd "${BUILD_DIR}" || die + dosbin ${PN} + if use fuse; then + dobin acngfs + fi + popd + + newinitd "${FILESDIR}"/initd-r1 ${PN} + newconfd "${FILESDIR}"/confd ${PN} + + insinto /etc/logrotate.d + newins "${FILESDIR}"/logrotate ${PN} + + doman doc/man/${PN}* + if use fuse; then + doman doc/man/acngfs* + fi + + # Documentation + dodoc doc/README TODO VERSION INSTALL ChangeLog + if use doc; then + dodoc doc/*.pdf + + docinto html + dodoc doc/html/* + + find conf -name '*.gz' -exec gzip -d {} \; || die + docinto examples/conf + dodoc conf/* + fi + + # perl daily cron script + dosbin scripts/expire-caller.pl + exeinto /etc/cron.daily + newexe "${FILESDIR}"/cron.daily ${PN} + + # default configuration + insinto /etc/${PN} + newins "${BUILD_DIR}"/conf/acng.conf ${PN}.conf + doins $( echo conf/* | sed 's|conf/acng.conf.in||g' ) + + keepdir /var/log/${PN} + # Some directories must exists + keepdir /var/log/${PN} + fowners -R ${PN}:${PN} \ + /etc/${PN} \ + /var/log/${PN} +} diff --git a/net-misc/apt-cacher-ng/apt-cacher-ng-3.2_p2.ebuild b/net-misc/apt-cacher-ng/apt-cacher-ng-3.2_p2.ebuild deleted file mode 100644 index 97f303d5634c..000000000000 --- a/net-misc/apt-cacher-ng/apt-cacher-ng-3.2_p2.ebuild +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -inherit cmake-utils toolchain-funcs user - -DESCRIPTION="Yet another caching HTTP proxy for Debian/Ubuntu software packages" -HOMEPAGE=" - https://www.unix-ag.uni-kl.de/~bloch/acng/ - https://packages.qa.debian.org/a/apt-cacher-ng.html -" -LICENSE="BSD-4 ZLIB public-domain" -SLOT="0" -SRC_URI=" - mirror://debian/pool/main/a/${PN}/${PN}_${PV/_*}.orig.tar.xz - mirror://debian/pool/main/a/${PN}/${PN}_${PV/_p/-}.debian.tar.xz -" - -KEYWORDS="~amd64 ~x86" -IUSE="doc fuse systemd tcpd" - -COMMON_DEPEND=" - app-arch/bzip2 - app-arch/xz-utils - dev-libs/openssl:* - sys-libs/zlib - systemd? ( - sys-apps/systemd - ) -" -DEPEND=" - ${COMMON_DEPEND} - dev-util/cmake - >sys-devel/gcc-4.8 - virtual/pkgconfig -" -RDEPEND=" - ${COMMON_DEPEND} - dev-lang/perl - fuse? ( sys-fs/fuse ) - tcpd? ( sys-apps/tcp-wrappers ) -" -PATCHES=( - "${WORKDIR}"/debian/patches/debian-changes -) -S=${WORKDIR}/${P/_*} - -pkg_pretend() { - if [[ $(gcc-major-version) -lt 4 ]]; then - die "GCC 4.8 or greater is required but you have $(gcc-major-version).$(gcc-minor-version)" - elif [[ $(gcc-major-version) = 4 ]] && [[ $(gcc-minor-version) -lt 8 ]]; then - die "GCC 4.8 or greater is required but you have $(gcc-major-version).$(gcc-minor-version)" - fi -} - -pkg_setup() { - # add new user & group for daemon - enewgroup ${PN} - enewuser ${PN} -1 -1 -1 ${PN} -} - -src_configure(){ - mycmakeargs=( "-DCMAKE_INSTALL_PREFIX=/usr" ) - if use fuse; then - mycmakeargs+=( "-DHAVE_FUSE_25=yes" ) - else - mycmakeargs+=( "-DHAVE_FUSE_25=no" ) - fi - if use tcpd; then - mycmakeargs=( "-DHAVE_LIBWRAP=yes" ) - else - mycmakeargs=( "-DHAVE_LIBWRAP=no" ) - fi - - cmake-utils_src_configure -} - -src_install() { - pushd ${BUILD_DIR} || die - dosbin ${PN} - if use fuse; then - dobin acngfs - fi - popd - - newinitd "${FILESDIR}"/initd-r1 ${PN} - newconfd "${FILESDIR}"/confd ${PN} - - insinto /etc/logrotate.d - newins "${FILESDIR}"/logrotate ${PN} - - doman doc/man/${PN}* - if use fuse; then - doman doc/man/acngfs* - fi - - # Documentation - dodoc doc/README TODO VERSION INSTALL ChangeLog - if use doc; then - dodoc doc/*.pdf - - docinto html - dodoc doc/html/* - - find conf -name '*.gz' -exec gzip -d {} \; || die - docinto examples/conf - dodoc conf/* - fi - - # perl daily cron script - dosbin scripts/expire-caller.pl - exeinto /etc/cron.daily - newexe "${FILESDIR}"/cron.daily ${PN} - - # default configuration - insinto /etc/${PN} - newins "${BUILD_DIR}"/conf/acng.conf ${PN}.conf - doins $( echo conf/* | sed 's|conf/acng.conf.in||g' ) - - keepdir /var/log/${PN} - # Some directories must exists - keepdir /var/log/${PN} - fowners -R ${PN}:${PN} \ - /etc/${PN} \ - /var/log/${PN} -} diff --git a/net-misc/apt-cacher-ng/files/apt-cacher-ng-3.2-flags.patch b/net-misc/apt-cacher-ng/files/apt-cacher-ng-3.2-flags.patch new file mode 100644 index 000000000000..9a909dcc0578 --- /dev/null +++ b/net-misc/apt-cacher-ng/files/apt-cacher-ng-3.2-flags.patch @@ -0,0 +1,112 @@ +- Rip out additional CFLAGS/LDFLAGS +- Drop osslcompat (bug #686608) + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,16 +106,6 @@ + _append(ACNG_CXXFLAGS -fvisibility-inlines-hidden) + endif() + +-foreach(linkarg -Wl,--as-needed -Wl,-O1 -Wl,--discard-all -Wl,--no-undefined -Wl,--build-id=sha1 -Wl,-fuse-ld=gold -Wl,--threads) +- STRING(REGEX REPLACE "=|-|," "" optname "${linkarg}") +- set(CMAKE_REQUIRED_FLAGS "${linkarg}") +- CHECK_CXX_COMPILER_FLAG("" "LD_${optname}") +- if(LD_${optname}) +- _append(CMAKE_EXE_LINKER_FLAGS ${linkarg}) +- endif() +- set(CMAKE_REQUIRED_FLAGS "") +-endforeach(linkarg) +- + option(USE_SSL "Use OpenSSL library for TLS and other crypto functionality" on) + + IF(CMAKE_SYSTEM MATCHES "Darwin") +@@ -134,14 +124,6 @@ + if(CMAKE_BUILD_TYPE MATCHES Debug) + set(USE_LTO_DEFAULT off) + _append(ACNG_COMPFLAGS -DDEBUG) +-else() +- set(CMAKE_REQUIRED_FLAGS "-Wl,--gc-sections") +- CHECK_CXX_COMPILER_FLAG("-Os -fdata-sections -ffunction-sections -Wl,--gc-sections" GC_SECTIONS) +- if(GC_SECTIONS) +- _append(ACNG_COMPFLAGS -fdata-sections -ffunction-sections) +- _append(CMAKE_EXE_LINKER_FLAGS -Wl,--gc-sections) +- endif() +- set(CMAKE_REQUIRED_FLAGS "") + endif() + + # XXX: could use the modern macros instead but they were not available in CMake 2.x +@@ -167,23 +149,6 @@ + endif() + endif() + +-option(USE_LTO "Enable Link Time Optimization (requires modern compilers)" ${USE_LTO_DEFAULT}) +- +-if(USE_LTO) +- SET(LDFLAGS_BACKUP "${CMAKE_EXE_LINKER_FLAGS}") +- SET(CMAKE_REQUIRED_FLAGS "${ACNG_COMPFLAGS} -flto") +- _append(CMAKE_EXE_LINKER_FLAGS -flto) +- CHECK_CXX_SOURCE_COMPILES("${CXX11_TESTSRC}" HAS_LTO) +- if(HAS_LTO) +- SET(ACNG_COMPFLAGS ${CMAKE_REQUIRED_FLAGS}) +- else() +- SET(CMAKE_REQUIRED_FLAGS "${ACNG_COMPFLAGS}") +- SET(CMAKE_EXE_LINKER_FLAGS "${LDFLAGS_BACKUP}") +- message(WARNING "Link Time Optimization support broken, disabling it.") +- endif() +-endif() +-message("-- LTO use: ${USE_LTO}") +- + FIND_LIBRARY(HAVE_SOCKETLIB socket) # separate socket lib looks like Solaris-like environment + if(HAVE_SOCKETLIB) + LIST(APPEND BaseNetworkLibs socket nsl) +@@ -378,7 +343,6 @@ + + CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/include/acsyscap.h.in" "${CMAKE_BINARY_DIR}/acsyscap.h") + +-add_subdirectory(oldssl-workaround) + add_subdirectory(client) + add_subdirectory(fs) + add_subdirectory(source) +@@ -415,3 +379,14 @@ + CFGDIR: ${CFGDIR} + SBINDIR: ${SBINDIR} + ") ++ ++MESSAGE(STATUS "<<< Gentoo configuration >>> ++Build type ${CMAKE_BUILD_TYPE} ++Install path ${CMAKE_INSTALL_PREFIX} ++Compiler flags: ++C ${CMAKE_C_FLAGS} ++C++ ${CMAKE_CXX_FLAGS} ++Linker flags: ++Executable ${CMAKE_EXE_LINKER_FLAGS} ++Module ${CMAKE_MODULE_LINKER_FLAGS} ++Shared ${CMAKE_SHARED_LINKER_FLAGS}\n") +--- a/fs/CMakeLists.txt ++++ b/fs/CMakeLists.txt +@@ -20,7 +20,7 @@ + list(APPEND fsSRCS ../source/aclogger.cc) + endif() + +- ADD_EXECUTABLE(acngfs ${fsSRCS} $) ++ ADD_EXECUTABLE(acngfs ${fsSRCS}) + SET_TARGET_PROPERTIES(acngfs PROPERTIES COMPILE_FLAGS "${ACNG_COMPFLAGS} ${ACNG_CXXFLAGS} ${acngfs_cflags}") + INSTALL(TARGETS acngfs DESTINATION ${LIBDIR}) + if(HAVE_DLOPEN) +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -4,12 +4,12 @@ + ADD_LIBRARY(acngstuff OBJECT ${SHAREDSRCS}) + SET_TARGET_PROPERTIES(acngstuff PROPERTIES COMPILE_FLAGS "${ACNG_COMPFLAGS} ${ACNG_CXXFLAGS} ${CFLAGS_DAEMON} ${CFLAGS_PTHREAD}") + +-ADD_EXECUTABLE(apt-cacher-ng $ ${ACNG_SRCS} apt-cacher.cc $) ++ADD_EXECUTABLE(apt-cacher-ng $ ${ACNG_SRCS} apt-cacher.cc) + TARGET_LINK_LIBRARIES(apt-cacher-ng ${BaseNetworkLibs} ${ServerLibs} ${CompLibs} ${SSL_LIB_LIST} ${LDFLAGS_DAEMON} ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBS_ACNG}) + SET_TARGET_PROPERTIES(apt-cacher-ng PROPERTIES COMPILE_FLAGS "${ACNG_COMPFLAGS} ${ACNG_CXXFLAGS} ${CFLAGS_DAEMON} ${CFLAGS_PTHREAD}") + INSTALL(TARGETS apt-cacher-ng DESTINATION ${SBINDIR}) + +-ADD_EXECUTABLE(acngtool acngtool.cc $ $) ++ADD_EXECUTABLE(acngtool acngtool.cc $) + SET_TARGET_PROPERTIES(acngtool PROPERTIES COMPILE_FLAGS "${ACNG_COMPFLAGS} ${ACNG_CXXFLAGS} ${CFLAGS_PTHREAD}") + TARGET_LINK_LIBRARIES(acngtool ${BaseNetworkLibs} ${CompLibs} ${SSL_LIB_LIST} ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBS_ACNGTOOL}) + INSTALL(TARGETS acngtool DESTINATION ${LIBDIR}) -- cgit v1.2.3-65-gdbad