# if you want to buil with SpeedyCGI support, run: # rpmbuild -ba --define 'with_speedy 1' openwebmail.spec %if %{?with_speedy:0}%{!?with_speedy:1} %define with_speedy 0 %endif %if %{with_speedy} Name: openwebmail-SpeedyCGI Summary: OpenWebMail is a Perl-based webmail client for SpeedyCGI. Requires: perl-CGI-SpeedyCGI Conflicts: openwebmail %else Name: openwebmail Summary: OpenWebMail is a Perl-based webmail client. Conflicts: openwebmail-SpeedyCGI %endif # set releasedate to date of used release %define releasedate 20060831 # do not touch the version - this comes from author Version: 2.52 # the release number should be usually 0.%{releasedate}.X (X - number for fixes) Release: 1.%{releasedate}.%{mysig} License: GPL Group: Applications/Internet URL: http://openwebmail.org Source: http://openwebmail.org/openwebmail/download/snapshot/openwebmail-%{version}-%{releasedate}.tar.gz Patch1: openwebmail-conf.patch Source13: openwebmail-httpd.conf Source14: openwebmail.logrotate Source15: openwebmail-README-RedHat.rpm Source16: openwebmail-pam.conf Source17: openwebmail-dbm.conf # new translated files (latest for OWM update) Source101: cs.gz Source102: template-cs.tgz BuildArch: noarch BuildRoot: %{_tmppath}/openwebmail-root BuildRequires: bash sed fileutils Requires: perl >= 5.0.5 # Spamassassin is standalone, but provides perl module too Requires: spamassassin perl(Mail::SpamAssassin) # MIME::Base64 is a part of Perl distribution since RH 8.0 so we have to # require module by name of the module and not by package name # MIME::Base64. We need version >= 3.01 (perl from RHEL3 has an older version) Requires: perl(MIME::Base64) >= 3.01 # Other modules distributed in perl package Requires: perl(CGI) >= 3.05 Requires: perl(Net::SMTP) Requires: perl(Digest) Requires: perl(Digest::MD5) # For PAM authentication we need extra Perl module Requires: perl-Authen-PAM # Other Perl extensions Requires: perl-Quota perl-suidperl aspell perl-Text-Aspell perl-Net-SSLeay perl-IO-Socket-SSL perl-Compress-Zlib Requires: perl-Text-Iconv >= 1.2 # Other aplications for extensions Requires: clamav antiword ImageMagick tnef wget lsof # OpenWebmail has own modules - to get the list run this command in OpenwebMail build directory: # ls cgi-bin/openwebmail/modules | awk '{print "modules::"$0}') Provides: perl(modules::datetime.pl) perl(modules::dbm.pl) perl(modules::enriched.pl) perl(modules::execute.pl) Provides: perl(modules::filelock.pl) perl(modules::htmlrender.pl) perl(modules::htmltext.pl) perl(modules::lang.pl) Provides: perl(modules::mailparse.pl) perl(modules::mime.pl) perl(modules::pop3.pl) perl(modules::suid.pl) perl(modules::tool.pl) %description Open WebMail is a webmail system based on the Neomail version 1.14 from Ernie Miller. Open WebMail is designed to manage very large mail folder files in a memory efficient way. It also provides a range of features to help users migrate smoothly from Microsoft Outlook to Open WebMail. Read the README-RedHat.rpm file under the doc directory for more info. %prep %setup -q -c -n openwebmail-%{version} # patch for openwebmail.conf (no backup file) %patch1 -p1 # this module uses old unmaintained perl-Pg module rm -f cgi-bin/openwebmail/auth/auth_pg.pl # HOWTO use this package install -m644 %{S:15} README-RedHat.rpm # show release date to users by default perl -pi -e 's/^version %%version%%$/version %%version%% (%%releasedate%%)/' cgi-bin/openwebmail/etc/defaults/openwebmail.conf # place new translations to the right place #rm -f cgi-bin/openwebmail/etc/lang/cs #gzip -dc %{S:101} > cgi-bin/openwebmail/etc/lang/cs #rm -rf cgi-bin/openwebmail/etc/templates/cs #tar xzf %{S:102} -C cgi-bin/openwebmail/etc/templates %build %install # specific files for this distribution only rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d install -m644 %{S:13} $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/openwebmail.conf mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d install -m644 %{S:14} $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openwebmail mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d #install -m644 %{S:16} $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/openwebmail # files from original tarball # destination path under $RPM_BUILD_ROOT is considerably changed # to come closer to the Filesystem Hierarchy Standard mkdir -p $RPM_BUILD_ROOT/%{_datadir}/openwebmail cp -a data/openwebmail $RPM_BUILD_ROOT/%{_datadir}/openwebmail/data cp -a cgi-bin/openwebmail $RPM_BUILD_ROOT/%{_datadir}/openwebmail/cgi-bin for D in lang styles templates; do mv $RPM_BUILD_ROOT/%{_datadir}/openwebmail/cgi-bin/etc/$D \ $RPM_BUILD_ROOT/%{_datadir}/openwebmail done mkdir -p $RPM_BUILD_ROOT/var/cache mv $RPM_BUILD_ROOT/%{_datadir}/openwebmail/cgi-bin/etc/users \ $RPM_BUILD_ROOT/var/cache/openwebmail mkdir -p $RPM_BUILD_ROOT/var/run mv $RPM_BUILD_ROOT/%{_datadir}/openwebmail/cgi-bin/etc/sessions \ $RPM_BUILD_ROOT/var/run/openwebmail mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir} mv $RPM_BUILD_ROOT/%{_datadir}/openwebmail/cgi-bin/etc \ $RPM_BUILD_ROOT/%{_sysconfdir}/openwebmail # DBM configuration is in extra file now (and there is no default dbm.conf file) install -m644 %{S:17} $RPM_BUILD_ROOT/%{_sysconfdir}/openwebmail/dbm.conf ( mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/smrsh cd $RPM_BUILD_ROOT/%{_sysconfdir}/smrsh ln -s ../..%{_datadir}/openwebmail/cgi-bin/vacation.pl mkdir -p $RPM_BUILD_ROOT/%{_datadir}/openwebmail/cgi-bin/etc cd $RPM_BUILD_ROOT/%{_datadir}/openwebmail/cgi-bin/etc ln -s ../../../../..%{_sysconfdir}/openwebmail/defaults defaults ln -s ../../../../..%{_sysconfdir}/openwebmail/openwebmail.conf openwebmail.conf ln -s ../../../../..%{_sysconfdir}/openwebmail/dbm.conf dbm.conf ) mkdir -p $RPM_BUILD_ROOT/var/log touch $RPM_BUILD_ROOT/var/log/openwebmail.log # /usr/share/openwebmail/cgi-bin/openwebmail-abook.pl # setup for Speedy-CGI %if %{with_speedy} for i in $RPM_BUILD_ROOT/%{_datadir}/openwebmail/cgi-bin/openwebmail*pl; do perl -pi -e 's@^#!/usr/bin/suidperl -T@#!/usr/bin/speedy_suid -T -- -T/var/tmp/speedy@' $i done %endif # there is a pretty mixture of normal files and directories with special # access rights. We have to write down all this stuff to this spec file # to be correct. Adopting this information from extracted files is wrong # and may not work (when building as non-root user for example). # So we use on-fly generated filelist. set +x # avoid the vast output BASE=$RPM_BUILD_ROOT%{_datadir}/openwebmail/ { find $BASE | while read BUILDNAME; do ABSNAME=${BUILDNAME#$RPM_BUILD_ROOT} FILENAME=${BUILDNAME#$BASE} case "$FILENAME" in cgi-bin/openwebmail*.pl) echo "%attr(4755,root,mail) \"$ABSNAME\"" ;; cgi-bin/vacation.pl) echo "%attr(0755,root,root) \"$ABSNAME\"" ;; cgi-bin/uty/*.pl|cgi-bin/uty/*.sh) echo "%attr(0755,root,root) \"$ABSNAME\"" ;; lang/*|templates/*) # odrezavame 1 adresar LANGTMP=${FILENAME#*/} LANGPRN=${LANGTMP%%/*} echo -n "%lang($LANGPRN) " [ -d "$BUILDNAME" ] && echo -n "%dir " echo "\"$ABSNAME\"" ;; data/help/*) # odrezavame 2 adresare LANGTMP=${FILENAME#*/*/} LANGPRN=${LANGTMP%%%%/*} echo -n "%lang($LANGPRN) " [ -d "$BUILDNAME" ] && echo -n "%dir " echo "\"$ABSNAME\"" ;; data/javascript/htmlarea.openwebmail/popups/*) # odrezavame 4 adresare LANGTMP=${FILENAME#*/*/*/*/} LANGPRN=${LANGTMP%%%%/*} echo -n "%lang($LANGPRN) " [ -d "$BUILDNAME" ] && echo -n "%dir " echo "\"$ABSNAME\"" ;; *) [ -d "$BUILDNAME" ] && echo -n "%dir " echo "\"$ABSNAME\"" ;; esac done BASE=$RPM_BUILD_ROOT/%{_sysconfdir}/openwebmail/ find $BASE | while read BUILDNAME; do ABSNAME=${BUILDNAME#$RPM_BUILD_ROOT/} FILENAME=${BUILDNAME#$BASE} case "$FILENAME" in *.db) echo "%verify(not md5 size mtime) \"$ABSNAME\"" ;; defaults/*|maps/*.map|README.conf) echo "\"$ABSNAME\"" ;; *.conf|*.book) echo "%config(noreplace) \"$ABSNAME\"" ;; holidays/*) echo "%lang(${FILENAME#*/}) \"$ABSNAME\"" ;; *) [ -d "$BUILDNAME" ] && echo -n "%dir " || echo -n "%config " echo "\"$ABSNAME\"" ;; esac done } > openwebmail-%{version}-filelist set -x # and now touch the %ghost files (they will not be included in the package) for i in b2g.db etc.mail.virtusertable.db etc.mail.virtusertable.rev.db g2b.db lunar.db; do touch $RPM_BUILD_ROOT%{_sysconfdir}/openwebmail/maps/$i done %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files -f openwebmail-%{version}-filelist %defattr(-,-,-) %attr(770,root,mail) /var/run/openwebmail %attr(770,root,mail) /var/cache/openwebmail %config(noreplace) %{_sysconfdir}/httpd/conf.d/openwebmail.conf #%config(noreplace) %{_sysconfdir}/pam.d/openwebmail %config(noreplace) %{_sysconfdir}/logrotate.d/openwebmail %{_sysconfdir}/smrsh/vacation.pl %attr(0660,root,mail) /var/log/openwebmail.log %ghost %{_sysconfdir}/openwebmail/maps/*.db %doc data/openwebmail/doc README-RedHat.rpm %post /usr/share/openwebmail/cgi-bin/openwebmail-tool.pl --init --no > /dev/null # send output to std.err. echo 1>&2 echo 'Script "/usr/share/openwebmail/cgi-bin/openwebmail-tool.pl --init" has been run.' 1>&2 echo "Reload WWW server by /etc/init.d/httpd reload" 1>&2 echo "Then access Open WebMail via http://$HOSTNAME/openwebmail/" 1>&2 echo 1>&2 %changelog * Tue Sep 12 2006 Milan Kerslager 2.52-20060831.ker.rhel4 - update to 2.52-20060831 - do not remove doc from the main tree as OWM links to them (doc has been moved from /usr/share/openwebmail-*/doc to the main Web tree /usr/share/openwebmail) - more %{lang} - enable %ghost files - run /usr/share/openwebmail/cgi-bin/openwebmail-tool.pl by %post * Tue Jun 27 2006 Milan Kerslager 2.52-20060618.ker.rhel4 - update to 2.52-20060618 - extended Requires: * Wed Aug 10 2005 Milan Kerslager 2.51-0.20050627.ker.rhel3 - update to 20050627 * Thu Mar 03 2005 Milan Kerslager 2.51-0.20050303.ker.rhel4 - update to the latest release with Czech translation updates * Wed Mar 02 2005 Milan Kerslager 2.51-0.20050301.ker.rhel4 - update to 2.51 - Require: perl-Compress-Zlib (because default HTTP compression) - Czech update for lang and templates * Wed Feb 23 2005 Milan Kerslager 2.50-0.20050221.ker.rhel3 - update to the latest release - remove Requires: perl-CGI as this is not a part of RHEL4 anymore and we have Requires: perl(MIME::Base64) >= 3.01 * Wed Feb 09 2005 Milan Kerslager 2.50-0.20050207.ker.rhel3 - update to the latest release - Requires: perl(MIME::Base64) >= 3.01 * Tue Dec 21 2004 Milan Kerslager 2.41-0.20041221.ker.rhel3 - new Czech traslations, latest shapshot * Fri Dec 17 2004 Milan Kerslager 2.41-0.20041216.ker.rhel3 - update to the latest release (new addr book) * Wed Sep 29 2004 Milan Kerslager 2.41-0.20040926.ker.rhel3 - updated to 2.41 * Sun Sep 05 2004 Milan Kerslager 2.40-0.20040905.ker.rhel3 - fixed Czech updates in main package + new Text.Czech iconset * Sat Sep 04 2004 Milan Kerslager 2.40-0.20040904.ker.rhel3 - updated to the latest release with integrated Czech translation update * Tue Aug 31 2004 Milan Kerslager 2.40-0.20040830.1.ker.rhel3 - removed /etc/pam.d/openwebmail because it uses 'login' as default - Czech translation update, Czech Cool3D.Czech icons update * Mon Jul 19 2004 Milan Kerslager 2.32-1.20040719.ker.rhel3 - tnef shell execution fixed * Mon Jul 19 2004 Milan Kerslager 2.32-1.20040718.ker.rhel3 - update to latest version (tnef support added) * Wed Jul 14 2004 Milan Kerslager 2.32-1.20040709.ker.rhel3 - update to latest version - remove vacation fix because has been accepted upstream * Thu Jul 08 2004 Milan Kerslager 2.32-1.20040708.1.ker.rhel3 - fix for vacation.pl * Thu Jul 08 2004 Milan Kerslager 2.32-1.20040708.ker.rhel3 - updated to latest release - fix SPEC file for new *.default location under etc/defaults without *.default extension * Wed Jun 30 2004 Milan Kerslager 2.32-0.20040630.ker.rhel3 - updated to latest release (with security fixes) * Mon May 10 2004 Milan Kerslager 2.30-0.20040510.ker.rhel3 - update because securityfix http://openwebmail.org/openwebmail/download/cert/patches/SA-04:03/ * Wed Apr 14 2004 Milan Kerslager 2.30-0.20040415.ker.rhel3 - new source from author (with czech updates) * Wed Apr 14 2004 Milan Kerslager 2.30-0.20040414.ker.rhel3 - new source from author - new czech templates * Tue Apr 13 2004 Milan Kerslager 2.30-0.20040413.5.ker.rhel3 - czech prefs.template * Tue Apr 13 2004 Milan Kerslager 2.30-0.20040413.3.ker.rhel3 - show releasedate to users in page footer by default (/etc/openwebmail.conf.default) - fix broken Czech language file * Tue Apr 13 2004 Milan Kerslager 2.30-0.20040413.ker.rhel3 - official update, Debian patch commented out - requires: perl(Digest::MD5) to reflect change since 04/10/2004 (maildb.pl) * Tue Apr 06 2004 Milan Kerslager 2.30-0.20040130.2.ker.rhel3 - fixed maildb.pl (extracted from from debian-7) * Sat Feb 14 2004 Milan Kerslager 2.30-0.20040130 - update to current 2.30 - DBM configuration moved to /etc/openwebmail/etc/dbm.conf (by author) - openwebmail.conf with no backup file (in final package) - /etc/pam.d/openwebmail fixed * Tue Nov 04 2003 Milan Kerslager 2.20-1.20031104_0.9 - added (noreplace) to /etc/openwebmail/*{conf,book} * Tue Oct 28 2003 Milan Kerslager 2.20-1.9.20031027 - updated to current version - added missingok,notifempty,size 50k to /etc/logrotate.d/openwebmail - patch for openwebmail.conf fixed for new defaults * Wed Oct 22 2003 Milan Kerslager 2.20-1.9.20031022 - updated to current version 2.20 (20031022) - perl-Aspell added to Requires: * Fri Oct 3 2003 Milan Kerslager 2.10-1.9.20031002 - updated to current version (20030904) - fixed .filter.book.db problem * Mon Sep 8 2003 Milan Kerslager 2.10-1.9.20030904 - updated to current version (20030904) * Mon Aug 25 2003 Milan Kerslager 2.10-1.9.20030825 - updated to 2.10 version (20030825) * Wed Jun 11 2003 Milan Kerslager 2.01-4.9.20030608 - minor change in openwebmail-httpd.conf - updated to 20030608 version * Wed May 21 2003 Milan Kerslager 2.01-2.9.20030520 - fix in openwebmail.conf (Web server config file) - %config(noreplace) and %{_sysconfdir} instead of /etc - /usr/share is %{_datadir}, /usr/share/openwebmail is %{_datadir}/openwebmail - openwebmail -> %{name} (where the name of the package is expected) * Wed May 20 2003 Milan Kerslager 2.01-2.9.20030520 - to utilize zlib compression and speedup install perl-Compress-Zlib (this is a standard part of Red Hat 9 distribution) - unneeded patch removed from source package - README-RedHat.rpm updated * Wed May 20 2003 Milan Kerslager 2.01-1.9.20030520 - updated to current relase (20030520) - fixes in config files (for Web server, autodetection for language and charset + autosaverc file (to not confuse new users) - added /etc/openwebmail/*.db files to package as %ghost files * Wed May 14 2003 Milan Kerslager 2.01-1.9 - updated to 2.01 - merged with Milan Krcmar's changes in spec file - MIME-Base64 is a part of perl-5.8.0, so we need Requires(MIME::Base64) users of RH 7.3 or perl older than 5.8.0 should install perl-MIME-Base64 package separately (this package is a part of RH 7.3) - a patch for openwebmail-tool.pl to check for a little bit modified line in DB_File.pm (RH 9 perl-5.8.0-88 specific - we do not want to force a user to modify the file on the disc [from another package]) - authentication is done via PAM now (Requires: perl-Authen-PAM) * Thu Feb 27 2003 Milan Krcmar 1.90.20030226-3 - RH release number removed from package's release number: no other differences found between 7.x and 8.0 packages - OWM's snapshot date appended to its version number to distinguish daily snapshots - doc files (including the RedHat notice) are now part of the main tarball, do not include them separately anymore - allow for whitespace in filenames (one such file exists in current release) - config patch applied to both openwebmail.conf and openwebmail.conf.default * Mon Feb 10 2003 Milan Krcmar 1.81-7x.20030130.2 - improved filelist creation to use only shell-builtin commands (speedup) - attached auth_unix.pl converted to a patch not to ignore source changes in this file - attached openwebmail.conf also converted to a patch which is furthermore applied to openwebmail.conf.default instead of openwebmail.conf - more files moved to come even closer to FHS - more requirements for Perl packages added * Fri Jan 31 2003 Milan Kerslager 1.81-8x.20030130.1 - updated to 1.81, 2003-01-30 - rebuild for 8.0 - release number design changed to allow build for 7.x and 8.x * Mon Jan 13 2003 Milan Kerslager 1.81-3.20030113 - updated due to remote exploit * Tue Dec 4 2002 Milan Kerslager 1.81-2.20021127 - added requires: perl-CGI - %lang() directives added - allow to use URL http://your.server.com/openwebmail (by Rewrite rules) * Tue Dec 3 2002 Milan Kerslager 1.81-1.20021127 - minor fixes * Tue Nov 26 2002 Milan Kerslager - initial release for RH 8.0