You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
170 lines
5.9 KiB
170 lines
5.9 KiB
## |
|
## arangodb.spec -- OpenPKG RPM Package Specification |
|
## Copyright (c) 2000-2015 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.2.6 |
|
%define V_tarball 2.2.6 |
|
|
|
# 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: 20141023 |
|
|
|
# list of sources |
|
Source0: https://www.arangodb.org/repositories/Source/ArangoDB-%{V_tarball}.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, v8b316, icu |
|
PreReq: readline, ncurses, openssl, libev, v8b316, 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 = http://www.arangodb.org/repositories/ |
|
regex = (\d+\.\d+\.\d+) |
|
} |
|
|
|
%prep |
|
%setup -q -n ArangoDB-%{V_tarball} |
|
%patch -p0 |
|
|
|
%build |
|
# configure program |
|
%{l_shtool} subst \ |
|
-e 's;v8_base;v8;g' \ |
|
-e 's;v8_nosnapshot;v8;g' \ |
|
configure |
|
CC="%{l_cc}" \ |
|
CXX="%{l_cxx}" \ |
|
CFLAGS="%{l_cflags -O}" \ |
|
CXXFLAGS="%{l_cxxflags -O}" \ |
|
CPPFLAGS="%{l_cppflags v8b316 ev icu .}" \ |
|
LDFLAGS="%{l_ldflags v8b316 .}" \ |
|
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 \ |
|
--with-libev=%{l_prefix} \ |
|
--with-v8=%{l_prefix} \ |
|
--with-icu-config=%{l_prefix}/bin/icu-config \ |
|
--disable-all-in-one-v8 \ |
|
--disable-all-in-one-libev \ |
|
--disable-all-in-one-icu \ |
|
--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 |
|
|
|
|