source: trunk/base/Makefile.in @ 112684

Last change on this file since 112684 was 97364, checked in by raimue@…, 8 years ago

Create datadir with correct owner and permissions

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.0 KB
Line 
1# $Id: Makefile.in 97364 2012-09-04 08:33:10Z raimue@macports.org $
2
3PATH            = @PATH_CLEANED@
4SUBDIR          = doc src tests
5DISTDIR         = dist
6DISTVER         =
7DISTTAG         = release_${subst .,_,${DISTVER}}
8DISTNAME        = MacPorts-${DISTVER}
9DISTARCTAG      = ${DISTTAG}-archive
10DISTARCNAME     = ${DISTNAME}-archive
11SVNURL          = https://svn.macports.org/repository/macports
12
13
14include Mk/macports.autoconf.mk
15
16
17all:: Mk/macports.autoconf.mk
18
19Mk/macports.autoconf.mk: Mk/macports.autoconf.mk.in src/config.h.in Makefile.in config.status
20        ./config.status
21        ${MAKE} clean
22
23config.status: configure
24        @if test -f ./config.status ; then      \
25                set -x ;                                                \
26                ./config.status --recheck ;             \
27        else                                                            \
28                set -x ;                                                \
29                echo "Source tree not configured. Use ./configure" ; \
30        fi
31
32include Mk/macports.subdir.mk
33
34install::
35        [ ! -f "$(DESTDIR)${sysconfdir}/macports/mp_version" ] || rm -vf "$(DESTDIR)${sysconfdir}/macports/mp_version"
36        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "$(DESTDIR)${datadir}/macports/"
37        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 setupenv.bash  "$(DESTDIR)${datadir}/macports/"
38        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 macports-pubkey.pem  "$(DESTDIR)${datadir}/macports/"
39# Only run these scripts when not building in a destroot
40ifeq ($(DESTDIR),)
41# create run user if it doesn't exist
42        @if test -n "${DSCL}" -a -n "${DSEDITGROUP}" ; then \
43        if ! ${DSCL} -q . -read /Groups/${RUNUSR} > /dev/null 2>&1 ; then \
44            if test `id -u` -eq 0; then \
45                echo "Creating group \"${RUNUSR}\"" ; \
46                ${DSEDITGROUP} -q -o create ${RUNUSR} ; \
47            else \
48                echo "Not creating group \"${RUNUSR}\" (not root)" ; \
49            fi ; \
50        fi ; \
51        if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then \
52            if test `id -u` -eq 0; then \
53                echo "Creating user \"${RUNUSR}\"" ; \
54                NEXTUID=501; \
55                while test -n "`${DSCL} -q /Search -search /Users UniqueID $$NEXTUID`"; do \
56                    let "NEXTUID=NEXTUID+1"; \
57                done; \
58                ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $$NEXTUID ; \
59                \
60                ${DSCL} -q . -delete /Users/${RUNUSR} AuthenticationAuthority ; \
61                ${DSCL} -q . -delete /Users/${RUNUSR} PasswordPolicyOptions ; \
62                ${DSCL} -q . -delete /Users/${RUNUSR} dsAttrTypeNative:KerberosKeys ; \
63                ${DSCL} -q . -delete /Users/${RUNUSR} dsAttrTypeNative:ShadowHashData ; \
64                \
65                ${DSCL} -q . -create /Users/${RUNUSR} RealName MacPorts ; \
66                ${DSCL} -q . -create /Users/${RUNUSR} Password \* ; \
67                ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $$(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $$2}') ; \
68                ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory "${localstatedir}/macports/home" ; \
69                ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false ; \
70            else \
71                echo "Not creating user \"${RUNUSR}\" (not root)" ; \
72            fi ; \
73        fi ; \
74        if test "$$(${DSCL} -q . -read /Users/${RUNUSR} NFSHomeDirectory)" = "NFSHomeDirectory: /var/empty" ; then \
75            if test `id -u` -eq 0; then \
76                echo "Updating home directory location for user \"${RUNUSR}\"" ; \
77                ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory "${localstatedir}/macports/home" ; \
78            else \
79                echo "Not updating home directory location for user \"${RUNUSR}\" (not root)" ; \
80            fi ; \
81        fi ; \
82        if test `sw_vers -productVersion | /usr/bin/awk -F . '{print $$2}'` -eq 4 -a `id -u` -eq 0; then \
83            GID=`${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $$2}'` ; \
84            if test "`${DSCL} -q . -read /Users/${RUNUSR} PrimaryGroupID 2>/dev/null | /usr/bin/awk '{print $$2}'`" != "$$GID"; then \
85                echo "Fixing PrimaryGroupID for user \"${RUNUSR}\"" ; \
86                ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $$GID ; \
87                ${DSCL} -q . -create /Users/${RUNUSR} RealName MacPorts ; \
88            fi ; \
89        fi ; \
90    else \
91        echo "Can't find ${DSCL} / ${DSEDITGROUP}, not creating user \"${RUNUSR}\"" ; \
92    fi
93# Add [default] tag to the central MacPorts repository, if it isn't already
94        $(TCLSH) src/upgrade_sources_conf_default.tcl "${prefix}"
95# Convert image directories (and direct mode installs) to image archives
96        $(TCLSH) src/images_to_archives.tcl "${macports_tcl_dir}"
97endif
98ifndef SELFUPDATING
99        @echo ""; echo "Congratulations, you have successfully installed the MacPorts system. To get the Portfiles and update the system, add ${prefix}/bin to your PATH and run:"; echo ""
100        @echo "sudo port -v selfupdate"; echo ""
101        @echo "Please read \"man port\", the MacPorts guide at http://guide.macports.org/ and Wiki at https://trac.macports.org/ for full documentation."; echo ""
102else
103        @echo ""; echo "Congratulations, you have successfully upgraded the MacPorts system."; echo ""
104endif
105
106group::
107        @echo "creating a macports group..." && sudo dseditgroup -o create -n . macports && echo "done! use './configure --with-install-group=macports --with-shared-directory' if you haven't already"
108
109rmgroup::
110        @echo "deleting macports group..." && sudo dseditgroup -o delete -n . macports && echo "done! use 'make group' to re-create"
111
112
113clean::
114
115distclean::
116        rm -f config.log config.status configure.lineno
117        rm -rf autom4te.cache ${DISTDIR}
118        rm -f Makefile Mk/macports.autoconf.mk portmgr/freebsd/Makefile
119        rm -f Doxyfile
120        rm -f setupenv.bash
121
122_gettag:
123        cd ${DISTDIR}; svn co ${SVNURL}/tags/${SVNTAG} ${PKGNAME}-svn
124
125_pkgdist:
126        [ ! -d ${DISTDIR}/${PKGNAME} ] || rm -rf ${DISTDIR}/${PKGNAME}
127        cd ${DISTDIR}; svn export ${PKGNAME}-svn ${PKGNAME}
128        cd ${DISTDIR}; COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar -c ${PKGNAME} | gzip > ${PKGNAME}.tar.gz
129        cd ${DISTDIR}; COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar -c ${PKGNAME} | bzip2 > ${PKGNAME}.tar.bz2
130        cd ${DISTDIR}; for tarball in ${PKGNAME}.tar.*; do { \
131                for type in -md5 -sha1 -ripemd160 -sha256; do { \
132                        openssl dgst $$type $$tarball; \
133                }; done >> ${DISTNAME}.chk.txt; \
134        }; done
135
136_dopkg: _gettag _pkgdist
137
138# This target fetches a tagged distribution from svn, and generates tarballs and checksums for it
139distfromsvn:
140        @[ -n "${DISTVER}" ] || { echo Must specify DISTVER, like: make DISTVER=1.4.0 distfromsvn; exit 1; }
141        [ -d ${DISTDIR} ] || mkdir ${DISTDIR}
142        rm -f ${DISTDIR}/${DISTNAME}.chk.txt
143        ${MAKE} SVNTAG=${DISTTAG}/base/ PKGNAME=${DISTNAME} _dopkg
144ifeq ($(ARC),yes)
145        ${MAKE} SVNTAG=${DISTARCTAG} PKGNAME=${DISTARCNAME} _dopkg
146endif
147
148tcldoc:
149        @[ -e "${prefix}/bin/tcldoc" ] \
150                || { echo "Install tcldoc with MacPorts in ${prefix} first."; exit 1; }
151        find src -name '*.tcl' | xargs ${TCLDOC} --verbose --title "MacPorts Documentation" --force tcldoc
152
153tcldox:
154        @[ -e "${prefix}/bin/doxygen" -a -e "${prefix}/bin/tcl-dox" -a -e "${prefix}/bin/dot" ] \
155                || { echo "Install doxygen, tcl-dox and graphviz with MacPorts in ${prefix} first."; exit 1; }
156        ${prefix}/bin/doxygen
157
158test::
159
160.PHONY: dist _gettag _pkgdist _dopkg tcldoc tcldox
Note: See TracBrowser for help on using the repository browser.