|
|
|
|
@ -43,6 +43,8 @@ Source0: https://github.com/arangodb/arangodb/archive/v%{V_tarball}.tar.gz
|
|
|
|
|
Source1: rc.arangodb |
|
|
|
|
Source2: arangod.conf |
|
|
|
|
Source3: arangosh.conf |
|
|
|
|
Source4: arangodump.conf |
|
|
|
|
Source5: arangomkdb.sh |
|
|
|
|
Patch0: arangodb.patch |
|
|
|
|
|
|
|
|
|
# build information |
|
|
|
|
@ -139,8 +141,15 @@ PreReq: readline, ncurses, openssl, icu, libexecinfo
|
|
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
|
|
|
%{SOURCE arangod.conf} \ |
|
|
|
|
%{SOURCE arangosh.conf} \ |
|
|
|
|
%{SOURCE arangodump.conf} \ |
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/arangodb/ |
|
|
|
|
|
|
|
|
|
# install utility |
|
|
|
|
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
|
|
|
-e 's;@l_bash@;%{l_bash};g' \ |
|
|
|
|
%{SOURCE arangomkdb.sh} \ |
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/bin/arangomkdb |
|
|
|
|
|
|
|
|
|
# install run-command script |
|
|
|
|
%{l_shtool} mkdir -f -p -m 755 \ |
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
|
|
|
|
@ -167,33 +176,35 @@ PreReq: readline, ncurses, openssl, icu, libexecinfo
|
|
|
|
|
%post |
|
|
|
|
if [ $1 -eq 1 ]; then |
|
|
|
|
# provide SSL/TLS certificate/key pairs |
|
|
|
|
if [ ! -f $RPM_INSTALL_PREFIX/etc/arangodb/arangodb-sv.pem ]; then |
|
|
|
|
if [ ! -f $RPM_INSTALL_PREFIX/etc/arangodb/arangod-sv.pem ]; then |
|
|
|
|
cat $RPM_INSTALL_PREFIX/etc/x509/example-server.crt.pem \ |
|
|
|
|
$RPM_INSTALL_PREFIX/etc/x509/example-server.key.pem \ |
|
|
|
|
>$RPM_INSTALL_PREFIX/etc/arangodb/arangodb-sv.pem |
|
|
|
|
chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/etc/arangodb/arangodb-sv.pem |
|
|
|
|
chmod 600 $RPM_INSTALL_PREFIX/etc/arangodb/arangodb-sv.pem |
|
|
|
|
>$RPM_INSTALL_PREFIX/etc/arangodb/arangod-sv.pem |
|
|
|
|
chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/etc/arangodb/arangod-sv.pem |
|
|
|
|
chmod 600 $RPM_INSTALL_PREFIX/etc/arangodb/arangod-sv.pem |
|
|
|
|
fi |
|
|
|
|
if [ ! -f $RPM_INSTALL_PREFIX/etc/arangodb/arangodb-ca.pem ]; then |
|
|
|
|
if [ ! -f $RPM_INSTALL_PREFIX/etc/arangodb/arangod-ca.pem ]; then |
|
|
|
|
cat $RPM_INSTALL_PREFIX/etc/x509/example-ca.crt.pem \ |
|
|
|
|
>$RPM_INSTALL_PREFIX/etc/arangodb/arangodb-ca.pem |
|
|
|
|
chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/etc/arangodb/arangodb-ca.pem |
|
|
|
|
chmod 644 $RPM_INSTALL_PREFIX/etc/arangodb/arangodb-ca.pem |
|
|
|
|
>$RPM_INSTALL_PREFIX/etc/arangodb/arangod-ca.pem |
|
|
|
|
chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/etc/arangodb/arangod-ca.pem |
|
|
|
|
chmod 644 $RPM_INSTALL_PREFIX/etc/arangodb/arangod-ca.pem |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# display information about next steps |
|
|
|
|
( echo "After initially starting ArangoDB with..." |
|
|
|
|
echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc arangodb start" |
|
|
|
|
echo "...you should immediately set a root password:" |
|
|
|
|
echo " \$ echo 'require(\"org/arangodb/users\").update(\"root\", \"<root-pw>\");' | \\%{l_nil}" |
|
|
|
|
echo "...you should immediately set the \"root\" password on database \"_system\":" |
|
|
|
|
echo " \$ echo 'require(\"@arangodb/users\").update(\"root\", \"<root-pw>\");' | \\%{l_nil}" |
|
|
|
|
echo " $RPM_INSTALL_PREFIX/bin/arangosh --server.disable-authentication true" |
|
|
|
|
echo "You can then create an user account:" |
|
|
|
|
echo " \$ echo 'u = require(\"org/arangodb/users\"); \\%{l_nil}" |
|
|
|
|
echo " u.save(\"<user-name>\", \"<user-pw>\"); u.reload();' | \\%{l_nil}" |
|
|
|
|
echo " $RPM_INSTALL_PREFIX/bin/arangosh \\%{l_nil}" |
|
|
|
|
echo " --server.username root --server.password <root-pw>" |
|
|
|
|
echo "You can then create a custom database with:" |
|
|
|
|
echo " \$ $RPM_INSTALL_PREFIX/bin/arangomkdb <database> <username> <password>" |
|
|
|
|
echo "Then you can connect to the custom database with:" |
|
|
|
|
echo " \$ $RPM_INSTALL_PREFIX/bin/arangosh \\%{l_nil}" |
|
|
|
|
echo " --server.database <database> \\%{l_nil}" |
|
|
|
|
echo " --server.username <username> \\%{l_nil}" |
|
|
|
|
echo " --server.password <password>" |
|
|
|
|
echo "The web interface of ArangoDB you can reach under:" |
|
|
|
|
echo " http://localhost:8529/" |
|
|
|
|
echo " https://localhost:8529/" |
|
|
|
|
) | %{l_rpmtool} msg -b -t notice |
|
|
|
|
fi |
|
|
|
|
if [ $1 -eq 2 ]; then |
|
|
|
|
|