Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support FreeBSD packaging

  • Loading branch information...
commit 176bb0f6a1fe2d65b20aea09842ebda6d51a030f 1 parent 698551d
Jared Morrow jaredmorrow authored
2  Makefile
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
12 package/Makefile
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'"))
1  package/freebsd/+COMMENT
View
@@ -0,0 +1 @@
+Riak highly scalable, fault-tolerant distributed database
13 package/freebsd/+DEINSTALL
View
@@ -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
3  package/freebsd/+DESC
View
@@ -0,0 +1,3 @@
+Riak is an open source, highly scalable, fault-tolerant distributed database.
+
+WWW: http://basho.com/products/riak-overview/
17 package/freebsd/+DISPLAY
View
@@ -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.
+
25 package/freebsd/+INSTALL
View
@@ -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
956 package/freebsd/+MTREE_DIRS
View
@@ -0,0 +1,956 @@
+# $FreeBSD: ports/Templates/BSD.local.dist,v 1.3 2010/11/12 20:57:14 pav Exp $
+#
+# Please see the file src/etc/mtree/README before making changes to this file.
+#
+
+/set type=dir uname=root gname=wheel mode=0755
+.
+ bin
+ ..
+ etc
+ devd
+ ..
+ man.d
+ ..
+ pam.d
+ ..
+ rc.d
+ ..
+ ..
+ include
+ X11
+ ..
+ ..
+ info
+ ..
+ lib
+ X11
+ app-defaults
+ ..
+ fonts
+ local
+ ..
+ ..
+ ..
+ ..
+ libdata
+ ldconfig
+ ..
+ ldconfig32
+ ..
+ pkgconfig
+ ..
+ ..
+ libexec
+ ..
+ man
+/set uname=man
+ cat1
+ ..
+ cat2
+ ..
+ cat3
+ ..
+ cat4
+ ..
+ cat5
+ ..
+ cat6
+ ..
+ cat7
+ ..
+ cat8
+ ..
+ cat9
+ ..
+ catl
+ ..
+ catn
+ ..
+ de.ISO8859-1 uname=root
+ cat1
+ ..
+ cat2
+ ..
+ cat3
+ ..
+ cat4
+ ..
+ cat5
+ ..
+ cat6
+ ..
+ cat7
+ ..
+ cat8
+ ..
+ cat9
+ ..
+ catl
+ ..
+ catn
+ ..
+/set uname=root
+ man1
+ ..
+ man2
+ ..
+ man3
+ ..
+ man4
+ ..
+ man5
+ ..
+ man6
+ ..
+ man7
+ ..
+ man8
+ ..
+ man9
+ ..
+ manl
+ ..
+ mann
+ ..
+ ..
+ en.ISO8859-1
+/set uname=man
+ cat1
+ ..
+ cat1aout
+ ..
+ cat2
+ ..
+ cat3
+ ..
+ cat4
+ i386
+ ..
+ ..
+ cat5
+ ..
+ cat6
+ ..
+ cat7
+ ..
+ cat8
+ i386
+ ..
+ ..
+ cat9
+ i386
+ ..
+ ..
+ catn
+ ..
+ ..
+ ja uname=root
+ cat1
+ ..
+ cat2
+ ..
+ cat3
+ ..
+ cat4
+ ..
+ cat5
+ ..
+ cat6
+ ..
+ cat7
+ ..
+ cat8
+ ..
+ cat9
+ ..
+ catl
+ ..
+ catn
+ ..
+/set uname=root
+ man1
+ ..
+ man2
+ ..
+ man3
+ ..
+ man4
+ ..
+ man5
+ ..
+ man6
+ ..
+ man7
+ ..
+ man8
+ ..
+ man9
+ ..
+ manl
+ ..
+ mann
+ ..
+ ..
+ man1
+ ..
+ man2
+ ..
+ man3
+ ..
+ man4
+ ..
+ man5
+ ..
+ man6
+ ..
+ man7
+ ..
+ man8
+ ..
+ man9
+ ..
+ manl
+ ..
+ mann
+ ..
+ ru.KOI8-R
+/set uname=man
+ cat1
+ ..
+ cat2
+ ..
+ cat3
+ ..
+ cat4
+ ..
+ cat5
+ ..
+ cat6
+ ..
+ cat7
+ ..
+ cat8
+ ..
+ cat9
+ ..
+ catl
+ ..
+ catn
+ ..
+/set uname=root
+ man1
+ ..
+ man2
+ ..
+ man3
+ ..
+ man4
+ ..
+ man5
+ ..
+ man6
+ ..
+ man7
+ ..
+ man8
+ ..
+ man9
+ ..
+ manl
+ ..
+ mann
+ ..
+ ..
+ ..
+ sbin
+ ..
+ share
+ aclocal
+ ..
+ dict
+ ..
+ doc
+ ja
+ ..
+ ..
+ emacs
+ site-lisp
+ ..
+ ..
+ examples
+ ..
+ java
+ classes
+ ..
+ ..
+ locale
+ af
+ LC_MESSAGES
+ ..
+ ..
+ am
+ LC_MESSAGES
+ ..
+ ..
+ ar
+ LC_MESSAGES
+ ..
+ ..
+ az
+ LC_MESSAGES
+ ..
+ ..
+ be
+ LC_MESSAGES
+ ..
+ ..
+ bg
+ LC_MESSAGES
+ ..
+ ..
+ bn
+ LC_MESSAGES
+ ..
+ ..
+ br
+ LC_MESSAGES
+ ..
+ ..
+ bs
+ LC_MESSAGES
+ ..
+ ..
+ ca
+ LC_MESSAGES
+ ..
+ ..
+ cs
+ LC_MESSAGES
+ ..
+ ..
+ cy
+ LC_MESSAGES
+ ..
+ ..
+ da
+ LC_MESSAGES
+ ..
+ ..
+ de
+ LC_MESSAGES
+ ..
+ ..
+ de_AT
+ LC_MESSAGES
+ ..
+ ..
+ dk
+ LC_MESSAGES
+ ..
+ ..
+ ee
+ LC_MESSAGES
+ ..
+ ..
+ el
+ LC_MESSAGES
+ ..
+ ..
+ en
+ LC_MESSAGES
+ ..
+ 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BY.ISO8859-5
+ ..
+ be_BY.UTF-8
+ ..
+ bg_BG.CP1251
+ ..
+ bg_BG.UTF-8
+ ..
+ ca_ES.ISO8859-1
+ ..
+ ca_ES.ISO8859-15
+ ..
+ ca_ES.UTF-8
+ ..
+ cs_CZ.ISO8859-2
+ ..
+ cs_CZ.UTF-8
+ ..
+ da_DK.ISO8859-1
+ ..
+ da_DK.ISO8859-15
+ ..
+ da_DK.UTF-8
+ ..
+ de_AT.ISO8859-1
+ ..
+ de_AT.ISO8859-15
+ ..
+ de_AT.UTF-8
+ ..
+ de_CH.ISO8859-1
+ ..
+ de_CH.ISO8859-15
+ ..
+ de_CH.UTF-8
+ ..
+ de_DE.ISO8859-1
+ ..
+ de_DE.ISO8859-15
+ ..
+ de_DE.UTF-8
+ ..
+ el_GR.ISO8859-7
+ ..
+ el_GR.UTF-8
+ ..
+ en_AU.ISO8859-1
+ ..
+ en_AU.ISO8859-15
+ ..
+ en_AU.US-ASCII
+ ..
+ en_AU.UTF-8
+ ..
+ en_CA.ISO8859-1
+ ..
+ en_CA.ISO8859-15
+ ..
+ en_CA.US-ASCII
+ ..
+ en_CA.UTF-8
+ ..
+ en_GB.ISO8859-1
+ ..
+ en_GB.ISO8859-15
+ ..
+ en_GB.US-ASCII
+ ..
+ en_GB.UTF-8
+ ..
+ en_IE.UTF-8
+ ..
+ en_NZ.ISO8859-1
+ ..
+ en_NZ.ISO8859-15
+ ..
+ en_NZ.US-ASCII
+ ..
+ en_NZ.UTF-8
+ ..
+ en_US.ISO8859-1
+ ..
+ en_US.ISO8859-15
+ ..
+ en_US.UTF-8
+ ..
+ es_ES.ISO8859-1
+ ..
+ es_ES.ISO8859-15
+ ..
+ es_ES.UTF-8
+ ..
+ et_EE.ISO8859-15
+ ..
+ et_EE.UTF-8
+ ..
+ fi_FI.ISO8859-1
+ ..
+ fi_FI.ISO8859-15
+ ..
+ fi_FI.UTF-8
+ ..
+ fr_BE.ISO8859-1
+ ..
+ fr_BE.ISO8859-15
+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 ..
+ pl_PL.ISO8859-2
+ ..
+ pl_PL.UTF-8
+ ..
+ pt_BR.ISO8859-1
+ ..
+ pt_BR.UTF-8
+ ..
+ pt_PT.ISO8859-1
+ ..
+ pt_PT.ISO8859-15
+ ..
+ pt_PT.UTF-8
+ ..
+ ro_RO.ISO8859-2
+ ..
+ ro_RO.UTF-8
+ ..
+ ru_RU.CP1251
+ ..
+ ru_RU.CP866
+ ..
+ ru_RU.ISO8859-5
+ ..
+ ru_RU.KOI8-R
+ ..
+ ru_RU.UTF-8
+ ..
+ sk_SK.ISO8859-2
+ ..
+ sk_SK.UTF-8
+ ..
+ sl_SI.ISO8859-2
+ ..
+ sl_SI.UTF-8
+ ..
+ sr_YU.ISO8859-2
+ ..
+ sr_YU.ISO8859-5
+ ..
+ sr_YU.UTF-8
+ ..
+ sv_SE.ISO8859-1
+ ..
+ sv_SE.ISO8859-15
+ ..
+ sv_SE.UTF-8
+ ..
+ tr_TR.ISO8859-9
+ ..
+ tr_TR.UTF-8
+ ..
+ uk_UA.ISO8859-5
+ ..
+ uk_UA.KOI8-U
+ ..
+ uk_UA.UTF-8
+ ..
+ zh_CN.GB18030
+ ..
+ zh_CN.GB2312
+ ..
+ zh_CN.GBK
+ ..
+ zh_CN.UTF-8
+ ..
+ zh_CN.eucCN
+ ..
+ zh_HK.Big5HKSCS
+ ..
+ zh_HK.UTF-8
+ ..
+ zh_TW.Big5
+ ..
+ zh_TW.UTF-8
+ ..
+ ..
+ pixmaps
+ ..
+ sgml
+ ..
+ skel
+ ..
+ xml
+ ..
+ ..
+ www
+ ..
+..
72 package/freebsd/Makefile
View
@@ -0,0 +1,72 @@
+BUILD_RIAK_PATH = $(BUILDDIR)/$(APP)-$(PKG_VERSION)
+BUILD_STAGE_DIR = $(BUILDDIR)/$(APP)
+PKGNAME = $(APP)-$(PKG_VERSION)-$(OSNAME)-$(ARCH).tbz
+
+build: packing_list templates
+ @echo "Building package $(PKGNAME)"
+ mkdir -p packages
+ cd $(BUILD_STAGE_DIR) && \
+ tar -cjf ../../packages/$(PKGNAME) *
+ cd packages && \
+ for tarfile in `ls *.tbz`; do \
+ shasum -a 256 $${tarfile} > $${tarfile}.sha \
+ ; done
+
+# Where most of the magic happens
+# Create a packing list according to pkg_create(1)
+# Write initial settings to a local file then copy
+# to the destination folder where we use 'find'
+# to populate the files and directories
+packing_list: $(BUILD_STAGE_DIR)
+ @echo "Adding to packaging list $(APP)-$(PKG_VERSION)"
+ echo "@name $(APP)-$(PKG_VERSION)" >> plist
+ echo "@cwd /usr/local" >> plist
+ echo "@conflicts riak-*" >> plist
+ echo "@exec if ! pw groupshow riak 2>/dev/null; then pw groupadd riak; fi" >> plist
+ echo "@exec if ! pw usershow riak 2>/dev/null; then pw useradd riak -g riak -h - -d /usr/local/riak -s /bin/sh -c \"Riak Server\"; fi" >> plist
+ echo "@owner riak" >> plist
+ echo "@group riak" >> plist
+ mv plist $(BUILD_STAGE_DIR)/+CONTENTS
+ cd $(BUILD_STAGE_DIR) && \
+ find riak -type f >> +CONTENTS
+ cd $(BUILD_STAGE_DIR) && \
+ find riak -type d -exec echo "@dirrm {}" \; >> +CONTENTS
+ cd $(BUILD_STAGE_DIR) && \
+ echo "@exec chown -R riak:riak /usr/local/riak" >> +CONTENTS
+ cd $(BUILD_STAGE_DIR) && \
+ echo "@display +DISPLAY" >> +CONTENTS
+
+templates: $(BUILD_STAGE_DIR)
+ @echo "Copying metadata files to package"
+ cp $(PKGERDIR)/+DESC $(PKGERDIR)/+COMMENT $(PKGERDIR)/+DEINSTALL \
+ $(PKGERDIR)/+MTREE_DIRS $(PKGERDIR)/+DISPLAY \
+ $(BUILD_STAGE_DIR)
+
+# Copy the app rel directory to the staging directory to build our
+# package structure
+$(BUILD_STAGE_DIR): buildrel
+ @echo "Copying rel directory to staging directory"
+ mkdir -p $@
+ cp -r $(BUILD_RIAK_PATH)/rel/riak $(BUILD_STAGE_DIR)
+
+# Build the release we need to package
+# Also ensure all binaries are executable
+# and copy the vars.config over for build config
+buildrel: $(BUILD_RIAK_PATH)
+ cp $(BUILD_RIAK_PATH)/rel/files/riak $(BUILD_RIAK_PATH)/rel/files/riak.tmp
+ sed -e "s/^RIAK_VERSION.*$$/RIAK_VERSION=\"${VERSIONSTRING}\"/" < \
+ $(BUILD_RIAK_PATH)/rel/files/riak.tmp > $(BUILD_RIAK_PATH)/rel/files/riak
+ cp -f $(PKGERDIR)/vars.config $(BUILD_RIAK_PATH)/rel/vars.config
+ $(MAKE) -C $(BUILD_RIAK_PATH) deps rel
+ chmod 0755 $(BUILD_RIAK_PATH)/rel/riak/bin/* $(BUILD_RIAK_PATH)/rel/riak/erts-*/bin/*
+
+
+
+$(BUILD_RIAK_PATH): $(BUILDDIR) $(APP)-$(PKG_VERSION).tar.gz
+ tar xz -C $(BUILDDIR) -f $(APP)-$(PKG_VERSION).tar.gz
+
+$(BUILDDIR):
+ mkdir -p $@
+
+$(PKGERDIR)/pkgclean:
+ rm -rf $(BUILD_STAGE_DIR) $(BUILDDIR)
51 package/freebsd/vars.config
View
@@ -0,0 +1,51 @@
+%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ft=erlang ts=4 sw=4 et
+
+% Platform-specific installation paths
+{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"}.
+
+%%
+%% etc/app.config
+%%
+{web_ip, "127.0.0.1"}.
+{web_port, 8098}.
+{handoff_port, 8099}.
+{pb_ip, "127.0.0.1"}.
+{pb_port, 8087}.
+{ring_state_dir, "{{platform_data_dir}}/ring"}.
+{bitcask_data_root, "{{platform_data_dir}}/bitcask"}.
+{leveldb_data_root, "{{platform_data_dir}}/leveldb"}.
+{sasl_error_log, "{{platform_log_dir}}/sasl-error.log"}.
+{sasl_log_dir, "{{platform_log_dir}}/sasl"}.
+{mapred_queue_dir, "{{platform_data_dir}}/mr_queue"}.
+
+%% riak_search
+{merge_index_data_root, "{{platform_data_dir}}/merge_index"}.
+
+%% secondary indices
+{merge_index_data_root_2i, "{{platform_data_dir}}/merge_index_2i"}.
+
+%% Javascript VMs
+{map_js_vms, 8}.
+{reduce_js_vms, 6}.
+{hook_js_vms, 2}.
+
+%%
+%% etc/vm.args
+%%
+{node, "riak@127.0.0.1"}.
+{crash_dump, "{{platform_log_dir}}/erl_crash.dump"}.
+
+%%
+%% bin/riak
+%%
+{runner_script_dir, "{{platform_bin_dir}}"}.
+{runner_base_dir, "/usr/local/riak"}.
+{runner_etc_dir, "{{platform_etc_dir}}"}.
+{runner_log_dir, "{{platform_log_dir}}"}.
+{pipe_dir, "/tmp/riak/"}.
+{runner_user, "riak"}.
5 rel/files/riak
View
@@ -7,6 +7,7 @@ if [ `uname -s` = 'SunOS' -a "${POSIX_SHELL}" != "true" ]; then
POSIX_SHELL="true"
export POSIX_SHELL
exec /usr/bin/ksh $0 "$@"
+ PATH=/usr/ucb:$PATH
fi
unset POSIX_SHELL # clear it so if we invoke other scripts, they run as ksh as well
@@ -24,8 +25,10 @@ PLATFORM_DATA_DIR={{platform_data_dir}}
SSL_DIST_CONFIG=$PLATFORM_DATA_DIR/ssl_distribution.args_file
RIAK_VERSION="git"
+WHOAMI=$(whoami)
+
# Make sure this script is running as the appropriate user
-if [ "$RUNNER_USER" -a "x$LOGNAME" != "x$RUNNER_USER" ]; then
+if ([ "$RUNNER_USER" ] && [ "x$WHOAMI" != "x$RUNNER_USER" ]); then
type sudo > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "sudo doesn't appear to be installed and your EUID isn't $RUNNER_USER" 1>&2
5 rel/files/riak-admin
View
@@ -5,6 +5,7 @@ if [ `uname -s` = 'SunOS' -a "${POSIX_SHELL}" != "true" ]; then
POSIX_SHELL="true"
export POSIX_SHELL
exec /usr/bin/ksh $0 "$@"
+ PATH=/usr/ucb:$PATH
fi
unset POSIX_SHELL # clear it so if we invoke other scripts, they run as ksh as well
@@ -17,8 +18,10 @@ RUNNER_LIB_DIR={{platform_lib_dir}}
RUNNER_LOG_DIR={{runner_log_dir}}
RUNNER_USER={{runner_user}}
+WHOAMI=$(whoami)
+
# Make sure this script is running as the appropriate user
-if [ "$RUNNER_USER" -a "x$LOGNAME" != "x$RUNNER_USER" ]; then
+if ([ "$RUNNER_USER" ] && [ "x$WHOAMI" != "x$RUNNER_USER" ]); then
type sudo > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "sudo doesn't appear to be installed and your EUID isn't $RUNNER_USER" 1>&2
Please sign in to comment.
Something went wrong with that request. Please try again.