aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1995-04-09 17:59:42 +0800
committerasami <asami@FreeBSD.org>1995-04-09 17:59:42 +0800
commit5ce5cefa61aff16bd2bc869c25d47bd849edafcd (patch)
tree102b811aa304485814b672d29898217bb5755fa4 /Mk
parentb499e2583fffadcf3cc19de665317f366657b8be (diff)
downloadfreebsd-ports-graphics-5ce5cefa61aff16bd2bc869c25d47bd849edafcd.tar.gz
freebsd-ports-graphics-5ce5cefa61aff16bd2bc869c25d47bd849edafcd.tar.zst
freebsd-ports-graphics-5ce5cefa61aff16bd2bc869c25d47bd849edafcd.zip
Add support for categorized subdirectories for packages. By default,
all .tgz files go to /usr/ports/packages/.packages, and a relative symlink is created for every item in CATEGORIES...i.e., if "CATEGORIES = foo bar", then /usr/ports/packages/{foo,bar}/pkgname.tgz both point to /usr/ports/packages/.packages/pkgname.tgz. Suggested by: jkh
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk31
1 files changed, 25 insertions, 6 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 2bbb24be028..46776aad120 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -3,7 +3,7 @@
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
#
-# $Id: bsd.port.mk,v 1.131 1995/04/04 04:23:37 gpalmer Exp $
+# $Id: bsd.port.mk,v 1.132 1995/04/04 05:57:19 jkh Exp $
#
# Please view me with 4 column tabs!
@@ -267,8 +267,10 @@ MAINTAINER?= ports@FreeBSD.ORG
CATEGORIES?= orphans
KEYWORDS?= ${CATEGORIES}
+PKGREPOSITORYSUBDIR?= .package
+PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
.if exists(${PACKAGES})
-PKGFILE?= ${PACKAGES}/${PKGNAME}${PKG_SUFX}
+PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
.else
PKGFILE?= ${PKGNAME}${PKG_SUFX}
.endif
@@ -420,12 +422,29 @@ pre-package:
.if !target(package)
package: pre-package
-# Makes some gross assumptions about a fairly simple package with no
-# install, require or deinstall scripts. Override the arguments with
-# PKG_ARGS if your package is anything but run-of-the-mill.
- @if [ -d ${PKGDIR} ]; then \
+ @if [ -e ${PKGDIR}/PLIST ]; then \
${ECHO_MSG} "===> Building package for ${DISTNAME}"; \
+ if [ -d ${PACKAGES} ]; then \
+ if [ ! -d ${PKGREPOSITORY} ]; then \
+ if ! mkdir -p ${PKGREPOSITORY}; then \
+ ${ECHO_MSG} ">> Can't create directory ${PKGREPOSITORY}."; \
+ exit 1; \
+ fi; \
+ fi; \
+ fi; \
${PKG_CMD} ${PKG_ARGS} ${PKGFILE}; \
+ if [ -d ${PACKAGES} ]; then \
+ rm -f ${PACKAGES}/*/${PKGNAME}${PKG_SUFX}; \
+ for cat in ${CATEGORIES}; do \
+ if [ ! -d ${PACKAGES}/$$cat ]; then \
+ if ! mkdir -p ${PACKAGES}/$$cat; then \
+ ${ECHO_MSG} ">> Can't create directory ${PACKAGES}/$$cat."; \
+ exit 1; \
+ fi; \
+ fi; \
+ ln -s ../${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PACKAGES}/$$cat; \
+ done; \
+ fi; \
fi
.endif