Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > media > contrib-src > by-pkgid > 365c2b27e67100f3f326341dd9eed52d > files > 9

squirrelmail-1.2.8-1mdk.src.rpm

%define basedir /var/www/squirrelmail
%define varlibdir /var/lib/squirrelmail
%define prefsdir %{varlibdir}/prefs
%define varspooldir /var/spool/squirrelmail
%define attdir %{varspooldir}/attach
%define etcdir /etc/squirrelmail
%define webdir /var/www/html
%define crondir /etc/cron.daily

Summary: Squirrelmail is a webmail client for PHP4.
Name: squirrelmail
Version: 1.2.8
Release: 1mdk
License: GPL
Url: http://www.squirrelmail.org/
Group: System/Servers
Source0: %{name}-%{version}.tar.bz2
Source2: squirrelmail-RPM.readme
Source3: http://www.squirrelmail.org/plugins/address_add.1.2-1.2.0.tar.gz
Source4: http://www.squirrelmail.org/plugins/block_sender.0.3-1.2.2.tar.gz
Source5: http://www.squirrelmail.org/plugins/login_image-0.2.tar.gz
Source6: http://www.squirrelmail.org/plugins/secure_login-0.2-1.2.0.tar.gz
Patch1: config.php.patch.bz2
Patch5: login_image-position.patch.bz2
BuildRoot: %_tmppath/%{name}-buildroot
BuildArch: noarch
Requires: apache >= 1.3.19 php >= 4.0.4 perl tmpwatch >= 2.8
Requires: MailTransportAgent

%description
SquirrelMail is a standards-based webmail package written in PHP4. It
includes built-in pure PHP support for the IMAP and SMTP protocols, and
all pages render in pure HTML 4.0 (with no Javascript) for maximum
compatibility across browsers.  It has very few requirements and is very
easy to configure and install. SquirrelMail has a all the functionality
you would want from an email client, including strong MIME support,
address books, and folder manipulation.

%package poutils
Summary: Some development tools for SquirrelMail.
Group: System/Servers
Requires: %{name} = %{version}

%description poutils
This package includes some development tools for squirrelmail
i18n, including the main po file and some compilation scripts.

%prep
%setup -q
rm -f plugins/make_archive.pl

if [ -d plugins/address_add ];then
echo "address_add plugin already present"
else
pushd plugins;gzip -dc %{SOURCE3} | tar -xvf -;popd
fi

if [ -d plugins/block_sender ];then
echo "block_sender plugin already present"
else
pushd plugins;gzip -dc %{SOURCE4} | tar -xvf -;popd
fi

if [ -d plugins/login_image ];then
echo "login_image plugin already present"
else
pushd plugins;gzip -dc %{SOURCE5} | tar -xvf -;popd
fi

%patch5 -p0

if [ -d plugins/secure_login ];then
echo "secure_login plugin already present"
else
pushd plugins;gzip -dc %{SOURCE6} | tar -xvf -;popd
fi

# Rearrange the documentation
mv AUTHORS ChangeLog COPYING INSTALL README UPGRADE doc/
mv ReleaseNotes doc/ReleaseNotes.txt
mv themes/README.themes doc/
for f in `find plugins -name "README*" -or -name INSTALL \
                   -or -name CHANGES -or -name HISTORY`; do
    mkdir -p doc/`dirname $f`
    mv $f $_
