Skip to content

Commit

Permalink
Add debian package files
Browse files Browse the repository at this point in the history
Bump version to 1.3.1
Remove dependency on Digest::SHA1
  • Loading branch information
manitou-mail committed Nov 3, 2012
1 parent 760ef18 commit 84ee28a
Show file tree
Hide file tree
Showing 16 changed files with 321 additions and 5 deletions.
1 change: 0 additions & 1 deletion Makefile.PL
Expand Up @@ -23,7 +23,6 @@ my %opts = (
'MIME::Body'=> 5.0,
'Mail::Address'=> 1.0,
'Bit::Vector' => 6.4,
'Digest::SHA1' => 2.11,
'Sys::Syslog' => 0.13
}
);
Expand Down
7 changes: 7 additions & 0 deletions debian/README
@@ -0,0 +1,7 @@
The Debian Package manitou-mdx
----------------------------

This package contains manitou-mdx, the Mail Database eXchanger daemon
for Manitou-Mail.

-- Daniel Verite <daniel@manitou-mail.org> Sun, 23 Sep 2012 14:01:29 +0200
11 changes: 11 additions & 0 deletions debian/changelog
@@ -0,0 +1,11 @@
manitou-mdx (1.3.1) unstable; urgency=low

* New upstream release

-- Daniel Verite <daniel@manitou-mail.org> Thu, 18 Oct 2012 14:09:12 +0200

manitou-mdx (1.3.0) unstable; urgency=low

* Initial Release.

-- Daniel Verite <daniel@manitou-mail.org> Sun, 23 Sep 2012 14:01:29 +0200
1 change: 1 addition & 0 deletions debian/compat
@@ -0,0 +1 @@
7
8 changes: 8 additions & 0 deletions debian/config
@@ -0,0 +1,8 @@
#!/bin/sh -e

. /usr/share/debconf/confmodule

db_input high manitou-mdx/install-db || true
db_go || true


21 changes: 21 additions & 0 deletions debian/control
@@ -0,0 +1,21 @@
Source: manitou-mdx
Section: mail
Priority: optional
Maintainer: Daniel Verite <daniel@manitou-mail.org>
HomePage: http://www.manitou-mail.org
Build-Depends: libdbd-pg-perl (>= 1.32), libmailtools-perl (>= 1.62), libmime-perl (>= 5.427), libbit-vector-perl (>= 6.4), libhtml-tree-perl (>=3.23), perl (>=5.10)

Package: manitou-mdx
Architecture: all
Priority: optional
HomePage: http://www.manitou-mail.org
Depends: libdbd-pg-perl (>= 1.32), libmailtools-perl (>= 1.62), libmime-perl (>= 5.427), libbit-vector-perl (>= 6.4), libhtml-tree-perl (>=3.23), perl (>=5.10), adduser
Description: mail-database exchanger script for the manitou-mail software
Manitou is a database-driven mail user-agent and associated
utilities. It provides a framework and tools for storing and
exposing mail as organized data, accessible by SQL. It is aimed at
handling seamlessly large mailboxes, possibly processed by multiple
concurrent users. In addition to the features commonly found in
traditional mail programs, its user interface comes with some more
unique, database oriented ways to organize, retrieve and process mail
messages.
37 changes: 37 additions & 0 deletions debian/copyright
@@ -0,0 +1,37 @@
This work was packaged for Debian by:

Daniel Verite <daniel@manitou-mail.org> on Sun, 23 Sep 2012 14:01:29 +0200

It was downloaded from:

<http://www.manitou-mail.org>

Upstream Author(s):

<Daniel Verite daniel@manitou-mail.org>

Copyright:

<Copyright (C) 2012 Daniel Verite>

License:

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2.

This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

On Debian systems, the complete text of the GNU General
Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'.

The Debian packaging is:

Copyright (C) 2012 Daniel Verite <daniel@manitou-mail.org>

