source: branches/dp2mp-move/base/Makefile.in @ 25121

Last change on this file since 25121 was 25121, checked in by jmpp@…, 10 years ago

Reordering of some of the upgrade rules: lets try to do as many directories deletions and renames first, then onto other stuff.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.5 KB
Line 
1SUBDIR          = config doc src
2DISTDIR         = dist
3DISTVER         =
4DISTTAG         = release_${subst .,_,${DISTVER}}
5DISTNAME        = MacPorts-${DISTVER}
6DISTARCTAG      = ${DISTTAG}-archive
7DISTARCNAME     = ${DISTNAME}-archive
8SVNURL          = http://svn.macports.org/repository/macports
9
10include Mk/macports.autoconf.mk
11
12all:: Mk/macports.autoconf.mk
13
14Mk/macports.autoconf.mk: Mk/macports.autoconf.mk.in src/config.h.in Makefile.in config.status
15        ./config.status
16        make clean
17
18config.status: configure
19        @if test -f ./config.status ; then      \
20                set -x ;                                                \
21                ./config.status --recheck ;             \
22        else                                                            \
23                set -x ;                                                \
24                echo "Source tree not configured. Use ./configure" ; \
25        fi
26
27dp2mpUpgrade:
28        @echo "Upgrading your existing MacPorts installation to the new layout."
29# We can safely delete the ${TCL_PACKAGE_DIR}/darwinports1.0 dir as files in it are always overwritten and will now
30# be installed onto ${TCL_PACKAGE_DIR}/macports1.0 with new names.
31        [ ! -d ${TCL_PACKAGE_DIR}/darwinports1.0 ] || rm -vrf ${TCL_PACKAGE_DIR}/darwinports1.0
32
33# MacPorts base files in ${datadir} are also safely removed as new ones are always installed,
34# and onto a their new location in this case too.
35        [ ! -d ${datadir}/darwinports ] || rm -vrf ${datadir}/darwinports
36
37# Main ${localstatedir}/db/dports directory (where installed ports live) is moved to its new location.
38#####this needs a lot of testing *WITH* installed ports!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
39        [ ! -d ${localstatedir}/db/dports ] || mv -v ${localstatedir}/db/dports ${localstatedir}/macports
40
41# Old version file can be safely deleted, as it was already used to start this upgrade
42# and a new one will be installed into the new location.
43        [ ! -f ${sysconfdir}/ports/dp_version ] || rm -vf ${sysconfdir}/ports/dp_version
44
45# The main configuration file is first renamed to macports.conf while still in its old dir.
46        [ ! -f ${sysconfdir}/ports/ports.conf ] || mv -v ${sysconfdir}/ports/ports.conf ${sysconfdir}/ports/macports.conf
47
48# Following that, the dir itself is renamed to its new name.
49        [ ! -d ${sysconfdir}/ports ] || mv -v ${sysconfdir}/ports ${sysconfdir}/macports
50
51
52# MacPorts rsyns server is replaced into the macpors.conf and sources.conf files.
53        sed -e "s/rsync.darwinports.org/rsync.macports.org/g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
54        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
55        sed -e "s/rsync.darwinports.org/rsync.macports.org/g" ${mpconfigdir}/sources.conf > ${mpconfigdir}/sources.conf.tmp && \
56        mv -v ${mpconfigdir}/sources.conf.tmp ${mpconfigdir}/sources.conf
57
58#
59        sed -e "s/dpupdate1\/base\//release\/base\//g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
60        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
61        sed -e "s/dpupdate\/dports/release\/ports/g" ${mpconfigdir}/sources.conf > ${mpconfigdir}/sources.conf.tmp && \
62        mv -v ${mpconfigdir}/sources.conf.tmp ${mpconfigdir}/sources.conf
63
64#
65        sed -e "s/db\/dports/macports/g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
66        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
67
68#
69        sed -e "s/etc\/ports/etc\/macports/g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
70        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
71
72#
73        sed -e "s/\-\-delete //" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
74        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
75
76#something more?
77
78####
79# NOTES:
80#    -) Is it safe to delete the dp_version file while the upgrade target runs?
81#    -) should we use the ${DESTDIR} sandbox?
82#    -) should we force moves?
83#    -) maybe I can regroup at least some of the sed calls?
84#    -)
85####
86
87install:: dp2mpUpgrade
88#The order of installation targets having been reversed between this Makefile and Mk/macports.subdir.mk to
89#get the upgrade target working in the best way possible, this informational text below ends up hidden
90#among lots of output. Therefore I need to find somewhere to put it, so that it's seen as it used to be.
91        @echo ""
92        @echo "Congratulations, you have successfully installed the MacPorts system. To get the Portfiles and update the system, run:"
93        @echo ""
94        @echo "sudo port selfupdate"
95        @echo ""
96        @echo "Please read port(1) and the MacPorts Wiki at http://trac.macports.org/ for full documentation."
97        @echo ""
98
99include Mk/macports.subdir.mk
100
101clean::
102
103distclean::
104        rm -f config.log config.status configure.lineno
105        rm -rf autom4te.cache ${DISTDIR}
106        rm -f Makefile Mk/macports.autoconf.mk
107
108_gettag:
109        cd ${DISTDIR}; svn co ${SVNURL}/tags/${SVNTAG} ${PKGNAME}-svn
110
111_pkgdist:
112        [ ! -d ${DISTDIR}/${PKGNAME} ] || rm -rf ${DISTDIR}/${PKGNAME}
113        cd ${DISTDIR}; svn export ${PKGNAME}-svn ${PKGNAME}
114        cd ${DISTDIR}; COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar -c ${PKGNAME} | gzip > ${PKGNAME}.tar.gz
115        cd ${DISTDIR}; COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar -c ${PKGNAME} | bzip2 > ${PKGNAME}.tar.bz2
116        cd ${DISTDIR}; for type in -md5 -sha1 -ripemd160; do openssl dgst $$type ${PKGNAME}.tar.gz ${PKGNAME}.tar.bz2; done >> ${DISTNAME}.chk.txt
117
118_dopkg: _gettag _pkgdist
119
120# This target fetches a tagged distribution from svn, and generates tarballs and checksums for it
121distfromsvn:
122        @[ -n "${DISTVER}" ] || ( echo Must specify DISTVER, like: make DISTVER=1.4.0 dist; exit 1 )
123        [ -d ${DISTDIR} ] || mkdir ${DISTDIR}
124        rm -f ${DISTDIR}/${DISTNAME}.chk.txt
125        ${MAKE} SVNTAG=${DISTTAG}/base/ PKGNAME=${DISTNAME} _dopkg
126ifeq ($(ARC),yes)
127        ${MAKE} SVNTAG=${DISTARCTAG} PKGNAME=${DISTARCNAME} _dopkg
128endif
129
130test::
131
132.PHONY: dist _gettag _pkgdist _dopkg
Note: See TracBrowser for help on using the repository browser.