done
mv doc/plugins/squirrelspell/doc/README doc/plugins/squirrelspell
rmdir doc/plugins/squirrelspell/doc
mv plugins/squirrelspell/doc/* doc/plugins/squirrelspell
rm -f doc/plugins/squirrelspell/index.php
rmdir plugins/squirrelspell/doc

# Fixup various files
echo "left_refresh=300" >> data/default_pref
%patch1 -p0
for f in contrib/RPM/squirrelmail.cron contrib/RPM/config.php.rh7; do
    perl -pi -e "s|__ATTDIR__|%{attdir}|g;"\
             -e "s|__PREFSDIR__|%{prefsdir}|g;" $f
done

cp %{SOURCE2} doc/RPM.readme

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
mkdir -p -m0755 $RPM_BUILD_ROOT%{etcdir}
mkdir -p -m0755 $RPM_BUILD_ROOT%{prefsdir}
mkdir -p -m0755 $RPM_BUILD_ROOT%{attdir}
mkdir -p -m0755 $RPM_BUILD_ROOT%{basedir}
mkdir -p -m0755 $RPM_BUILD_ROOT%{crondir}

# install default_pref
install -m 0644 data/default_pref $RPM_BUILD_ROOT%{prefsdir}

# install the config files
mkdir -p -m0755 $RPM_BUILD_ROOT%{basedir}/config
install -m 0644 config/*.php $RPM_BUILD_ROOT%{basedir}/config/
install -m 0644 contrib/RPM/config.php.rh7 $RPM_BUILD_ROOT%{etcdir}/config.php
# symlink
ln -s %{etcdir}/config.php $RPM_BUILD_ROOT%{basedir}/config/config.php
install -m 0755 config/*.pl $RPM_BUILD_ROOT%{basedir}/config/

# install index.php
install -m 0644 index.php $RPM_BUILD_ROOT%{basedir}/

# install functions
mkdir -p -m0755 $RPM_BUILD_ROOT%{basedir}/functions
install -m 0644 functions/* $RPM_BUILD_ROOT%{basedir}/functions/

# install src
mkdir -p -m0755 $RPM_BUILD_ROOT%{basedir}/src
install -m 0644 src/* $RPM_BUILD_ROOT%{basedir}/src/

# install themes
mkdir -p -m0755 $RPM_BUILD_ROOT%{basedir}/themes
install -m 0644 themes/*.php $RPM_BUILD_ROOT%{basedir}/themes/
mkdir -p -m0755 $RPM_BUILD_ROOT%{basedir}/themes/css
install -m 0644 themes/css/*.css $RPM_BUILD_ROOT%{basedir}/themes/css/
# install images
mkdir -p -m0755 $RPM_BUILD_ROOT%{basedir}/images
install -m 0644 images/* $RPM_BUILD_ROOT%{basedir}/images/

# install the plugins
cp -rp plugins $RPM_BUILD_ROOT%{basedir}

# install the locales.
cp -rp locale $RPM_BUILD_ROOT%{basedir}

# install help files
cp -rp help $RPM_BUILD_ROOT%{basedir}

# po will go into the poutils package, so just copy it
cp -rp po $RPM_BUILD_ROOT%{basedir}

# install the cron script
install -m 0755 contrib/RPM/squirrelmail.cron $RPM_BUILD_ROOT/%{crondir}

# symlink to %{basedir} from %{webdir}.
mkdir -p -m0755 $RPM_BUILD_ROOT%{webdir}
ln -s %{basedir} $RPM_BUILD_ROOT/%{webdir}/webmail
# once we switch to Apache 2.0, make an Alias /webmail /var/www/squirrelmail
# in a /etc/httpd/conf.d/squirrelmail.conf file, installed -m 644

%post
# fix the hostname
for f in %{etcdir}/config.php %{etcdir}/config.php.rpmnew; do
    perl -pi -e "s|__HOSTNAME__|$HOSTNAME|g" $f
done

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%config %dir %{etcdir}
%config(noreplace) %{etcdir}/config.php
%doc doc/*
%dir %{basedir}
%dir %{varlibdir}
%dir %{varspooldir}
%{basedir}/config
%{basedir}/functions
%{basedir}/help
%{basedir}/images
%{basedir}/locale
%{basedir}/plugins
%{basedir}/src
%{basedir}/themes
%{basedir}/index.php
%attr(0700, apache, apache) %dir %{prefsdir}
%attr(0700, apache, apache) %dir %{attdir}
%{prefsdir}/default_pref
%{webdir}/webmail
%{crondir}/squirrelmail.cron

%files poutils
%defattr(-,root,root)
%{basedir}/po

%changelog
* Mon Sep 16 2002  Lenny Cartier <lenny@mandrakesoft.com> 1.2.8-1mdk
- from David Walser <luigiwalser@yahoo.com> 
	- more merging with Konstantin Riabitsev
	- update address_add and block_sender plugins
	- 1.2.8

* Fri Jun 28 2002 Yves Duret <yduret@mandrakesoft.com> 1.2.7-5mdk
- requires on MailTransportAgent instead of smtpdaemon. i sux.

* Fri Jun 28 2002 Yves Duret <yduret@mandrakesoft.com> 1.2.7-4mdk
- fix requires on smtpdaemon instead /usr/sbin/sendmail (alternatives).

* Wed Jun 26 2002 Lenny Cartier <lenny@mandrakesoft.com> 1.2.7-3mdk
- from David Walser <luigiwalser@yahoo.com> :
	- incorporate some changes from Konstantin Riabitsev
	- replace abook_take with address_add

* Tue Jun 25 2002 David Walser <luigiwalser@yahoo.com> 1.2.7-3mdk
- incorporate some changes from Konstantin Riabitsev
- replace abook_take with address_add

* Tue Jun 25 2002 Lenny Cartier <lenny@mandrakesoft.com> 1.2.7-2mdk
- from David Walser <luigiwalser@yahoo.com> :
        - add plugins: abook_take block_sender login_image secure_login
        - enable plugins: filter delete_move_next abook_take block_sender

* Sun Jun 23 2002 David Walser <luigiwalser@yahoo.com> 1.2.7-1mdk
- fix typo in squirrelmail-RPM.readme
- move more stuff into doc/
- 1.2.7

* Mon May 06 2002 Lenny Cartier <lenny@mandrakesoft.com> 1.2.6-1mdk
- minor changes on Konstantin Riabitsev specfile.

* Thu Jan 24 2002 Konstantin Riabitsev <icon@duke.edu>
- Fix for the horrible remote execution bug in squirrelspell.
  (/me shuts his ears in the door. Bad Dobby!)
- Check whether we need to edit the config.php file before actually
  sed'ing it.
- Release for 1.2.4.

* Wed Jan 23 2002 Konstantin Riabitsev <icon@duke.edu>
- Setting 0755 permissions on the created directories so people
  running the --rebuild with umask 007 don't get a broken install.
- cp'ing the RPM.readme file instead of moving it.
- cp -rp'ing some dirs instead of mv'ing them
- minor bugfixes to %files section.
- organizing docs for the spamcop plugin now as well
- fixes in the default config -- trailing slashes added to the prefsdir
  and attach_dir (squirrelmail's bug, really).

* Mon Jan 21 2002 Konstantin Riabitsev <icon@duke.edu>
- Package for Squirrelmail-1.2.3.
- Accommodation for the themes/css directory.
- Added RPM.readme and a warning message for upgraders
  (I know, I hate myself, too. ;))

* Wed Jan 02 2002 Konstantin Riabitsev <icon@duke.edu>
- Updated paths as per the list discussion. If you are upgrading, please
  move the existing preferences from /var/squirrelmail/prefs to
  /var/lib/squirrelmail/prefs
- A cleanup cron script. Runs daily and cleans up any old temp attachments
  files in the attachment dir (10 days or older).

* Tue Jan 01 2002 Konstantin Riabitsev <icon@duke.edu>
- Package for the 1.2.2 release.

* Fri Dec 28 2001 Konstantin Riabitsev <icon@duke.edu>
- Changed Requires: sendmail to Requires: /usr/sbin/sendmail so people
  with Postfix can install it as well.
- Changed the chowning of the /var/squirrelmail/* to doing it the right
  way, with %attr's.

* Tue Dec 25 2001 Konstantin Riabitsev <icon@duke.edu>
- First spec file build for RH7.
- Locale patches.
- Fixed russian po/mo files (still screws up on occasion! php/gettext is
  so broken!).
- Default config for RH7 systems.