source: trunk/base/src/macports1.0/Makefile @ 79071

Last change on this file since 79071 was 79071, checked in by jmr@…, 9 years ago

make sure TCL_PACKAGE_DIR exists before creating symlink in it

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1SRCS=           macports.tcl macports_dlist.tcl macports_util.tcl \
2                macports_autoconf.tcl macports_index.tcl macports_fastload.tcl
3OBJS=           macports.o get_systemconfiguration_proxies.o sysctl.o
4SHLIB_NAME=     MacPorts${SHLIB_SUFFIX}
5
6INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/macports1.0
7INSTALLPKGLINK= ${TCL_PACKAGE_DIR}/macports1.0
8
9include ../../Mk/macports.autoconf.mk
10include ../../Mk/macports.tea.mk
11
12ifeq ($(OBJC_RUNTIME), APPLE_RUNTIME)
13        LIBS+= -framework CoreFoundation -framework SystemConfiguration
14endif
15
16pkgIndex.tcl: $(SRCS)
17
18test::
19        ${TCLSH} tests/macports_dlist.tcl
20        ${TCLSH} tests/macports_util.tcl
21
22distclean:: clean
23        rm -f macports_autoconf.tcl macports_fastload.tcl ${SHLIB_NAME}
24
25install:: all
26        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
27
28        $(SILENT) set -x; for file in ${SRCS}; do \
29                $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}/$$file; \
30        done
31
32        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 pkgIndex.tcl ${INSTALLDIR}
33
34        echo "${TCL_PACKAGE_DIR}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
35        if test -z "${DESTDIR}" -a "${INSTALLPKGLINK}" != "${INSTALLDIR}"; then \
36                if test ! -d "${TCL_PACKAGE_DIR}"; then \
37                        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "${TCL_PACKAGE_DIR}" || true; \
38                fi; \
39                if test -w "${TCL_PACKAGE_DIR}"; then \
40                        if test ! -L "${INSTALLPKGLINK}" && test -d "${INSTALLPKGLINK}"; then \
41                                rm -rf "${INSTALLPKGLINK}" || true; \
42                        fi; \
43                        if test ! -e "${INSTALLPKGLINK}"; then \
44                                ln -s "${INSTALLDIR}" "${INSTALLPKGLINK}" || true; \
45                        fi; \
46                fi; \
47        fi
Note: See TracBrowser for help on using the repository browser.