source: trunk/dports/sysutils/MacPorts/Portfile @ 91334

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

MacPorts port: distribution pkg support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 14.7 KB
Line 
1# $Id: Portfile 91334 2012-03-30 01:33:11Z jmr@macports.org $
2
3PortSystem          1.0
4
5name                MacPorts
6version             2.0.4
7
8categories          sysutils
9platforms           darwin freebsd
10maintainers         lists.macosforge.org:macports-mgr
11
12description         The MacPorts Infrastructure
13long_description \
14   MacPorts provides the infrastructure that allows easy installation and \
15   management of freely available software on Mac OS X 10.4 or newer systems.
16
17notes "This port cannot directly be used to upgrade MacPorts; use 'port\
18selfupdate' for that."
19
20homepage            http://www.macports.org/
21master_sites
22# testing subdir is for non-final releases only
23#dist_subdir         ${name}/testing
24use_bzip2           yes
25
26checksums           rmd160 02d8cce3ee1d4bc8f74d20dc3486ac3ae8d9b1d1 \
27                    sha256 0229cd60addea3fb2ccd4123dbb7751998b138466f57946f01c822439dcc46ad
28
29variant keep_prefix description "Use configured prefix instead of enforcing /opt/local" {}
30if {![variant_isset keep_prefix]} {
31    prefix          /opt/local
32}
33
34# Readline is disabled by default to avoid support issues with people who
35# have a readline in /usr/local. Since this portfile is presumably used in a
36# clean environment, enable it here.
37configure.args      --enable-readline
38
39# We don't want to use anything supplied by ports when building MacPorts itself.
40configure.env       PATH=/usr/bin:/bin:/usr/sbin:/sbin
41
42# Some of MacPorts' default flags don't play well when we're building MacPorts
43# itself; nuke them.
44configure.cppflags
45configure.ldflags
46configure.cc_archflags
47configure.objc_archflags
48configure.ld_archflags
49compiler.cpath
50compiler.library_path
51
52# MacPorts' configure removes ${prefix}/bin from $PATH,
53# so better do not use ccache, to avoid problems.
54configure.ccache no
55
56post-destroot {
57    # Only install .default versions of config files.
58    delete ${destroot}${prefix}/etc/macports/macports.conf
59    delete ${destroot}${prefix}/etc/macports/pubkeys.conf
60    delete ${destroot}${prefix}/etc/macports/sources.conf
61    delete ${destroot}${prefix}/etc/macports/variants.conf
62}
63
64# don't enable until releases have a Distribution file
65package.flat    no
66if {![info exists package.resources]} {
67    set package.resources ${workpath}/pkg_resources
68    set package.scripts   ${workpath}/pkg_resources
69} elseif {!${package.flat}} {
70    package.scripts   ${package.resources}
71}
72set resources_lang ${package.resources}/English.lproj
73
74pre-pkg {
75    file copy -force -- ${worksrcpath}/portmgr/dmg/ReadMe.rtf ${resources_lang}
76    file copy -force -- ${worksrcpath}/portmgr/dmg/License.html ${resources_lang}
77    file copy -force -- ${worksrcpath}/portmgr/dmg/postflight ${package.scripts}
78    file copy -force -- ${worksrcpath}/src/upgrade_sources_conf_default.tcl ${package.scripts}
79    file copy -force -- ${worksrcpath}/src/images_to_archives.tcl ${package.scripts}
80
81    file attributes ${package.scripts}/postflight -permissions 0755
82    file attributes ${package.scripts}/upgrade_sources_conf_default.tcl -permissions 0755
83    file attributes ${package.scripts}/images_to_archives.tcl -permissions 0755
84    file attributes ${resources_lang}/ReadMe.rtf -permissions 0644
85    file attributes ${resources_lang}/License.html -permissions 0644
86
87    reinplace "s|__PREFIX__|${prefix}|g" \
88              ${package.scripts}/postflight \
89              ${resources_lang}/ReadMe.rtf
90    reinplace "s|is built|contains a Universal installer|" ${resources_lang}/ReadMe.rtf
91    reinplace "s|__XVERS__|${macosx_deployment_target}|" ${resources_lang}/ReadMe.rtf
92    if {${package.flat}} {
93        if {[file exists ${worksrcpath}/portmgr/dmg/Distribution]} {
94            file copy -force -- ${worksrcpath}/portmgr/dmg/Distribution ${workpath}
95        } else {
96            file copy -force -- ${filespath}/Distribution ${workpath}
97        }
98        file attributes ${workpath}/Distribution -permissions 0644
99        reinplace "s|__PREFIX__|${prefix}|g" ${workpath}/Distribution
100        switch $macosx_deployment_target {
101            10.4    {set xcode_cli "Command Line Support"}
102            10.5    -
103            10.6    {set xcode_cli "UNIX Development"}
104            default {set xcode_cli "Command Line Tools or UNIX Development"}
105        }
106        reinplace "s|__XCODECLITOOLS__|${xcode_cli}|g" ${workpath}/Distribution
107        reinplace "s|__XVERS__|${macosx_deployment_target}|" ${workpath}/Distribution
108        set next_major [lindex [split $macosx_deployment_target .] 0].[expr [lindex [split $macosx_deployment_target .] 1] + 1]
109        reinplace "s|__NEXT_XVERS__|$next_major|" ${workpath}/Distribution
110        reinplace "s|__VERSION__|${version}|" ${workpath}/Distribution
111    } else {
112        file copy -force -- ${worksrcpath}/portmgr/dmg/InstallationCheck ${package.resources}
113        file copy -force -- ${worksrcpath}/portmgr/dmg/InstallationCheck.strings ${resources_lang}
114        file attributes ${package.resources}/InstallationCheck -permissions 0755
115        file attributes ${resources_lang}/InstallationCheck.strings -permissions 0644
116        reinplace "s|__PREFIX__|${prefix}|g" \
117              ${package.resources}/InstallationCheck
118        reinplace "s|__DARWINVERS__|${os.major}|" ${package.resources}/InstallationCheck
119        reinplace "s|__XVERS__|${macosx_deployment_target}|" \
120            ${resources_lang}/InstallationCheck.strings
121    }
122    # won't be there before the pkg is built with older base versions
123    if {[file isfile ${resources_lang}/Welcome.html]} {
124        reinplace "s|or newer ||" ${resources_lang}/Welcome.html
125        if {${os.major} > 8} {
126            reinplace "s|10\\.4|${macosx_deployment_target}|" ${resources_lang}/Welcome.html
127        }
128    }
129}
130
131post-pkg {
132    # for older base versions
133    set lproj ${workpath}/${name}-${version}.pkg/Contents/Resources/English.lproj
134    if {[file isfile ${lproj}/Welcome.html]} {
135        reinplace "s|or newer ||" ${resources_lang}/Welcome.html
136        if {${os.major} > 8} {
137            reinplace "s|10\\.4|${macosx_deployment_target}|" ${resources_lang}/Welcome.html
138        }
139    }
140}
141
142platform darwin 8 powerpc {
143    pre-configure {
144        set sdkrootpath /Developer/SDKs/MacOSX10.4u.sdk
145        if {[file exists ${sdkrootpath}]} {
146            # User has SDK installed.
147            set tclstubpath /System/Library/Frameworks/Tcl.framework/Versions/8.4/libtclstub8.4.a
148            if {![file exists ${sdkrootpath}${tclstubpath}]} {
149                ui_msg "Fixing your MacOSX10.4u installation by copying libtclstub8.4.a to ${sdkrootpath}${tclstubpath}"
150                xinstall -p ${tclstubpath} ${sdkrootpath}${tclstubpath}
151            }
152            # Supply architecture and sysroot flags to build MacPorts universal.
153            configure.cflags-append -isysroot ${sdkrootpath} -arch ppc -arch i386
154            configure.env-append SHLIB_LDFLAGS='-Wl,-syslibroot,${sdkrootpath} -arch ppc -arch i386'
155        }
156    }
157}
158
159platform darwin 8 i386 {
160    # Supply architecture flags to build MacPorts universal.
161    configure.cflags-append -arch ppc -arch i386
162    configure.args-append SHLIB_LDFLAGS='-arch ppc -arch i386'
163}
164
165platform darwin 9 {
166    # Supply architecture flags to build MacPorts universal.
167    configure.cflags-append -arch ppc -arch i386
168    configure.args-append SHLIB_LDFLAGS='-arch ppc -arch i386'
169}
170
171platform darwin {
172    if {${os.major} >= 10} {
173        # Supply architecture flags to build MacPorts universal.
174        configure.cflags-append -arch x86_64 -arch i386
175        configure.args-append SHLIB_LDFLAGS='-arch x86_64 -arch i386'
176    }
177}
178
179destroot.violate_mtree yes
180destroot.keepdirs    ${destroot}${prefix}/include \
181                     ${destroot}${prefix}/lib \
182                     ${destroot}${prefix}/libexec \
183                     ${destroot}${prefix}/sbin \
184                     ${destroot}${prefix}/share/info \
185                     ${destroot}${prefix}/share/man/cat1 \
186                     ${destroot}${prefix}/share/man/cat2 \
187                     ${destroot}${prefix}/share/man/cat3 \
188                     ${destroot}${prefix}/share/man/cat4 \
189                     ${destroot}${prefix}/share/man/cat5 \
190                     ${destroot}${prefix}/share/man/cat6 \
191                     ${destroot}${prefix}/share/man/cat7 \
192                     ${destroot}${prefix}/share/man/cat8 \
193                     ${destroot}${prefix}/share/man/cat9 \
194                     ${destroot}${prefix}/share/man/catl \
195                     ${destroot}${prefix}/share/man/catn \
196                     ${destroot}${prefix}/share/man/man1 \
197                     ${destroot}${prefix}/share/man/man2 \
198                     ${destroot}${prefix}/share/man/man3 \
199                     ${destroot}${prefix}/share/man/man4 \
200                     ${destroot}${prefix}/share/man/man5 \
201                     ${destroot}${prefix}/share/man/man6 \
202                     ${destroot}${prefix}/share/man/man7 \
203                     ${destroot}${prefix}/share/man/man8 \
204                     ${destroot}${prefix}/share/man/man9 \
205                     ${destroot}${prefix}/share/man/manl \
206                     ${destroot}${prefix}/share/man/mann \
207                     ${destroot}${prefix}/share/nls/C \
208                     ${destroot}${prefix}/share/nls/skel \
209                     ${destroot}${prefix}/share/nls/af_ZA.ISO8859-1 \
210                     ${destroot}${prefix}/share/nls/af_ZA.ISO8859-15 \
211                     ${destroot}${prefix}/share/nls/bg_BG.CP1251 \
212                     ${destroot}${prefix}/share/nls/cs_CZ.ISO8859-2 \
213                     ${destroot}${prefix}/share/nls/da_DK.ISO8859-1 \
214                     ${destroot}${prefix}/share/nls/da_DK.ISO8859-15 \
215                     ${destroot}${prefix}/share/nls/de_AT.ISO8859-1 \
216                     ${destroot}${prefix}/share/nls/de_AT.ISO8859-15 \
217                     ${destroot}${prefix}/share/nls/de_CH.ISO8859-1 \
218                     ${destroot}${prefix}/share/nls/de_CH.ISO8859-15 \
219                     ${destroot}${prefix}/share/nls/de_DE.ISO8859-1 \
220                     ${destroot}${prefix}/share/nls/de_DE.ISO8859-15 \
221                     ${destroot}${prefix}/share/nls/el_GR.ISO8859-7 \
222                     ${destroot}${prefix}/share/nls/en_AU.ISO8859-1 \
223                     ${destroot}${prefix}/share/nls/en_AU.ISO8859-15 \
224                     ${destroot}${prefix}/share/nls/en_AU.US-ASCII \
225                     ${destroot}${prefix}/share/nls/en_CA.ISO8859-1 \
226                     ${destroot}${prefix}/share/nls/en_CA.ISO8859-15 \
227                     ${destroot}${prefix}/share/nls/en_CA.US-ASCII \
228                     ${destroot}${prefix}/share/nls/en_GB.ISO8859-1 \
229                     ${destroot}${prefix}/share/nls/en_GB.ISO8859-15 \
230                     ${destroot}${prefix}/share/nls/en_GB.US-ASCII \
231                     ${destroot}${prefix}/share/nls/en_NZ.ISO8859-1 \
232                     ${destroot}${prefix}/share/nls/en_NZ.ISO8859-15 \
233                     ${destroot}${prefix}/share/nls/en_NZ.US-ASCII \
234                     ${destroot}${prefix}/share/nls/en_US.ISO8859-1 \
235                     ${destroot}${prefix}/share/nls/en_US.ISO8859-15 \
236                     ${destroot}${prefix}/share/nls/es_ES.ISO8859-1 \
237                     ${destroot}${prefix}/share/nls/es_ES.ISO8859-15 \
238                     ${destroot}${prefix}/share/nls/et_EE.ISO8859-15 \
239                     ${destroot}${prefix}/share/nls/fi_FI.ISO8859-1 \
240                     ${destroot}${prefix}/share/nls/fi_FI.ISO8859-15 \
241                     ${destroot}${prefix}/share/nls/fr_BE.ISO8859-1 \
242                     ${destroot}${prefix}/share/nls/fr_BE.ISO8859-15 \
243                     ${destroot}${prefix}/share/nls/fr_CA.ISO8859-1 \
244                     ${destroot}${prefix}/share/nls/fr_CA.ISO8859-15 \
245                     ${destroot}${prefix}/share/nls/fr_CH.ISO8859-1 \
246                     ${destroot}${prefix}/share/nls/fr_CH.ISO8859-15 \
247                     ${destroot}${prefix}/share/nls/fr_FR.ISO8859-1 \
248                     ${destroot}${prefix}/share/nls/fr_FR.ISO8859-15 \
249                     ${destroot}${prefix}/share/nls/hi_IN.ISCII-DEV \
250                     ${destroot}${prefix}/share/nls/hr_HR.ISO8859-2 \
251                     ${destroot}${prefix}/share/nls/hu_HU.ISO8859-2 \
252                     ${destroot}${prefix}/share/nls/is_IS.ISO8859-1 \
253                     ${destroot}${prefix}/share/nls/is_IS.ISO8859-15 \
254                     ${destroot}${prefix}/share/nls/it_CH.ISO8859-1 \
255                     ${destroot}${prefix}/share/nls/it_CH.ISO8859-15 \
256                     ${destroot}${prefix}/share/nls/it_IT.ISO8859-1 \
257                     ${destroot}${prefix}/share/nls/it_IT.ISO8859-15 \
258                     ${destroot}${prefix}/share/nls/ja_JP.SJIS \
259                     ${destroot}${prefix}/share/nls/ja_JP.eucJP \
260                     ${destroot}${prefix}/share/nls/ko_KR.eucKR \
261                     ${destroot}${prefix}/share/nls/la_LN.ISO8859-1 \
262                     ${destroot}${prefix}/share/nls/la_LN.ISO8859-15 \
263                     ${destroot}${prefix}/share/nls/la_LN.ISO8859-2 \
264                     ${destroot}${prefix}/share/nls/la_LN.ISO8859-4 \
265                     ${destroot}${prefix}/share/nls/la_LN.US-ASCII \
266                     ${destroot}${prefix}/share/nls/lt_LT.ISO8859-4 \
267                     ${destroot}${prefix}/share/nls/nl_BE.ISO8859-1 \
268                     ${destroot}${prefix}/share/nls/nl_BE.ISO8859-15 \
269                     ${destroot}${prefix}/share/nls/nl_NL.ISO8859-1 \
270                     ${destroot}${prefix}/share/nls/nl_NL.ISO8859-15 \
271                     ${destroot}${prefix}/share/nls/no_NO.ISO8859-1 \
272                     ${destroot}${prefix}/share/nls/no_NO.ISO8859-15 \
273                     ${destroot}${prefix}/share/nls/pl_PL.ISO8859-2 \
274                     ${destroot}${prefix}/share/nls/pt_BR.ISO8859-1 \
275                     ${destroot}${prefix}/share/nls/pt_PT.ISO8859-1 \
276                     ${destroot}${prefix}/share/nls/pt_PT.ISO8859-15 \
277                     ${destroot}${prefix}/share/nls/ro_RO.ISO8859-2 \
278                     ${destroot}${prefix}/share/nls/ru_RU.CP866 \
279                     ${destroot}${prefix}/share/nls/ru_RU.ISO8859-5 \
280                     ${destroot}${prefix}/share/nls/ru_RU.KOI8-R \
281                     ${destroot}${prefix}/share/nls/sk_SK.ISO8859-2 \
282                     ${destroot}${prefix}/share/nls/sl_SI.ISO8859-2 \
283                     ${destroot}${prefix}/share/nls/sv_SE.ISO8859-1 \
284                     ${destroot}${prefix}/share/nls/sv_SE.ISO8859-15 \
285                     ${destroot}${prefix}/share/nls/tr_TR.ISO8859-9 \
286                     ${destroot}${prefix}/share/nls/uk_UA.ISO8859-5 \
287                     ${destroot}${prefix}/share/nls/uk_UA.KOI8-U \
288                     ${destroot}${prefix}/share/nls/zh_CN.eucCN \
289                     ${destroot}${prefix}/share/nls/zh_TW.Big5 \
290                     ${destroot}${prefix}/var/macports/build \
291                     ${destroot}${prefix}/var/macports/distfiles \
292                     ${destroot}${prefix}/var/macports/registry
Note: See TracBrowser for help on using the repository browser.