I only use a few packages from the Courier MTA, but the spec file always
installed some files for MySQL, PostgreSQL and Fax support.

The attached patch moves some of those files back to their respective
packages where they seem they should be.

Also, the patch cleans up how filelist1 is finally processed to produce
filelist for the main package. Before this patch, each package would
grab the files from filelist1 and place the lines into their own
filelist and then the reverse was done to filelist1 to produce filelist.

The patch changes it to use sort and uniq to automatically produce
filelist from filelist1 and the per package filelist.* files by using
only the unique lines from filelist1.

Don't mind the offset differences, I have some other modifications to
courier.spec for other reasons and manually editted those changes out of
the diff.

JE

--- courier-0.44.2-orig/courier.spec.in 2003-11-15 21:04:45.000000000 +0000
+++ courier.spec.in     2003-12-05 22:21:46.000000000 +0000
@@ -375,6 +379,7 @@
 export LANG
 %{__make}
 %{__make} check
+
 %install
 LANG=C
 export LANG
@@ -448,47 +453,6 @@
 
 ' <permissions.dat >filelist1 || exit 1
 
-############################################################################
-#
-# Break up a single filelist into multiple packages right here.  This is
-# going to be ugly.
-#
-
-%{__sed} -n '/imap[\.a-z0-9]*$/p;/imapd-ssl/p' <filelist1 | grep -v authpam 
>filelist.imap
-%{__sed} -n '/pop3[\.a-z0-9]*$/p;/pop3d-ssl/p' <filelist1 | grep -v authpam 
>filelist.pop3
-%{__sed} -n '/couriermlm/p' <filelist1 >filelist.mlm
-%{__sed} -n '/authstart$/p;/authend$/p' <filelist1 >filelist.auth
-%{__sed} -n '/maildrop[^/]*$/p;/mailbot/p;/reformail[^/]*$/p' <filelist1 
>filelist.maildrop
-
-%{__sed} -n '/15ldap/p;/authdaemond.ldap/p;/courierldapalias/p' <filelist1 
>filelist.ldap
-
-if test -d /etc/openldap
-then
-       %{__mkdir_p} $RPM_BUILD_ROOT/etc/openldap/schema
-       cp authlib/authldap.schema $RPM_BUILD_ROOT/etc/openldap/schema/courier.schema
-       echo '%attr(644, root, root) %config(noreplace) 
/etc/openldap/schema/courier.schema' >>filelist.ldap
-fi
-
-%{__sed} -n '/15mysql/p;/authdaemond.mysql/p' <filelist1 >filelist.mysql
-
-%{__sed} -n '/15pgsql/p;/authdaemond.pgsql/p' <filelist1 >filelist.pgsql
-
-%{__sed} -n '/faxmail/p;/35fax/p;/34fax/p' <filelist1 >filelist.fax
-
-%{__mkdir_p} $RPM_BUILD_ROOT/etc/mgetty+sendfax
-%{__ln_s} %{_datadir}/faxmail/new_fax $RPM_BUILD_ROOT/etc/mgetty+sendfax/new_fax
-
-# Delete all of the above, AND ldapaddressbook+webmail from the filelist.
-# Do not install esmtp.authpam, taken care of elsewhere.
-# Do not install htmldoc, taken care of elsewhere
-
-%{__sed} 
'/imap[\.a-z0-9]*$/d;/imapd-ssl/d;/pop3[\.a-z0-9]*$/d;/pop3d-ssl/d;/couriermlm/d;/webmail/d;/authsystem\.passwd/d;/authlib\/changepwd/d;/ldapaddressbook.dist$/d;/pcpd/d;/calendar/d;/maildrop[^/]*$/d;/mailbot/d;/reformail[^/]*$/d;/authstart$/d;/authend$/d;/15ldap/d;/47webmail/d;/authdaemond.ldap/d;/courierldapalias/d;/15mysql/d;/15pgsql/d;/authdaemond.mysql/d;/authdaemond.pgsql/d;/faxmail/d;/35fax/d;/34fax/d;/esmtp\.authpam/d;/htmldoc/d'
 <filelist1 >filelist
-
-# authsystem.passwd goes into webmail, but it's picked up by
-# authlib/changepwd too, hence we sort.
-
-%{__sed} -n 
'/47webmail/p;/sqwebmail/p;/authsystem\.passwd/p;/authlib\/changepwd/p;/webmail-logincache/p;/ldapaddressbook.dist$/p;/pcpd/p;/calendar/p'
 <filelist1 | sed '/images/d' | sort | uniq >filelist.webmail
-
 # Note that we delete all 'webmail's, but extract only 'sqwebmail's.
 # This removes all webmail-related stuff from the main filelist,
 # and adds everything except the executable, webmail, to filelist.webmail.
@@ -504,27 +468,47 @@
 # Remove the webadmin wrapper from filelist (but keep all html and pl files
 # there.
 
