basho/node_package — pull request #84 by jaredmorrow (2013-08-21 20:54:57+00:00)
Title: FreeBSD: Change package name to .tbz and scan data dirs

* This commit changes the naming of the package. `pkg_add`
on FreeBSD needs package names to end in .tbz rather than .tgz
* The data and log directories were not scanned for extra
directories so some default directories would be left out
of the package install.
* Some directories such as /usr/sbin were included in the
default @dirrm list, those have been removed

Fixes: #77 #83

New Install / Test / Uninstall run below:

### Install

```
[buildbot@riak-test-freebsd-9 /tmp]$ sudo pkg_add riak-ee-1.4.1-2cabf831-FreeBSD-amd64.tbz
riak:*:1002:
riak:*:1002:1002::0:0:Riak user:/usr/local/lib/riak:/bin/sh

Thank you for installing riak-ee.

riak-ee has been installed in /usr/local owned by user:group riak:riak

The primary directories are:

{platform_bin_dir, "/usr/local/sbin"}
{platform_data_dir, "/var/db/riak"}
{platform_etc_dir, "/usr/local/etc/riak"}
{platform_lib_dir, "/usr/local/lib/riak/lib"}
{platform_log_dir, "/var/log/riak"}

These can be configured and changed in the /usr/local/etc/riak/app.config.

Add /usr/local/sbin to your path to run riak riak-admin search-cmd riak-repl riak-debug directly.

Man pages are available for riak(1) riak-admin(1) search-cmd(1) riak-repl(1) riak-debug(1)
```

### Test

```
[buildbot@riak-test-freebsd-9 /tmp]$ sudo find /var/db/riak -type d
/var/db/riak
/var/db/riak/snmp
/var/db/riak/snmp/agent
/var/db/riak/snmp/agent/db
/var/db/riak/ring
[buildbot@riak-test-freebsd-9 /tmp]$ sudo riak start
[buildbot@riak-test-freebsd-9 /tmp]$ sudo riak ping
pong
```

### Uninstall

```
[buildbot@riak-test-freebsd-9 /tmp]$ sudo pkg_delete "riak-ee-*"
pkg_delete: file '/usr/local/lib/riak/lib/mnesia-4.7/include' doesn't exist
pkg_delete: unable to completely remove directory '/usr/local/lib/riak/lib/mnesia-4.7/include'
pkg_delete: file '/usr/local/lib/riak/erts-5.9.1/doc' doesn't exist
pkg_delete: unable to completely remove directory '/usr/local/lib/riak/erts-5.9.1/doc'
pkg_delete: file '/usr/local/lib/riak/erts-5.9.1/man' doesn't exist
pkg_delete: unable to completely remove directory '/usr/local/lib/riak/erts-5.9.1/man'
pkg_delete: unable to completely remove directory '/usr/local/lib/riak'
pkg_delete: couldn't entirely delete package `riak-ee-1.4.1-2cabf831'
(perhaps the packing list is incorrectly specified?)
To delete riak-ee user permanently, use 'pw userdel riak'

To completely clean your system you will need to remove the following directories manually
* /var/db/riak
* /var/log/riak

[buildbot@riak-test-freebsd-9 /tmp]$ sudo find /var/db/riak -type d -maxdepth 1
/var/db/riak
/var/db/riak/snmp
/var/db/riak/ring
/var/db/riak/kv_vnode
/var/db/riak/bitcask
/var/db/riak/anti_entropy
/var/db/riak/riak_repl
[buildbot@riak-test-freebsd-9 /tmp]$ sudo ls -l /var/log/riak
total 56
-rw-r--r-- 1 riak riak 11547 Aug 21 20:33 console.log
-rw-r--r-- 1 riak riak 450 Aug 21 20:33 crash.log
-rw-r--r-- 1 riak riak 564 Aug 21 20:32 erlang.log.1
-rw-r--r-- 1 riak riak 334 Aug 21 20:33 error.log
-rw-r--r-- 1 riak riak 261 Aug 21 20:32 run_erl.log
```