1 change: 1 addition & 0 deletions debian/docs
@@ -0,0 +1 @@
README
2 changes: 2 additions & 0 deletions debian/manitou-mdx.default
@@ -0,0 +1,2 @@
# enable/disable manitou-mdx start at boot
ENABLED=1
95 changes: 95 additions & 0 deletions debian/manitou-mdx.init
@@ -0,0 +1,95 @@
#! /bin/sh
#
# manitou-mdx start/stop manitou-mdx daemon
#
### BEGIN INIT INFO
# Provides: manitou-mdx
# Required-Start: $syslog, $local_fs, $remote_fs
# Required-Stop: $syslog, $local_fs, $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop the manitou-mdx daemon
### END INIT INFO

set -e

PATH=/bin:/usr/bin:/usr/sbin:/sbin
DAEMON=/usr/bin/manitou-mdx
NAME=manitou-mdx
DESC="manitou-mdx daemon"
DUID=manitou
PIDFILE=/var/run/manitou/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
MANITOU_MDX_OPTS="--fork --pidfile=$PIDFILE $MANITOU_MDX_OPTS"
ENABLED=1

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

. /lib/lsb/init-functions

# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
. /etc/default/$NAME
fi

if [ "$ENABLED" = "0" ]; then
echo "$DESC: disabled, see /etc/default/$NAME"
exit 0
fi

ret=0
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
if start-stop-daemon --start --oknodo --quiet \
--pidfile $PIDFILE --chuid $DUID --name $NAME \
--startas $DAEMON -- $MANITOU_MDX_OPTS
then
log_end_msg 0
else
ret=$?
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
if start-stop-daemon --stop --oknodo --quiet \
--pidfile $PIDFILE --name $NAME
then
log_end_msg 0
else
ret=$?
log_end_msg 1
fi
rm -f $PIDFILE
;;
reload|force-reload)
log_action_begin_msg "Reloading $DESC configuration..."
if start-stop-daemon --stop --signal 1 --quiet \
--pidfile $PIDFILE --name $NAME
then
log_action_end_msg 0
else
ret=$?
log_action_end_msg 1
fi
;;
restart)
$0 stop
$0 start
ret=$?
;;
status)
status_of_proc -p $PIDFILE $DAEMON "$NAME" 2>/dev/null
ret=$?
;;

*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
exit 1
;;
esac

exit $ret
59 changes: 59 additions & 0 deletions debian/manpages/manitou-spool.1
@@ -0,0 +1,59 @@
'\" t
.\" Title: manitou-spool
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 09/27/2012
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "MANITOU\-SPOOL" "1" "09/27/2012" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
manitou-spool \- drop a mail file into the spool for manitou\-mdx to import
.SH "SYNOPSIS"
.sp
\fBmanitou\-spool\fR \fIDIRECTORY\fR
.SH "DESCRIPTION"
.sp
manitou\-spool(1) is meant to be called as the right side of a pipe through an entry in \fI/etc/aliases\fR, or a \fIprocmailrc\fR file, or as a mail delivery agent for \fIfetchmail\fR, or any similar tool that passes a mail message to the standard input of a program for final delivery\&.
.sp
It copies the standard input into the spool directory in a new file uniquely named mail\-YYYMMDD\-HHMISS\-pid, where \fIYYYMMDD\-HHMISS\fR is the current date and time and \fIpid\fR is the current process ID\&.
.SH "EXIT STATUS"
.PP
\fB0\fR
.RS 4
Success
.RE
.PP
\fB1\fR
.RS 4
Failure
.RE
.SH "AUTHOR"
.sp
Daniel Verite
.SH "RESOURCES"
.sp
Main web site: http://www\&.manitou\-mail\&.org/
.SH "COPYING"
.sp
Copyright (C) 2012 Daniel Verite\&. Licence: GNU General Public License (GPL) version 2\&.
52 changes: 52 additions & 0 deletions debian/postinst
@@ -0,0 +1,52 @@
#!/bin/sh -e
. /usr/share/debconf/confmodule

