File:  [DragonFly] / src / share / mk / Attic / bsd.port.mk
Revision 1.23: download - view: text, annotated - select for diffs
Sun Nov 28 22:29:19 2004 UTC (9 years, 10 months ago) by joerg
Branches: MAIN
CVS tags: HEAD
Allow "make index" to actually by fixing lots of smaller glitches all over
the (dfports) tree.

- PORTSDIR must be kept for bsd.port.pre.mk, because it is used to include
  e.g. bsd.python.mk
- The DFPORTS_WARNING change didn't work as intended and neither did the
  old version. We want be quiet about redirections if we have any of the
  special targets to process (like describe), which does include the
  output of the cd command. We also want to define the .BEGIN rule only
  once. This is now protected by the better named _DFPORTS_REDIRECT
- Define another bunch of variables, normally provided by bsd.port.mk.
  This should fix the mysterious warnings encountered.

# $FreeBSD: src/share/mk/bsd.port.mk,v 1.303.2.2 2002/07/17 19:08:23 ru Exp $
# $DragonFly: src/share/mk/bsd.port.mk,v 1.23 2004/11/28 22:29:19 joerg Exp $

PORTSDIR?=	/usr/ports
DFPORTSDIR?=	/usr/dfports
PORTPATH!=	/usr/bin/relpath ${PORTSDIR} ${.CURDIR}

.if !defined(DFOSVERSION)
DFOSVERSION!=	/sbin/sysctl -n kern.osreldate
.endif

# Temporary Hack
#
OSVERSION ?= 480102
UNAME_s?= FreeBSD
UNAME_v?=FreeBSD 4.8-CURRENT
UNAME_r?=4.8-CURRENT

.makeenv UNAME_s
.makeenv UNAME_v
.makeenv UNAME_r
.makeenv OSVERSION

.if !exists(${DFPORTSDIR}/${PORTPATH}/Makefile)

.if defined(USE_RC_SUBR)
.undef USE_RC_SUBR
RC_SUBR=	/etc/rc.subr
.endif

.if defined(USE_GCC)
.  if ${USE_GCC} == 3.4
.undef USE_GCC
CCVER=	gcc34
.makeenv CCVER
.  endif
.endif

# If the port does not exist in /usr/dfports/<portpath> use the original
# FreeBSD port.  Also process as per normal if BEFOREPORTMK is set so
# any expected variables are set.
#
.include <bsd.own.mk>
.include "${PORTSDIR}/Mk/bsd.port.mk"

.else

.if !defined(BEFOREPORTMK)
.undef PORTSDIR
.endif

.undef BEFOREPORTMK
.undef AFTERPORTMK

# Otherwise retarget to the DragonFly override port.
#

TARGETS+=	all
TARGETS+=	build
TARGETS+=	checksum
TARGETS+=	clean
TARGETS+=	clean-for-cdrom
TARGETS+=	clean-for-cdrom-list
TARGETS+=	clean-restricted
TARGETS+=	clean-restricted-list
TARGETS+=	configure
TARGETS+=	deinstall
TARGETS+=	depend
TARGETS+=	depends
TARGETS+=	describe
TARGETS+=	distclean
TARGETS+=	extract
TARGETS+=	fetch
TARGETS+=	fetch-list
TARGETS+=	ignorelist
TARGETS+=	makesum
TARGETS+=	maintainer
TARGETS+=	package
TARGETS+=	realinstall
TARGETS+=	reinstall
TARGETS+=	install
TARGETS+=	tags

.if !defined(_DFPORTS_REDIRECT)
_DFPORTS_REDIRECT=
.if !make(package-depends-list) && !make(all-depends-list) && \
    !make(run-depends-list) && !make(build-depends-list) && \
    !make(describe)
.BEGIN:
	@echo "WARNING, USING DRAGONFLY OVERRIDE ${DFPORTSDIR}/${PORTPATH}"
	cd ${DFPORTSDIR}/${PORTPATH} && ${MAKE} -B ${.TARGETS}
.else
.BEGIN:
	@cd ${DFPORTSDIR}/${PORTPATH} && ${MAKE} -B ${.TARGETS} 
.endif
.endif

.if !empty(.TARGETS)
${.TARGETS}:
.else
all:
.MAIN: all
.endif

# Hack to get Makefiles with conditional statements working
XFREE86_VERSION?=	4
ARCH?=			i386
MACHINE_ARCH?=		i386
HAVE_GNOME?=
FILESDIR?=		${.CURDIR}/files
X_WINDOW_SYSTEM?=	xfree86-4
CAT?=			cat
PREFIX?=		/usr
PERL_LEVEL?=		5
LOCALBASE?=		/usr/local
SED?=			/usr/bin/sed
ECHO_CMD?=		echo
GREP?=			/usr/bin/grep
AWK?=			/usr/bin/awk
UNAME?=			/usr/bin/uname
EXPR?=			/bin/expr
HAVE_SDL?=

# WORKAROUND to get portupgrade working
# Taken from: ${PORTSDIR}/Mk/bsd.port.mk
.if !defined(PKGNAME)
PKGNAME=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
.endif
 
.endif