Date: Sat, 9 Nov 1996 06:17:13 -0800 (PST) From: asami@freebsd.org (Satoshi Asami) To: ports@freebsd.org Subject: Please review and test: new bsd.port.mk Message-ID: <199611091417.GAA19798@baloon.mimi.com>
next in thread | raw e-mail | index | archive | help
Ok, here are some fairly large scale changes to bsd.port.mk that I've been testing for awhile. (I've built literally hundreds of packages with these so they should mostly be ok :). Please test and comment. Highlights: (1) There is no default "orphans" for CATEGORIES, it simply fails if you have a Makefile without one. I really don't know why we did it that way to begin with! (2) Fix case when user had DISTDIR defined elsewhere and DIST_SUBDIR is also defined. (Submitted by: max) (3) Add several popular master sites as variables. See print/lout/Makefile for usage. :) One nice thing this enables the user to do is to define the nearest mirror site in /etc/make.conf. This is especially useful for continents without a full FreeBSD master site. Eventually, we will probably split this into a separate file (bsd.port.sites.mk?), and add some more sites from all corners of the world. (4) COMPRESS_MAN command alias is replaced by MAN[1-9LN] variables. You just say "MAN1=foo.1 bar.1" and the make rules will automatically compress it for you if necessary. (Idea by: obrien) (5) New "distclean" target to delete distfile too. (Submitted by: obrien) (6) Chained dependency cleaning, can be turned off by NOCLEANDEPENDS. Or should I reverse the logic an not make it the defaut, turned on by CLEANDEPENDS? Satoshi ------- Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v retrieving revision 1.228 diff -u -r1.228 bsd.port.mk --- bsd.port.mk 1996/11/03 07:51:59 1.228 +++ bsd.port.mk 1996/11/09 13:58:13 @@ -47,8 +47,7 @@ # XMKMF - Set to path of `xmkmf' if not in $PATH (default: xmkmf -a ). # MAINTAINER - The e-mail address of the contact person for this port # (default: ports@FreeBSD.ORG). -# CATEGORIES - A list of descriptive categories into which this port falls -# (default: orphans). +# CATEGORIES - A list of descriptive categories into which this port falls. # # Variables that typically apply to an individual port. Non-Boolean # variables without defaults are *mandatory*. @@ -253,7 +252,10 @@ .endif LOCALBASE?= /usr/local X11BASE?= /usr/X11R6 -DISTDIR?= ${PORTSDIR}/distfiles/${DIST_SUBDIR} +DISTDIR?= ${PORTSDIR}/distfiles/ +.if defined(DIST_SUBDIR) +DISTDIR:= ${DISTDIR}/${DIST_SUBDIR} +.endif PACKAGES?= ${PORTSDIR}/packages TEMPLATES?= ${PORTSDIR}/templates .if !defined(NO_WRKDIR) @@ -370,11 +372,6 @@ ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} INSTALL_MAN= \ ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} -.if defined(NOMANCOMPRESS) -COMPRESS_MAN= @${DO_NADA} -.else -COMPRESS_MAN= gzip -9nf -.endif # The user can override the NO_PACKAGE by specifying this from # the make command line @@ -417,11 +414,15 @@ SETENV?= /usr/bin/env RM?= /bin/rm MKDIR?= /bin/mkdir -p -GZCAT?= /usr/bin/gzcat +RMDIR?= /bin/rmdir +AWK?= /usr/bin/awk BASENAME?= /usr/bin/basename -SED?= /usr/bin/sed +FALSE?= /usr/bin/false GREP?= /usr/bin/grep -AWK?= /usr/bin/awk +GZCAT?= /usr/bin/gzcat +GZIP?= -9 +GZIP_CMD?= /usr/bin/gzip -nf ${GZIP} +SED?= /usr/bin/sed # Used to print all the '===>' style prompts - override this to turn them off. ECHO_MSG?= ${ECHO} @@ -434,6 +435,30 @@ MASTER_SITE_OVERRIDE= ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ .endif +# Popular master sites +MASTER_SITE_XCONTRIB?= \ + ftp://ftp.x.org/contrib/${MASTER_SITE_SUBDIR}/ \ + ftp://crl.dec.com/pub/X11/contrib/${MASTER_SITE_SUBDIR}/ + +MASTER_SITE_GNU?= \ + ftp://prep.ai.mit.edu/pub/gnu/${MASTER_SITE_SUBDIR}/ \ + ftp://wuarchive.wustl.edu/systems/gnu/${MASTER_SITE_SUBDIR}/ + +MASTER_SITE_PERL_CPAN?= \ + ftp://ftp.digital.com/pub/plan/perl/CPAN/modules/by-module/${MASTER_SITE_SUBDIR}/ \ + ftp://ftp.cdrom.com/pub/perl/CPAN/modules/by-module/${MASTER_SITE_SUBDIR}/ + +MASTER_SITE_TEX_CTAN?= \ + ftp://ftp.cdrom.com/pub/tex/ctan/${MASTER_SITE_SUBDIR}/ \ + ftp://wuarchive.wustl.edu/packages/TeX/${MASTER_SITE_SUBDIR}/ \ + ftp://ftp.funet.fi/pub/TeX/CTAN/${MASTER_SITE_SUBDIR}/ \ + ftp.tex.ac.uk/public/ctan/tex-archive/${MASTER_SITE_SUBDIR}/ + +MASTER_SITE_SUNSITE?= \ + ftp://sunsite.unc.edu/pub/Linux/${MASTER_SITE_SUBDIR}/ \ + ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/${MASTER_SITE_SUBDIR}/ \ + ftp://ftp://ftp.funet.fi/pub/mirrors/sunsite.unc.edu/pub/Linux/${MASTER_SITE_SUBDIR}/ + # Empty declaration to avoid "variable MASTER_SITES recursive" error MASTER_SITES?= PATCH_SITES?= @@ -467,7 +492,12 @@ # Documentation MAINTAINER?= ports@FreeBSD.ORG -CATEGORIES?= orphans + +.if !defined(CATEGORIES) +.BEGIN: + @${ECHO_MSG} "CATEGORIES is mandatory." + @${FALSE} +.endif # Note this has to start with a capital letter (or more accurately, it # shouldn't match "[a-z]*"), see the target "delete-package-links" below. @@ -486,6 +516,22 @@ HAS_CONFIGURE= yes .endif +MANPREFIX?= ${PREFIX} + +.for sect in 1 2 3 4 5 6 7 8 9 +.if defined(MAN${sect}) +_MANPAGES+= ${MAN${sect}:S.^.man/${MANLANG}/man${sect}/.} +.endif +.endfor + +.if defined(MANL) +_MANPAGES+= ${MANL:S.^.man/${MANLANG}/manl/.} +.endif + +.if defined(MANN) +_MANPAGES+= ${MANN:S.^.man/${MANLANG}/mann/.} +.endif + .MAIN: all ################################################################ @@ -889,7 +935,12 @@ X11BASE=${X11BASE} \ /bin/sh ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \ fi -.if make(real-install) && !defined(NO_PKG_REGISTER) +.if make(real-install) && defined(_MANPAGES) && !defined(NOMANCOMPRESS) +.for manpage in ${_MANPAGES} + ${GZIP_CMD} ${MANPREFIX}/${manpage} +.endfor +.endif +.if make(real-install) && !defined(NO_PKG_REGISTER) @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fake-pkg .endif .if !make(real-fetch) \ @@ -1015,6 +1066,9 @@ .if !target(clean) clean: pre-clean +.if !defined(NOCLEANDEPENDS) + @${MAKE} clean-depends +.endif @${ECHO_MSG} "===> Cleaning for ${PKGNAME}" .if !defined(NO_WRKDIR) @${RM} -rf ${WRKDIR} @@ -1023,6 +1077,21 @@ .endif .endif +.if !target(pre-distclean) +pre-distclean: + @${DO_NADA} +.endif + +.if !target(distclean) +distclean: pre-distclean clean + @${ECHO_MSG} "===> Dist cleaning for ${PKGNAME}" + @(cd ${DISTDIR}; \ + ${RM} -f ${DISTFILES} ${PATCHFILES}) +.if defined(DIST_SUBDIR) + @${RMDIR} ${DISTDIR} +.endif +.endif + # Prints out a list of files to fetch (useful to do a batch fetch) .if !target(fetch-list) @@ -1254,11 +1323,25 @@ .endif +.if !target(clean-depends) +clean-depends: + -@for i in ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}; do \ + dir=`${ECHO} $$i | ${SED} -e 's/.*://'`; \ + (cd $$dir; ${MAKE} clean); \ + done + -@for dir in ${DEPENDS}; do \ + (cd $$dir; ${MAKE} clean); \ + done +.endif + .if !target(depends-list) depends-list: - @for i in ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${DEPENDS}; do \ + @for i in ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}; do \ dir=`${ECHO} $$i | ${SED} -e 's/.*://'`; \ - (cd $$dir ; ${MAKE} package-name depends-list); \ + (cd $$dir; ${MAKE} package-name depends-list); \ + done + @for dir in ${DEPENDS}; do \ + (cd $$dir; ${MAKE} package-name depends-list); \ done .endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611091417.GAA19798>