the original logic went into a section of code assuming some
incarnation is there, but it's basically a "test -d" fix. Closes PR
ports/2082.
Reviewed by: max ("although I didn't test it, it looks fine")
(1) Change commented out MAINTAINER to FreeBSD_MAINTAINER and
OpenBSD_MAINTAINER. These are not comments anymore, so we may
even use it in the future.
(2) Instead of the ".if ${OPSYS} = "NetBSD" hack, use ".if exists()"
to find the location of md5 an tar. Play similar trick for fetch
(OpenBSD uses /usr/bin/ftp which groks http: addresses).
This commit includes most of the changes made in 1.242 (although many
of them are done differently after more discussion). One thing that
is conspicuously missing is NOMANCOMPRESS, which has been postponed
until Warner figures out what exactly the situation is on the OpenBSD
ports paradigm. (In a nutshell, we can't just define NOMANCOMPRESS in
this file even if uncompressed manpages is the default for OpenBSD,
because that will take away the ability of individual users to select
manpage compression.)
Reviewed by: imp@openbsd.org
and scripts/{pre,post}-* as environment vars. Also, if BATCH is
set, "BATCH=yes" is automatically added to SCRIPTS_ENV.
(Requested by: max)
(2) The INSTALL_* macros are added to SCRIPTS_ENV and MAKE_ENV as
BSD_INSTALL_*. (Requested by: obrien)
(3) New variable MOTIF_ONLY, which will only build ports with
REQUIRES_MOTIF defined. This doesn't do dependencies right (what
if the depended port doesn't need Motif) yet.
(4) Try not to clean the same port twice in clean-depends when (for
instance) it's defined in both BUILD_DEPENDS and INSTALL_DEPENDS.
Note that it won't check chained dependencies so you may still see
the same port cleaned multiple times, but checking that far will
surely make this run slower than the un-"optimized" case so I left
it as is. (Requested by: jkh)
(5) Ignore *.rej files in patches/ directory in addition to *~ and
*.orig.
Generalize the selection of programs to run based on the existance of files
rather than the OS names that we find. Add comments about me being the
keeper of the OpenBSD mods of this file. Use ftp on OpenBSD rather than
fetch since OpenBSD's FTP supports urls and there is no fetch.
Reviewed by: Joerge Wunch, Jordan Hubbard, and others in ports I've forgotten
Obtained from: OpenBSD with changes from me.
Add a little more sophistication to the md5 grep command.
Change the md5 checksum logic a bit. Now, the message is printed
out for every successfully/unsuccessfully matched checksum, and it
aborts at the end if there was a mismatch. Also, make missing checksum
and IGNORE file inconsistency fatal, as there is now no reason to have
a missing checksum.
(1) MANLANG is now a list (defaulting to ""), so if you have English
and Japanese-EUC versions of the manpages, you can say something
like `MANLANG= "" ja_JP.EUC' and manpage compression will DTRT.
(2) Add new variables MAN%cPREFIX (where %c=[1-9LN]) which default to
MANPREFIX (which defaults to PREFIX), to specify per-section
prefixes. In particular, this handles the cases in many perl
ports, which install man1pages into man/man1 and man3pages into
lib/perl5/man/man3.
Note these modifications won't change the behavior of existing
variables used in previously-approved ways, so any Makefile that
worked before will still continue to work.
(1) Print out reason when port is ignored because of NO_CDROM,
RESTRICTED, IS_INTERACTIVE, (not) IS_INTERACTIVE, BROKEN,
REQUIRES_MOTIF or NO_PACKAGE.
Submitted by: obrien
(2) Add new special file in pkg/: DISPLAY. (Cf. man pkg_create)
(3) Minor bugfix in clean-depends target, which sometimes executed
"make clean" in the current directory. (Which is probably ok, but
is wrong nonetheless.)
you have a Makefile without one.
(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. For instance,
MASTER_SITE_XCONTRIB is defined to be a list of X11R6 contrib sites,
which you can set MASTER_SITES to in your Makefile if you just
want ftp.x.org or any of the mirror sites.
There is also a new variable, MASTER_SITE_SUBDIR, to specify which
subdirectory of the master site your tarball is located.
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.
Right now, XCONTRIB, GNU, PERL_CPAN, TEX_CTAN, and SUNSITE are
supported.
(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.
Reviewed by: the ports list
Submitted by: Jason Thorpe <thorpej@nas.nasa.gov>
(2) Remove the bogus "CAT+=" definition. Closes PR ports/1703.
Submitted by: Peter Childs <pjchilds@imforei.apana.org.au>
(3) Change MKDIR to "/bin/mkdir -p", remove "-p" from ${MKDIR}
invocations. Closes PR ports/1901.
Submitted by: obrien
(4) Add a new macro variable COMPRESS_MAN, which will evaluate to gzip
if NOMANCOMPRESS isn't set (default), or true if it is.
(5) Add a new variable NO_CHECKSUM, which will disable the md5 checksum.
Submitted by: jkh
(6) Also, move NO_PATCH and NO_PACKAGE checks to right place in
invocation order.
(7) Check for LIB_DEPENDS before installation too. (It used to check
only before extraction.)
Forgotten a long time ago by: asami
Submitted by: max
While I'm here, add "${DIST_SUBDIR}/" at end of CDROM pathnames. Also
add an empty declaration of PATCH_SITES next to MASTER_SITES to avoid
"variable recursive" error.
bombing mercilessly.
(2) If that directory has a directory called CVS, remind the user of
the existence of the "-P" option to cvs co and update.
(3) While I'm here, clean up the PATCH_DEBUG code a bit. In
particular, don't duplicate a whole bunch of code just for adding
a single "echo" statement. ;)
Reviewed by: the ports list
won't be pulled into individual ports that include this file. ;)
(2) Document MOTIFLIB, it's not set in the ports Makefiles but is
important for Motif ports (already documented in the handbook).
(3) Add INSTALL_PROGRAM, INSTALL_SCRIPT, INSTALL_DATA, INSTALL_MAN as
"aliases" of the appropriate install command line, for use in *-install
targets.
Reviewed by: the ports list (item 3 only)
(SRC_ENCAPSUATION). Stick in some cd ${.CURDIR} directives which have
been (benignly) missing all this time. Allow more types of targets to be
selectively disabled.
"MASTER_SITES:= ..." of defined(MASTER_SITE_OVERRIDE) case, otherwise
it would cause a recursive variable definition error when
MASTER_SITE_OVERRIDE is set and MASTER_SITES is not set.
(1) The new NO_CDROM Boolean variable means "don't put the distfile/
package on the CDROM you're going to sell". It will basically
turn off everything if FOR_CDROM is set.
Many of the NO_PACKAGE ports are actually "don't sell for profit"
types, which we shouldn't have any problem distributing via ftp.
(2) The new RESTRICTED Boolean variable means don't build this unless
you know what you are doing. It doesn't have any effect unless
NO_RESTRICTED is also set.
(3) BROKEN means this port is broken. At least it will now show up in
INDEX and README.html, and give people more incentive to fix (I
hope).
RESTRICTED and BROKEN are expected to replace the pseudo-targets
in parent Makefiles. (The RESTRICTED and BROKEN list didn't do
anything before, they were solely for grepping purposes.)
(4) The Motif support brings in four new variables: REQUIRES_MOTIF,
which the porter sets for ports that require Motif to build;
HAVE_MOTIF, which the user sets to indicate the system has Motif;
MOTIF_STATIC, which the user sets to indicate that the static
libXm, instead af the default dynamic library, is to be used; and
MOTIFLIB, which is set to "${X11BASE}/lib/libXm.a" or
"-L${X11BASE}/lib -lXm", depending on whether MOTIF_STATIC is set.
The porter is expected to replace all occurrences of libXm in the
{Im,M}akefiles with ${MOTIFLIB}, and this will allow both dynamic
linkage (for users with Motif) and static linkage (for those who
build packages to be used by those withot Motif, i.e., me ;)
automatically.
Original Motif support idea by: graichen
word: "zilch"). I guess the only way to get people try and comment on
these kind of things is to shove it down their throat.... ;)
Anyway, here's a set of changes required for auto-generation of READMEs
in ports directories. Necessary changes and additions of templates
to the ports tree will follow shortly.
Eventually I'll commit all the generated READMEs to the tree, but that
will be in the rather distant future. For now, I encourage anyone
with a -current systam and a matching ports tree to do a "make readmes"
at the top level and see what they get.
Next step will be to add pkg/{COMMENT,DESCR} to all the categories.
which has been in the tree for a much longer time.
Sorry for the multiple commits and I know I shouldn't be doing this but
my hamster tells me to be orthogonal...("hey Phoenix, do you think
I should call it LOCALBASE?" "squeak" "ok, if you say so").
counterpart to X11BASE (default "/usr/X11R6").
Now PREFIX is set to ${X11BASE} or ${LOCAL_PREFIX} depending on
whether USE_IMAKE or USE_X11 is set or not.
This enables us to refer to non-X ports from X ports using
${LOCAL_PREFIX}, thus removing most of the remaining "/usr/local"s
from the ports tree.
This will also allow the system administrator to move the whole
"local" tree to somewhere else, without affecting X ports. (Of course
not all ports are necessarily happy with that, but we're working on
it.)
Based on: an idea that came up while I was watching a football game
several months ago ("hey, maybe I can move that sideline
without disturbing the other!")
"foo", what this does is:
(1) Put all distfiles and patchfiles in /usr/ports/distfiles/foo
(2) Go to ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/foo when the
master site is down
When your port has a lot of dist/patchfiles, or has a file that does
not have a very port-specific name (e.g., "Makefile"), set this
variable instead of redefining DISTDIR. (If you redefine DISTDIR, (1)
will work but (2) will not.)
Agreed that it's a good idea by: adam
(Sorry Jordan, but your other idea (${CATEGORIES}) was a major hit.)
Also remove the keyword field in the INDEX line and replace it with
two columns: build-time dependencies and run-time dependencies. They
are both list of package names (minus the ".tgz").
(1) people can have weird paths and it will still work, and
(2) if you really need to use /usr/local/bin/cp instead of /bin/cp,
you can do that by changing only one line.
Submitted by: wosch
/var/db/pkg/${PKGNAME} exists. ("make install" will do nothing
because this is not a critical error and the installation is
treated as successful.)
Closes PR 870.
too. Basically, if the name starts with a "/", it's tested with "test -e";
otherwise, it's tested with "witch -s".
Reviewed by: the ports list (well at least nobody complained)
They are called from the fetch, extract and install targets,
respectively.
Also, only RUN_DEPENDS is put into the @pkgdep list of the package.
EXEC_DEPENDS is still supported (for now), it is copied into
BUILD_DEPENDS and RUN_DEPENDS. This will go away after we finish
fixing all the ports Makefiles.
This change fixes the following bug/features:
(1) "make fetch" building and installing all the dependencies
(2) Programs needed for building only (e.g., gmake) put into the
packages' dependency lists ("why does the emacs package depend on
gmake?")
Reviewed by: the ports list
the file is fetched or not. Apparently Jordan fixed it a long time
ago but it was broken again at import of the new version of ncftp.
Which means even if we fix it, it may break again and we may need to
fix it again, and (imagination here, please)....
Instead, move the file existence check into the for loop for
MASTER_SITES/PATCH_SITES and break out with "continue 2" when the file
is found. This is actually a cleaner logic than before if you ask me,
because instead of assuming the file is fetched on a 0 exit status
from ncftp AND checking for the existence of the file after the loop,
the check is done exactly once for each iteration and nowhere else.
do-extract target depending on defined(EXTRACT_ONLY) or not, simply
set EXTRACT_ONLY ?= ${DISTFILES} and always use ${EXTRACT_ONLY} as
the extraction list.
change, but I've been testing this on thud and silvia for quite a
while, also I haven't gotten any bug reports from the ports list, so
I'm going to let it loose!
It cleans up this file quite a bit, now I can go in and start adding
some more "interesting" things.... ;)
of replacing it. This way you can point it to a site close to you
that carries many distfiles, and still let it go fetch from the
original site if the distfile is not there.
Original idea by: mmead@Glock.COM
to do something else than "install". For example,
make IS_DEPENDED_TARGET=fetch fetch
will fetch the required distfiles including those of the dependencies
without actually building and installing dependencies.
Also document ECHO_MSG.
Requested by: paul
Reviewed by: paul, jhs and others
ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/
as our distribution point for distfiles and patches. Other than
cosmetic changes (freebsd.cdrom.com -> ftp.freebsd.org), the
omission of "ports" is important. I would like to move this
directory completely out of the ports tree (on the ftp site),
so that people who do "get ports.tar.gz" won't get a bogus distfiles
-> ../distfiles symlink (which will make "make fetch" fail).
Sometime around the 2.1 release, the distfiles link will be deleted.
set permissions and ownerships of PREFIX (usually /usr/local). This
is the default if USE_IMAKE or USE_X11 is set.
This should be useful for machines like thud, where we want to keep
the /usr/local subtree writable to a group ("ports" in our case). Anybody
who installs stuff in /usr/local should have this set in the environment.
Note this won't affect anything the pkg_* suite does.
Note that the two "touch"s I took out from do-patch shouldn't have
been there in the first place.
This target may give incorrent results if two separate patches deal
with the same file, and their hunks overlap. (But having those kinds
of patches are bad, and they should be merged anyway.)
Reviewed by: hsu
".../packages/All". The "all" category that was automatically added
for every package is gone.
Note that bsd.port.mk requires category names to start with lowercase
names, otherwise it may get confused.
Reviewed by: jkh
By the way, here is a small script to convert your local package
hierarchy. Run it in bash, as /bin/sh not only will bark at the
$(.) command substitution but will also botch the [a-z]*/*.tgz
expansion (long-standing and annoying bug, reported before).
cd /usr/ports/packages
mv .packages All
for i in [a-z]*/*.tgz; do
j=$(basename $i)
/bin/rm $i
ln -s ../All/$j $i
done
one of the key components of the system, but I'm sure that this:
===
- ${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \
+ ${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \
===
change has absolutely no chance to screw us up, right? :)
Ports for which we can't build packages should define NO_PACKAGE but
still prepare pkg/* files. The user who really wants a package and
clear of the legal problems can say FORCE_PACKAGE from the command line
to build a package anyway.
package: check installation, build package, create links,
touch cookie
repackage: ditto but don't check cookie
package-noinstall: just build package from installed stuff, no cookies
involved at all
package-links create the symbolic links only
delete-package: delete package and symbolic links
delete-package-links: delete links only
These should make the management of the spaghetti of package links
a little friendlier. :)
too (otherwise the chain won't work).
(2) If NO_WRKDIR is set, "make clean" removes "./.*_done" (assuming
these are cookies...or should I list all the cookies?)
build, install) are now all skeletons and do nothing but
(1) Call pre-* target (if exists)
(2) Call scripts/pre-* script (if exists)
(3) Call do-* target
(4) Call post-* target (if exists)
(5) Call scripts/post-* script (if exists)
The do-* targets do all the work. The pre-* and post-* targets/scripts
don't exist by default. The main targets check for the cookies too, so
porters shouldn't have to worry about them at all.
NOTE: THE MAIN TARGETS IN THE PORTS MAKEFILES SHOULD GO AWAY. We need
to fix this before wcarchive comes back up. Change the names to do-*,
rip out the cookies, rip out the calls to pre-* etc. and most of them
should work.
Also, reorganize the whole thing so that similar targets are together
and add more comments. Surround section header with 64 #'s (C-u C-u
C-u # in emacs :).
Hopefully this will be the last major change to bsd.port.mk. Now let
the Makefile-hacking begin.
rule.
2. Have all non-X11 prefix using packages include the BSD.local.dist mtree
file for initialization of /usr/local. I'm still not sure if this is
A Good Thing(tm) but I'll see what the users say. It's easily overridden.
3. Standardise on ${PKG_DBDIR} as pointer to /var/db/pkg or local preference.
"Building for WWW" (pops up in two different ports) "Installing for
web2c-6.1" (ditto), which aren even't reminiscent of the port's real
name.
Sorry jmz, please don't go fix the print Makefiles' own messages.
We are going to take them out after we do the great bsd.port.mk
update anyway.
the top level and have the build-package sequence of each port work
together.
For the old behavior (i.e, just go ahead and blindly pack everything up,
regardless of the contents of work/), there is a new target "repackage".
Since "build" depends on "configure", which depends on "patch", etc.,
this shouldn't disrupt any Makefile that doesn't break the dependency
chain.
The old behavior was very annoying because when I did a "make -k",
it would still try to go configure and build even if the extraction
failed.
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
New variables:
PATCH_SITES: patch equivalent of MASTER_SITES, overridable with
. MASTER_SITE_OVERRIDE.
PATCHFILES: Additional files to fetch and give to patch before
. applying the ones in patches/patch-*. If name ends
. with ".gz" or ".Z", it will be piped through zcat first.
Plus PATCH_DIST_STRIP and PATCH_DIST_ARGS that serve the same functions
as PATCH_STRIP and PATCH_ARGS for patches in patches/patch-*.
In the documentation and echo messages, I used the term "distributed
patches" and "FreeBSD patches" to refer to ${PATCHFILES} and patches/patch-*.
If you can come up with better names, by all means go ahead and fix them.
"grep PATCH /usr/ports/*/*/Makefile" reveals seven ports (mule, jless,
jtcl, jtk, dgd, less, color_xterm, gee I wonder why I'm the one who
implemented this) that can benefit from this. I'm now diving headlong
into /usr/ports to fix their Makefiles.
installation script, DEINSTALL for the deinstallation script, and
REQ for the requirement script, will be added with appropriate
flags to PKG_ARGS if they exist under pkg/.
have three variables:
EXEC_DEPENDS - A list of "prog:dir" pairs of other ports this
package depends on. "prog" is the name of an
executable. make will search your $PATH for it and go
into "dir" to do a "make all install" if it's not found.
LIB_DEPENDS - A list of "lib:dir" pairs of other ports this package
depends on. "lib" is the name of a shared library.
make will use "ldconfig -r" to search for the
library. Note that lib can be any regular expression,
and you need two backslashes in front of dots (.) to
supress its special meaning (e.g., use
"foo\\.2\\.:${PORTSDIR}/utils/foo" to match "libfoo.2.*").
DEPENDS - A list of other ports this package depends on being
made first. Use this for things that don't fall into
the above two categories.
DEPENDS behaves exactly like before, so old Makefiles will still work
the same. The two variables are lists of pairs as described above.
For instance, if your program depends on unzip and libjpeg.5.*, use
the following definitions:
EXEC_DEPENDS= unzip:${PORTSDIR}/archivers/unzip
LIB_DEPENDS= jpeg\\.5\\.:${PORTSDIR}/graphics/jpeg
gmake:${PORTSDIR}/utils/gmake is automatically added to EXEC_DEPENDS
if USE_GMAKE is defined.
If NO_DEPENDS is defined, the list will just be printed out one by one.
2) Change INSTALL_MANPAGES to NO_INSTALL_MANPAGES and document it
3) Add a PKGNAME variable to allow the package name
not to be dictated by stupid DISTNAMEs
4) Add a PATCH_DEBUG option and a slight change to the default
patch system - add --forward to help ensure correct patching
Further investigation showed that prefix was erroneously set to /usr/local
for X11 based ports as well, when the assumption was that they'd really go
into ${X11BASE} (an /etc/make.conf variable that the user's free to set).
Set X11BASE to /usr/X11R6 if the user hasn't already, and assume that
the user really wants prefix to point there when the port is XMKMF based.
MASTER_SITE_OVERRIDE - If set in the environment, will override everyone's
MASTER_SITES settings. Useful if you'd prefer to point to a
distfiles repository somewhere closer.
MASTER_SITE_FREEBSD - Sets OVERRIDE to be FreeBSD's own master repository.
about them.. :-) The patches/* won't work, it needs to be patches/patch-*
to avoid catching things like CVS files when working with a checked-out
copy of ports! Whoops!
1. Make build rely on a BUILD_COOKIE now. I'm tired of builds
being redone gratuitously while I'm trying to debug a tree build
problem.
2. Remove all the literal `touch -f' commands and indirect them through
variables. This lets you "leave tracks" in different ways, depending
on the medium. Just part 1 of my planned changes to make builds
directly off the CD work.
is an interactive port, and requires user input somewhere along
the way (either fetching, configuring, building or installing).
If the user then sets BATCH in their environment, this port will be
skipped. If the user sets INTERACTIVE, then ONLY those ports marked
interactive are run (allowing one to do all ports in two passes).
If the user sets both BATCH and INTERACTIVE, then a metal claw extends
from the CRT and brutally yanks their nose off.
install cookie work any other way (perhaps I'm just being stupid).
In any case, INSTALL_COOKIE now works as advertised, and prevents duplicate
installations. pre-install users will have to keep their own cookies if
they wish to avoid duplicate installations, or tell me how to make the
rules run properly.