pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg Import the second part of a patch from Jo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/262f93b99331
branches:  trunk
changeset: 354329:262f93b99331
user:      khorben <khorben%pkgsrc.org@localhost>
date:      Thu Oct 27 00:24:58 2016 +0000

description:
Import the second part of a patch from John Marino

This:
- fixes the "/usr/ports" paths in code and man pages to
  ${PKGSRCDIR} (normal) or hardcoded to "/usr/pkgsrc" (future, its for
  builders like Synth and poudriere)
- changes default DB path from "/var/db/pkg" to "/var/db/pkgng". It
  seems the original default was too ambiguous as "pkg" is used
  everywhere in pkgsrc and it's the default format (not pkgng format)
- similarly, changes default CACHE patch from "/var/cache/pkg" to
  "/var/cache/pkgng"
- bumps PKGREVISION again

Another relevant comment from John and reworded by myself for context:
(all misquotings mine)

? Importantly, FreeBSD, NetBSD, and DragonFly all provide libarchive
in base. Therefore, this changes the port to use the base version when
available because the libarchive requirement is considered heavy. The
OpenSSL dependency brings a lot with, including perl. When trying to
update the bootstrap to build pkgng instead of pkg_* tools, it is
critical that the dependencies remain low. Other platforms will have
to suffer with the libarchive requirement if they want to use pkgng.

Following this, special linking code is needed for DragonFly since the
SSL libraries are now private. In fact, the only userland program
allowed to link with them is pkg(8) for bootstrapping reasons listed
above. ?

Thanks again!

diffstat:

 pkgtools/pkg/Makefile |  49 +++++++++++++++++++++++++++++++++++++++++++++++--
 pkgtools/pkg/PLIST    |   2 +-
 2 files changed, 48 insertions(+), 3 deletions(-)

diffs (84 lines):

diff -r 266bd84cb781 -r 262f93b99331 pkgtools/pkg/Makefile
--- a/pkgtools/pkg/Makefile     Thu Oct 27 00:06:54 2016 +0000
+++ b/pkgtools/pkg/Makefile     Thu Oct 27 00:24:58 2016 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.7 2016/10/27 00:06:54 khorben Exp $
+# $NetBSD: Makefile,v 1.8 2016/10/27 00:24:58 khorben Exp $
 
 DISTNAME=      pkg-1.8.7
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    pkgtools
 MASTER_SITES=  http://files.etoilebsd.net/pkg/
 EXTRACT_SUFX=  .tar.xz
@@ -51,10 +51,52 @@
 SUBST_SED.pkgconf-prefix+=     -e "s|/usr/local|${PREFIX}|g"
 SUBST_MESSAGE.pkgconf-prefix=  Correct the installation prefix in pkg.conf(5).
 
+SUBST_CLASSES+=        portsdir
+SUBST_STAGE.portsdir=          pre-install
+SUBST_FILES.portsdir=          libpkg/pkg_config.c \
+                               src/pkg.conf.sample \
+                               docs/pkg-create.8 \
+                               docs/pkg-set.8 \
+                               docs/pkg-repo.8 \
+                               docs/pkg.conf.5 \
+                               docs/pkg-version.8 \
+                               docs/pkg.8
+SUBST_SED.portsdir=            -e "s|/usr/ports|${PORTSDIR}|g" \
+                               -e "s|/var/db/pkg|/var/db/pkgng|g" \
+                               -e "s|/var/cache/pkg|/var/cache/pkgng|g"
+SUBST_MESSAGE.portsdir=                Correct reference to FreeBSD portsdir.
+
+.if defined(PACKAGE_BUILDING) # set by Synth which has custom location, so use default path
+PORTSDIR=      /usr/pkgsrc
+.else
+PORTSDIR=      ${PKGSRCDIR}
+.endif
+
+# DragonFly SSL libraries are private.  pkg(8) is the one exception of a userland
+# program that is allowed to link to them due to bootstrap reasons
+.if exists(/usr/lib/priv/libprivate_ssl.so)
+BUILDLINK_PASSTHRU_RPATHDIRS=  /lib/priv
+.endif
+
 post-patch:
        ${CP} ${FILESDIR}/readpassphrase_compat.h \
                ${WRKSRC}/src/
 
+# DragonFly SSL libraries are private.
+.if exists(/usr/lib/priv/libprivate_ssl.so)
+       ${SED} -i.bak \
+               -e 's|lssl|lprivate_ssl|' \
+               -e 's|lcrypto|lprivate_crypto|' \
+               -e 's|la_rpath = |la_rpath = -R/lib/priv |' \
+               ${WRKSRC}/libpkg/Makefile.in \
+               ${WRKSRC}/src/Makefile.in \
+               ${WRKSRC}/tests/Makefile.in
+       ${SED} -i.bak \
+               -e '/OS_CFLAGS=/ s|SOURCE|SOURCE -I/usr/include/priv|' \
+               -e '/OS_LDFLAGS=/ s|=|="-L/usr/lib/priv -R/lib/priv"|' \
+               ${WRKSRC}/configure
+.endif
+
 post-install:
        ${RM} ${DESTDIR}${PREFIX}/sbin/pkg2ng
        ${MV} ${DESTDIR}${PREFIX}/etc/bash_completion.d/_pkg.bash \
@@ -76,5 +118,8 @@
        ${MV} ${DESTDIR}${PREFIX}/etc/pkg.conf.sample \
                ${DESTDIR}${EGDIR}/pkg.conf.sample
 
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} != "FreeBSD" && ${OPSYS} != "DragonFly" && ${OPSYS} != "NetBSD"
 .include "../../archivers/libarchive/buildlink3.mk"
+.endif
 .include "../../mk/bsd.pkg.mk"
diff -r 266bd84cb781 -r 262f93b99331 pkgtools/pkg/PLIST
--- a/pkgtools/pkg/PLIST        Thu Oct 27 00:06:54 2016 +0000
+++ b/pkgtools/pkg/PLIST        Thu Oct 27 00:24:58 2016 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.4 2016/10/27 00:06:54 khorben Exp $
+@comment $NetBSD: PLIST,v 1.5 2016/10/27 00:24:58 khorben Exp $
 include/pkg.h
 lib/libpkg.la
 lib/libpkg_static.la



Home | Main Index | Thread Index | Old Index