Skip to content
Permalink
Browse files

enable --with-dports-dir.

Attention: this changes the default behavior upon installation, since it will
configure $PREFIX/$portconfigdir/sources.conf (commonly /etc/ports/sources.conf)
If you don't re-install (and remove your old sources.conf prior to that), this won't affect you.
(and it should not, since you most likely have a already configured sources.conf).
By default, it will add the dports-tree from your checked out copy from which you install
to sources.conf.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@3937 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Felix Kronlage
Felix Kronlage committed Nov 13, 2003
1 parent bbc7f7f commit 286fbb742d882745471857a31236402dbd89a85d
Showing with 38 additions and 34 deletions.
  1. +32 −33 aclocal.m4
  2. +4 −0 configure.ac
  3. +2 −1 doc/Makefile
@@ -5,39 +5,38 @@ dnl explicitly. If not, search for it

# OD_PATH_DPORTSDIR(DEFAULT_DPORTSDIR)
#---------------------------------------
# AC_DEFUN([OD_PATH_DPORTSDIR],[
# dnl For ease of reading, run after gcc has been found/configured
# AC_REQUIRE([AC_PROG_CC])

# AC_ARG_WITH(dports-dir, [AC_HELP_STRING([--with-dports-dir=DIR], [Specify alternate dports directory])], [ dportsdir="$withval" ] )


# AC_MSG_CHECKING([for dports tree])

# if test "x$dportsdir" != "x" ; then
# if test -d "$dportsdir" -a -e "$dportsdir/PortIndex" ; then
# :
# else
# AC_MSG_ERROR([$dportsdir not a valid dports tree])
# fi
# else
# dnl If the user didn't give a path, look for default
# if test "x$1" != "x" ; then
# if test -d "$1" -a -e "$1/PortIndex" ; then
# dportsdir=$1
# fi
# fi
# fi

# if test "x$dportsdir" != "x" ; then
# AC_MSG_RESULT($dportsdir)
# DPORTSDIR="$dportsdir"
# AC_SUBST(DPORTSDIR)
# else
# AC_MSG_WARN([No dports tree found])
# fi

# ])
AC_DEFUN([OD_PATH_DPORTSDIR],[
dnl For ease of reading, run after gcc has been found/configured
AC_REQUIRE([AC_PROG_CC])
AC_ARG_WITH(dports-dir, [AC_HELP_STRING([--with-dports-dir=DIR], [Specify alternate dports directory])], [ dportsdir="$withval" ] )
AC_MSG_CHECKING([for dports tree])
if test "x$dportsdir" != "x" ; then
if test -d "$dportsdir" -a -e "$dportsdir/PortIndex" ; then
:
else
AC_MSG_ERROR([$dportsdir not a valid dports tree])
fi
else
dnl If the user didn't give a path, look for default
if test "x$1" != "x" ; then
if test -d "$1" -a -e "$1/PortIndex" ; then
dportsdir=$1
fi
fi
fi
if test "x$dportsdir" != "x" ; then
AC_MSG_RESULT($dportsdir)
DPORTSDIR="$dportsdir"
AC_SUBST(DPORTSDIR)
else
AC_MSG_WARN([No dports tree found])
fi
])


# OD_PATH_PORTCONFIGDIR(DEFAULT_PORTCONFIGDIR, PREFIX)
@@ -17,8 +17,12 @@ AC_SUBST(REPLACEMENT_PROGS)
# Check for md5 implementation
OD_LIB_MD5

# set default dports-directory
DPORTS_DIR_DEFAULT=`pwd | sed -e "s/base/dports/"`

# Check for paths
AC_PREFIX_DEFAULT(/opt/local)
OD_PATH_DPORTSDIR([$DPORTS_DIR_DEFAULT])
OD_PATH_PORTCONFIGDIR([/etc/ports], [$prefix])

# Check for install ownership
@@ -20,10 +20,11 @@ install:
set -x; \
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 ports.conf ${DESTDIR}${portconfigdir}; \
fi

$(SILENT)if test ! -e ${DESTDIR}${portconfigdir}/sources.conf ; then \
set -x; \
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 sources.conf ${DESTDIR}${portconfigdir}; \
echo "file://${dportsdir}" >> ${DESTDIR}${portconfigdir}/sources.conf; \
fi
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${DESTDIR}${portconfigdir}
$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m 775 ${INSTALLDIR}/share/darwinports/resources/port1.0/install

0 comments on commit 286fbb7

Please sign in to comment.
You can’t perform that action at this time.