#!/bin/sh

name="omta"
title="OMTA"
package="omta"
version="0.51"
build="1"
noarch="n"
build_info="Standard build."

info="An offline SMTP server."
info_pl="Oflajnowy serwer SMTP."
desc="The Offline Mail Transfer Agent, or OMTA, is an SMTP server tool
wich allows people who have a dial-up connection to queue their
mail on their harddisk, and only attempt send it to their SMTP
server whenever they are online."
desc_pl="Offline Mail Tranfer Agent, lub po prostu OMTA, jest serwerem
SMTP, który pozwala posiadaczom połączenia dial-up na
kolejkowanie swojej poczty na dysku i przesłaniu jej do serwera
SMTP gdy są on-line."
category="net/server/smtp"
environment="daemon"
contact="$name@packages.packware.gnu.pl"
vendor="The Packware Project"
vendor_id="pw"

requires=""
obsoletes=""
conflicts=""

docs_source="AUTHORS,CHANGES,COPYING,FAQ,INSTALL,README,README.etrnquery,VERSION"
docs_cwd=""

strip_bin="y"
reset_own="y"
reset_dir="y"
reset_fil="y"
delete_cat="y"

. /usr/src/tgz/lib/builder.defs

add_source ftp://omta.runlevel.net/pub/$name/$name-$version.tar.gz

apply_patch omta-config.pw.patch

configure_option --prefix=/usr
configure_option --with-queuepath=/var/spool/omta

install_option DESTDIR=$pkg_main
install_option install-etrnquery

parent_package="$package"
write_info main

cd $src1

do_configure
do_make
do_install

mkdir -p $pkg_main/etc
cp omta.conf.dist $pkg_main/etc/omta.conf
mkdir -p $pkg_main/var/spool/omta

change_mod main var/spool/omta 770
change_own main var/spool/omta .mail
change_mod main usr/bin/omta 2755
change_own main usr/bin/omta .mail

make_docs

make_package main

clean_up
