Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#11689 closed submission (fixed)

New Portfile for pulse build server

Reported by: simon@… Owned by: macports-tickets@…
Priority: Low Milestone:
Component: ports Version:
Keywords: Cc: simon@…, roederja
Port:

Description

# Copyright (c) 2007, Simon Harris
# 
# All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 
#     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#     * 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.
#     * 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.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id$

PortSystem 1.0

name                    pulse
version                 1.2.18
categories              java
maintainers             simon@redhillconsulting.com.au
description             Pulse automated build server
long_description	Pulse is an automated build or continuous integration server. \
			Pulse regularly checks out your project's source code from your \
			SCM, builds the project and reports on the results. A project \
			build typically involves compiling the source code and running \
			tests to ensure the quality of the code. By automating this \
			process, pulse allows you to constantly monitor the health of \
			your project.
homepage                http://www.zutubi.com/products/pulse/
master_sites		http://www.zutubi.com/download/
checksums		md5 6da10683325bf7239827e2ff842600d1
depends_lib		bin:java:kaffe

set osuser		pulse
set osgroup		pulse
set home		${prefix}/share/java/pulse
set bin			${home}/bin
set executable		${bin}/pulse
set dbdir		${prefix}/var/db/pulse
use_configure		no

startupitem.create	yes
startupitem.init	"PULSE_HOME=${home}\nPATH=/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql82/bin:$PATH"
startupitem.start	"su ${osuser} -c \"${executable} start\""
startupitem.stop	"su ${osuser} -c \"${executable} shutdown\""

build {}

destroot {
	# Create the Pulse user
	addgroup ${osgroup}
	set gid [existsgroup ${osgroup}]
	adduser ${osuser} shell=/bin/sh gid=${gid} home=${dbdir} realname=Pulse\ Server

	# Ensure we have the needed directories
	xinstall -m 755 -d ${destroot}${home}

	# Copy the files
	system "cp -R ${worksrcpath}/ ${destroot}${home}"

	# Keep empty directories
	destroot.keepdirs-append ${destroot}${home}/logs ${destroot}${home}/versions

	# Fix ownership of some directories pulse really needs to write to
	system "chown -R ${osuser}:${osgroup} ${destroot}${home}/logs"
	system "chown -R ${osuser}:${osgroup} ${destroot}${home}/versions"

	# Add a symlink from bin directory to the pulse script
	system "ln -fs ${executable} ${destroot}${prefix}/bin/pulse"
}

post-install {
	ui_msg "#"
	ui_msg "# The script ${executable} has been installed to facilitate starting and"
	ui_msg "# stopping ${name} as a true daemon process. It must be run as ${osuser}."
	ui_msg "# For example:"
	ui_msg "#"
	ui_msg "#   sudo su pulse -c "${executable} start"
	ui_msg "#"
	ui_msg "# This script assumes it is run from ${home}. To run from outside this"
	ui_msg "# directory, you must set the value of PULSE_HOME to the absolute path"
	ui_msg "# of this directory. For example:"
	ui_msg "#"
  ui_msg "#   PULSE_HOME=${home} sudo su pulse -c "${executable} start"
	ui_msg "#"
	ui_msg "# You will also need To create the directory ${dbdir} if it does not"
	ui_msg "# already exist:"
	ui_msg "#"
	ui_msg "#   sudo mkdir -p ${dbdir}"
	ui_msg "#   sudo chown ${osuser}:${osgroup} ${dbdir}"
	ui_msg "#"
}

Attachments (1)

Portfile (4.3 KB) - added by simon@… 17 years ago.
Portfile

Download all attachments as: .zip

Change History (13)

comment:1 Changed 17 years ago by pipping@…

in case anyone wonders, the license header above is from the BSD license.

comment:2 Changed 17 years ago by pipping@…

Component: baseports
Milestone: New Ports

comment:3 Changed 17 years ago by simon@…

What, if anything, do I need to do in order to have this "approved"?

comment:4 Changed 17 years ago by roederja

Cc: simon@… jann@… added

Looks good, but do you really insist on that license ? And can you attach the Portfile as file, instead of pasting it ?

Changed 17 years ago by simon@…

Attachment: Portfile added

Portfile

comment:5 Changed 17 years ago by simon@…

The license I added simply after following instructions below which recommends a BSD license. I've also attached the file.

What's the process for updating the file in the future? They update the software fairly regularly with new features and bug fixes.

comment:6 Changed 17 years ago by roederja

Hm regarding the license, I think this is only for source code contributions. I've never seen a port file with a license on it. That's why I'm asking if you insist on it, or if it can be committed without it.

comment:7 Changed 17 years ago by simon@…

Ahh gotcha. Feel free to remove the license. It didn't have one initially but I added it as per my reading of the instructions :). Silly me.

comment:8 Changed 17 years ago by roederja

Resolution: fixed
Status: newclosed

I committed it now in r24716. But can you replace the system "cp .." calls by the built in copy command for the next version? Same goes for the chown.

comment:9 Changed 17 years ago by simon@…

Will do. I'm pretty sure I tried that originally but it didn't work for some reason. I'll have another go with the latest release.

comment:10 Changed 17 years ago by jmpp@…

Milestone: New PortsPort Submissions

Milestone New Ports deleted

comment:11 Changed 15 years ago by jmroot (Joshua Root)

Type: enhancementsubmission

comment:12 Changed 15 years ago by (none)

Milestone: Port Submissions

Milestone Port Submissions deleted

Note: See TracTickets for help on using tickets.