|
|
|
|
##
|
|
|
|
|
## arangodb.spec -- OpenPKG RPM Package Specification
|
|
|
|
|
## Copyright (c) 2000-2013 OpenPKG Foundation e.V. <http://openpkg.net/>
|
|
|
|
|
##
|
|
|
|
|
## Permission to use, copy, modify, and distribute this software for
|
|
|
|
|
## any purpose with or without fee is hereby granted, provided that
|
|
|
|
|
## the above copyright notice and this permission notice appear in all
|
|
|
|
|
## copies.
|
|
|
|
|
##
|
|
|
|
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
|
|
|
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
|
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
|
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
|
|
|
|
|
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
|
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
|
|
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
|
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
|
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
## SUCH DAMAGE.
|
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
# package version
|
|
|
|
|
%define V_opkg 1.3.0a2
|
|
|
|
|
%define V_dist 1.3.0-alpha2
|
|
|
|
|
|
|
|
|
|
# package information
|
|
|
|
|
Name: arangodb
|
|
|
|
|
Summary: Document/Graph/Key-Value Database
|
|
|
|
|
URL: http://www.arangodb.org/
|
|
|
|
|
Vendor: triAGENS GmbH
|
|
|
|
|
Packager: OpenPKG Foundation e.V.
|
|
|
|
|
Distribution: OpenPKG Community
|
|
|
|
|
Class: EVAL
|
|
|
|
|
Group: Database
|
|
|
|
|
License: Apache
|
|
|
|
|
Version: %{V_opkg}
|
|
|
|
|
Release: 20130426
|
|
|
|
|
|
|
|
|
|
# list of sources
|
|
|
|
|
Source0: https://www.arangodb.org/repositories/devel/Source/ArangoDB-%{V_dist}.tar.bz2
|
|
|
|
|
Source1: rc.arangodb
|
|
|
|
|
Source2: arangod.conf
|
|
|
|
|
Source3: arangosh.conf
|
|
|
|
|
Patch0: arangodb.patch
|
|
|
|
|
|
|
|
|
|
# build information
|
|
|
|
|
BuildPreReq: OpenPKG, openpkg >= 20120101
|
|
|
|
|
PreReq: OpenPKG, openpkg >= 20120101
|
|
|
|
|
BuildPreReq: readline, ncurses, openssl, libev, v8, icu
|
|
|
|
|
PreReq: readline, ncurses, openssl, libev, v8, icu
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
ArangoDB is an open-source database with a flexible data model
|
|
|
|
|
for documents, graphs, and key-values. Build high performance
|
|
|
|
|
applications using a convenient SQL-like query language or
|
|
|
|
|
JavaScript extensions.
|
|
|
|
|
|
|
|
|
|
%track
|
|
|
|
|
prog arangodb = {
|
|
|
|
|
version = %{version}
|
|
|
|
|
url = https://www.arangodb.org/repositories/devel/index.html
|
|
|
|
|
regex = ArangoDB-(__VER__(?:-(?:alpha|beta|rc)\d+)?)\.tar\.bz2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n ArangoDB-%{V_dist}
|
|
|
|
|
%patch -p0
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
# configure program
|
|
|
|
|
CC="%{l_cc}" \
|
|
|
|
|
CXX="%{l_cxx}" \
|
|
|
|
|
CFLAGS="%{l_cflags -O}" \
|
|
|
|
|
CXXFLAGS="%{l_cxxflags -O}" \
|
|
|
|
|
CPPFLAGS="%{l_cppflags ev icu .}" \
|
|
|
|
|
LDFLAGS="%{l_ldflags}" \
|
|
|
|
|
LIBS="-lcrypto -lncurses -lexecinfo -lm" \
|
|
|
|
|
./configure \
|
|
|
|
|
--prefix=%{l_prefix} \
|
|
|
|
|
--mandir=%{l_prefix}/man \
|
|
|
|
|
--with-readline=%{l_prefix} \
|
|
|
|
|
--with-openssl-inc=%{l_prefix}/include \
|
|
|
|
|
--with-openssl-lib=%{l_prefix}/lib \
|
|
|
|
|
--with-libev=%{l_prefix} \
|
|
|
|
|
--with-v8=%{l_prefix} \
|
|
|
|
|
--with-icu-config=%{l_prefix}/bin/icu-config \
|
|
|
|
|
--disable-all-in-one-libev \
|
|
|
|
|
--disable-all-in-one-v8 \
|
|
|
|
|
--disable-all-in-one-icu
|
|
|
|
|
|
|
|
|
|
# build program
|
|
|
|
|
%{l_make} %{l_mflags -O}
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
# install program
|
|
|
|
|
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
|
|
|
|
|
|
|
|
|
|
# post-adjust installation
|
|
|
|
|
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/lib >/dev/null 2>&1 || true
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/log >/dev/null 2>&1 || true
|
|
|
|
|
|
|
|
|
|
# install default configuration
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/arangodb/*
|
|
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
|
|
%{SOURCE arangod.conf} \
|
|
|
|
|
%{SOURCE arangosh.conf} \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/arangodb/
|
|
|
|
|
|
|
|
|
|
# install run-command script
|
|
|
|
|
%{l_shtool} mkdir -f -p -m 755 \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
|
|
|
|
|
%{l_shtool} install -c -m 755 %{l_value -s -a} \
|
|
|
|
|
%{SOURCE rc.arangodb} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
|
|
|
|
|
|
|
|
|
|
# create run-time directory
|
|
|
|
|
%{l_shtool} mkdir -f -p -m 755 \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/arangodb/db \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/arangodb/log \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/arangodb/run
|
|
|
|
|
|
|
|
|
|
# determine installation files
|
|
|
|
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
|
|
|
|
|
%{l_files_std} \
|
|
|
|
|
'%config %{l_prefix}/etc/arangodb/*' \
|
|
|
|
|
'%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/arangodb/*'
|
|
|
|
|
|
|
|
|
|
%files -f files
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
|
# display information about next steps
|
|
|
|
|
( echo "After initially starting ArangoDB with..."
|
|
|
|
|
echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc arangodb start"
|
|
|
|
|
echo "...you should immediately configure an administrator account:"
|
|
|
|
|
echo " \$ echo 'require(\"users\").save(\"admin\", \"<admin-password>\", );' | \\ "
|
|
|
|
|
echo " $RPM_INSTALL_PREFIX/bin/arangosh"
|
|
|
|
|
echo " \$ echo 'require(\"users\").reload();' | \\ "
|
|
|
|
|
echo " $RPM_INSTALL_PREFIX/bin/arangosh"
|
|
|
|
|
) | %{l_rpmtool} msg -b -t notice
|
|
|
|
|
fi
|
|
|
|
|
if [ $1 -eq 2 ]; then
|
|
|
|
|
# after upgrade, restart service
|
|
|
|
|
eval `%{l_rc} arangodb status 2>/dev/null`
|
|
|
|
|
[ ".$arangodb_active" = .yes ] && %{l_rc} mongodb restart
|
|
|
|
|
fi
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
# before erase, stop service and remove log files
|
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
|
%{l_rc} arangodb stop 2>/dev/null
|
|
|
|
|
rm -f $RPM_INSTALL_PREFIX/var/arangodb/run/* >/dev/null 2>&1 || true
|
|
|
|
|
rm -f $RPM_INSTALL_PREFIX/var/arangodb/log/* >/dev/null 2>&1 || true
|
|
|
|
|
rm -rf $RPM_INSTALL_PREFIX/var/arangodb/db/* >/dev/null 2>&1 || true
|
|
|
|
|
fi
|
|
|
|
|
exit 0
|
|
|
|
|
|