SHA256
1
0
forked from pool/courier-imap
courier-imap/courier-imap.spec

243 lines
8.6 KiB
RPMSpec

#
# spec file for package courier-imap (Version 4.1.1)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: courier-imap
BuildRequires: courier-authlib-devel fam-devel gcc-c++ libstdc++-devel openssl-devel postfix
URL: http://www.courier-mta.org/imap/
Summary: An IMAP and POP3 Server for Maildir MTAs
Version: 4.1.1
Release: 5
License: GPL
Conflicts: imap qpopper
Group: Productivity/Networking/Email/Servers
Obsoletes: %{name}-ldap
Source: %{name}-%{version}.tar.bz2
Source1: pop3.pamd
Source2: imap.pamd
Source4: courier-imap.init
Source5: courier-imap-ssl.init
Source6: courier-pop.init
Source7: courier-pop-ssl.init
Patch: %{name}-4.0.6.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Prefix: /usr
%define _sysconfdir /etc/courier
%define _localstatedir /var/run
%define authdaemondir %{_localstatedir}/authdaemon.courier-imap
%description
Courier-IMAP is a lightweight server that provides IMAP access to
maildir mailboxes. It supports folders, custom authentication modules,
and virtual mailboxes. A compatible POP3 server is also provided. The
source code is based on the IMAP module in the Courier Mail Server, but
this build is independently repackaged to work with any other MTA that
delivers to maildir format mailboxes.
%prep
%setup -q
%patch
%build
%{suse_update_config}
export CFLAGS="$RPM_OPT_FLAGS"
./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} \
--datadir=%{_datadir}/courier-imap \
--libdir=%{_libdir} --libexecdir=%{_prefix}/lib/courier-imap \
--localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir}/courier-imap --mandir=%{_mandir} \
--infodir=%{_infodir} --with-piddir=/var/run \
--disable-root-check \
--enable-unicode \
--with-authdaemonvar=%{authdaemondir} \
--enable-workarounds-for-imap-client-bugs \
--host=%{_host} --build=%{_build} --target=%{_target_platform}
make
#make check
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# Move daemons into sbin
mv $RPM_BUILD_ROOT%{_prefix}/bin/{couriertls,imapd,pop3d} $RPM_BUILD_ROOT%{_prefix}/sbin/
# Rename imapd.8 to courier-imapd.8
mv $RPM_BUILD_ROOT%{_mandir}/man8/imapd.8 $RPM_BUILD_ROOT%{_mandir}/man8/courier-imapd.8
# Install PAM config files
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
install -m 644 $RPM_SOURCE_DIR/pop3.pamd $RPM_BUILD_ROOT/etc/pam.d/pop3
install -m 644 $RPM_SOURCE_DIR/imap.pamd $RPM_BUILD_ROOT/etc/pam.d/imap
# Install init scripts
mkdir -p $RPM_BUILD_ROOT/etc/init.d
for i in imap imap-ssl pop pop-ssl ; do
install -m 644 $RPM_SOURCE_DIR/courier-$i.init $RPM_BUILD_ROOT/etc/init.d/courier-$i
ln -sf /etc/init.d/courier-$i $RPM_BUILD_ROOT%{_prefix}/sbin/rccourier-$i
done
# Remove original init scripts, will not work longer
rm $RPM_BUILD_ROOT%{_prefix}/lib/courier-imap/imapd.rc
rm $RPM_BUILD_ROOT%{_prefix}/lib/courier-imap/imapd-ssl.rc
rm $RPM_BUILD_ROOT%{_prefix}/lib/courier-imap/pop3d.rc
rm $RPM_BUILD_ROOT%{_prefix}/lib/courier-imap/pop3d-ssl.rc
#
# Fix imapd.dist
#
%{__sed} 's/^IMAPDSTART=.*/IMAPDSTART=YES/' \
<$RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist \
>$RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist.tmp
%{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist.tmp \
$RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist
%{__sed} 's/^IMAPDSSLSTART=.*/IMAPDSSLSTART=YES/' \
<$RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist \
>$RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist.tmp
%{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist.tmp \
$RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist
%{__chmod} 600 $RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist
%{__chmod} 600 $RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist
%{__sed} 's/^POP3DSTART=.*/POP3DSTART=YES/' \
<$RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist \
>$RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist.tmp
%{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist.tmp \
$RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist
%{__sed} 's/^POP3DSSLSTART=.*/POP3DSSLSTART=YES/' \
<$RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist \
>$RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist.tmp
%{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist.tmp \
$RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist
%{__chmod} 600 $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist
%{__chmod} 600 $RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist
# For %doc macro
cp -p imap/README README.imap
cp -p maildir/README.maildirquota.txt README.maildirquota
cp -p maildir/README.sharedfolders.txt README.sharedfolders
mkdir -p $RPM_BUILD_ROOT%{_datadir}/courier-imap
cp -p sysconftool $RPM_BUILD_ROOT%{_datadir}/courier-imap/sysconftool
chmod 755 $RPM_BUILD_ROOT%{_datadir}/courier-imap/sysconftool
cat >$RPM_BUILD_ROOT%{_datadir}/courier-imap/configlist <<EOF
%{_sysconfdir}/imapd.dist
%{_sysconfdir}/imapd-ssl.dist
%{_sysconfdir}/pop3d.dist
%{_sysconfdir}/pop3d-ssl.dist
EOF
%post
%{_datadir}/courier-imap/sysconftool `%{__cat} %{_datadir}/courier-imap/configlist` >/dev/null
%preun
%stop_on_removal courier-imap courier-imap-ssl courier-pop courier-pop-ssl
if [ "$1" = "0" ]; then
rm -f %{_localstatedir}/couriersslcache
rm -f %{_localstatedir}/imapd.pid
rm -f %{_localstatedir}/imapd-ssl.pid
rm -f %{_localstatedir}/imapd.pid.lock
rm -f %{_localstatedir}/imapd-ssl.pid.lock
rm -f %{_localstatedir}/pop3d.pid
rm -f %{_localstatedir}/pop3d-ssl.pid
rm -f %{_localstatedir}/pop3d.pid.lock
rm -f %{_localstatedir}/pop3d-ssl.pid.lock
fi
exit 0
%postun
%restart_on_update courier-imap courier-imap-ssl courier-pop courier-pop-ssl
%insserv_cleanup
exit 0
%files
%defattr(-,root,root,755)
%doc AUTHORS COPYING imap/BUGS README README.imap README.maildirquota
%doc README.sharedfolders
%attr(644,root,root) %config /etc/pam.d/imap
%attr(644,root,root) %config /etc/pam.d/pop3
%attr(755 root,root) %config /etc/init.d/courier-*
%dir %{_sysconfdir}
%config %{_sysconfdir}/imap*
%config %{_sysconfdir}/pop3*
%config %{_sysconfdir}/quotawarnmsg.example
%dir %{_prefix}/lib/courier-imap
%{_prefix}/lib/courier-imap/makedatprog
%{_prefix}/lib/courier-imap/couriertcpd
%{_bindir}/*
%{_sbindir}/*
%{_mandir}/man?/*
%dir %{_datadir}/courier-imap/
%{_datadir}/courier-imap/*
%clean
rm -rf $RPM_BUILD_ROOT
%changelog -n courier-imap
* Mon Sep 11 2006 - tpatzig@suse.de
- Add Conflict to qpopper
* Tue Aug 01 2006 - mskibbe@suse.de
- update to version 4.1.1 which
o fixed some compiler warnings
o fix segfault if non-cert files were found in the cert dir
o Added koi8-u character set
o fix quota calculations on 32 bit platforms with 64 bit off_t
o Don't assume that connect() of a non-blocking socket always
fails with INPROGRESS
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Dec 06 2005 - kukuk@suse.de
- Don't link static
* Mon Nov 14 2005 - kukuk@suse.de
- Add postfix to nfb to fix location of sendmail [#133327]
* Wed Nov 02 2005 - kukuk@suse.de
- Update to version 4.0.6
* Fri Sep 23 2005 - kukuk@suse.de
- Fix imapd and pop3d init scripte for SSL connections [#113213]
* Mon Sep 19 2005 - kukuk@suse.de
- Update to version 4.0.5
* Fri Aug 26 2005 - kukuk@suse.de
- Rename courier-pop3* init scripts to courier-pop* to be
LSB conform
- Source imapd-ssl and pop3-ssl from init scripts [#113213],
use correct SSLPIDFILE variable and add path to checkproc
* Wed Aug 03 2005 - kukuk@suse.de
- Update to version 4.0.4
* Thu Jul 21 2005 - kukuk@suse.de
- Use Maildir from config file [#94231]
- If user removed PIDFILE entry from config file, set default
one [#85845]
* Thu Nov 18 2004 - kukuk@suse.de
- Update to release 3.0.8
* Mon Nov 15 2004 - kukuk@suse.de
- Use common-* PAM config files for imap and pop3
* Mon Sep 06 2004 - kukuk@suse.de
- Fix permission of /usr/lib/courier-imap/authlib/authdaemond.ldap
[#44721]
* Mon Aug 16 2004 - kukuk@suse.de
- Update to bug fix release 3.0.7
* Wed May 12 2004 - kukuk@suse.de
- Update to 3.0.3
* Thu Mar 25 2004 - mmj@suse.de
- Add postfix to # neededforbuild
* Wed Mar 17 2004 - kukuk@suse.de
- Update to 3.0.2: vpopmail password fixes, filesystem/ACL fixes
* Mon Mar 08 2004 - kukuk@suse.de
- Update to official 3.0.0 release
* Mon Feb 09 2004 - kukuk@suse.de
- Update to official 2.2.1 release
* Sat Jan 10 2004 - adrian@suse.de
- build as user
* Fri Aug 29 2003 - kukuk@suse.de
- Add conflict with imap package
* Tue Aug 26 2003 - kukuk@suse.de
- Fix typo in spec file
- Update to 2.1.1
* Sun Aug 03 2003 - aj@suse.de
- Package sysconftool also.
* Fri Aug 01 2003 - kukuk@suse.de
- Rename imapd.8 to courier-imapd.8 to resolve file conflicts.
* Wed Jul 30 2003 - kukuk@suse.de
- Initial version