srcdir = @srcdir@
VPATH  = @srcdir@

include ../../Mk/macports.autoconf.mk

INSTALLDIR=	${TCL_PACKAGE_PATH}/package1.0

SRCS=	package.tcl portdmg.tcl portmdmg.tcl portmpkg.tcl portpkg.tcl \
	portarchive.tcl portunarchive.tcl portarchivefetch.tcl

all:: pkgIndex.tcl

pkgIndex.tcl: $(SRCS)
	$(SILENT) ../pkg_mkindex.sh .

clean::
	rm -f pkgIndex.tcl

distclean:: clean
	rm -f package_test_autoconf.tcl
	rm -f Makefile

test::
	$(TCLSH) $(srcdir)/../tests/test.tcl -nocolor

install:: all
	$(INSTALL) -d -o "${DSTUSR}" -g "${DSTGRP}" -m "${DSTMODE}" "${DESTDIR}${INSTALLDIR}"
	$(SILENT)set -x; for file in ${SRCS}; do \
		$(INSTALL) -o "${DSTUSR}" -g "${DSTGRP}" -m 444 "$(srcdir)/$$file" "${DESTDIR}${INSTALLDIR}"; \
	done
	$(INSTALL) -o "${DSTUSR}" -g "${DSTGRP}" -m 444 pkgIndex.tcl "${DESTDIR}${INSTALLDIR}"
