|
|
|
|
##
|
|
|
|
|
## arangodb.spec -- OpenPKG RPM Package Specification
|
|
|
|
|
## Copyright (c) 2000-2016 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 2.7.4
|
|
|
|
|
%define V_tarball 2.7.4
|
|
|
|
|
|
|
|
|
|
# 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: 20160120
|
|
|
|
|
|
|
|
|
|
# list of sources
|
|
|
|
|
Source0: https://github.com/arangodb/arangodb/archive/v%{V_tarball}.tar.gz
|
|
|
|
|
Source1: rc.arangodb
|
|
|
|
|
Source2: arangod.conf
|
|
|
|
|
Source3: arangosh.conf
|
|
|
|
|
Patch0: arangodb.patch
|
|
|
|
|
|
|
|
|
|
# build information
|
|
|
|
|
BuildPreReq: OpenPKG, openpkg >= 20140101, gcc, gcc::with_cxx = yes
|
|
|
|
|
PreReq: OpenPKG, openpkg >= 20140101
|
|
|
|
|
BuildPreReq: readline, ncurses, openssl, icu, libexecinfo
|
|
|
|
|
PreReq: readline, ncurses, openssl, icu, libexecinfo
|
|
|
|
|
|
|
|
|
|
%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://github.com/arangodb/arangodb/releases
|
|
|
|
|
regex = v(\d+\.\d+\.\d+)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n arangodb-%{V_tarball}
|
|
|
|
|
%patch -p0
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
# do not use -ldl on non-Linux platforms
|
|
|
|
|
case "%{l_platform -t}" in
|
|
|
|
|
*-linux* ) ;;
|
|
|
|
|
* ) %{l_shtool} subst -e 's;-ldl;;g' configure m4/external.openssl ;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
# patch sources
|
|
|
|
|
%{l_shtool} subst \
|
|
|
|
|
-e 's;/bin/bash;%{l_bash};g' \
|
|
|
|
|
3rdParty/V8-*/build/gyp/gyp
|
|
|
|
|
|
|
|
|
|
# provide tools as it is too hard to pass the correct flags
|
|
|
|
|
# to all sub-directory build processes of ArangoDB
|
|
|
|
|
mkdir tool
|
|
|
|
|
( echo "#!/bin/sh"
|
|
|
|
|
echo "exec %{l_prefix}/bin/cc -std=gnu11 %{l_cflags -O} %{l_cppflags} %{l_ldflags} \${1+\"\$@\"}"
|
|
|
|
|
) >tool/cc
|
|
|
|
|
( echo "#!/bin/sh"
|
|
|
|
|
echo "exec %{l_prefix}/bin/c++ -std=gnu++14 %{l_cxxflags -O} %{l_cppflags} %{l_ldflags} \${1+\"\$@\"}"
|
|
|
|
|
) >tool/c++
|
|
|
|
|
chmod a+x tool/*
|
|
|
|
|
PATH=`pwd`/tool:$PATH
|
|
|
|
|
|
|
|
|
|
# configure program
|
|
|
|
|
CC="cc" \
|
|
|
|
|
CXX="c++" \
|
|
|
|
|
CFLAGS="" \
|
|
|
|
|
CXXFLAGS="" \
|
|
|
|
|
CPPFLAGS="" \
|
|
|
|
|
LDFLAGS="" \
|
|
|
|
|
LIBS="-lcrypto -lncurses -lexecinfo -lm" \
|
|
|
|
|
AUTOMAKE="true" \
|
|
|
|
|
AUTOCONF="true" \
|
|
|
|
|
ACLOCAL="true" \
|
|
|
|
|
./configure \
|
|
|
|
|
--prefix=%{l_prefix} \
|
|
|
|
|
--mandir=%{l_prefix}/man \
|
|
|
|
|
--with-readline=%{l_prefix} \
|
|
|
|
|
--with-openssl-inc=%{l_prefix}/include \
|
|
|
|
|
--with-openssl-lib=%{l_prefix}/lib \
|
|
|
|
|
--disable-all-in-one-etcd
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|