# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 58283 2009-09-25 04:15:55Z ryandesign@macports.org $

PortSystem          1.0

name                mnogosearch
version             3.3.8
categories          www
platforms           darwin
maintainers         gmail.com:dbraband openmaintainer
description         Full-featured SQL-based web search engine
long_description    mnoGoSearch is a full-featured SQL-based web search \
                    engine. mnoGoSearch consists of two parts. The first \
                    part is the indexing mechanism (indexer).  indexer walks \
                    over html hypertext references and stores found words \
                    and new references into a database. The second part is \
                    the web CGI front-end to provide searching using data \
                    collected by indexer.

homepage            http://www.mnogosearch.org/
master_sites        ${homepage}Download/
checksums           md5 4c561e3f7fb4c7328e2aa242474d7836 \
                    sha1 c0195aed87476296172884c2adbcfeb6f67d9bc4 \
                    rmd160 f28ede3c9eae4ae9a0351900a1cbf5a519b989a8
depends_lib         port:openssl port:zlib
patchfiles          patch-doc_Makefile.in

configure.args      --sysconfdir=${prefix}/etc/mnogosearch \
                    --localstatedir=${prefix}/var/mnogosearch \
                    --datadir=${prefix}/share/mnogosearch \
                    --mandir=${prefix}/share/man --disable-static \
                    --with-openssl --with-zlib

post-configure {
    ui_msg "\n\n-------------------------------------------------------------"
    ui_msg "Note:  if you did not select any database variants, mnogosearch"
    ui_msg "will be built without the indexer (which may not be what you"
    ui_msg "wanted)."
    ui_msg "-------------------------------------------------------------\n\n"
}

destroot.keepdirs	${destroot}${prefix}/var/mnogosearch

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING ChangeLog INSTALL \
        NEWS README README.CVS README.XML TODO \
        ${destroot}${prefix}/share/doc/${name}
}

variant mysql4 conflicts mysql5 {
    depends_lib-append      port:mysql4
    configure.args-append   --with-mysql=${prefix}
}

variant mysql5 conflicts mysql4 {
    use_autoconf yes
    patchfiles-append       patch-locations_configure.in
    depends_lib-append      path:bin/mysql_config5:mysql5
    configure.args-append   --with-mysql=${prefix}
}

variant postgresql7 conflicts postgresql81 postgresql83 {
    depends_lib-append      port:postgresql7
    configure.args-append   --with-pgsql=${prefix}/lib/pgsql7
}

variant postgresql81 conflicts postgresql7 postgresql83 {
    depends_lib-append      port:postgresql81
    configure.args-append   --with-pgsql=${prefix}/lib/postgresql81
}

variant postgresql83 conflicts postgresql7 postgresql81 {
    use_autoconf yes
    patchfiles-append       patch-locations_configure.in
    depends_lib-append      port:postgresql83
    configure.args-append   --with-pgsql=${prefix}
}


# Other database variants would go here

variant nosyslog {
    configure.args-append   --disable-syslog
}

livecheck.type      regex
livecheck.url       ${homepage}download.html
livecheck.regex     ${name}-(\[0-9.\]+)\\.tar
