source: trunk/dports/science/htcondor/Portfile @ 107162

Last change on this file since 107162 was 107162, checked in by aronnax@…, 7 years ago

htcondor: add variants for different versions of Python

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.5 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 107162 2013-06-20 19:34:39Z aronnax@macports.org $
3
4PortSystem              1.0
5PortGroup               github 1.0
6PortGroup               cmake 1.0
7PortGroup               active_variants 1.1
8
9github.setup            htcondor htcondor 8_0_0 V
10version                 [strsed ${github.version} g/_/\./]
11revision                1
12maintainers             aronnax
13
14categories              science parallel net
15license                 apache
16platforms               darwin
17description \
18  specialized workload management system for compute-intensive jobs
19long_description \
20  HTCondor is a specialized workload management system for compute-intensive \
21  jobs. Like other full-featured batch systems, HTCondor provides a job \
22  queueing mechanism, scheduling policy, priority scheme, resource monitoring, \
23  and resource management. Users submit their serial or parallel jobs to \
24  HTCondor, HTCondor places them into a queue, chooses when and where to run \
25  the jobs based upon a policy, carefully monitors their progress, and \
26  ultimately informs the user upon completion.
27homepage                http://research.cs.wisc.edu/htcondor
28
29default_variants        +personal +python27
30
31variant personal \
32  description "configure your computer as a one-node personal Condor pool" {
33
34    add_users           condor group=condor
35
36    startupitem.create  yes
37    startupitem.name    ${name}
38    startupitem.start   "${prefix}/sbin/condor_master -f"
39    startupitem.stop    "${prefix}/sbin/condor_off -all -master"
40}
41
42set pythons_suffixes {25 26 27 31 32 33}
43
44set pythons_ports {}
45foreach s ${pythons_suffixes} {
46    lappend pythons_ports python${s}
47}
48
49configure.args-append   -DWITH_PYTHON_BINDINGS:BOOL="0"
50
51foreach s ${pythons_suffixes} {
52    set p python${s}
53    set v [string index ${s} 0].[string index ${s} 1]
54    set i [lsearch -exact ${pythons_ports} ${p}]
55    set c [lreplace ${pythons_ports} ${i} ${i}]
56    set d ${frameworks_dir}/Python.framework/Versions/${v}/lib/python${v}
57    eval [subst {
58        variant ${p} description "Enable Python interface for Python ${v}" conflicts ${c} {
59
60            depends_lib-append      port:${p}
61            require_active_variants boost ${p}
62            configure.args-append   -DC_PYTHONARCHLIB:PATH="${d}/site-packages"
63            configure.args-strsed   s/-DWITH_PYTHON_BINDINGS:BOOL="0"/-DWITH_PYTHON_BINDINGS:BOOL="1"/
64
65            post-patch {
66                reinplace "s|@prefix@|${prefix}|g" ${worksrcpath}/src/condor_utils/condor_config.cpp
67                reinplace "s|@c_pythonarchlib@|${d}/site-packages|g" ${worksrcpath}/build/cmake/CondorPackageConfig.cmake
68            }
69
70        }
71    }]
72}
73
74checksums               rmd160  d7a11387a78b1a25d2ecd04f2d136d74f2f5fb6c \
75                        sha256  d07e2ccc24beefc84f5c878b702468e52ca20a26ef326b3eca2a2c531fa95876
76
77depends_build-append    port:latex2html
78
79depends_lib-append      port:boost \
80                        port:expat \
81                        port:kerberos5 \
82                        port:openssl \
83                        port:pcre
84
85license_noconflict      latex2html
86
87# FIXME: For some reason, Condor uses install_name_tool to have dynamic links
88# point to @executable_path/../lib/condor/libexpat.1.dylib, etc, instead of
89# @executable_path/../lib/libexpat.1.dylib, etc. Why?
90patchfiles              patch-src-condor_scripts-macosx_rewrite_libs.diff \
91                        patch-src-condor_utils-condor_config.cpp.diff \
92                        patch-src-python-bindings-CMakeLists.txt.diff \
93                        patch-build-cmake-CondorPackageConfig.cmake.diff
94
95post-patch {
96    reinplace "s|@prefix@|${prefix}|g" ${worksrcpath}/src/condor_utils/condor_config.cpp
97}
98
99compiler.blacklist      clang
100
101# FIXME: Globus support is disabled because Globus is not available in MacPorts.
102configure.args-append   -DWITH_GLOBUS:BOOL="0" -DBUILD_TESTING:BOOL="0"
103
104# Man pages are not part of the default build target.
105post-build {
106    system -W ${worksrcpath}/doc "make just-man-pages"
107}
108
109# These are empty directories that are needed by the personal Condor pool.
110destroot.keepdirs       ${destroot}${prefix}/etc/condor/config.d \
111                        ${destroot}${prefix}/var/lib/condor/execute \
112                        ${destroot}${prefix}/var/lib/condor/spool \
113                        ${destroot}${prefix}/var/log/condor
114
115# Condor installs some documentation into ${prefix}. Move them into
116# ${prefix}/share/doc/${name}.
117post-destroot {
118    # Move manpages into place.
119    eval xinstall [glob ${worksrcpath}/doc/man/man1/*] \
120        ${destroot}${prefix}/share/man/man1
121
122    # Remove SysV-init and Fedora-style service scripts.
123    # See https://htcondor-wiki.cs.wisc.edu/index.cgi/tktview?tn=3684
124    file delete ${destroot}${prefix}/etc/init.d/condor
125    file delete ${destroot}${prefix}/etc/sysconfig/condor
126
127    # Remove packaging scripts.
128    file delete ${destroot}${prefix}/sbin/condor_configure
129    file delete ${destroot}${prefix}/sbin/condor_install
130
131    # Move documentation into ${prefix}/share.
132    file mkdir ${destroot}${prefix}/share/doc/${name}
133    move \
134      ${destroot}${prefix}/examples \
135      ${destroot}${prefix}/LICENSE-2.0.txt \
136      ${destroot}${prefix}/README \
137      ${destroot}${prefix}/share/doc/${name}
138
139    # Move example configuration files from ${prefix}/etc to ${prefix}/share.
140    move \
141      ${destroot}${prefix}/etc/examples \
142      ${destroot}${prefix}/share/doc/${name}/examples/config
143
144    # If deploying a personal Condor pool, create all necessary directories.
145    if {[variant_isset personal]} {
146        xinstall -d ${destroot}${prefix}/etc/condor/config.d
147        xinstall ${filespath}/condor_config ${destroot}${prefix}/etc/condor
148        reinplace "s|@prefix@|${prefix}|g" ${destroot}${prefix}/etc/condor/condor_config
149        xinstall ${filespath}/condor_config.local ${destroot}${prefix}/etc/condor
150
151        xinstall -d ${destroot}${prefix}/var/lib
152        xinstall -d -o condor -g condor ${destroot}${prefix}/var/lib/condor/execute
153        xinstall -d -o condor -g condor ${destroot}${prefix}/var/lib/condor/spool
154        xinstall -d ${destroot}${prefix}/var/log
155        xinstall -d -o condor -g condor ${destroot}${prefix}/var/log/condor
156    }
157}
158
159# Override default GitHub livecheck because the HTCondor git repository has
160# thousands of tags, and GitHub has to paginate the tags.
161livecheck.type          regexm
162livecheck.url           ${homepage}/downloads/
163livecheck.version       ${version}
164livecheck.regex         {Current Stable Release</td>\s*<td [^>]*>([0-9]+(\.[0-9]+)+)}
Note: See TracBrowser for help on using the repository browser.