Ticket #11689: Portfile

File Portfile, 4.3 KB (added by simon@…, 18 years ago)

Portfile

Line 
1# Copyright (c) 2007, Simon Harris
2#
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6#
7#     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8#     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9#     * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10#
11# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
12# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
13# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
14# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
15# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
16# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
18# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
19# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22#
23# $Id$
24
25PortSystem 1.0
26
27name                    pulse
28version                 1.2.18
29categories              java
30maintainers             simon@redhillconsulting.com.au
31description             Pulse automated build server
32long_description        Pulse is an automated build or continuous integration server. \
33                        Pulse regularly checks out your project's source code from your \
34                        SCM, builds the project and reports on the results. A project \
35                        build typically involves compiling the source code and running \
36                        tests to ensure the quality of the code. By automating this \
37                        process, pulse allows you to constantly monitor the health of \
38                        your project.
39homepage                http://www.zutubi.com/products/pulse/
40master_sites            http://www.zutubi.com/download/
41checksums               md5 6da10683325bf7239827e2ff842600d1
42depends_lib             bin:java:kaffe
43
44set osuser              pulse
45set osgroup             pulse
46set home                ${prefix}/share/java/pulse
47set bin                 ${home}/bin
48set executable          ${bin}/pulse
49set dbdir               ${prefix}/var/db/pulse
50use_configure           no
51
52startupitem.create      yes
53startupitem.init        "PULSE_HOME=${home}\nPATH=/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql82/bin:$PATH"
54startupitem.start       "su ${osuser} -c \"${executable} start\""
55startupitem.stop        "su ${osuser} -c \"${executable} shutdown\""
56
57build {}
58
59destroot {
60        # Create the Pulse user
61        addgroup ${osgroup}
62        set gid [existsgroup ${osgroup}]
63        adduser ${osuser} shell=/bin/sh gid=${gid} home=${dbdir} realname=Pulse\ Server
64
65        # Ensure we have the needed directories
66        xinstall -m 755 -d ${destroot}${home}
67
68        # Copy the files
69        system "cp -R ${worksrcpath}/ ${destroot}${home}"
70
71        # Keep empty directories
72        destroot.keepdirs-append ${destroot}${home}/logs ${destroot}${home}/versions
73
74        # Fix ownership of some directories pulse really needs to write to
75        system "chown -R ${osuser}:${osgroup} ${destroot}${home}/logs"
76        system "chown -R ${osuser}:${osgroup} ${destroot}${home}/versions"
77
78        # Add a symlink from bin directory to the pulse script
79        system "ln -fs ${executable} ${destroot}${prefix}/bin/pulse"
80}
81
82post-install {
83        ui_msg "#"
84        ui_msg "# The script ${executable} has been installed to facilitate starting and"
85        ui_msg "# stopping ${name} as a true daemon process. It must be run as ${osuser}."
86        ui_msg "# For example:"
87        ui_msg "#"
88        ui_msg "#   sudo su pulse -c "${executable} start"
89        ui_msg "#"
90        ui_msg "# This script assumes it is run from ${home}. To run from outside this"
91        ui_msg "# directory, you must set the value of PULSE_HOME to the absolute path"
92        ui_msg "# of this directory. For example:"
93        ui_msg "#"
94  ui_msg "#   PULSE_HOME=${home} sudo su pulse -c "${executable} start"
95        ui_msg "#"
96        ui_msg "# You will also need To create the directory ${dbdir} if it does not"
97        ui_msg "# already exist:"
98        ui_msg "#"
99        ui_msg "#   sudo mkdir -p ${dbdir}"
100        ui_msg "#   sudo chown ${osuser}:${osgroup} ${dbdir}"
101        ui_msg "#"
102}