BSD support #90

Merged
merged 3 commits into from May 11, 2012

7 participants

@Vagabond

Don't use /bin/bash in the shebang, use /bin/sh (and add a crazy workaround for Solaris' /bin/sh not actually being a POSIX shell).

@dizzyd

+1, if it passes b_e

@zaa

Works ok for us on

uname -mrs
FreeBSD 8.1-RELEASE i386
@jj1bdx

At least about the shebang script, it looks OK to me.

(I changed it to /usr/local/bin/bash when I tested, but this is not recommended because for FreeBSD bash is only a Port and not with the OS distribution.)

@sc68cal

What about using env to locate bash - that is typically how to ensure portability.

@jj1bdx

For FreeBSD and other BSD-derived OSes, bash is not installed as a part of the distributions. So shebang of #!/usr/bin/env bash does not work anyway.
If there were anything critical in the script needed something only bash could do, the usage of bash would be justified, but I think that's not the case for this pull-request.

@sc68cal

True, but the Makefile for the port can just add

RUN_DEPENDS=    bash:${PORTSDIR}/shells/bash
@jj1bdx

I think adding a bash dependency to the FreeBSD Port Makefile does not solve the fundamental issues of bash dependencies, though it is surely a workaround for the time being. The question is whether we have to require Riak to install bash or not. And not all people want to install Riak from the source code.

FYI, on FreeBSD Port for Erlang (lang/erlang), bash is not a requirement. And I think it shouldn't be.

@Vagabond

The bash dependency is pointless and should/will be removed, I just haven't had the time to reverify that the change doesn't break anything.

@koobs

Confirming a successful build and test using the following port Makefile and patch: https://gist.github.com/ee3563208933cd8e97a6

Note the post-build: target, which blanket replaces /bin/bash references with /bin/sh refs with no other modifications.

./riak console output: http://codepad.org/Co9W7spF

All ./riak and ./riak-admin commands seem to work.

The patch in the gist above is for code already committed but didn't make it into 1.1.2 so shouldn't be required in the port for long

Port is based on draco2002 original work at https://github.com/draco2003/freebsd-database-riak

Only work left is to add a pkg_plist, install /rel/* bits to appropriate system locations and get an RC script in.

@jaredmorrow

+1, tested that everything still works on Solaris, Fedora, Ubuntu

@Vagabond Vagabond merged commit b2d4198 into master May 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment