File imap.spec of Package imap

#
# spec file for package imap
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           imap
Summary:        IMAP4, POP2, and POP3 Mail Server
License:        Apache-2.0
Group:          Productivity/Networking/Email/Servers
Version:        2025
Release:        1.0
Url:            https://github.com/abcbarryn/panda-imap
Source0:        https://github.com/abcbarryn/panda-imap/archive/refs/tags/imap-2025-04-06.tar.gz
Source1:        README.SuSE
# pam config
Source2:        %{name}.pamd
Source3:        pop.pamd
# xinetd config
Source4:        %{name}.xinetd
# c-client config
Source5:        c-client.cf
Source6:        %name.firewall
Source100:      %{name}.rpmlintrc
Patch1:         panda-imap-2013-06-openssl.patch
Patch2:         imap-fPIC.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         bash /bin/echo /bin/mv
BuildRequires:  libopenssl-3-devel
BuildRequires:  pam-devel
%if 0%{?suse_version} >= 1100
BuildRequires:  fdupes
%endif
BuildRequires:  gcc <= 13
Requires:       inet-daemon
Requires:       pam

%description
This package contains IMAP4, POP2, and POP3 mail servers.

After installation, activate the servers in the file /etc/xinetd.d/imap.



Authors:
--------
    Mark Crispin <mrc@cac.washington.edu>
    Barry Nelson <barry.nelson@amobiledevice.com>

%package devel
Summary:        IMAP4rev1/c-client Development Environment
License:        BSD-3-Clause
Group:          Development/Libraries/C and C++

%description devel
This package contains the libraries and header files for IMAP client
programs.



Authors:
--------
    Mark Crispin <mrc@cac.washington.edu>
    Barry Nelson <barry.nelson@amobiledevice.com>

%prep
%setup -n panda-imap-imap-2025-04-06
%autopatch -p0

