---
name: p4d
version: 2012.1.549175
origin: devel/p4d
comment: Perforce server
arch: freebsd:9:x86:64
www: http://www.perforce.com/
maintainer: gordon@FreeBSD.org
prefix: /usr/local
licenselogic: single
flatsize: 3877089
desc: |
  Perforce is a commercial revision control system that can be used
  gratis for developing free software. (see the WWW page for details).

  WWW: http://www.perforce.com/
deps:
  p4: {origin: devel/p4, version: 2012.1.473528}
categories: [devel]
users: [p4admin]
groups: [p4admin]
files:
  /usr/local/etc/rc.d/p4d: b2f7b91bc3d71520f0ac701d334177372d53f445e37f8b91a8c18d2f5c577dff
  /usr/local/sbin/p4d: 4eaa6da3bbddeecae7ec64ca84bcc631a95a3b1d355b3a923b4e45e6fb6e85cb
scripts:
  post-install: |
    echo "===> Creating users and/or groups."
    if ! /usr/sbin/pw groupshow p4admin >/dev/null 2>&1; then  echo "Creating group 'p4admin' with gid '94'.";  /usr/sbin/pw groupadd p4admin -g 94; else echo "Using existing group 'p4admin'."; fi
    if ! /usr/sbin/pw usershow p4admin >/dev/null 2>&1; then  echo "Creating user 'p4admin' with uid '94'.";  /usr/sbin/pw useradd p4admin -u 94 -g 94  -c "Perforce admin" -d /nonexistent -s /usr/sbin/nologin;  else echo "Using existing user 'p4admin'."; fi
    cd /usr/local
    /bin/mkdir -p /var/db/p4d
    /usr/sbin/chown p4admin:p4admin /var/db/p4d
    /bin/chmod 750 /var/db/p4d
    /usr/bin/touch /var/log/p4d.log
    /usr/sbin/chown p4admin:p4admin /var/log/p4d.log
    /bin/chmod 640 /var/log/p4d.log
  pre-deinstall: |
    if /usr/sbin/pw usershow p4admin >/dev/null 2>&1; then  echo "==> You should manually remove the \"p4admin\" user. "; fi
    cd /usr/local
  post-deinstall: |
    cd /usr/local
message: |
  Read the release notes for this release to determine how to migrate the
  database to the new version. Generally, this is done via the 'p4d -xu'
  command.

  http://www.perforce.com/perforce/doc.current/user/relnotes.txt

  It is highly recommended that you checkpoint the server (with the old
  binary) before you attempt an upgrade; please be sure you have valid
  backups of your database before you go any further.