-%{__sed} '/courier\/webmail\/webadmin /d' <filelist >filelist.tmp
-%{__mv} filelist.tmp filelist
+%{__sed} '/libexec\/courier\/webmail/d;/htmldoc/d' <filelist1 >filelist1.tmp
+%{__mv} filelist1.tmp filelist1
 
 # For the same reason we delete all images from filelist.webmail:
 
 %{__mkdir_p} $RPM_BUILD_ROOT%{_documentrootdir}
 %{__mv} $RPM_BUILD_ROOT%{_datadir}/sqwebmail/images 
$RPM_BUILD_ROOT%{_documentrootdir}/webmail
 
-# Do we need to install a cron job to clean out webmail's cache?
+%{__sed} '/\/sqwebmail\/images/d' <filelist1 >filelist1.tmp
+%{__mv} filelist1.tmp filelist1
 
-if test -f webmail/cron.cmd
-then
-       %{__mkdir_p} $RPM_BUILD_ROOT/etc/cron.hourly
-       %{__cat} >$RPM_BUILD_ROOT/etc/cron.hourly/courier-webmail-cleancache <<EOF
-#!/bin/sh
+############################################################################
+#
+# Break up a single filelist into multiple packages right here.  This is
+# going to be ugly.
+#
 
-su - bin -s /bin/sh -c %{_datadir}/sqwebmail/cleancache.pl
-EOF
+%{__sed} -n '/imap[\.a-z0-9]*$/p;/imapd-ssl/p' <filelist1 | grep -v authpam 
>filelist.imap
+%{__sed} -n '/pop3[\.a-z0-9]*$/p;/pop3d-ssl/p' <filelist1 | grep -v authpam 
>filelist.pop3
+%{__sed} -n '/couriermlm/p' <filelist1 >filelist.mlm
+%{__sed} -n '/authstart$/p;/authend$/p' <filelist1 >filelist.auth
+%{__sed} -n '/maildrop[^/]*$/p;/mailbot/p;/reformail[^/]*$/p' <filelist1 
>filelist.maildrop
 
-       echo "%attr(555, root, bin) /etc/cron.hourly/courier-webmail-cleancache" 
>>filelist.webmail
-fi
+%{__sed} -n '/15ldap/p;/authdaemond.ldap/p;/courierldapalias/p;/authldaprc/p' 
<filelist1 >filelist.ldap
+
+%{__sed} -n '/15mysql/p;/authdaemond.mysql/p;/authmysqlrc/p' <filelist1 
>filelist.mysql
+
+%{__sed} -n '/15pgsql/p;/authdaemond.pgsql/p;/authpgsqlrc/p' <filelist1 
>filelist.pgsql
+
+%{__sed} -n 
'/faxmail/p;/35fax/p;/34fax/p;/faxcoverpage/p;/faxnotifyrc/p;/faxrc/p;/module\.fax/p;/courier\/modules\/fax/p;/faxtmp/p'
 <filelist1 >filelist.fax
+
+%{__mkdir_p} $RPM_BUILD_ROOT/etc/mgetty+sendfax
+%{__ln_s} %{_datadir}/faxmail/new_fax $RPM_BUILD_ROOT/etc/mgetty+sendfax/new_fax
+
+%{__sed} '/\.authpam/d;' <filelist1 >filelist1.tmp
+%{__mv} filelist1.tmp filelist1
+
+# authsystem.passwd goes into webmail, but it's picked up by
+# authlib/changepwd too, hence we sort.
+
+%{__sed} -n 
'/47webmail/p;/sqwebmail/p;/authsystem\.passwd/p;/authlib\/changepwd/p;/webmail-logincache/p;/ldapaddressbook.dist$/p;/pcpd/p;/calendar/p;/webgpg/p;/etc\/courier\/webmail/p;/courierwebadmin/p'
 <filelist1 | sort | uniq >filelist.webmail
 
 #
 # Move .html documentation back to build dir, so that RPM will move it to
@@ -630,6 +614,32 @@
        %{__ln_s} %{_bindir}/sendmail $RPM_BUILD_ROOT/usr/bin/sendmail
 %endif
 
+# Cleanup the filelist finally
+cat filelist.* filelist1 | sort | uniq -u > filelist
+
+# Now create some new files that aren't in filelist1
+
+# Do we need to install a cron job to clean out webmail's cache?
+
+if test -f webmail/cron.cmd
+then
+       %{__mkdir_p} $RPM_BUILD_ROOT/etc/cron.hourly
+       %{__cat} >$RPM_BUILD_ROOT/etc/cron.hourly/courier-webmail-cleancache <<EOF
+#!/bin/sh
+
+su - bin -s /bin/sh -c %{_datadir}/sqwebmail/cleancache.pl
+EOF
+
+       echo "%attr(555, root, bin) /etc/cron.hourly/courier-webmail-cleancache" 
>>filelist.webmail
+fi
+
+if test -d /etc/openldap
+then
+       %{__mkdir_p} $RPM_BUILD_ROOT/etc/openldap/schema
+       cp authlib/authldap.schema $RPM_BUILD_ROOT/etc/openldap/schema/courier.schema
+       echo '%attr(644, root, root) %config(noreplace) 
/etc/openldap/schema/courier.schema' >>filelist.ldap
+fi
+
 #
 # maildrop wrapper soft links (value added for the RPM)
 #


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to