[144726] trunk/dports/science
cal at macports.org
cal at macports.org
Sat Jan 16 06:54:58 PST 2016
Revision: 144726
https://trac.macports.org/changeset/144726
Author: cal at macports.org
Date: 2016-01-16 06:54:58 -0800 (Sat, 16 Jan 2016)
Log Message:
-----------
esorepo: Provide easy access to ESO's ports tree
Closes #46954
Added Paths:
-----------
trunk/dports/science/esorepo/
trunk/dports/science/esorepo/Portfile
Added: trunk/dports/science/esorepo/Portfile
===================================================================
--- trunk/dports/science/esorepo/Portfile (rev 0)
+++ trunk/dports/science/esorepo/Portfile 2016-01-16 14:54:58 UTC (rev 144726)
@@ -0,0 +1,127 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+
+name esorepo
+version 1.1
+categories science
+license GPL-2+
+platforms darwin
+supported_archs noarch
+maintainers eso.org:usd-help
+
+description ESO repository of software for astronomical data reduction
+
+long_description \
+ The European Southern Observatory (ESO) maintains and distributes a number \
+ of open source software packages (e.g. data reduction pipelines and front-end \
+ tools) for the astronomical science community. This port provides a convenient \
+ configuration mechanism to add an additional repository URL to allow further \
+ installation of ESO software via MacPorts.
+
+homepage http://www.eso.org/sci/software
+master_sites ftp://ftp.eso.org/pub/dfs/pipelines/repositories/macports/
+
+fetch {}
+checksum {}
+extract {}
+test {}
+use_configure no
+
+build {
+ set key_file [open "${workpath}/eso-pubkey.pem" w]
+ puts ${key_file} "-----BEGIN PUBLIC KEY-----"
+ puts ${key_file} "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy2Au5qRNn/zoRRZ7rdsn"
+ puts ${key_file} "g3lbrM33Iz3xew4yZD5L6LI69qVVfmaUsELreeK+bZAf8bLl5+HYHHvM/pBZq/+6"
+ puts ${key_file} "LBf+NnESVwmKfhEppHim3MqRNyTfSOJAM+J1xt1/dvZkBX8ehZO8piRRaKUPzauW"
+ puts ${key_file} "WhahV417jD37AWKXlRCNPxUtgEk7kRrMQuP4olWWVul+m7piGrDMzQsAOtvEMX5R"
+ puts ${key_file} "J5Ygr3iZNq8WSXhAMqfm6cksxq7kMa8sfpw8lU1jXKfN4wREH3w2oJohkkTYFqUq"
+ puts ${key_file} "0FBnqBkGZlv5e1FUEFW1rnvUpbzOxgDgfdOKwzqNWw2EGl6baQT63iIqa752kCE7"
+ puts ${key_file} "SwIDAQAB"
+ puts ${key_file} "-----END PUBLIC KEY-----"
+ close ${key_file}
+}
+
+destroot {
+ xinstall -m 755 -d ${destroot}${prefix}/share/${name}
+ xinstall -m 644 ${workpath}/eso-pubkey.pem ${destroot}${prefix}/share/${name}/eso-pubkey.pem
+}
+
+pre-activate {
+ set config_file [open ${prefix}/etc/macports/sources.conf r]
+ set config_data [read ${config_file}]
+ close ${config_file}
+ set already_in_sources 0
+ if {[regexp -line {^ftp://ftp\.eso\.org/pub/dfs/pipelines/repositories/macports/ports\.tar$} ${config_data}]} {
+ set already_in_sources 1
+ ui_error "${prefix}/etc/macports/sources.conf already contains a reference to ftp://ftp.eso.org/pub/dfs/pipelines/repositories/macports/ports.tar."
+ }
+ set config_file [open ${prefix}/etc/macports/archive_sites.conf r]
+ set config_data [read ${config_file}]
+ close ${config_file}
+ set already_in_archive_sites 0
+ if {[regexp -line {^urls\s+ftp://ftp\.eso\.org/pub/dfs/pipelines/repositories/macports/packages$} ${config_data}]} {
+ set already_in_archive_sites 1
+ ui_error "${prefix}/etc/macports/archive_sites.conf already contains a reference to ftp://ftp.eso.org/pub/dfs/pipelines/repositories/macports/packages."
+ }
+ set config_file [open ${prefix}/etc/macports/pubkeys.conf r]
+ set config_data [read ${config_file}]
+ close ${config_file}
+ set already_in_pubkeys 0
+ # Check for the public key reference with a loop rather than regexp, since ${prefix} may contain one of '[](){}?.\'
+ foreach line [split ${config_data} "\n"] {
+ if {"${line}" == "${prefix}/share/${name}/eso-pubkey.pem"} {
+ set already_in_pubkeys 1
+ ui_error "${prefix}/etc/macports/pubkeys.conf already contains a reference to ${prefix}/share/${name}/eso-pubkey.pem."
+ break
+ }
+ }
+ if {${already_in_sources} || ${already_in_archive_sites} || ${already_in_pubkeys}} {
+ ui_error "A number of references to the ESO repository have already been configured."
+ ui_error "Thus, either the repository is already accessible, in which case this port is"
+ ui_error "not necessary, or the configuration is not complete."
+ ui_error "If you want to add the ESO repository to MacPorts with this port then remove"
+ ui_error "all references mentioned above and try install this port again."
+ return -code error "ESO repository might have already been configured manually."
+ }
+ set config_file [open ${prefix}/etc/macports/sources.conf a]
+ puts ${config_file} "# ESO MacPorts Portfile source repository (automatically added by ${name})."
+ puts ${config_file} "ftp://ftp.eso.org/pub/dfs/pipelines/repositories/macports/ports.tar"
+ close ${config_file}
+ set config_file [open ${prefix}/etc/macports/archive_sites.conf a]
+ puts ${config_file} "# ESO MacPorts binary package repository (automatically added by ${name})."
+ puts ${config_file} "name ESO repository"
+ puts ${config_file} "type tbz2"
+ puts ${config_file} "prefix /opt/local"
+ puts ${config_file} "applications_dir /Applications/MacPorts"
+ puts ${config_file} "frameworks_dir /opt/local/Library/Frameworks"
+ puts ${config_file} "urls ftp://ftp.eso.org/pub/dfs/pipelines/repositories/macports/packages"
+ close ${config_file}
+ set config_file [open ${prefix}/etc/macports/pubkeys.conf a]
+ puts ${config_file} "# ESO RSA public signature key (automatically added by ${name})."
+ puts ${config_file} "${prefix}/share/${name}/eso-pubkey.pem"
+ close ${config_file}
+}
+
+post-deactivate {
+ reinplace -E "/^# ESO MacPorts Portfile source repository \\(automatically added by ${name}\\)\\.\[\[:space:]]*$/{ \
+ N;/\\nftp:\\/\\/ftp\\.eso\\.org\\/pub\\/dfs\\/pipelines\\/repositories\\/macports\\/ports\\.tar\[\[:space:]]*$/d;}" \
+ ${prefix}/etc/macports/sources.conf
+ reinplace -E "/^# ESO MacPorts binary package repository \\(automatically added by ${name}\\)\\.\[\[:space:]]*$/{ \
+ N;N;N;N;N;N;/\\nurls \[\[:space:]]*ftp:\\/\\/ftp\\.eso\\.org\\/pub\\/dfs\\/pipelines\\/repositories\\/macports\\/packages\[\[:space:]]*$/d;}" \
+ ${prefix}/etc/macports/archive_sites.conf
+ reinplace -E "/^# ESO RSA public signature key \\(automatically added by ${name}\\)\\.\[\[:space:]]*$/{ \
+ N;/\\n\[^#]*\\/share\\/${name}\\/eso-pubkey\\.pem\[\[:space:]]*$/d;}" \
+ ${prefix}/etc/macports/pubkeys.conf
+}
+
+notes "\
+ Please run 'sudo port sync' to synchronize with the ESO repository.\n\n\
+ WARNING: This port adds additional sources, binary download servers and\
+ cryptographic keys to your MacPorts installation. It is technically\
+ possible for ESO to provide modified binary packages signed with their key\
+ for ports that are not part of their repository. Additionally, ESO's FTP\
+ server will be checked for available binary packages for each\
+ installation, which may give ESO metadata about what you are trying to\
+ install. If you do not want this, you can always uninstall this port."
Property changes on: trunk/dports/science/esorepo/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160116/80e486f7/attachment-0001.html>
More information about the macports-changes
mailing list