%build
export CFLAGS="$RPM_OPT_FLAGS -DSSL_get_peer_certificate=SSL_get1_peer_certificate -DOPENSSL_NO_DEPRECATED -DDISABLE_POP_PROXY=1 -fPIC -fno-strict-aliasing -fstack-protector"
yes | make lnp MYCFLAGS="$CFLAGS" SSLTYPE=unix IP=6
make lnp c-client
gcc -shared -Wl,-soname,libc-client.so.%{version} -o libc-client.so.%{version} c-client/*.o -lpam

%install
mkdir -p $RPM_BUILD_ROOT/usr/{sbin,share/man/man8,share/doc/packages/imap}
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
strip imapd/imapd ipopd/ipop2d ipopd/ipop3d dmail/dmail mlock/mlock tmail/tmail
ranlib c-client/c-client.a
cp libc-client.so.%{version} $RPM_BUILD_ROOT/%{_libdir}
install -m 755 imapd/imapd ipopd/ipop2d ipopd/ipop3d mtest/mtest $RPM_BUILD_ROOT/usr/sbin/
install -m 755 dmail/dmail mailutil/mailutil mlock/mlock tmail/tmail $RPM_BUILD_ROOT/usr/bin/
install -m 644 $RPM_SOURCE_DIR/%{name}.pamd ${RPM_BUILD_ROOT}/etc/pam.d/%{name}
install -m 644 $RPM_SOURCE_DIR/pop.pamd ${RPM_BUILD_ROOT}/etc/pam.d/pop
install -m 644 -D $RPM_SOURCE_DIR/%{name}.xinetd $RPM_BUILD_ROOT/etc/xinetd.d/%{name}
install -m 644 $RPM_SOURCE_DIR/c-client.cf ${RPM_BUILD_ROOT}/etc/c-client.cf
install -m 644 src/imapd/imapd.8 $RPM_BUILD_ROOT/usr/share/man/man8/imapd.8
install -m 644 src/ipopd/ipopd.8 $RPM_BUILD_ROOT/usr/share/man/man8/ipopd.8
install -m 644 $RPM_SOURCE_DIR/README.SuSE $RPM_BUILD_ROOT/usr/share/doc/packages/%{name}/
install -m 644 CONTENTS README docs/RELNOTES $RPM_BUILD_ROOT/usr/share/doc/packages/%{name}/
install -m 644 docs/{FAQ,bugs,imaprc,md5,naming,drivers}.txt $RPM_BUILD_ROOT/usr/share/doc/packages/%{name}/
mkdir -p $RPM_BUILD_ROOT/%{_includedir}/%{name}
cp src/osdep/tops-20/*.h $RPM_BUILD_ROOT/%{_includedir}/%{name}
cp src/osdep/unix/*.h $RPM_BUILD_ROOT/%{_includedir}/%{name}
cp src/c-client/*.h $RPM_BUILD_ROOT/%{_includedir}/%{name}
cp c-client/linkage.{h,c} $RPM_BUILD_ROOT/%{_includedir}/%{name}
cp c-client/osdep.h $RPM_BUILD_ROOT/%{_includedir}/%{name}
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
install -m 644 c-client/c-client.a $RPM_BUILD_ROOT/%{_libdir}/libc-client.a
ln -sf libc-client.a $RPM_BUILD_ROOT/%{_libdir}/c-client.a
install -m 755 libc-client.so.%{version} $RPM_BUILD_ROOT/%{_libdir}/
ln -sf libc-client.so.%{version} $RPM_BUILD_ROOT/%{_libdir}/libc-client.so
install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/
install -m 644 %{S:6} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
# rpmlint
%if 0%{?suse_version} >= 1100
%fdupes $RPM_BUILD_ROOT%{_includedir}
%endif

%post
ln -fs /etc/ssl /usr/local/ssl
if [ -f /usr/share/ssl/certs/imapd.pem ] ; then
    if [ ! -f /etc/ssl/certs/imapd.pem ] ; then
	echo "moving imapd certificate to /etc/ssl/certs"
	mv /usr/share/ssl/certs/imapd.pem /etc/ssl/certs/
    fi
fi
if [ -f /usr/share/ssl/certs/ipop3d.pem ] ; then
    if [ ! -f /etc/ssl/certs/ipop3d.pem ] ; then
	echo "moving ipop3d certificate to /etc/ssl/certs"
	mv /usr/share/ssl/certs/ipop3d.pem /etc/ssl/certs/
    fi
fi
/sbin/ldconfig


%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr (-,root,root)
/usr/sbin/*
/usr/share/man/man8/*
%config /etc/pam.d/*
%dir /etc/xinetd.d
%config(noreplace) /etc/xinetd.d/%{name}
%doc /usr/share/doc/packages/%{name}
/usr/bin/*
%config(noreplace) /etc/c-client.cf
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
%dir /etc/sysconfig/SuSEfirewall2.d
%dir /etc/sysconfig/SuSEfirewall2.d/services


%files devel
%defattr (-,root,root)
%{_libdir}/*.a
%{_libdir}/*.so
%{_libdir}/*.so.*
%{_includedir}/%{name}

%changelog
* Fri Dec  6 2013 mls@suse.de
- link libc-client with -lpam (as we link other packages with
  with --as-needed)
* Fri Dec 18 2009 chris@computersalat.de
- update to 2007e which
  o fix bugs
- cleanup spec
  o sort tags
  o {name} macro
- rework patches
  o imap-2002c-c++.diff > imap-2007e-c++.patch
  o imap-2006c1.diff > imap-2007e.patch
- rpmlint
  o deprecated-use-of-%%run_ldconfig
  o shlib-policy-name-error
  - renamed sub-pkg 'lib' to 'libc-client2013_suse'
  o files-duplicate {_includedir}
  - added rpmlintrc
* Tue Nov  3 2009 coolo@novell.com
- updated patches to apply with fuzz=0
* Mon Jan  7 2008 mskibbe@suse.de
- Bug 351197 - several packages use wrong dir for SuSEfirewall2
  services files
* Fri Mar 16 2007 mskibbe@suse.de
- fix ports in firewall file
* Fri Mar  2 2007 mskibbe@suse.de
- imap : Support for FATE #300687: Ports for SuSEfirewall added
  via packages (#250579)
* Thu Nov 16 2006 mskibbe@suse.de
- update to version 2006c1 which
  o fix bugs
  o fix bug( Bug 217287 - imap-2004g_suse-28: use of dangerous
    "gets" function )
  o fix bug( Bug 144598 - imap-2004g_suse-4: dodgy code )
* Thu Feb  2 2006 ro@suse.de
- give libc-client.so a SONAME
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Sat Jan 14 2006 schwab@suse.de
- Don't strip binaries.
* Wed Jan 11 2006 seife@suse.de
- add -fstack-protector
* Mon Oct 10 2005 rommel@suse.de
- version update to imap-2004g (includes fix for Bug #120608)
* Mon Aug 22 2005 rommel@suse.de
- the FreeFork license used by UW says we have to make it clear in the version
  number that we modified the sources; hinted by our license manager
* Fri Jan 21 2005 arvin@suse.de
- updated to version 2004c
* Tue Dec 14 2004 arvin@suse.de
- updated to version 2004b RC1
* Mon Nov 15 2004 kukuk@suse.de
- Use common-* PAM config files in imap.pamd and pop.pamd
* Mon Sep 13 2004 arvin@suse.de
- fixes for mailbox access over rsh and ssh (bug #43905)
* Fri Jul 16 2004 arvin@suse.de
- updated to version 2004a (bugfix release)
* Tue May 11 2004 arvin@suse.de
- updated to version 2004
- enable IPv6 support
* Fri Feb 27 2004 arvin@suse.de
- add %%run_ldconfig
* Fri Jan 16 2004 kukuk@suse.de
- Add pam-devel to neededforbuild
* Fri Oct 31 2003 arvin@suse.de
- build rpms as non-root user
* Wed Sep 24 2003 arvin@suse.de
- updated to version 2002e (minor release with primarily bugfixes)
* Thu Jun 12 2003 arvin@suse.de
- fixed directory file list
* Fri Jun  6 2003 arvin@suse.de
- updated to version 2002d (minor release with primarily bugfixes)
* Thu Apr 17 2003 arvin@suse.de
- updated to version 2002c (minor release with primarily bugfixes)
* Tue Apr 15 2003 arvin@suse.de
- explain how to create a certificate (bug #26281)
* Fri Apr 11 2003 arvin@suse.de
- added tls/ssl services to xinetd config file
* Thu Apr 10 2003 arvin@suse.de
- updated to version 2002b (maintenace release)
* Thu Apr 10 2003 arvin@suse.de
- fixed path for certificates (now /etc/ssl/certs) (bug #25762)
* Thu Mar  6 2003 arvin@suse.de
- don't use tcpwrapper config file for xinetd (bug #24773)
* Mon Mar  3 2003 arvin@suse.de
- added config file for xinetd
* Fri Feb  7 2003 kukuk@suse.de
- Use pam_unix2.so instead of pam_unix.so
- Don't use absolute path to pam modules
* Wed Nov 20 2002 arvin@suse.de
- updated to imap version 2002
- now compiled with the default SSLTYPE=nopwd in accordance with
  current IESG security requirements
* Thu Nov  7 2002 arvin@suse.de
- include linkage.c in imap-devel
* Tue Sep  3 2002 arvin@suse.de
- fixed header files to be C++ compliant
* Wed Jul 24 2002 arvin@suse.de
- moved shared library into extra sub package
* Fri Jul 12 2002 arvin@suse.de
- imap-devel package requires imap package
* Mon May  6 2002 arvin@suse.de
- fixed overflow while parsing rfc822 messages
* Mon Apr 22 2002 arvin@suse.de
- make c-client.a a link to libc-client.a
* Thu Apr 18 2002 kukuk@suse.de
- Use -fPIC instead of -fpic
* Mon Feb  4 2002 arvin@suse.de
- updated to version 2001a (maintenance release)
- turned SSL support on again
* Fri Aug 24 2001 ro@suse.de
- removed /lib/security path from pam.d config file
* Mon Jun 18 2001 arvin@suse.de
- added osdep.h to imap-devel (bug #8698)
* Tue May  8 2001 arvin@suse.de
- bzip2 sources
* Wed Apr 18 2001 arvin@suse.de
- do not explicit provide imap, it's done automatically
* Tue Feb  6 2001 arvin@suse.de
- updated to version 2000c
- fixed to compile without kernel header files
* Tue Dec 19 2000 arvin@suse.de
- ensure to link against shared version of libcrypto
* Mon Dec 18 2000 arvin@suse.de
- added SSL support
* Fri Nov  3 2000 kukuk@suse.de
- Fix compiling on SPARC
* Fri Nov  3 2000 arvin@suse.de
- changed group tag
* Thu Oct 26 2000 arvin@suse.de
- new version with imap 2000
- contains both programs and libraries
* Fri Mar 17 2000 rolf@suse.de
- removed binaries [bug#2378]
- compile -fpic for shared lib
- use RPM macros for locations of files
- set Group: tag
* Thu Dec 23 1999 rolf@suse.de
- make shared lib work and strip it
* Thu Dec  9 1999 rolf@suse.de
- new version 4.7
- build for PAM systems (LDAP not supported)
- apply lock-patch
- also build shared lib
* Fri Oct  1 1999 rolf@suse.de
- initial version 4.5.BETA
openSUSE Build Service is sponsored by