Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
please welcome bsd.pkgng.mk
Baptiste Daroussin committed 15 years ago
commit ff858bf34ddf2491def496d85b3540380fbb016e
parent 87440fe899c485eaeee96fbd160b45bfe56ab321
2 files changed +89 -115
added ports/bsd.pkgng.mk
@@ -0,0 +1,89 @@
+
PKGPREINSTALL?=		${PKGDIR}/pkg-pre-install
+
PKGPOSTINSTALL?=	${PKGDIR}/pkg-post-install
+
PKGPREDEINSTALL?=	${PKGDIR}/pkg-pre-deinstall
+
PKGPOSTDEINSTALL?=	${PKGDIR}/pkg-post-deinstall
+
PKGPREUPGRADE?=		${PKGDIR}/pkg-pre-upgrade
+
PKGPOSTUPGRADE?=	${PKGDIR}/pkg-post-upgrade
+
PKGUPGRADE?=		${PKGDIR}/pkg-upgrade
+

+
ACTUAL-PACKAGE-DEPENDS?= \
+
	if [ "${_LIB_RUN_DEPENDS}" != "  " ]; then \
+
		for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
+
			pkgname=$$(${PKG_INFO} -q $${dir\#\#${PORTSDIR}/}); \
+
			${ECHO_CMD} $$pkgname:$${dir\#\#${PORTSDIR}/}; \
+
			for pkg in $$(${PKG_INFO} -qd $${dir\#\#${PORTSDIR}/}); do\
+
				origin=$$(${PKG_INFO} -qo $${pkg%-*}); \
+
				${ECHO_CMD} $$pkg:$$origin; \
+
			done; \
+
		done; \
+
	fi
+

+
.if !defined(PKG_ARGS)
+
PKG_ARGS=		-v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} actual-package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u -t : -k 2`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
+
.if !defined(NO_MTREE)
+
PKG_ARGS+=		-m ${MTREE_FILE}
+
.endif
+
.if defined(PKGORIGIN)
+
PKG_ARGS+=		-o ${PKGORIGIN}
+
.endif
+
.if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS)
+
PKG_ARGS+=		-C "${CONFLICTS}"
+
.endif
+
.if defined(CONFLICTS_INSTALL) && !defined(DISABLE_CONFLICTS)
+
PKG_ARGS+=		-C "${CONFLICTS_INSTALL}"
+
.endif
+
PKG_ARGS+= -n ${PKGNAME}
+
.if defined(MAINTAINER)
+
PKG_ARGS+= -r ${MAINTAINER}
+
.endif
+
.if defined(WWW)
+
PKG_ARGS+= -w ${WWW}
+
.endif
+
.if exists(${PKGMESSAGE})
+
PKG_ARGS+= -M ${PKGMESSAGE}
+
.endif
+
.if exists(${PKGINSTALL})
+
PKGSCRIPTS+=	${PKGINSTALL}
+
.endif
+
.if exists(${PKGPREINSTALL})
+
PKGSCRIPTS+=	${PKGPREINSTALL}
+
.endif
+
.if exists(${PKGPOSTINSTALL})
+
PKGSCRIPTS+=	${PKGPOSTINSTALL}
+
.endif
+
.if exists(${PKGDEINSTALL})
+
PKGSCRIPTS+=	${PKGDEINSTALL}
+
.endif
+
.if exists(${PKGPREDEINSTALL})
+
PKGSCRIPTS+=	${PKGPREDEINSTALL}
+
.endif
+
.if exists(${PKGPOSTDEINSTALL})
+
PKGSCRIPTS+=	${PKGPOSTDEINSTALL}
+
.endif
+
.if exists(${PKGUPGRADE})
+
PKGSCRIPTS+=	${PKGUPGRADE}
+
.endif
+
.if exists(${PKGPREUPGRADE})
+
PKGSCRIPTS+=	${PKGPREUPGRADE}
+
.endif
+
.if exists(${PKGPOSTUPGRADE})
+
PKGSCRIPTS+=	${PKGPOSTUPGRADE}
+
.endif
+
.if defined(PKGSCRIPTS)
+
PKG_ARGS+=	-s "${PKGSCRIPTS}"
+
.endif
+
.endif
+

+
.if !target(fake-pkg)
+
fake-pkg:
+
.if !defined(NO_PKG_REGISTER)
+
	@${ECHO_MSG} "===>   Registering installation for ${PKGNAME}"
+
.if defined(FORCE_PKG_REGISTER)
+
	@${PKG_CMD} ${PKG_ARGS} -F
+
.else
+
	@${PKG_CMD} ${PKG_ARGS}
+
.endif
+
.else
+
	@${DO_NADA}
+
.endif
+
.endif
deleted ports/bsd.port.mk.patch
@@ -1,115 +0,0 @@
-
--- /usr/ports/Mk/bsd.port.mk.orig	2010-12-29 08:14:56.000000000 +0100
-
+++ /usr/ports/Mk/bsd.port.mk	2011-01-27 10:34:48.075978090 +0100
-
@@ -2476,8 +2476,15 @@
-
 
-
 DESCR?=			${PKGDIR}/pkg-descr
-
 PLIST?=			${PKGDIR}/pkg-plist
-
+PKGPREINSTALL?=	${PKGDIR}/pkg-pre-install
-
+PKGPOSTINSTALL?=	${PKGDIR}/pkg-post-install
-
 PKGINSTALL?=	${PKGDIR}/pkg-install
-
+PKGPREDEINSTALL?=	${PKGDIR}/pkg-pre-deinstall
-
+PKGPOSTDETINSTALL?=	${PKGDIR}/pkg-post-deinstall
-
 PKGDEINSTALL?=	${PKGDIR}/pkg-deinstall
-
+PKGPREUPGRADE?=	${PKGDIR}/pkg-pre-upgrade
-
+PKGPOSTUPGRADE?=	${PKGDIR}/pkg-post-upgrade
-
+PKGUPGRADE?=	${PKGDIR}/pkg-upgrade
-
 PKGREQ?=		${PKGDIR}/pkg-req
-
 PKGMESSAGE?=	${PKGDIR}/pkg-message
-
 
-
@@ -2493,6 +2500,48 @@
-
 
-
 .if !defined(PKG_ARGS)
-
 PKG_ARGS=		-v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} actual-package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u -t : -k 2`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
-
+.if defined(PKGNG)
-
+PKG_ARGS+= -n ${PKGNAME}
-
+.if defined(MAINTAINER)
-
+PKG_ARGS+= -r ${MAINTAINER}
-
+.endif
-
+.if defined(WWW)
-
+PKG_ARGS+= -w ${WWW}
-
+.endif
-
+.if exists(${PKGMESSAGE})
-
+PKG_ARGS+= -M ${PKGMESSAGE}
-
+.endif
-
+.if exists(${PKGINSTALL})
-
+PKGSCRIPTS+=	${PKGINSTALL}
-
+.endif
-
+.if exists(${PKGPREINSTALL})
-
+PKGSCRIPTS+=	${PKGPREINSTALL}
-
+.endif
-
+.if exists(${PKGPOSTINSTALL})
-
+PKGSCRIPTS+=	${PKGPOSTINSTALL}
-
+.endif
-
+.if exists(${PKGDEINSTALL})
-
+PKGSCRIPTS+=	${PKGDEINSTALL}
-
+.endif
-
+.if exists(${PKGPREDEINSTALL})
-
+PKGSCRIPTS+=	${PKGPREDEINSTALL}
-
+.endif
-
+.if exists(${PKGPOSTDEINSTALL})
-
+PKGSCRIPTS+=	${PKGPOSTDEINSTALL}
-
+.endif
-
+.if exists(${PKGUPGRADE})
-
+PKGSCRIPTS+=	${PKGUPGRADE}
-
+.endif
-
+.if exists(${PKGPREUPGRADE})
-
+PKGSCRIPTS+=	${PKGPREUPGRADE}
-
+.endif
-
+.if exists(${PKGPOSTUPGRADE})
-
+PKGSCRIPTS+=	${PKGPOSTUPGRADE}
-
+.endif
-
+.if defined(PKGSCRIPTS)
-
+PKG_ARGS+=	-s "${PKGSCRIPTS}"
-
+.endif
-
+.endif
-
 .if !defined(NO_MTREE)
-
 PKG_ARGS+=		-m ${MTREE_FILE}
-
 .endif
-
@@ -5552,6 +5601,7 @@
-
 		fi; \
-
 	done
-
 
-
+.if !defined(PKGNG)
-
 ACTUAL-PACKAGE-DEPENDS?= \
-
 	if [ "${_LIB_RUN_DEPENDS}" != "  " ]; then \
-
 		origins=$$(for pkgname in ${PKG_DBDIR}/*; do \
-
@@ -5581,6 +5631,19 @@
-
 		done; \
-
 		[ -z "$$packagelist" ] || ${AWK} -F '( |:)' 'BEGIN { pkgname="broken_contents" } /@pkgdep / { pkgname=$$2 } /@comment DEPORIGIN:/ { printf "%s:%s\n", pkgname, $$3; pkgname="broken_contents" }' $$packagelist; \
-
 	fi
-
+.else
-
+ACTUAL-PACKAGE-DEPENDS?= \
-
+	if [ "${_LIB_RUN_DEPENDS}" != "  " ]; then \
-
+		for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
-
+			pkgname=$$(${PKG_INFO} -q $${dir\#\#${PORTSDIR}/}); \
-
+			${ECHO_CMD} $$pkgname:$${dir\#\#${PORTSDIR}/}; \
-
+			for pkg in $$(${PKG_INFO} -qd $${dir\#\#${PORTSDIR}/}); do\
-
+				origin=$$(${PKG_INFO} -qo $${pkg%-*}); \
-
+				${ECHO_CMD} $$pkg:$$origin; \
-
+			done; \
-
+		done; \
-
+	fi
-
+.endif
-
 
-
 # Print out package names.
-
 
-
@@ -5993,6 +6056,7 @@
-
 	fi
-
 	@${RM} -rf ${PKG_DBDIR}/${PKGNAME}
-
 .endif
-
+.if !defined(PKGNG)
-
 	@if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \
-
 		${ECHO_MSG} "===>   Registering installation for ${PKGNAME}"; \
-
 		${MKDIR} ${PKG_DBDIR}/${PKGNAME}; \
-
@@ -6031,6 +6095,11 @@
-
 		${RM} -f /tmp/${PKGNAME}-required-by; \
-
 	fi
-
 .else
-
+	@${ECHO_MSG} "===>   Registering installation for ${PKGNAME}"
-
+
-
+	@${PKG_CMD} ${PKG_ARGS}
-
+.endif
-
+.else
-
 	@${DO_NADA}
-
 .endif
-
 .endif