Ticket #3086: Portfile

File Portfile, 1.9 KB (added by digdog@…, 20 years ago)

Portfile

Line 
1# $Id: Portfile,v 1.15 2003/08/05 09:29:04 jkh Exp $
2
3PortSystem 1.0
4name            perforce
5version         04.2
6categories      devel
7maintainers     eric@opendarwin.org
8description     Fast source code management system
9long_description         Perforce is a commercial revision control system that can be used gratis for developing free software. (see the WWW page for details).
10homepage    http://www.perforce.com/
11platforms       darwin freebsd
12master_sites    ftp://www.perforce.com/pub/perforce/r${portversion}/bin.darwin60ppc/
13dist_subdir     ${portname}
14worksrcdir      ${portname}
15distfiles       p4 p4.1 p4d p4d.1
16checksums       p4 md5 7fbf723b25c7957ee554adb472b911da \
17                p4d md5 9020dd51eb14440b6e88fb653b97ea5e \
18extract         { system "mkdir -p ${portpath}/${workdir}/${worksrcdir}"
19                  system "cp ${distpath}/* \
20                  ${portpath}/${workdir}/${worksrcdir}/" }
21configure       {}
22build           {}
23destroot        { cd ${worksrcpath}
24                  system "install -o root -m 755 -d ${destroot}${prefix}/bin"
25                  system "install -o root -m 755 -d ${destroot}${prefix}/sbin"
26                  system "install -o root -m 755 -c p4 ${destroot}${prefix}/bin"
27                  system "install -o root -m 755 -c p4d ${destroot}${prefix}/sbin"
28
29variant server {
30depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
31
32        post-destroot {
33                addgroup perforce
34                set gid [existsgroup perforce]
35                adduser perforce realname=Perforce\ Server gid=${gid} \
36                        home=${prefix}/share/perforce shell=/bin/sh
37                system "install -o perforce -m 755 -d \
38                        ${destroot}${prefix}/share/perforce/depot"
39                system "install -o root -m 755 -d ${destroot}${prefix}/etc/rc.d"
40                system "install -o perforce -m 644 -c /dev/null \
41                        ${destroot}${prefix}/share/perforce/log"
42                set script [open "${destroot}${prefix}/etc/rc.d/perforce.sh" w 0755]
43                puts $script "#!/bin/sh"
44                puts $script "su perforce -c \"${prefix}/sbin/p4d -d -r \
45                        ${prefix}/share/perforce/depot -L \
46                        ${prefix}/share/perforce/log\""
47                close $script
48        }
49}
50