[89202] trunk/dports/science
ram at macports.org
ram at macports.org
Fri Jan 20 19:24:25 PST 2012
Revision: 89202
http://trac.macports.org/changeset/89202
Author: ram at macports.org
Date: 2012-01-20 19:24:24 -0800 (Fri, 20 Jan 2012)
Log Message:
-----------
science/ligo-lvalert: new port
Added Paths:
-----------
trunk/dports/science/ligo-lvalert/
trunk/dports/science/ligo-lvalert/Portfile
trunk/dports/science/ligo-lvalert/files/
trunk/dports/science/ligo-lvalert/files/patch-disable_server.diff
Added: trunk/dports/science/ligo-lvalert/Portfile
===================================================================
--- trunk/dports/science/ligo-lvalert/Portfile (rev 0)
+++ trunk/dports/science/ligo-lvalert/Portfile 2012-01-21 03:24:24 UTC (rev 89202)
@@ -0,0 +1,42 @@
+# $Id$
+
+PortSystem 1.0
+PortGroup python27 1.0
+
+name ligo-lvalert
+version 1.0
+categories science
+platforms darwin
+maintainers ram
+license GPL
+
+description The LIGO-Virgo Alert System
+long_description \
+ A prototype notification service built on the xmpp (jabber) protocol \
+ and the pubsub extension. It provides a basic notification tool \
+ which allows multiple producers and consumers of notifications.
+
+homepage https://www.lsc-group.phys.uwm.edu/daswg/projects/lvalert.html
+master_sites http://www.lsc-group.phys.uwm.edu/daswg/download/software/source/
+
+checksums md5 179776a3576efa70e339a71da107252a \
+ sha1 f765da15ed4d3066af70747fd45deb749c2ecedd \
+ rmd160 1a86daa2df47843cd12647140f05120b646043ec
+
+patchfiles patch-disable_server.diff
+
+depends_lib-append port:ligo-common \
+ port:py27-pyxmpp \
+ port:py27-libxml2 \
+ port:py27-m2crypto \
+ port:py27-dnspython
+
+python.link_binaries no
+
+post-destroot {
+ foreach x [glob -type {x} ${destroot}${python.prefix}/bin/*] { system "ln $x ${destroot}${prefix}/bin" }
+}
+
+livecheck.type regex
+livecheck.url ${master_sites}
+livecheck.regex {ligo-lvalert-(\d+(?:\.\d+)*).tar.gz}
Property changes on: trunk/dports/science/ligo-lvalert/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/dports/science/ligo-lvalert/files/patch-disable_server.diff
===================================================================
--- trunk/dports/science/ligo-lvalert/files/patch-disable_server.diff (rev 0)
+++ trunk/dports/science/ligo-lvalert/files/patch-disable_server.diff 2012-01-21 03:24:24 UTC (rev 89202)
@@ -0,0 +1,207 @@
+--- ligo/lvalert/__init__.py
++++ ligo/lvalert/__init__.py
+@@ -16,6 +16,6 @@
+
+ __author__ = "LIGO Scientific Collaboration"
+
+-__all__ = ["pubsub", "lvstanzaprocessor", "utils"]
++__all__ = ["pubsub", "lvstanzaprocessor"]
+
+ GIT_TAG = 'lvalert-1.0-3'
+--- ligo/lvalert/utils.py
++++ /dev/null
+@@ -1,194 +0,0 @@
+-#!/usr/bin/python
+-
+-import sys
+-import os
+-import urlparse
+-from optparse import *
+-from subprocess import Popen,PIPE
+-
+-# Note that some of these utilities are not available unless glue is installed.
+-
+-import warnings
+-
+-try:
+- from glue.ligolw import ligolw
+- from glue.ligolw import table
+- from glue.ligolw.table import Table
+- from glue.ligolw import lsctables
+- from glue.ligolw import utils
+-except ImportError:
+- Table = object
+- warnings.warn("Glue is not installed. Some lvalert.utils functions require glue")
+-
+-##############################################################################
+-#
+-# definition of the LVAlertTable
+-#
+-##############################################################################
+-
+-class LVAlertTable(Table):
+- """
+- for reference, file is written as
+- file: //host/path_to_file/file
+- uid: the unique id assigned by gracedb
+- temp_data_loc: current location (just the directory)
+- of the ouput of the pipeline (this is VOLATILE)
+- """
+- tableName = "LVAlert:table"
+- validcolumns = {
+- "file": "lstring",
+- "uid": "lstring",
+- "temp_data_loc": "lstring",
+- "alert_type": "lstring",
+- "description": "lstring",
+- }
+-
+-class LVAlertRow(object):
+- __slots__ = LVAlertTable.validcolumns.keys()
+-
+-LVAlertTable.RowType = LVAlertRow
+-
+-##############################################################################
+-#
+-# useful utilities
+-#
+-##############################################################################
+-
+-def parse_file_url(file_url):
+- """
+- simple function to parse the file urls of the form:
+- file://host_name/path_to_file/file
+- where path_to_file is assumed to be the /private subdir of a gracedb entry
+- returns:
+- host: host_name in the above example
+- full_path: path_to_file/file in the above example
+- general_dir: the /general subdir of the gracedb entry (where data not
+- produced by the event supplier should be placed)
+- """
+- parsed = urlparse.urlparse(file_url)
+- host = parsed[1]
+- path, fname = os.path.split(parsed[2])
+-
+- return host, path, fname
+-
+-def get_LVAdata_from_stdin(std_in, as_dict=False):
+- """
+- this function takes an LVAlertTable from sys.stdin and it returns:
+- host: the machine the payload file was created on
+- full_path: the full path to (and including) the payload file
+- general_dir: the directory in gracedb that the output of your code should
+- be written to
+- uid: the gracedb unique id associated with the event in the LVAlertTable
+- """
+- doc = utils.load_fileobj(std_in)[0]
+- lvatable = table.get_table(doc, LVAlertTable.tableName)
+- file = lvatable[0].file
+- uid = lvatable[0].uid
+- data_loc = lvatable[0].temp_data_loc
+-
+- if as_dict:
+- return {
+- "file" : lvatable[0].file,
+- "uid" : lvatable[0].uid,
+- "data_loc" : lvatable[0].temp_data_loc,
+- "description" : lvatable[0].description,
+- "alert_type" : lvatable[0].alert_type,
+- }
+-
+- return file, uid, data_loc
+-
+-def get_LVAdata_from_file(filename, as_dict=False):
+- """
+- this function takes the name of an xml file containing a single LVAlertTable
+- and it returns:
+- host: the machine the payload file was created on
+- full_path: the full path to (and including) the payload file
+- general_dir: the directory in gracedb that the output of your code should
+- be written to
+- uid: the gracedb unique id associated with the event in the LVAlertTable
+- """
+- doc = utils.load_filename(filename)
+- lvatable = table.get_table(doc, LVAlertTable.tableName)
+- file = lvatable[0].file
+- uid = lvatable[0].uid
+- data_loc = lvatable[0].temp_data_loc
+-
+- if as_dict:
+- return {
+- "file" : lvatable[0].file,
+- "uid" : lvatable[0].uid,
+- "data_loc" : lvatable[0].temp_data_loc,
+- "description" : lvatable[0].description,
+- "alert_type" : lvatable[0].alert_type,
+- }
+-
+- return file, uid, data_loc
+-
+-def make_LVAlertTable(file_url, uid, data_loc, alert_type="new", desc=""):
+- """
+- create xml doc which contains an LVAlert Table
+- with submission file file_loc and data located at data_loc
+- """
+- xmldoc = ligolw.Document()
+- xmldoc.appendChild(ligolw.LIGO_LW())
+- lvalerttable = lsctables.New(LVAlertTable)
+- row = lvalerttable.RowType()
+- row.file = file_url
+- row.uid = uid
+- row.temp_data_loc = data_loc
+- row.alert_type = alert_type
+- row.description = desc
+- lvalerttable.append(row)
+- xmldoc.childNodes[0].appendChild(lvalerttable)
+-
+- return xmldoc
+-
+-
+-#the following is meant as a template for small jobs
+-#notes:
+-# * we only use the vanilla universe which is appropriate for python
+-# jobs and things not condor-compiled
+-# * it only works for single-process jobs; anything more complicated will
+-# require a dag
+-condor_sub_template = \
+- """
+- universe = vanilla
+- executable = macroexecutible
+- arguments = macroargs
+- log = macrolog
+- error = macroerr
+- output = macroout
+- getenv = True
+- notification = never
+- queue
+- """
+-def write_condor_sub(executible, args, logdir, uid):
+- """
+- write a simple condor submission file
+- uid: unique id used in naming the files (to avoid conflicts)
+- executible: the name of the executible file
+- args: a list of arguments to executible
+- logdir: directory to keep log files
+- returns the name of the file
+- """
+- subfile = condor_sub_template.replace('macroexecutible', executible)\
+- .replace('macroargs', args)\
+- .replace('macrolog', os.path.join(logdir,str(uid)+'.log'))\
+- .replace('macroerr', os.path.join(logdir,str(uid)+'.err'))\
+- .replace('macroout', os.path.join(logdir,str(uid)+'.out'))
+- fname = str(uid) + '.sub'
+- f = open(fname,'w')
+- f.write(subfile)
+- f.close()
+-
+- return fname
+-
+-def submit_condor_job(subfile):
+- """
+- submit the subfile to condor
+- returns the process id
+- """
+- p = Popen(["condor_submit "+subfile], shell=True).pid
+-
+- return p
+-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120120/1c7c986b/attachment.html>
More information about the macports-changes
mailing list