diff options
author | Richard Kreuter <richard@10gen.com> | 2010-02-10 10:37:02 -0500 |
---|---|---|
committer | Richard Kreuter <richard@10gen.com> | 2010-02-10 10:37:02 -0500 |
commit | a71dbfc15ad59c7b199a87f310885383c05a7f7a (patch) | |
tree | cd620d83009d0dd2181a57eb7167bae79eb05d2a | |
parent | a2bc5e32690d80e84c79f9f7d1f953ea91431155 (diff) | |
download | mongo-a71dbfc15ad59c7b199a87f310885383c05a7f7a.tar.gz |
Apply changes to debian/ to 1.2.x branch. MINOR
-rw-r--r-- | buildscripts/frob_version.py | 69 | ||||
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | debian/control | 6 | ||||
-rw-r--r-- | debian/init.d | 98 | ||||
-rw-r--r-- | debian/lintian-overrides | 11 | ||||
-rw-r--r-- | debian/mongod.1 | 16 | ||||
-rw-r--r-- | debian/mongoimport.1 | 63 | ||||
-rw-r--r-- | debian/mongoimportjson.1 | 45 | ||||
-rw-r--r-- | debian/mongosniff.1 | 30 | ||||
-rw-r--r-- | debian/postinst | 6 | ||||
-rw-r--r-- | debian/rules | 13 |
11 files changed, 234 insertions, 131 deletions
diff --git a/buildscripts/frob_version.py b/buildscripts/frob_version.py new file mode 100644 index 00000000000..7b89e0b78e9 --- /dev/null +++ b/buildscripts/frob_version.py @@ -0,0 +1,69 @@ +#!/usr/bin/python + +from __future__ import with_statement +import tempfile +import sys +import re +import os + +def opentemp(basename): + # The following doesn't work in python before 2.6 +# return tempfile.NamedTemporaryFile('w', -1, ".XXXXXX", basename, '.', False) + fname = basename +".TMP" + if os.path.exists(fname): + raise "not clobbering file %s" % fname + return open(fname, 'w') + +def frob_debian_changelog(version): + fname = 'debian/changelog' + with opentemp(fname) as o: + with open(fname) as i: + lineno = 0 + for line in i: + if lineno == 0: + newline = re.sub(r'\([^)]*\)', '('+version+')', line) + o.write(newline) + else: + o.write(line) + os.rename(o.name, fname) + +def frob_rpm_spec(version): + fname = 'rpm/mongo.spec' + with opentemp(fname) as o: + with open(fname) as i: + frobbed = False + for line in i: + if frobbed: + o.write(line) + else: + if line.find('Version:') == 0: + print >> o, 'Version: ' + version + frobbed = True + else: + o.write(line) + os.rename(o.name, fname) + +def frob_stdafx_cpp(version): + fname = 'stdafx.cpp' + with opentemp(fname) as o: + with open(fname) as i: + frobbed = False + for line in i: + if frobbed: + o.write(line) + else: + if re.search(r'const.*char.*versionString\[\].*=', line): + o.write(' const char versionString[] = "%s";' % version) + else: + o.write(line) + os.rename(o.name, fname) + +(progname, version) = sys.argv +if version is None: + print >> sys.stderr, 'usage: %s VERSION' % progname + sys.exit(1) +frob_debian_changelog(version) +frob_rpm_spec(version) +## I don't yet know what-all cares about the versionString inside the +## mongo code, so I'm not actually calling this yet. +# frob_stdafx_cpp(version) diff --git a/debian/changelog b/debian/changelog index c068dafb47f..d15478ae435 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,10 @@ -mongodb (1.2.2) stable; urgency=low +mongodb (1.3.1) unsable; urgency=low + + * munged debian files + + -- Richard Kreuter <richard@10gen.com> Fri, 05 Feb 2010 16:56:28 -0500 + +mongodb (1.3.1) unstable; urgency=low * Initial release diff --git a/debian/control b/debian/control index 901835db6df..2aef1c3abf6 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,14 @@ Source: mongodb Section: devel Priority: optional -Maintainer: Kristina Chodorow <kristina@10gen.com> -Build-Depends: debhelper (>= 7), libboost-dev, libpcre3, libpcre3-dev, scons, xulrunner-1.9-dev, libboost-thread-dev, libboost-filesystem-dev, libboost-program-options-dev, libboost-date-time-dev +Maintainer: Richard Kreuter <richard@10gen.com> +Build-Depends: debhelper (>= 7), libpcre3, libpcre3-dev, scons, xulrunner-dev, libboost1.35-dev | libboost1.37-dev | libboost1.38-dev | libboost1.40-dev, libboost-thread1.35-dev | libboost-thread1.37-dev | libboost-thread1.38-dev | libboost-thread1.40-dev, libboost-filesystem1.35-dev | libboost-filesystem1.37-dev | libboost-filesystem1.38-dev | libboost-filesystem1.40-dev, libboost-program-options1.35-dev | libboost-program-options1.37-dev | libboost-program-options1.38-dev | libboost-program-options1.40-dev, libboost-date-time1.35-dev | libboost-date-time1.37-dev | libboost-date-time1.38-dev | libboost-date-time1.40-dev, libpcap-dev, libreadline-dev Standards-Version: 3.8.0 Homepage: http://www.mongodb.org Package: mongodb Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, xulrunner-1.9-dev +Depends: ${shlibs:Depends}, ${misc:Depends}, xulrunner-dev Description: An object/document-oriented database MongoDB is a high-performance, open source, schema-free document-oriented data store that's easy to deploy, manage diff --git a/debian/init.d b/debian/init.d index b4eedf0f0e5..bfa9c39609e 100644 --- a/debian/init.d +++ b/debian/init.d @@ -21,8 +21,8 @@ # ### BEGIN INIT INFO # Provides: mongodb -# Required-Start: $network $local_fs -# Required-Stop: +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $network $local_fs $remote_fs # Should-Start: $named # Should-Stop: # Default-Start: 2 3 4 5 @@ -48,10 +48,21 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/mongod -DATA=/var/lib/mongodb -NAME=MongoDB DESC=database +# Default defaults. Can be overridden by the /etc/default/$NAME +NAME=mongodb +CONF=/etc/mongodb.conf +DATA=/var/lib/mongodb +LOGDIR=/var/log/mongodb +PIDFILE=/var/run/$NAME.pid +LOGFILE=$LOGDIR/$NAME.log # Server logfile + +# Include mongodb defaults if available +if [ -f /etc/default/$NAME ] ; then + . /etc/default/$NAME +fi + if test ! -x $DAEMON; then echo "Could not find $DAEMON" exit 0 @@ -63,35 +74,15 @@ fi . /lib/lsb/init-functions -LOGDIR=/var/log/mongodb -PIDFILE=/var/run/$NAME.pid +STARTTIME=1 DIETIME=10 # Time to wait for the server to die, in seconds # If this value is set too low you might not # let some servers to die gracefully and # 'restart' will not work -LOGFILE=$LOGDIR/$NAME.log # Server logfile -DAEMON_OPTS="--dbpath $DATA --logpath $LOGFILE run" - - -# Include mongodb defaults if available -if [ -f /etc/default/$NAME ] ; then - . /etc/default/$NAME -fi - -DAEMONUSER=mongodb -# Check that the user exists (if we set a user) -# Does the user exist? -if [ -n "$DAEMONUSER" ] ; then - if getent passwd | grep -q "^$DAEMONUSER:"; then - # Obtain the uid and gid - DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'` - DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'` - else - log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist." - exit 1 - fi -fi +DAEMONUSER=${DAEMONUSER:-mongodb} +DAEMON_OPTS=${DAEMON_OPTS:-"--dbpath $DATA --logpath $LOGFILE run"} +DAEMON_OPTS="$DAEMON_OPTS --config $CONF" set -e @@ -121,45 +112,22 @@ running() { start_server() { # Start the process using the wrapper - if [ -z "$DAEMONUSER" ] ; then - start-stop-daemon --background --start --quiet --pidfile $PIDFILE \ - --make-pidfile --exec $DAEMON -- $DAEMON_OPTS - errcode=$? - else -# if we are using a daemonuser then change the user id start-stop-daemon --background --start --quiet --pidfile $PIDFILE \ --make-pidfile --chuid $DAEMONUSER \ --exec $DAEMON -- $DAEMON_OPTS errcode=$? - fi return $errcode } stop_server() { # Stop the process using the wrapper - if [ -z "$DAEMONUSER" ] ; then - start-stop-daemon --stop --quiet --pidfile $PIDFILE - rm $PIDFILE - errcode=$? - else -# if we are using a daemonuser then look for process that match start-stop-daemon --stop --quiet --pidfile $PIDFILE \ --user $DAEMONUSER \ --exec $DAEMON errcode=$? - fi - return $errcode } -reload_server() { - [ ! -f "$PIDFILE" ] && return 1 - pid=pidofproc $PIDFILE # This is the daemon's pid - # Send a SIGHUP - kill -USR1 $pid - return $? -} - force_stop() { # Force the process to die killing it manually [ ! -e "$PIDFILE" ] && return @@ -182,7 +150,7 @@ force_stop() { case "$1" in start) - log_daemon_msg "Starting $DESC $NAME" + log_daemon_msg "Starting $DESC" "$NAME" # Check if it's running first if running ; then log_progress_msg "apparently already running" @@ -254,35 +222,11 @@ case "$1" in exit 1 fi ;; - # Use this if the daemon cannot reload + # MongoDB can't reload its configuration. reload) log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" log_warning_msg "cannot re-read the config file (use restart)." ;; - # And this if it cann - #reload) - # - # If the daemon can reload its config files on the fly - # for example by sending it SIGHUP, do it here. - # - # If the daemon responds to changes in its config file - # directly anyway, make this a do-nothing entry. - # - # log_daemon_msg "Reloading $DESC configuration files" "$NAME" - # if running ; then - # reload_server - # if ! running ; then - # Process died after we tried to reload - # log_progress_msg "died on reload" - # log_end_msg 1 - # exit 1 - # fi - # else - # log_progress_msg "server is not running" - # log_end_msg 1 - # exit 1 - # fi - #;; *) N=/etc/init.d/$NAME diff --git a/debian/lintian-overrides b/debian/lintian-overrides new file mode 100644 index 00000000000..c843e9ecfab --- /dev/null +++ b/debian/lintian-overrides @@ -0,0 +1,11 @@ +# Agreed with upstream, that redefining rpath is necessary as xulrunner used to +# change API without changing so-name +mongodb: binary-or-shlib-defines-rpath ./usr/bin/mongo /usr/lib64/xulrunner-1.9.1 +mongodb: binary-or-shlib-defines-rpath ./usr/bin/mongod /usr/lib64/xulrunner-1.9.1 +mongodb: binary-or-shlib-defines-rpath ./usr/bin/mongodump /usr/lib64/xulrunner-1.9.1 +mongodb: binary-or-shlib-defines-rpath ./usr/bin/mongoexport /usr/lib64/xulrunner-1.9.1 +mongodb: binary-or-shlib-defines-rpath ./usr/bin/mongofiles /usr/lib64/xulrunner-1.9.1 +mongodb: binary-or-shlib-defines-rpath ./usr/bin/mongoimport /usr/lib64/xulrunner-1.9.1 +mongodb: binary-or-shlib-defines-rpath ./usr/bin/mongorestore /usr/lib64/xulrunner-1.9.1 +mongodb: binary-or-shlib-defines-rpath ./usr/bin/mongos /usr/lib64/xulrunner-1.9.1 +mongodb: binary-or-shlib-defines-rpath ./usr/bin/mongosniff /usr/lib64/xulrunner-1.9.1 diff --git a/debian/mongod.1 b/debian/mongod.1 new file mode 100644 index 00000000000..7b863590584 --- /dev/null +++ b/debian/mongod.1 @@ -0,0 +1,16 @@ +.\" Documentation for the MongoDB shell +.TH MONGOD "1" "June 2009" "10gen" "Mongo Database" +.SH "NAME" +mongod \- the Mongo Daemon +.SH "SYNOPSIS" +.SH "DESCRIPTION" +.PP +\fBmongod\fR +is a core MongoDB daemon. You are not supposed to call it directly, please refer to the wiki if necessary. +.SH "COPYRIGHT" +.PP +Copyright 2007\-2009 10gen +.SH "SEE ALSO" +For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org. +.SH "AUTHOR" +Antonin Kral diff --git a/debian/mongoimport.1 b/debian/mongoimport.1 new file mode 100644 index 00000000000..4b6c3de156b --- /dev/null +++ b/debian/mongoimport.1 @@ -0,0 +1,63 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH MONGOIMPORT "1" "January 2010" "10gen" "Mongo Database" +.SH "NAME" +mongoimport \- the Mongo import tool +.SH "SYNOPSIS" +\fBmongoimport [\fIOPTIONS\fR]\fR +.SH "DESCRIPTION" +.PP +\fBmongoimport\fR +is a tool to import a MongoDB collection from JSON, CSV, or TSV. The query can be filtered or a list of fields to input can be given. +.\".SH "EXAMPLES" +.\".TP +.\".B mongoimport -d test -c test1 --csv -f "name,num" +.\"import documents from test.test1 in CSV format +.SS "OPTIONS" +.TP +\fB\-\-help\fR +show usage information +.TP +.B \-h, \-\-host HOST +server to connect to (default HOST=localhost) +.TP +.B \-d, \-\-db DATABASE +database to use +.TP +.B \-c, \-\-c COLLECTION +collection to use (some commands) +.TP +.B \-\-dbpath PATH +directly access mongod data files in this path, +instead of connecting to a mongod instance +.TP +.B \-v, \-\-verbose +be more verbose (include multiple times for more +verbosity e.g. \fB\-vvvvv\fR) +.TP +.B \-f, \-\-fields NAMES +comma seperated list of field names e.g. \fB\-f\fR name,age +.TP +.B \-\-fieldFile FILE +file with fields names \- 1 per line +.TP +.B \-\-ignoreBlanks +if given, empty fields in csv and tsv will be ignored +.TP +.B \-\-type TYPE +type of file to import. default: json (json,csv,tsv) +.TP +.B \-\-file FILE +file to import from; if not specified stdin is used +.TP +.B \-\-drop +drop collection first +.TP +.B \-\-headerline +CSV,TSV only \- use first line as headers +.SH "COPYRIGHT" +.PP +Copyright 2007\-2009 10gen +.SH "SEE ALSO" +For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org. +.SH "AUTHOR" +Kristina Chodorow diff --git a/debian/mongoimportjson.1 b/debian/mongoimportjson.1 deleted file mode 100644 index 5f3f450693e..00000000000 --- a/debian/mongoimportjson.1 +++ /dev/null @@ -1,45 +0,0 @@ -.\" Documentation for the MongoDB shell -.TH MONGOIMPORTJSON "1" "June 2009" "10gen" "Mongo Database" -.SH "NAME" -mongoimportjson \- the Mongo import tool -.SH "SYNOPSIS" -\fBmongoimportjson [\fIOPTIONS\fR]\fR -.SH "DESCRIPTION" -.PP -\fBmongoimportjson\fR -is a tool to import JSON documents into MongoDB. This utility takes a single file that contains one JSON string per line and inserts it. A databaase and collection must be specified. -.SH "OPTIONS" -.TP -.B \-\-help -show usage information -.TP -.B \-h, \-\-host HOST -server to connect to (default HOST=localhost) -.TP -.B \-d, \-\-db DATABASE -database to use -.TP -.B \-c, \-\-c COLLECTION -collection to use -.TP -.B \-\-file FILE -file from which to import -.TP -.B \-\-dbpath PATH -directly access mongod data files in this path, instead of connecting to a mongod instance -.TP -.B \-\-idbefore -create id index before importing -.TP -.B \-\-id -create id index after importing (recommended) -.TP -.B \-\-drop -drop collection before importing -.SH "COPYRIGHT" -.PP -Copyright 2007\-2009 10gen -.SH "SEE ALSO" -For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org. -.SH "AUTHOR" -Kristina Chodorow diff --git a/debian/mongosniff.1 b/debian/mongosniff.1 new file mode 100644 index 00000000000..b6f1063e096 --- /dev/null +++ b/debian/mongosniff.1 @@ -0,0 +1,30 @@ +.TH MONGOSNIFF "1" "Jan 2010" "10gen" "Mongo Database" +.SH "NAME" +mongosniff \- the Mongo packet analyzer +.SH "SYNOPSIS" +\fBmongosniff [\fIOPTIONS\fR] [\fI<port0> <port1> ...\fR] +.SH "DESCRIPTION" +.PP +\fBmongosniff\fR +is a analyzer tool for analyzing packets coming to your database. +.PP +.SH "OPTIONS" +.TP +.B \-\-forward +Forward all parsed request messages to mongod instance at specified host:port +.TP +.B \-\-source +Source of traffic to sniff, either a network interface or a file containing previously captured packets, in pcap format. If no source is specified, mongosniff will attempt to sniff from one of the machine's network interfaces. +.TP +.B \-\-help +print a short help message. +.TP +.B <port0> +These parameters are used to filter sniffing. By default, only port 27017 is sniffed. +.SH "COPYRIGHT" +.PP +Copyright 2007\-2009 10gen +.SH "SEE ALSO" +For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org. +.SH "AUTHOR" +Antonin Kral diff --git a/debian/postinst b/debian/postinst index 3745b99c539..0bcc2e289e7 100644 --- a/debian/postinst +++ b/debian/postinst @@ -22,16 +22,16 @@ case "$1" in configure) # create a mongodb group and user if ! grep -q mongodb /etc/passwd; then - adduser --system mongodb + adduser --system --no-create-home mongodb addgroup --system mongodb adduser mongodb mongodb fi - # create db + # create db -- note: this should agree with dbpath in mongodb.conf mkdir -p /var/lib/mongodb chown mongodb:mongodb /var/lib/mongodb - # create logdir + # create logdir -- note: this should agree with logpath in mongodb.conf mkdir -p /var/log/mongodb chown mongodb:mongodb /var/log/mongodb ;; diff --git a/debian/rules b/debian/rules index c25872397ed..d65daf5f174 100644 --- a/debian/rules +++ b/debian/rules @@ -26,6 +26,7 @@ build-stamp: configure-stamp # Add here commands to compile the package. scons #docbook-to-man debian/mongodb.sgml > mongodb.1 + ls debian/*.1 > debian/mongodb.manpages touch $@ @@ -49,16 +50,24 @@ clean: rm -rf tools/*.o rm -rf shell/*.o rm -rf .sconf_temp - dh_clean + rm -f buildscripts/*.pyc + rm -f *.pyc + rm -f buildinfo.cpp + dh_clean debian/files install: build dh_testdir dh_testroot - dh_clean -k + dh_prep dh_installdirs scons --prefix=$(CURDIR)/debian/mongodb/usr install + mkdir -p $(CURDIR)/debian/mongodb/etc + cp $(CURDIR)/debian/mongodb.conf $(CURDIR)/debian/mongodb/etc/mongodb.conf + mkdir -p $(CURDIR)/debian/mongodb/usr/share/lintian/overrides/ + install -m 644 $(CURDIR)/debian/lintian-overrides \ + $(CURDIR)/debian/mongodb/usr/share/lintian/overrides/mongodb # Build architecture-independent files here. binary-indep: build install |