case "$1" in
configure)
if ! getent group manitou > /dev/null 2>&1 ; then
addgroup --system --quiet manitou
fi
if ! getent passwd manitou > /dev/null 2>&1 ; then
adduser --quiet --system --ingroup manitou \
--home /var/lib/manitou/ manitou
fi
chown manitou:manitou /etc/manitou-mdx.conf
chmod 640 /etc/manitou-mdx.conf
if [ ! -d /var/run/manitou ]; then
mkdir -m 750 /var/run/manitou
chown manitou:manitou /var/run/manitou
fi
db_get manitou-mdx/install-db
if [ "$RET" = "true" ]; then
if [ -z "$2" ]; then
su postgres -c 'manitou-mgr --create-database' || ret=$?
# if the db already exists, try to upgrade the schema
if [ $ret -eq 2 ]; then
su manitou -c 'manitou-mgr --upgrade-schema'
elif [ $ret -ne 0 ]; then
# if the db creation failed, don't autostart
sed -i -e 's/^ENABLED=1/ENABLED=0/' /etc/default/manitou-mdx
fi
else
su manitou -c 'manitou-mgr --upgrade-schema'
fi
else
sed -i -e 's/^ENABLED=1/ENABLED=0/' /etc/default/manitou-mdx
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)

;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

#DEBHELPER#

db_stop

exit 0
13 changes: 13 additions & 0 deletions debian/rules
@@ -0,0 +1,13 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
dh $@
7 changes: 7 additions & 0 deletions debian/templates
@@ -0,0 +1,7 @@
Template: manitou-mdx/install-db
Type: boolean
Description: Install the database?
The database can be created automatically now, or later by running manitou-mgr manually. The automatic creation assumes that PostgreSQL runs on this host and that passwordless local connections are allowed with the peer method (which is the case with a default pg_hba.conf file).
If this step fails, manitou-mdx will still be installed but the database will have to be created manually later and the db_connect_string section updated accordingly in /etc/manitou-mdx.conf
Default: true

9 changes: 6 additions & 3 deletions lib/Manitou/Schema.pm
Expand Up @@ -29,11 +29,11 @@ require Exporter;
create_table_statements create_trigger_statements);

sub current_version {
return "1.3.0";
return "1.3.1";
}

sub supported_versions {
return ("0.9.12", "1.0.0", "1.0.1", "1.0.2", "1.1.0", "1.2.0", "1.3.0");
return ("0.9.12", "1.0.0", "1.0.1", "1.0.2", "1.1.0", "1.2.0", "1.3.0", "1.3.1");
}

my $create_script=<<EOF;
Expand Down Expand Up @@ -742,7 +742,7 @@ sub extract_statements {

sub create_table_statements {
my @stmt=extract_statements($create_script);
for my $t qw(mailing_definition mailing_run mailing_data mail_template import_mbox import_message) {
for my $t (qw(mailing_definition mailing_run mailing_data mail_template import_mbox import_message)) {
push @stmt, $tables{$t};
}
foreach my $c (keys %object_comments) {
Expand Down Expand Up @@ -898,6 +898,9 @@ sub upgrade_schema_statements {
push @stmt, $tables{"import_message"};
push @stmt, $functions{"wordsearch"};
}
elsif ($from eq "1.3.0" && $to eq "1.3.1") {
# no change in schema
}
return @stmt;
}

Expand Down
2 changes: 1 addition & 1 deletion script/manitou-mgr
Expand Up @@ -256,7 +256,7 @@ sub create_database {
$s2->execute();
if ($s2->fetchrow_array) {
print STDERR "The database $dbname already exists.\nPlease check and drop the database before attempting to recreate, or choose another database name.\n";
exit 1;
exit 2;
}
$s2->finish;
$dbh1->do("CREATE DATABASE $dbname OWNER $dbuser") or die;
Expand Down

0 comments on commit 84ee28a

Please sign in to comment.