This is the spec file:
#
# spec file for package arangodb
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via
http://bugs.opensuse.org/#
%define _cfgdir %{_sysconfdir}/arangodb
%define _databasedir %{_localstatedir}/lib/arangodb
%define _logdir %{_localstatedir}/log/arangodb
%define _piddir %{_localstatedir}/run/arangodb
%define _builtinEV --disable-all-in-one-libev
%define _builtinV8 --enable-all-in-one-v8
%define _skipFdupes 0
%define _builtinICU --enable-all-in-one-icu
%define _builtMRuby --disable-mruby
%define _with_unittests 0
%define _maintainer_mode ""
Name: arangodb
Version: 1.3.0
Release: 13
Summary: An open-source, multi-model NoSQL database
License: Apache-2.0
Group: Productivity/Databases/Servers
Url:
http://www.arangodb.orgSource: %{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: readline-devel
BuildRequires: python
%{?systemd_requires}
# with unit-tests
%if %{_with_unittests} != 0
BuildRequires: ctags
BuildRequires: curl
BuildRequires: bison
BuildRequires: flex
BuildRequires: boost-devel
%define _maintainer_mode --enable-maintainer-mode
%endif
# only needed if you want to rebuild the documentation
# BuildRequires: doxygen graphviz graphviz-gd graphviz-gnome python
%if 0%{?suse_version}
BuildRequires: libopenssl-devel
BuildRequires: pwdutils
BuildRequires: fdupes
%if 0%{?suse_version} >= 1210
BuildRequires: systemd
%endif
#
# use builtin libev for SLES
#
%if 0%{?sles_version} != 0
%define _builtinEV --enable-all-in-one-libev
%else
BuildRequires: libev-devel
Requires: libicu
BuildRequires: libicu-devel
%define _builtinICU --enable-icu
%endif
%endif
%if 0%{?centos_version} || 0%{?rhel_version}
BuildRequires: openssl-devel
%define _builtinEV --enable-all-in-one-libev
%define _skipFdupes 1
# bugfix for ncurses
%ifarch i686 i586 i486 i386
%define optflags -O2 -g -march=i586
%endif
%endif
%if 0%{?fedora_version}
BuildRequires: openssl-devel
Requires: libicu
BuildRequires: libicu-devel
%define _builtinICU --disable-all-in-one-icu --enable-icu
%define _builtinEV --enable-all-in-one-libev
%define _skipFdupes 1
%endif
%if 0%{?mdkversion}
BuildRequires: openssl-devel
Requires: libicu
BuildRequires: libicu-devel
%define _builtinICU --enable-icu
%define _builtinEV --enable-all-in-one-libev
%define _skipFdupes 1
%endif
##############################################################################
#
# description SECTION
#
##############################################################################
%description
ArangoDB is a durable, reliable, transactional multi-model database. It's key-features are: Schema-free schemata, an integrated application server, flexible data modelling, free index choice, and configurable durability.
The ArangoDB consists of a server, a separate shell, which allows you to administrate the server, and a set of client API for various languages.
It is written in C/C++.
%prep
%setup -q
##############################################################################
#
# build SECTION
#
##############################################################################
%build
%if 0%{?centos_version} < 600 || 0%{?rhel_version} < 600
export READLINE_LDFLAGS="-lncurses"
%endif
%configure \
%{_maintainer_mode} \
%{_builtinEV} \
%{_builtinV8} \
%{_builtinICU} \
%{_builtMRuby}
make %{?jobs:-j%jobs}
##############################################################################
#
# install SECTION
#
##############################################################################
%install
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p %{buildroot}%{_databasedir}
mkdir -p %{buildroot}%{_logdir}
mkdir -p %{buildroot}%{_piddir}
%if 0%{?suse_version}
%{__install} -D -m 0755 Installation/Linux/rc.arangod.OpenSuSE %{buildroot}%{_sysconfdir}/init.d/arangodb
ln -s %{_sysconfdir}/init.d/arangodb %{buildroot}%{_sbindir}/rcarangodb
%if 0%{?suse_version} >= 1210
%{__install} -D -m 0644 etc/systemd/arangodb.service %{buildroot}%{_unitdir}/arangodb.service
%endif
%else
%{__install} -D -m 0755 Installation/Linux/rc.arangod.Centos %{buildroot}%{_sysconfdir}/init.d/arangodb
%endif
%if %{_skipFdupes} == 0
%fdupes %{buildroot}%{_datadir}/arangodb
%endif
%check
%if %{_with_unittests} != 0
make unittests
make unittests-shell-server
%endif
%post
%if 0%{?suse_version}
%{fillup_and_insserv -f -y arangodb}
%restart_on_update arangodb
%if 0%{?suse_version} >= 1210
%service_add_post arangodb.service
%endif
%else
chkconfig --level 2345 arangodb on
%endif
echo "
ArangoDB (
http://www.arangodb.org)
A universal open-source database with a flexible data model for documents,
graphs, and key-values.
First Steps with ArangoDB:
http:/
www.arangodb.org/quickstartUpgrading ArangoDB:
http://www.arangodb.org/manuals/current/Upgrading.htmlUpgrading ArangoDB database files:
> /etc/init.d/arangodb upgrade
Configuration file:
/etc/arangodb/arangod.conf
Start ArangoDB shell client:
> ${bindir}/arangosh
"
%if 0%{?suse_version} >= 1210
echo "Start ArangoDB service:
> systemctl start arangodb.service
Enable ArangoDB service:
> systemctl enable arangodb.service
"
%else
echo "Start ArangoDB service:
> /etc/init.d/arangodb start
"
%endif
exit 0
%postun
%if 0%{?suse_version}
%restart_on_update arangodb
%insserv_cleanup
%if 0%{?suse_version} >= 1210
%service_del_postun arangodb.service
%endif
%else
exit 0
%endif
%pre
# create arangodb group only if it doesn't already exist
if ! getent group arangodb >/dev/null 2>&1; then
/usr/sbin/groupadd -r arangodb
fi
# create arangodb user only if it doesn't already exist
if ! getent passwd arangodb >/dev/null 2>&1; then
/usr/sbin/useradd -r -g arangodb --home %{_localstatedir}/arangodb arangodb
/usr/sbin/usermod -c "Arango Server" arangodb
fi
%if 0%{?suse_version} >= 1210
%service_add_pre arangodb.service
%endif
%preun
%if 0%{?suse_version}
%stop_on_removal arangodb
%if 0%{?suse_version} >= 1210
%service_del_preun arangodb.service
%endif
%else
%{_sysconfdir}/init.d/arangodb stop > /dev/null 2>&1 || true
chkconfig --del arangodb
exit 0
%endif
%files
%defattr(-,root,root,0755)
%doc README
%doc README.md
%doc Doxygen/doc
%attr(0755,arangodb,arangodb) %{_databasedir}
%attr(0755,arangodb,arangodb) %{_logdir}
%ghost %attr(0755,arangodb,arangodb) %{_piddir}
%config(noreplace) %attr(-,arangodb,arangodb) %{_cfgdir}
%{_bindir}/*
%{_sbindir}/*
%{_mandir}/*/*
%{_datadir}/arangodb
%{_sysconfdir}/init.d/arangodb
%if 0%{?suse_version} >= 1210
%{_unitdir}/arangodb.service
%endif
%changelog