Here is an spec file for mailman. This is really for our environment
and which is not completely done. There are still group owner ship
changes that need to occur but I thought I would release what I have for
the moment. Again this is work in progress and might not match what
OpenPKG is looking for. I just thought I'd make it available to those
who might want an mailman spec file. 

Best Regards,
Frank Torres

##
##  mailman.spec -- OpenPKG RPM Specification
##  Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
##  Copyright (c) 2000-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
##  Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
##  SUCH DAMAGE.
##

#   package version
%define V_dist   2.1.5
%define V_opkg   2.1.5
%define V_tools  20040702
%define mmdir %{l_prefix}/libexec/mailman
%define varmmdir %{l_prefix}/var/mailman
%define docdir %{l_prefix}/share/mailman-%{version}
%define logdir %{l_prefix}/var/log/mailman
%define queuedir %{l_prefix}/var/spool/mailman/qfiles
%define httpdconfdir %{l_prefix}/etc/httpd/conf.d
%define lockdir %{varmmdir}/locks
%define restart_flag %{lockdir}/restart-after-rpm-install
%define mm_cfg %{l_prefix}/libexec/mailman/Mailman/mm_cfg.py.dist
%define urlhost mailman
%define mailhost mailhost

%define httpdconffile mailman.conf

#   package information
Name:         mailman
Summary:      Mailing List Manager
URL:          http://www.list.org
Vendor:       mailman
Packager:     The OpenPKG Project
Distribution: OpenPKG
Class:        BASE
Group:        SCM
License:      GNU
Version:      %{V_opkg}
Release:      1

#   package options
%option       with_username %{l_musr}
%option       with_groupname  %{l_mgrp}
%option       with_urlhost %{urlhost}
%option       with_mailhost %{mailhost}
%option       cgigroup  %{l_mgrp}


#   list of sources
Source0:      http://www.list.org/tarballs/mailman-%{V_dist}.tgz
#Source2:      http://svnbook.red-bean.com/book.pdf
#Source3:      rc.mailman

#   build information
Prefix:       %{l_prefix}
BuildRoot:    %{l_buildroot}
BuildPreReq:  OpenPKG, openpkg >= 2.1.0, diffutils, make
BuildPreReq:  python >= 2.1.3
#%if "%{with_cvs2svn}" == "yes"
#PreReq:       cvs, python
#%endif
AutoReq:      no
AutoReqProv:  no

%description
   Mailman is software to help manage email discussion lists, much like
   Majordomo and Smartmail. Unlike most similar products, Mailman gives
   each mailing list a webpage, and allows users to subscribe,
   unsubscribe, etc. over the Web. Even the list manager can administer
   his or her list entirely from the Web. Mailman also integrates most
   things people want to do with mailing lists, including archiving, mail
   <-> news gateways, and so on.


%track

%prep
    echo "True value is => $RPM_BUILD_ROOT"
    %setup -q
#    %setup -q -T -D -a 1

%build
    #   configure package
    CC="%{l_cc}" \
    CFLAGS="%{l_cflags -O}" \
    CPPFLAGS="%{l_cppflags}" \
    LDFLAGS="%{l_ldflags}" \
    ./configure \
        --prefix=%{mmdir} \
        %if "%{with_username}" == "%{l_musr}" 
          --with-username=%{l_musr} \
        %else
          --with-username=%{with_username} \
        %endif
        %if "%{with_groupname}" == "%{l_mgrp}"
          --with-groupname=%{l_mgrp} \
        %else
          --with-groupname=%{with_groupname} \
        %endif
        %if "%{cgigroup}" == "%{l_mgrp}"
          --with-cgi-gid=%{l_mgrp} \
        %else
          --with-cgi-gid=%{cgigroup} \
        %endif
        %if "%{with_urlhost}" == "%{urlhost}"
          --with-urlhost=%{urlhost} \
        %else
          --with-urlhost=%{with_urlhost} \
        %endif
        %if "%{with_mailhost}" == "%{mailhost}"
          --with-mailhost=%{mailhost} \
        %else
          --with-mailhost=%{with_mailhost} \
        %endif
        --sysconfdir=%{l_prefix}/etc/mailman \
        --with-var-prefix=%{varmmdir} \
        --enable-static \
        --without-permcheck

    #   build package
    %{l_make} %{l_mflags}

%install
    #   install package
    rm -rf $RPM_BUILD_ROOT
    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT

    #Install the mailman rc.d script
    %{l_shtool} install -d $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
    %{l_shtool} install -c -m 755 
$RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/scripts/mailman 
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/rc.mailman

    #   install run-command script
#    %{l_shtool} mkdir -f -p -m 755 \
#        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
#    %{l_shtool} install -c -m 755 %{l_value -s -a} \
#        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
         %{l_files_std} \


    #   create directory for default repository and svnserve pidfile

%files -f files

%clean
    rm -rf $RPM_BUILD_ROOT

%post
# sendmail aliases
echo "my Prefix is: %{l_prefix}" >>/tmp/mylog
if [ -f %{l_prefix}/etc/sendmail/aliases ]; then
  if [ \(`grep -q "mailman-owner" %{l_prefix}/etc/sendmail/aliases 2> /dev/null`\) ]; 
then
    cat >> %{l_prefix}/etc/sendmail/aliases <<EOF
# mailman aliases
mailman: postmaster
mailman-owner: mailman
EOF
    if [ -f %{l_prefix}/bin/newaliases ]; then
      %{l_prefix}/bin/newaliases > /dev/null 2>&1 || :
    elif [ -f %{l_prefix}/bin/newaliases ]; then
      %{l_prefix}/bin/newaliases > /dev/null 2>&1 || :
    fi
  fi
fi

if [ -f %{mm_cfg} ]; then
    echo "DEFAULT_URL_PATTERN = 'https://%s/mailman/'" >> %{mm_cfg}
    echo "MTA = None" >> %{mm_cfg}
fi

Reply via email to