Browse Source

make SSL optional

master
parent
commit
f43e654195
  1. 40
      mongodb/mongodb.conf
  2. 25
      mongodb/mongodb.spec

40
mongodb/mongodb.conf

@ -2,26 +2,30 @@
## mongodb.conf -- MongoDB Server Configuration
##
fork = true
pidfilepath = @l_prefix@/var/mongodb/run/mongodb.pid
logpath = @l_prefix@/var/mongodb/log/mongodb.log
logappend = true
fork = true
pidfilepath = @l_prefix@/var/mongodb/run/mongodb.pid
logpath = @l_prefix@/var/mongodb/log/mongodb.log
logappend = true
bind_ip = 127.0.0.1
port = 27017
bind_ip = 127.0.0.1
port = 27017
nohttpinterface = true
auth = true
rest = true
notablescan = true
nohttpinterface = true
auth = true
rest = true
notablescan = true
dbpath = @l_prefix@/var/mongodb/db
directoryperdb = true
journal = true
dbpath = @l_prefix@/var/mongodb/db
directoryperdb = true
journal = true
#keyFile = @l_prefix@/etc/mongodb/mongodb.key
#master = true
#slave = true
#source = 127.0.0.1:27018
#autoresync = true
#keyFile = @l_prefix@/etc/mongodb/mongodb.key
#master = true
#slave = true
#source = 127.0.0.1:27018
#autoresync = true
#sslOnNormalPorts = true
#sslPEMKeyFile = @l_prefix@/etc/mongodb/mongodb.pem
#sslPEMKeyPassword = pass

25
mongodb/mongodb.spec

@ -34,6 +34,9 @@ License: AGPL
Version: 2.0.6
Release: 20120608
# package options
%option with_ssl no
# list of sources
Source0: http://downloads.mongodb.org/src/mongodb-src-r%{version}.tar.gz
Source1: rc.mongodb
@ -43,8 +46,12 @@ Patch0: mongodb.patch
# build information
BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, gcc::with_cxx = yes, scons
PreReq: OpenPKG, openpkg >= 20100101
BuildPreReq: boost, libexecinfo, v8, openssl, pcre, pcre::with_cxx = yes, snappy
PreReq: boost, libexecinfo, v8, openssl, pcre, pcre::with_cxx = yes, snappy
BuildPreReq: boost, libexecinfo, v8, pcre, pcre::with_cxx = yes, snappy
PreReq: boost, libexecinfo, v8, pcre, pcre::with_cxx = yes, snappy
%if "%{with_ssl}" == "yes"
BuildPreReq: openssl, x509
PreReq: openssl, x509
%endif
%description
MongoDB bridges the gap between key-value stores (which are fast and
@ -91,7 +98,9 @@ PreReq: boost, libexecinfo, v8, openssl, pcre, pcre::with_cxx = yes, snapp
--use-system-pcre \
--use-system-snappy \
--usev8 \
%if "%{with_ssl}" == "yes"
--ssl \
%endif
.
%install
@ -147,6 +156,15 @@ PreReq: boost, libexecinfo, v8, openssl, pcre, pcre::with_cxx = yes, snapp
chmod 700 $RPM_INSTALL_PREFIX/etc/mongodb/mongodb.key
chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/etc/mongodb/mongodb.key
# optionally create bundled SSL certificate/key file
%if "%{with_ssl}" == "yes"
cat $RPM_INSTALL_PREFIX/etc/x509/example-server.crt.pem \
$RPM_INSTALL_PREFIX/etc/x509/example-server.key.pem \
>$RPM_INSTALL_PREFIX/etc/mongodb/mongodb.pem
chmod 700 $RPM_INSTALL_PREFIX/etc/mongodb/mongodb.pem
chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/etc/mongodb/mongodb.pem
%endif
# display information about next steps
( echo "After initially starting MongoDB with..."
echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mongodb start"
@ -174,6 +192,9 @@ PreReq: boost, libexecinfo, v8, openssl, pcre, pcre::with_cxx = yes, snapp
rm -f $RPM_INSTALL_PREFIX/var/mongodb/log/* >/dev/null 2>&1 || true
rm -rf $RPM_INSTALL_PREFIX/var/mongodb/db/* >/dev/null 2>&1 || true
rm -f $RPM_INSTALL_PREFIX/etc/mongodb/mongodb.key >/dev/null 2>&1 || true
%if "%{with_ssl}" == "yes"
rm -f $RPM_INSTALL_PREFIX/etc/mongodb/mongodb.pem >/dev/null 2>&1 || true
%endif
fi
exit 0

Loading…
Cancel
Save