On Monday 28 October 2002 04:59 pm, Michael Schloh von Bennewitz wrote:

Hi,

> I make patches with GNU 'diff -Naur', but anything that GNU patch can
> handle is find.

This is fine for me.

Here a patch for imapd.spec in order to get /etc/imapd.group, sieve and the 
perl utils working correctly.

Regards,
--martin

--- imapd.spec.org      2002-10-28 16:56:08.000000000 +0100
+++ imapd.spec  2002-10-28 17:09:37.000000000 +0100
@@ -22,6 +22,10 @@
 ##  SUCH DAMAGE.
 ##
 
+%ifndef              with_fsl
+%define       with_fsl     no
+%endif
+
 #   package information
 Name:         imapd
 Summary:      Cyrus IMAP Server
@@ -37,15 +41,22 @@
 #   list of sources
 Source0:      
ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-%{version}.tar.gz
 Source1:      imapd.conf
-Source2:      rc.imapd
+Source2:      rc.imapd 
+Source3:      Makefile
 Patch0:       imapd.patch
-Patch1:       imapd-db4.patch
+Patch1:       imapd-db4.patch  
+Patch2:              timsieved.lex.c.patch
+Patch3:       groupfile.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
 BuildPreReq:  OpenPKG, openpkg >= 20020206, sasl, db >= 4.1.24, openssl, 
make, perl
 PreReq:       OpenPKG, openpkg >= 20020206, sasl, openssl, MTA
+%if "%{with_fsl}" == "yes"
+BuildPreReq:  fsl
+PreReq:       fsl
+%endif
 AutoReq:      no
 AutoReqProv:  no
 Provides:     IMAP
@@ -63,33 +74,44 @@
     %setup -q -n cyrus-imapd-%{version}
     %patch0 -p0
     %patch1 -p1
+    %patch2 -p0
+    %patch3 -p0
 
 %build
     cflags="-I%{l_prefix}/include"
-    ldflags="-L%{l_prefix}/lib"
+    ldflags="-L%{l_prefix}/lib -ldb"
     case "%{l_target}" in
         *-solaris* ) ldflags="$ldflags -lsocket -lnsl" ;;
     esac
     CC="%{l_cc}" \
     CPPFLAGS="$cflags" \
     CFLAGS="%{l_cflags -O} $cflags" \
+%if "%{with_fsl}" == "yes"
+    LDFLAGS="-L%{l_prefix}/lib `%{l_prefix}/bin/fsl-config --ldflags`" \
+    LIBS="-ldb `%{l_prefix}/bin/fsl-config --libs`" \
+%else
     LDFLAGS="$ldflags" \
+%endif
     ./configure \
         --prefix=%{l_prefix} \
+       --libdir=%{l_prefix}/lib \
         --with-openssl=%{l_prefix} \
         --with-dbdir=%{l_prefix} \
-        --with-sasl=%{l_prefix} \
+        --with-staticsasl=%{l_prefix} \
         --with-statedir=%{l_prefix}/var/imapd \
         --with-auth=unix \
-        --without-perl \
-        --disable-sieve \
         --with-cyrus-prefix=%{l_prefix} \
         --with-cyrus-user=%{l_musr} \
-        --with-cyrus-group=%{l_mgrp}
+        --with-cyrus-group=%{l_mgrp} \
+       --without-ucdsnmp \
+       --without-zephyr \
+       --with-perl=%{l_prefix}/bin/perl \
+       --without-afs
 
     #   redirect the hard coded file paths
     %{l_shtool} subst -e "s;/etc/\(.*\).conf;%{l_prefix}/etc/imapd/\\1.conf;" 
\
-        imap/*.c imap/*.h master/*.c master/*.h
+        imap/*.c imap/*.h master/*.c master/*.h 
+    %{l_shtool} subst -e 
"s;/etc/imapd.group;%{l_prefix}/etc/imapd/imapd.group;" lib/auth_unix.c
     %{l_make} %{l_mflags}
 
 %install
@@ -98,10 +120,44 @@
         prefix=$RPM_BUILD_ROOT%{l_prefix} \
         exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
         cyrus_prefix=$RPM_BUILD_ROOT%{l_prefix}
+    eval `%{l_prefix}/bin/perl -V:version -V:archname`
+    perl=$RPM_BUILD_ROOT/perl
+    echo "#!/bin/sh" >$perl
+    echo "exec %{l_prefix}/bin/perl \\" >>$perl
+    echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
+    echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" 
>>$perl
+    echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
+    echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" 
>>$perl
+    echo " 
-I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" 
>>$perl
+    echo " \"\$@\"" >>$perl
+    chmod a+x $perl
+
+    #   determine general tools and arguments
+    perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
+    make="%{l_make} %{l_mflags}"
+    makeargs="PERL=$perl FULLPERL=$perl"
+    for dir in perl/imap 
+    do 
+     (
+        cd $dir
+        $perl Makefile.PL %{l_prefix} $perlargs
+        $make $makeargs all
+        $make $makeargs install
+     )
+    done
+    # clean up
+    find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
+    find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
+    find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir 
>/dev/null 2>&1 || true)
+
+    # avoid conflicts
+    eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch 
-V:installsitelib`
+
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/etc/imapd \
         $RPM_BUILD_ROOT%{l_prefix}/var/imapd \
-        $RPM_BUILD_ROOT%{l_prefix}/var/spool
+        $RPM_BUILD_ROOT%{l_prefix}/var/spool \
+       $RPM_BUILD_ROOT%{l_prefix}/var/spool/imap/sieve
 
     #   offer a sane configuration
     cp master/conf/small.conf master/conf/cyrus.conf
@@ -129,7 +185,17 @@
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
         %{l_files_std} \
         '%config %{l_prefix}/etc/imapd/imapd.conf' \
-        '%config %{l_prefix}/etc/imapd/cyrus.conf'
+        '%config %{l_prefix}/etc/imapd/cyrus.conf' \
+       '%not %dir %{l_prefix}/lib/perl5' \
+        '%not %dir %{l_prefix}/lib/perl5/*' \
+        "%not %dir $installarchlib" \
+        "%not %dir $installprivlib" \
+        "%not %dir $installsitearch" \
+        "%not %dir $installsitelib" \
+        "%not %dir $installarchlib/auto" \
+        "%not %dir $installprivlib/auto" \
+        "%not %dir $installsitearch/auto" \
+        "%not %dir $installsitelib/auto"
 
 %files -f files
 

--
Dipl.-Phys. Martin Konold
e r f r a k o n
Erlewein, Frank, Konold & Partner - Beratende Ingenieure und Physiker
Germanenstrasse 15, 70563 Stuttgart, Germany
email: [EMAIL PROTECTED]

______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   [EMAIL PROTECTED]

Reply via email to