Created attachment 174003 [details] apt-cacher-ng port shar file apt-cacher-ng while originating from Debian is usable as a specialized caching http/https proxy for many other software distribution sites. This port patches upstream apt-cacher-ng to compile cleanly on FreeBSD and add FreeBSD installer as well as pkg(ng) related configuration, so that apt-cacher-ng can be used right away in a FreeBSD context.
Created attachment 190914 [details] Updated shar to upstream version 3.1 and FreeBSD 11.1 Updated version following upstream changes and FreeBSD changes
Created attachment 190927 [details] apt-cacher-ng port shar file upstream 3.1 / FreeBSD 10.4/11.1 fixed MANDIR
XLICENSE_FILE= ${WRKSRC}/COPYING Setting LICENSE_FILE without also setting LICENSE is useless. XDEFAULT_VERSIONS+= ssl=openssl This is a red flag. A default version effects the entire ports collection. It cannot be set in an individual port. XSSL_BUILD_DEPENDS= pkg-config:${PORTSDIR}/devel/pkgconf openssl:${PORTSDIR}/security/openssly If the port needs openssl then add USES=ssl (or SSL_USES=ssl) and nothing else. Since the port already always has USES=ssl maybe the SSL option isn't really needed and SSL support could always be on. - All of the ${PORTSDIR} things are old school and should be removed. XFUSE_CMAKE_ON= -DUSE_FUSE:BOOL=ON XFUSE_CMAKE_OFF= -DUSE_FUSE:BOOL=OFF Replace with (and the other *_CMAKE_{ON,OFF}): FUSE_CMAKE_BOOL= USE_FUSE Can you confirm that this passes portlint and a Poudriere test build? In particular a test build on 12.0-BETA4 would be good to make sure it still builds against OpenSSL 1.1.1.
(In reply to Tobias Kortkamp from comment #3) s/effects/affects/
Hey Tobias, thanks for looking into it and the suggestions. I will set-up a 12.0 machine and also update the upstream changes since last submission. Cheers, Keve
Created attachment 199542 [details] apt-cacher-ng port shar file upstream 3.2/FreeBSD 11.2-R-p4 and 12.0-RC1 Included comments from review, thank you for the feedback. Builds on a 12.0-RC1 system with poudriere+portshaker against 11.2-RELEAE-p4 and 12.0-RC1. portlint -A only complains about the use of hyphen in the name, something many official ports also do. Please let me know if there is anything else I can do.
ould you order the variables according to [1]? XThis is a port of apt-cacher-ng, a caching http/s proxy specialized in Never start pkg-descr with "This is a port". How about starting with "apt-cacher-ng is a caching ..." instead? There are also some typos in pkg-descr. XMore details are on the original projects web page. I think this sentence is superfluous and could be dropped. It's pretty much why pkg-descr always ends with WWW. XOPTIONS_DEFAULT= SSL DOCS DOCS is always enabled by default, so it doesn't need to be here. X#SSL_BUILD_DEPENDS= pkg-config:devel/pkgconf X#SSL_BUILD_DEPENDS= pkg-config:devel/pkgconf openssl:security/openssl X#SSL_LIB_DEPENDS= libcrypto.so:security/openssl Please remove all the commented out variables. Especially these very wrong bits. XSSL_DESC= Include SSL support to allow proxying https sites. Remove the dot at the end. XFUSE_DESC= Include FUSE support. FUSE already has a better common description. What does the option do in the context of the port (maybe mention acngfs)? XDISTNAME= ${PORTNAME}_${PORTVERSION}.orig You can eliminate setting WRKSRC below if you use DISTFILES= ${PORTNAME}_${PORTVERSION}.orig${EXTRACT_SUFX} instead here. Xpost-stage: Use post-install X ${INSTALL_MAN} ${WRKSRC}/COPYING ${STAGEDIR}${DOCSDIR} X ${INSTALL_MAN} ${WRKSRC}/ChangeLog ${STAGEDIR}${DOCSDIR} X ${INSTALL_MAN} ${WRKSRC}/TODO ${STAGEDIR}${DOCSDIR} Use INSTALL_DATA to install documentation. COPYING is already installed via LICENSE_FILE. No need to install it twice. Does the ChangeLog and TODO really contain useful information for users? X ${INSTALL_MAN} ${WRKDIR}/Readme.FreeBSD ${STAGEDIR}${DOCSDIR} I think this should be a pkg-message instead, so that users see it after installation. [1] https://www.freebsd.org/doc/en/books/porters-handbook/porting-order.html
Ping.
Hey Tobias, thanks for your heads-up. Will do the changes very soon. Cheers, Keve
Hi Tobias, I have applied most of your remarks, I have troubles applying some. COPYING - if I leave it out the file is not copied and the build breaks. DISTFILES - if I set it DISTFILES= ${PORTNAME}_${PORTVERSION}.orig${EXTRACT_SUFX} and remove DISTNAME and WRKSRC the build is ok, but running portlint -A I get WARN: Makefile: use of DISTFILES with single file discouraged. distribution filename should be set by DISTNAME and EXTRACT_SUFX. WARN: Makefile: do not use DISTFILES and DISTNAME to control WRKSRC. how about "WRKSRC=${WRKDIR}/${PORTNAME}-${PORTVERSION}"? So portlint says the exact opposite as your recommendation. Please clarify. Cheers, Keve
(In reply to keve from comment #10) > COPYING - if I leave it out the file is not copied and the build breaks. Remove it from pkg-plist too? > So portlint says the exact opposite as your recommendation. So?
To clarify, portlint is a linting tool that often gets things wrong. The Porter's Handbook specifically recommend setting DISTFILES in this case as well: From [1] Note: PKGNAMEPREFIX and PKGNAMESUFFIX do not affect DISTNAME. Also note that if WRKSRC is equal to ${WRKDIR}/${DISTNAME} while the original source archive is named something other than ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}, leave DISTNAME alone— defining only DISTFILES is easier than both DISTNAME and WRKSRC (and possibly EXTRACT_SUFX). [1] https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-distfiles.html
Created attachment 200001 [details] apt-cacher-ng port shar file upstream 3.2/FreeBSD 11.2-R-p4 and 12.0-RC2 Here are the changes implemented. Please file a bug report against portlint as you seem to have a point that it is getting things wrong. Having portlint report problems that should be ignored renders it useless.
Created attachment 200002 [details] apt-cacher-ng.diff With respect to hier(7), I think a more appropriate place for the files in lib/apt-cacher-ng would be ${DATADIR} (share/apt-cacher-ng) or libexec/apt-cacher-ng. Is it ok if we set LIBDIR to something else or will it break at runtime?
+%%ETCDIR%%/backends_debian +%%ETCDIR%%/backends_freebsd +%%ETCDIR%%/backends_ubuntu Are these supposed to be user editable too?
Giving it back to the pool for lack of time. I might pick this up again over the holidays or next year if nobody takes it in the meantime.
On #14, I will give it a try. Generally speaking it should be possible. On #15, Yes, these are first class configurable files. In fact these are the files with which the administrator can set his preference on which particular upstream mirror to fetch distribution files from. They are pre-populated with sensible defaults. On #16, this is a pity, I hope it will not take another 2 years until it is picked up again. shar -> diff any reason why? I can certainly submit diffs from now on as well.
(In reply to keve from comment #17) If you can run this port through the standard QA processes/tools (at least portlint and poudriere), and confirm that it passesd, it will go a long way to signaling that it's ready to commit. For details and instructions see: https://www.freebsd.org/doc/en/books/porters-handbook/testing.html If you need any help, #freebsd-ports on freenode IRC :)
(In reply to keve from comment #17) > shar -> diff any reason why? I can certainly submit diffs from now on as well. We use SVN as our VCS and when I prep it for commit running 'svn diff' is much easier than creating a shar. You are free to submit new ports either as a shar or as a unified diff. In the interest of committing this now rather than delaying it longer, I removed the SSL option and made it mandatory since the port was failing to build when I disabled it: source/acngtool.cc:565:7: error: use of undeclared identifier 'm_ssl' m_ssl = nullptr; ^
A commit references this bug: Author: tobik Date: Tue Dec 25 08:03:15 UTC 2018 New revision: 488298 URL: https://svnweb.freebsd.org/changeset/ports/488298 Log: New port: www/apt-cacher-ng apt-cacher-ng is a caching http/s proxy specialized in handling distribution websites. Originating from Debian it can be used to cache package retrieval for other distributions as well. The port includes support to add FreeBSD distribution specifics to apt-cacher-ng. WWW: https://www.unix-ag.uni-kl.de/~bloch/acng/ PR: 212097 Submitted by: keve@keve.hu Changes: head/www/Makefile head/www/apt-cacher-ng/ head/www/apt-cacher-ng/Makefile head/www/apt-cacher-ng/distinfo head/www/apt-cacher-ng/files/ head/www/apt-cacher-ng/files/apt_cacher_ng.in head/www/apt-cacher-ng/files/backends_debian.in head/www/apt-cacher-ng/files/backends_freebsd.in head/www/apt-cacher-ng/files/backends_ubuntu.in head/www/apt-cacher-ng/files/freebsd_mirrors.in head/www/apt-cacher-ng/files/patch-CMakeLists.txt head/www/apt-cacher-ng/files/patch-client_CMakeLists.txt head/www/apt-cacher-ng/files/patch-conf_acng.conf.in head/www/apt-cacher-ng/files/patch-fs_CMakeLists.txt head/www/apt-cacher-ng/files/patch-oldssl-workaround_CMakeLists.txt head/www/apt-cacher-ng/files/patch-source_CMakeLists.txt head/www/apt-cacher-ng/files/patch-source_acfg__defaults.cc head/www/apt-cacher-ng/files/pkg-message.in head/www/apt-cacher-ng/pkg-descr head/www/apt-cacher-ng/pkg-plist