Ticket #52722: Portfile

File Portfile, 3.1 KB (added by akkornel (A. Karl Kornel), 8 years ago)

The Portfile

Line 
1# -*- 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
2# $Id$
3
4PortSystem              1.0
5PortGroup           github 1.0
6
7github.setup        dun munge 0.5.12 munge-
8categories                  net security
9license             GPL-3
10maintainers         kornel.us:karl
11description         Creating and validating credentials in HPC clusters.
12long_description    MUNGE (MUNGE Uid 'N' Gid Emporium) is an authentication \
13                    service for creating and validating credentials.  It is \
14                    designed to be highly scalable for use in an HPC cluster \
15                    environment.  It allows a process to authenticate the UID \
16                    and GID of another local or remote process within a group \
17                    of hosts having common users and groups.  These hosts form \
18                    a security realm that is defined by a shared cryptographic \
19                    key.  Clients within this security realm can create and \
20                    validate credentials without the use of root privileges, \
21                    reserved ports, or platform-specific methods.
22homepage            https://dun.github.io/munge/
23
24platforms               darwin
25checksums               rmd160 0bc366a2d0a49875e7cf35ea2aebeef33490ed0c \
26                    sha256 23585c1da3f4ea7c2882511c0a08220a2be13d9c03e54486bb8546791fa6c89b
27
28# We can either use OpenSSL or libgcrypt.  Let's default to OpenSSL.
29depends_lib-append      port:openssl
30use_configure           yes
31configure.args      --with-crypto-lib=openssl \
32                    --with-openssl-prefix=${prefix}
33
34# Allow using libgcrypt instead of OpenSSL.
35variant libgcrypt description {Use libgcrypt for cryptograpic routines} {
36    depends_lib-delete      port:openssl
37    depends_lib-append      port:libgcrypt
38    configure.args-delete   --with-crypto-lib=openssl \
39                            --with-openssl-prefix=${prefix}
40    configure.args-append   --with-crypto-lib=libgcrypt \
41                            --with-libgcrypt-prefix=${prefix}
42}
43
44# Allow doing testing
45test.run            yes
46test.target         check
47
48# When activating, make sure certain things are set
49post-activate {
50    # Create directories for config and for munge runtime
51    xinstall -m 700 -d ${prefix}/etc/munge
52    xinstall -m 711 -d ${prefix}/var/lib/munge
53    xinstall -m 755 -d ${prefix}/var/run/munge
54
55    # If a key doens't already exist, create a new one.
56    if {![file exists ${prefix}/etc/munge/munge.key]} {
57        system "dd if=/dev/urandom of=${prefix}/etc/munge/munge.key bs=1 count=1024"
58        file attributes ${prefix}/etc/munge/munge.key -permissions 0600
59    }
60
61}
62notes "Once munge is activated, a random key will be generated and placed at ${prefix}/etc/munge/munge.key.  If you put in your own key, make sure only root can access it, and remember to restart munged!"
63
64# Create a startup item for munge
65startupitem.create      yes
66startupitem.name        munged
67startupitem.executable  ${prefix}/sbin/munged --foreground
68startupitem.logfile     ${prefix}/var/log/munged.log
69startupitem.logevents   yes
70startupitem.netchange   yes