Annotation of pkgsrc/pkgtools/pkg_install/Makefile, Revision 1.179
1.179 ! joerg 1: # $NetBSD: Makefile,v 1.178 2010/04/15 22:25:11 tron Exp $
1.4 hubertf 2:
1.58 schmonz 3: # Notes to package maintainers:
1.57 hubertf 4: #
1.58 schmonz 5: # Updating this package does not automatically necessitate bumping
6: # PKGTOOLS_REQD in bsd.pkg.mk. Do so if and only if there is a critical
7: # change in the pkg_* tools that pkgsrc relies on for proper operation.
1.57 hubertf 8:
1.58 schmonz 9: DISTNAME= pkg_install-${VERSION}
1.1 agc 10: CATEGORIES= pkgtools
1.58 schmonz 11: MASTER_SITES= # empty
12: DISTFILES= # empty
1.1 agc 13:
1.169 joerg 14: OWNER= joerg@NetBSD.org
1.82 reed 15: HOMEPAGE= http://www.pkgsrc.org/
1.90 grant 16: COMMENT= Package management and administration tools for pkgsrc
1.163 wiz 17: LICENSE= modified-bsd
1.60 schmonz 18:
1.133 joerg 19: PKG_DESTDIR_SUPPORT= user-destdir
1.155 joerg 20: BOOTSTRAP_PKG= yes
1.164 joerg 21: SKIP_LICENSE_CHECK= yes
1.133 joerg 22:
1.132 adrianp 23: CONFLICTS+= audit-packages-[0-9]*
24:
1.115 rillig 25: GNU_CONFIGURE= yes
1.141 jlam 26: CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
1.168 jmmv 27: CONFIGURE_ARGS+= --with-pkgdbdir=${PKG_DBDIR:Q}
1.113 jlam 28:
1.142 jlam 29: USE_FEATURES= nbcompat
30:
1.159 joerg 31: NBCOMPAT_CONFIGURE_ARGS+= --enable-bsd-getopt --enable-db
1.148 joerg 32:
1.121 erh 33: SKIP_AUDIT_PACKAGES= yes
1.122 rillig 34: NO_PKGTOOLS_REQD_CHECK= yes
35: PKG_PRESERVE= yes
1.144 joerg 36: CHECK_PERMS= no
1.1 agc 37:
1.97 jlam 38: # These are needed to solve a chicken-and-egg problem where pkgsrc uses
1.96 jlam 39: # newer features of pkg_install, but older NetBSD installations won't
40: # support them. In this case, we explicitly use the native GCC
41: # compiler to avoid problems with depending on pkgsrc GCC for building
1.128 jlam 42: # pkg_install.
1.117 jlam 43: #
1.147 joerg 44: # We also use the newly built pkg_{add,create,delete} since upgrading
45: # from an older pkg_install might required features of the new program.
1.159 joerg 46: #
1.156 joerg 47: # Note that the definitions are only overriden for the phases that are
48: # supposed to use them. pkg_admin pmatch might be used when looking for
49: # dependencies. If that is ever changed in a incompatible way, this has to
50: # be rethought.
1.96 jlam 51: USE_NATIVE_GCC= yes
1.156 joerg 52:
53: .if defined(_PKGSRC_BARRIER)
1.147 joerg 54: PKG_ADD_CMD= ${WRKSRC}/add/pkg_add
55: PKG_CREATE_CMD= ${WRKSRC}/create/pkg_create
56: PKG_DELETE_CMD= ${WRKSRC}/delete/pkg_delete
1.149 jlam 57: PKG_INFO_CMD= ${WRKSRC}/info/pkg_info
1.154 he 58: .endif
1.89 grant 59:
1.139 joerg 60: CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES
61: CPPFLAGS+= -D_FILE_OFFSET_BITS=64
62:
1.100 tv 63: CPPFLAGS+= -DDEF_UMASK=${DEF_UMASK}
64:
1.122 rillig 65: MAKE_ENV+= MACHINE_ARCH=${MACHINE_ARCH:Q}
66: MAKE_ENV+= OPSYS=${OPSYS:Q}
1.91 grant 67:
1.92 jlam 68: PKG_DBDIR?= /var/db/pkg
1.132 adrianp 69: EGDIR= ${PREFIX}/share/examples/pkg_install
1.92 jlam 70:
1.122 rillig 71: PLIST_SUBST+= PKG_DBDIR=${PKG_DBDIR:Q}
1.117 jlam 72:
1.125 jlam 73: DEINSTALL_SRC= # empty
1.124 jlam 74: INSTALL_SRC= ${PKGDIR}/INSTALL
75: FILES_SUBST+= PKG_DBDIR=${PKG_DBDIR:Q} \
76: PKG_TOOLS_BIN=${PKG_TOOLS_BIN:Q} \
77: MKDIR=${MKDIR:Q}
1.132 adrianp 78: MESSAGE_SUBST+= PKGVULNDIR=${PKG_DBDIR:Q} \
79: EGDIR=${EGDIR:Q}
1.124 jlam 80:
1.92 jlam 81: .include "../../mk/bsd.prefs.mk"
82:
1.172 joerg 83: VERSION!= ${AWK} '/PKGTOOLS_VERSION/ {print $$3}' \
1.58 schmonz 84: ${FILESDIR}/lib/version.h
1.78 jlam 85:
1.177 joerg 86: # raw format appeared in libarchive 2.8.
87: BUILDLINK_API_DEPENDS.libarchive+= libarchive>=2.8.0
1.152 joerg 88:
1.137 joerg 89: .include "../../archivers/bzip2/builtin.mk"
90: .include "../../archivers/libarchive/builtin.mk"
91: .include "../../devel/zlib/builtin.mk"
1.159 joerg 92: .include "../../security/openssl/builtin.mk"
93:
1.171 joerg 94: .include "options.mk"
95:
1.159 joerg 96: .if !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
97: CONFIGURE_ARGS+= --with-ssl
98:
99: .include "../../security/openssl/buildlink3.mk"
100: .endif
1.137 joerg 101:
102: .if empty(USE_BUILTIN.bzip2:M[yY][eE][sS]) || \
103: empty(USE_BUILTIN.zlib:M[yY][eE][sS])
104: USE_BUILTIN.libarchive= no
105: .endif
106:
107: FILESDIR.bzip2?= ${.CURDIR}/../../archivers/bzip2/files
108: FILESDIR.libarchive?= ${.CURDIR}/../../archivers/libarchive/files
109: FILESDIR.zlib?= ${.CURDIR}/../../devel/zlib/files
1.150 joerg 110: FILESDIR.libfetch?= ${.CURDIR}/../../net/libfetch/files
1.137 joerg 111:
112: .if empty(USE_BUILTIN.bzip2:M[yY][eE][sS])
113: CPPFLAGS+= -I${WRKDIR}/bzip2
114: LDFLAGS+= -L${WRKDIR}/bzip2
115: .endif
116: .if empty(USE_BUILTIN.zlib:M[yY][eE][sS])
117: CPPFLAGS+= -I${WRKDIR}/zlib
118: LDFLAGS+= -L${WRKDIR}/zlib
119: .endif
120: .if empty(USE_BUILTIN.libarchive:M[yY][eE][sS])
121: CPPFLAGS+= -I${WRKDIR}/libarchive/libarchive
122: LDFLAGS+= -L${WRKDIR}/libarchive/.libs
1.174 joerg 123:
1.179 ! joerg 124: LIBARCHIVE_LIBS= ${SED} -n -e 's/^Libs://p' -e 's/^Libs.private://p' \
! 125: ${WRKDIR}/libarchive/build/pkgconfig/libarchive.pc 2>/dev/null || echo
! 126: LIBS+= ${LIBARCHIVE_LIBS:sh}
! 127:
1.174 joerg 128: CONFIG_GUESS_OVERRIDE+= ${WRKDIR}/libarchive/build/autoconf/config.guess
1.175 obache 129: CONFIG_SUB_OVERRIDE+= ${WRKDIR}/libarchive/build/autoconf/config.sub
1.174 joerg 130:
1.178 tron 131: . if ${OPSYS} == "Darwin"
132: # Make sure that the linker used our static library instead of the
133: # (outdated) dynamic library "/usr/lib/libarchive.dylib".
134: LDFLAGS+= -Wl,-search_paths_first
135: . endif
136:
1.174 joerg 137: # Hack to make sure that the libarchive version is replaced
1.175 obache 138: pre-configure: config-guess-override config-sub-override
1.179 ! joerg 139: .else
! 140: LIBS+= -larchive
1.137 joerg 141: .endif
1.150 joerg 142: CPPFLAGS+= -I${WRKDIR}/libfetch
143: LDFLAGS+= -L${WRKDIR}/libfetch
1.137 joerg 144:
1.179 ! joerg 145: CONFIGURE_ENV+= LIBS=${LIBS:Q}
! 146:
1.58 schmonz 147: do-extract:
1.107 tv 148: @${CP} -R ${FILESDIR} ${WRKSRC}
1.137 joerg 149: .if empty(USE_BUILTIN.bzip2:M[yY][eE][sS])
150: @${CP} -R ${FILESDIR.bzip2} ${WRKDIR}/bzip2
151: .endif
152: .if empty(USE_BUILTIN.zlib:M[yY][eE][sS])
153: @${CP} -R ${FILESDIR.zlib} ${WRKDIR}/zlib
154: .endif
155: .if empty(USE_BUILTIN.libarchive:M[yY][eE][sS])
156: @${CP} -R ${FILESDIR.libarchive} ${WRKDIR}/libarchive
157: .endif
1.150 joerg 158: @${CP} -R ${FILESDIR.libfetch} ${WRKDIR}/libfetch
1.137 joerg 159:
160: pre-configure:
161: .if empty(USE_BUILTIN.bzip2:M[yY][eE][sS])
162: cd ${WRKDIR}/bzip2 && ${BUILD_MAKE_CMD} libbz2.a
163: .endif
164: .if empty(USE_BUILTIN.zlib:M[yY][eE][sS])
165: cd ${WRKDIR}/zlib && ${BUILD_MAKE_CMD} libz.a
166: .endif
167: .if empty(USE_BUILTIN.libarchive:M[yY][eE][sS])
168: cd ${WRKDIR}/libarchive && \
169: ${SETENV} ${_CONFIGURE_SCRIPT_ENV} \
170: ${CONFIG_SHELL} ${CONFIG_SHELL_FLAGS} \
1.143 joerg 171: ./configure --disable-shared --disable-bsdtar \
1.173 joerg 172: --disable-bsdcpio --without-expat --without-xml2 \
1.179 ! joerg 173: --disable-dependency-tracking
1.137 joerg 174: cd ${WRKDIR}/libarchive && ${BUILD_MAKE_CMD}
175: .endif
1.151 joerg 176: cd ${WRKDIR}/libfetch && ${SETENV} ${MAKE_ENV} \
177: ${MAKE_PROGRAM} ${MAKE_FLAGS} ${BUILD_MAKE_FLAGS} \
178: -f ${MAKE_FILE} depend all
179:
1.12 hubertf 180:
1.106 erh 181: # XXX Reverse the order that update does things since
182: # XXX we need pkg_delete built before we can deinstall.
183: # XXX This should probably be the default order for all packages.
184: update:
185: ${MAKE}
1.127 jlam 186: ${MAKE} deinstall _UPDATE_RUNNING=YES
1.118 jlam 187: ${MAKE} ${UPDATE_TARGET}
1.108 jklos 188: ${MAKE} clean
1.106 erh 189:
1.170 joerg 190: update-catpages:
191: for f in lib/pkgsrc.7 add/pkg_add.1 admin/pkg_admin.1 \
192: create/pkg_create.1 delete/pkg_delete.1 info/pkg_info.1 \
193: lib/pkg_summary.5 lib/pkgsrc.7; do \
194: nroff -mdoc ${FILESDIR}/$$f > \
195: ${FILESDIR}/$${f%%.[157]}.cat; \
196: done
197: nroff -mdoc ${FILESDIR}/lib/pkg_install.conf.5.in > \
198: ${FILESDIR}/lib/pkg_install.conf.cat.in
199:
1.1 agc 200: .include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>