source: trunk/base/Makefile.in @ 26811

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

Correct an output comment and run group the commands with { }, not ( ) which makes them run in a subshell.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.4 KB
Line 
1# $Id: Makefile.in 26811 2007-07-09 07:27:37Z jmpp@macports.org $
2
3SUBDIR          = config doc src
4DISTDIR         = dist
5DISTVER         =
6DISTTAG         = release_${subst .,_,${DISTVER}}
7DISTNAME        = MacPorts-${DISTVER}
8DISTARCTAG      = ${DISTTAG}-archive
9DISTARCNAME     = ${DISTNAME}-archive
10SVNURL          = http://svn.macports.org/repository/macports
11UPGRADECHECK    = ${localstatedir}/macports/.mprename
12
13include Mk/macports.autoconf.mk
14
15all:: Mk/macports.autoconf.mk
16
17Mk/macports.autoconf.mk: Mk/macports.autoconf.mk.in src/config.h.in Makefile.in config.status
18        ./config.status
19        make clean
20
21config.status: configure
22        @if test -f ./config.status ; then      \
23                set -x ;                                                \
24                ./config.status --recheck ;             \
25        else                                                            \
26                set -x ;                                                \
27                echo "Source tree not configured. Use ./configure" ; \
28        fi
29
30upgrade:
31        @echo ""; echo "Upgrading your existing MacPorts installation to the new namespace if necessary:"; echo ""
32
33# We can safely delete the ${TCL_PACKAGE_DIR}/darwinports1.0 dir as files in it are always overwritten and will now be installed onto
34# ${TCL_PACKAGE_DIR}/macports1.0 with new names:
35        [ ! -d ${TCL_PACKAGE_DIR}/darwinports1.0 ] || rm -rf ${TCL_PACKAGE_DIR}/darwinports1.0
36
37# MacPorts base files in ${datadir} are also safely removed as new ones are always installed, and onto a their new location in this case too:
38        [ ! -d ${datadir}/darwinports ] || rm -rf ${datadir}/darwinports
39
40# Old version file can be safely deleted, as it was already used to start this upgrade and a new one will be installed into the new location:
41        [ ! -f ${sysconfdir}/ports/dp_version ] || rm -vf ${sysconfdir}/ports/dp_version
42
43# Old ports.conf(5) man page is removed:
44        [ ! -f ${prefix}/share/man/man5/ports.conf.5 ] || rm -vf ${prefix}/share/man/man5/ports.conf.5
45
46# Conf files directory is renamed:
47        [ ! -d ${sysconfdir}/ports ] || mv -v ${sysconfdir}/ports ${sysconfdir}/macports
48
49# Important directories inside ${localstatedir}/db/dports are moved to their new location, creating it first:
50        [ -d ${localstatedir}/macports ] || mkdir -vp ${localstatedir}/macports
51        for dir in distfiles packages receipts software; do \
52                [ ! -d ${localstatedir}/db/dports/$${dir} ] || mv -v ${localstatedir}/db/dports/$${dir} ${localstatedir}/macports ; \
53        done
54
55# Move the default ports tree to the new layout:
56        [ ! -d ${localstatedir}/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports ] || { mkdir -vp \
57        ${localstatedir}/macports/sources/rsync.macports.org/release && mv -v \
58        ${localstatedir}/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports ${localstatedir}/macports/sources/rsync.macports.org/release/ports ; }
59
60# Open up receipts and upgrade any paths in them containing old conventions to the new namespace:
61        for receipt in ${localstatedir}/macports/receipts/*/*/receipt.bz2 ; do [ ! \( -f $${receipt} -a ! -f $${receipt}.mpsaved \) ] || { \
62                cp -v $${receipt} $${receipt}.mpsaved && { \
63                        $(BZIP2) -q -dc $${receipt} | sed 's/db\/dports/macports/g' | $(BZIP2) -q -zf > $${receipt}.new ; \
64                } && mv -v $${receipt}.new $${receipt} ; \
65        }; done
66
67# Check for existance of the main configuration file and perform a couple of replacements on it, backing it up first:
68## 1) new default path up to our configuration files (referenced through other variables);
69## 2) new default value for the portdbpath variable;
70## 3) new MacPorts rsync server;
71## 4) new default value for the base tree;
72## 5) new default value for trunk's base sources for users who have it (some do);
73## 6) stray quotes are removed from the value of the rsync_options key in old conf files;
74## 7) useless --delete option is removed from the default rsync flags (--delete is implied by --delete-after);
75## 8) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
76## 9) finally, move remaining instances of any form of our new name (which by this time should only remain in comments, if at all) to our new name.
77        [ ! \( -f ${sysconfdir}/macports/ports.conf -a ! -f ${UPGRADECHECK} \) ] || { \
78                mv -v ${sysconfdir}/macports/ports.conf ${sysconfdir}/macports/macports.conf.mpsaved; \
79                sed 's/etc\/ports/etc\/macports/g' ${sysconfdir}/macports/macports.conf.mpsaved > ${sysconfdir}/macports/macports.conf.tmp && \
80                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
81                sed 's/db\/dports/macports/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
82                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
83                sed 's/darwinports/macports/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
84                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
85                sed 's/dpupdate1\/base/release\/base/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
86                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
87                sed 's/dpupdate\/base\/\{0,1\}/trunk\/base\//g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
88                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
89                sed '/^rsync_options/s/"\(.*\)"/\1/' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
90                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
91                sed 's/ --delete / /' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
92                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
93                sed 's/ ports.conf(5)/ macports.conf(5)/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
94                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
95                sed 's/[Dd]\(arwin\)\{0,1\}[Pp]\(orts\)\{0,1\}/MacPorts/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
96                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
97        }
98
99# Check for existance of the main sources file and perform a couple of replacements on it, backing it up first:
100## 1) new MacPorts rsync server;
101## 2) new default value for the ports tree.
102        [ ! \( -f ${sysconfdir}/macports/sources.conf -a ! -f ${UPGRADECHECK} \) ] || { \
103                cp -v ${sysconfdir}/macports/sources.conf ${sysconfdir}/macports/sources.conf.mpsaved; \
104                sed 's/darwinports/macports/g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
105                        mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf; \
106                sed 's/dpupdate\/dports/release\/ports\//g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
107                        mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf; \
108        }
109
110# Check for existance of a personal configuration file and perform a couple of replacements on it, backing it up first:
111## 1) new default path up to our configuration files (referenced through other variables);
112## 2) new default value for the portdbpath variable;
113## 3) new MacPorts rsync server;
114## 4) new default value for the base tree;
115## 5) new default value for trunk's base sources for users who have it (some do);
116## 6) stray quotes are removed from the value of the rsync_options key in old conf files;
117## 7) useless --delete option is removed from the default rsync flags (--delete is implied by --delete-after);
118## 8) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
119## 9) finally, move remaining instances of any form of our new name (which by this time should only remain in comments, if at all) to our new name.
120        [ ! \( -f $${HOME}/.macports/ports.conf -a ! -f ${UPGRADECHECK} \) ] || { \
121                mv -v $${HOME}/.macports/ports.conf $${HOME}/.macports/macports.conf.mpsaved; \
122                sed 's/etc\/ports/etc\/macports/g' $${HOME}/.macports/macports.conf.mpsaved > $${HOME}/.macports/macports.conf.tmp && \
123                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
124                sed 's/db\/dports/macports/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
125                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
126                sed 's/darwinports/macports/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
127                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
128                sed 's/dpupdate1\/base/release\/base/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
129                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
130                sed 's/dpupdate\/base\/\{0,1\}/trunk\/base\//g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
131                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
132                sed '/^rsync_options/s/"\(.*\)"/\1/' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
133                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
134                sed 's/ --delete / /' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
135                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
136                sed 's/ ports.conf(5)/ macports.conf(5)/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
137                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
138                sed 's/[Dd]\(arwin\)\{0,1\}[Pp]\(orts\)\{0,1\}/MacPorts/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
139                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
140        }
141
142# Upgrade success announcement (meaning we're done ;):
143        @[ -f ${UPGRADECHECK} ] || { echo ""; echo "MacPorts installation successfully upgraded from the old DarwinPorts namespace!"; echo ""; \
144        echo "MacPorts rename update done!" > ${UPGRADECHECK} ; }
145
146
147install:: upgrade
148
149include Mk/macports.subdir.mk
150
151install::
152        @echo ""; echo "Congratulations, you have successfully installed the MacPorts system. To get the Portfiles and update the system, run:"; echo ""
153        @echo "sudo port selfupdate"; echo ""
154        @echo "Please read port(1) and the MacPorts Wiki at http://trac.macports.org/ for full documentation."; echo ""
155        @echo "Stray sources might have been left in the legacy ${localstatedir}/db/dports directory after this upgrade, which moved most of what it could to ${localstatedir}/macports, so you might want to look in the former and cleanup manually."; echo ""
156
157clean::
158
159distclean::
160        rm -f config.log config.status configure.lineno
161        rm -rf autom4te.cache ${DISTDIR}
162        rm -f Makefile Mk/macports.autoconf.mk
163
164_gettag:
165        cd ${DISTDIR}; svn co ${SVNURL}/tags/${SVNTAG} ${PKGNAME}-svn
166
167_pkgdist:
168        [ ! -d ${DISTDIR}/${PKGNAME} ] || rm -rf ${DISTDIR}/${PKGNAME}
169        cd ${DISTDIR}; svn export ${PKGNAME}-svn ${PKGNAME}
170        cd ${DISTDIR}; COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar -c ${PKGNAME} | gzip > ${PKGNAME}.tar.gz
171        cd ${DISTDIR}; COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar -c ${PKGNAME} | bzip2 > ${PKGNAME}.tar.bz2
172        cd ${DISTDIR}; for type in -md5 -sha1 -ripemd160; do openssl dgst $$type ${PKGNAME}.tar.gz ${PKGNAME}.tar.bz2; done >> ${DISTNAME}.chk.txt
173
174_dopkg: _gettag _pkgdist
175
176# This target fetches a tagged distribution from svn, and generates tarballs and checksums for it
177distfromsvn:
178        @[ -n "${DISTVER}" ] || { echo Must specify DISTVER, like: make DISTVER=1.4.0 distfromsvn; exit 1; }
179        [ -d ${DISTDIR} ] || mkdir ${DISTDIR}
180        rm -f ${DISTDIR}/${DISTNAME}.chk.txt
181        ${MAKE} SVNTAG=${DISTTAG}/base/ PKGNAME=${DISTNAME} _dopkg
182ifeq ($(ARC),yes)
183        ${MAKE} SVNTAG=${DISTARCTAG} PKGNAME=${DISTARCNAME} _dopkg
184endif
185
186test::
187
188.PHONY: dist _gettag _pkgdist _dopkg
Note: See TracBrowser for help on using the repository browser.