Permalink
Browse files

Support FreeBSD packaging

  • Loading branch information...
1 parent 698551d commit 176bb0f6a1fe2d65b20aea09842ebda6d51a030f Jared Morrow committed May 23, 2012
View
@@ -208,7 +208,7 @@ PKG_VERSION = $(shell echo $(DISTNAME) | sed -e 's/^$(REPO)-//')
package: dist
$(MAKE) -C package package
-pkgclean:
+pkgclean: distclean
$(MAKE) -C package pkgclean
.PHONY: package
View
@@ -6,17 +6,14 @@ ARCH = $(shell uname -m)
PKGER = $(shell cat /etc/redhat-release 2> /dev/null)
ifeq ($(PKGER),)
OSNAME = Debian
-PKGER = debuild
PKGERDIR = deb
else
OSNAME = RedHat
-PKGER = rpmbuild
PKGERDIR = rpm
endif
endif
ifeq ($(OS),SunOS)
ARCH = $(shell uname -p)
-PKGER = make
PKGERDIR = solaris
DISTRO = $(shell head -1 /etc/release|awk \
'{if ($$1 == "OmniOS") {print $$1} else {print "Solaris"}}')
@@ -25,10 +22,15 @@ endif
ifeq ($(OS),Darwin)
OSNAME = OSX
ARCH = $(shell uname -m)
-PKGER = make
PKGERDIR = osx
BUILDDIR = osxbuild
endif
+ifeq ($(OS),FreeBSD)
+OSNAME = $(OS)
+ARCH = $(shell uname -p)
+PKGERDIR = freebsd
+BUILDDIR = bsdbuild
+endif
DATE = $(shell date +%Y-%m-%d)
VERSIONSTRING = $(APP) ($(PKG_VERSION) $(DATE)) $(OSNAME) $(ARCH)
@@ -42,7 +44,7 @@ $(APP)-$(PKG_VERSION).tar.gz: ../$(DISTNAME).tar.gz
ln -s $< $@
pkgclean: $(PKGERDIR)/pkgclean
- rm -rf $(APP)-$(PKG_VERSION).tar.gz working rpmbuild debuild packages osxbuild
+ rm -rf $(APP)-*.tar.gz working rpmbuild debuild packages osxbuild bsdbuild
pkgcheck:
$(if $(DISTNAME),,$(error "You can't generate a release tarball from a non-tagged revision. Run 'git checkout <tag>', then 'make dist'"))
@@ -0,0 +1 @@
+Riak highly scalable, fault-tolerant distributed database
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+ exit 0
+fi
+
+USER=riak
+
+if pw usershow "${USER}" 2>/dev/null 1>&2; then
+ echo "To delete riak user permanently, use 'pw userdel ${USER}'"
+fi
+
+exit 0
@@ -0,0 +1,3 @@
+Riak is an open source, highly scalable, fault-tolerant distributed database.
+
+WWW: http://basho.com/products/riak-overview/
@@ -0,0 +1,17 @@
+Thank you for installing Riak.
+
+Riak has been installed in /usr/local/riak owned by user:group riak:riak
+
+The primary directories are:
+
+ {platform_bin_dir, "/usr/local/riak/bin"}
+ {platform_data_dir, "/usr/local/riak/data"}
+ {platform_etc_dir, "/usr/local/riak/etc"}
+ {platform_lib_dir, "/usr/local/riak/lib"}
+ {platform_log_dir, "/usr/local/riak/log"}
+
+These can be configured and changed in the platform_etc_dir/app.config.
+
+Add /usr/local/riak/bin to your path to run the riak, riak-admin, and search-cmd
+scripts directly.
+
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+if [ "$2" != "PRE-INSTALL" ]; then
+ exit 0
+fi
+
+if ! pw groupshow riak >/dev/null; then
+ if pw groupadd riak; then
+ echo "Added group riak"
+ else
+ echo "Failed to add group riak" >&2
+ exit 1
+ fi
+fi
+
+if ! pw usershow riak >/dev/null; then
+ if pw useradd riak -g riak -h - -d /usr/local/riak -s bash -c "RIak Server"; then
+ echo "Added user riak"
+ else
+ echo "Failed to add user riak" >&2
+ exit 1
+ fi
+fi
+
+#eof
Oops, something went wrong. Retry.

0 comments on commit 176bb0f

Please sign in to comment.