Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37046951
en ru br
ALT Linux repos
S:2.3.21-alt1
D:1.1-alt0.hg20070530
5.0: 1.1.6-alt2
4.1: 1.0.13-alt1
4.0: 1.0.3.hg20070801-alt1
+updates:1.0.3.hg20070801-alt1
3.0: 0.99.14-alt2

Other repositories
Upstream:1.0.13

Group :: System/Servers
RPM: dovecot

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define _ssldir %(openssl-config --openssldir)

Name: dovecot
Version: 1.0.13
Release: alt1

Summary: Dovecot secure IMAP/POP3 server
License: GPL
Group: System/Servers
Url: http://%name.org/

Packager: Sergey Ivanov <seriv at altlinux.ru>

PreReq: openssl >= 0.9.6g-alt2
Requires(pre): cert-sh-functions shadow-utils
Requires(post,preun): service

###########################################

# Relations with other POP3/IMAP server pkgs (like courier-imap)

# Provide the abstract service names (which are virtual pkg names),

# specify their origin (our pkg name as the epoch + version-release):
Provides: IMAPD = %name:%version-%release
Provides: POP3D = %name:%version-%release

# End of the statements to describe relations with other POP3/IMAP server pkgs

########################################

Source0: %name-%version.tar.gz
Source1: %name.init
Source2: %name.pam
Source3: %name-auth.control

# ALT patches

Patch0: %name-1.0.13-alt-conf.patch

BuildPreReq: automake_1.9
# Automatically added by buildreq on Sun Apr 08 2007
BuildRequires: gcc-c++ glibc-devel-static libldap-devel libMySQL-devel libpam-devel libsqlite3-devel openssl postgresql-devel zlib-devel

%description
Dovecot is an IMAP/POP3 server for Linux/UNIX-like systems, written with
security primarily in mind. Although it's written with C, it uses
several coding techniques to avoid most of the common pitfalls.

Dovecot can work with standard mbox and maildir formats and it's fully
compatible with UW-IMAP and Courier IMAP servers as well as mail
clients accessing the mailboxes directly.

%package -n dovecot-devel
Summary: Libraries and headers for Dovecot
Group: Development/Other

%description -n dovecot-devel
Headers and static libraries for Dovecot

%define _libexecdir /usr/libexec

%prep
%setup -n %name-%version -q
%patch0 -p1


%build
%set_automake_version 1.9

export CPPFLAGS="`pkg-config --cflags-only-I openssl`"
export LDFLAGS="`pkg-config --libs-only-L openssl`"

%__mv doc/wiki/Makefile.am.in doc/wiki/Makefile.am
%__aclocal
%__autoheader
%__libtoolize --force
%__automake --add-missing
%__autoconf

%configure \
   --localstatedir=%_var                   \
   --with-moduledir=%_libdir/%name/modules \
   --sysconfdir=%_sysconfdir/%name         \
   --enable-ipv6                           \
   --enable-header-install                 \
   --with-rawlog                           \
   --with-ssl=openssl                      \
   --with-pop3d                            \
   --with-pgsql                            \
   --with-mysql                            \
   --with-sqlite                           \
   --with-ldap                             \
   --with-cyrus-sasl2
%make_build

%install
%make_install DESTDIR=%buildroot install

## Cleanup


# We will make our own %%doc set

%__rm -rf %buildroot%_docdir/%name

## Install


%__mkdir_p -m 0755 %buildroot%_sysconfdir/pam.d
%__mkdir_p -m 0755 %buildroot%_initdir
%__mkdir_p -m 0755 %buildroot%_sysconfdir/%name
%__mkdir_p -m 0755 %buildroot%_datadir/%name
%__mkdir_p -m 0755 %buildroot%_ssldir/{certs,private}

# Base directory

%__mkdir_p -m 0700 %buildroot%_var/run/%name

# Chroot for imap-login

%__mkdir_p -m 0750 %buildroot%_var/run/%name/login

# Init script

%__install -m 0755 %SOURCE1 %buildroot%_initdir/%name

# PAM config

%__install -m 0600 %SOURCE2 %buildroot%_sysconfdir/pam.d/%name

# Default config

%__mv -f %buildroot%_sysconfdir/%name/%name{-example,}.conf

# OpenSSL stuff

# Need more working on it.
%__mv doc/dovecot-openssl.cnf %buildroot%_sysconfdir/%name

# Ghosts. How to include it in package and remove on

# package remove without checking of size mismatch?
touch %buildroot%_ssldir/certs/%name.pem
touch %buildroot%_ssldir/private/%name.pem
touch %buildroot%_var/run/%name/ssl-parameters.dat

# devel files

%__mkdir -p %buildroot%{_includedir}/%{name}/{deliver,lib,lib-mail,lib-storage}
%__mkdir -p %buildroot%{_libdir}/%{name}/modules/{lib,lib-mail,lib-storage}

%__install -p -m644 dovecot-config %buildroot%{_includedir}/%{name}
for folder in deliver lib lib-mail lib-storage
do
   if [ -d $RPM_BUILD_ROOT%{_libdir}/%{name}/modules/$folder/ ]; then
       %__install -p -m644 src/$folder/*.a %buildroot%{_libdir}/%{name}/modules/$folder/
   fi
done

#control file

install -pD -m755 %SOURCE3 %buildroot%_controldir/%name-auth

#link for backward compatibility

ln -s %{_libexecdir}/%name/deliver %buildroot%{_libdir}/%name

# Done



%pre
%_sbindir/groupadd -r -f %name 2>/dev/null ||:
%_sbindir/useradd -r -n -g %name -d %_var/run/%name \
-s /dev/null -c 'Dovecot secure IMAP server' %name 2>/dev/null ||:
%pre_control %name-auth

%post
%post_control %name-auth -s none
%post_service %name


%preun
%preun_service %name
#%postun
#if id %name >/dev/null 2>&1; then
# userdel %name
#fi

#if sg %name -c true >/dev/null 2>&1; then

# groupdel nntpcache
#fi

%files
%_controldir/%name-auth
%config(noreplace) %_sysconfdir/%name/%name.conf
%config(noreplace) %_sysconfdir/%name/dovecot-openssl.cnf
%config(noreplace) %_sysconfdir/pam.d/%name
%config(noreplace) %_initdir/%name

%dir %attr(0755,root,root) %_var/run/%name
%dir %attr(0750,root,%name) %_var/run/%name/login
%dir %_libdir/%name

%_libexecdir/%name/checkpassword-reply
%_libexecdir/%name/deliver
%_libexecdir/%name/dict
%_libexecdir/%name/dovecot-auth
%_libexecdir/%name/gdbhelper
%_libexecdir/%name/imap
%_libexecdir/%name/imap-login
%_libexecdir/%name/pop3
%_libexecdir/%name/pop3-login
%_libexecdir/%name/rawlog
%_libexecdir/%name/ssl-build-param
%_libexecdir/%name/idxview
%_libexecdir/%name/logview
%_libdir/%name/deliver
%_libdir/%name/modules/*.so
%_libdir/%name/modules/imap/*.so
%_libdir/%name/modules/pop3/*.so
%_libdir/%name/modules/lda/*.so

%_sysconfdir/%name
%_datadir/%name
%_sbindir/*

%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %_var/run/%name/ssl-parameters.dat
%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %_ssldir/certs/%name.pem
%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %_ssldir/private/%name.pem

%doc doc/*.txt INSTALL AUTHORS ChangeLog
%doc COPYING* TODO README NEWS doc/*.conf

%files -n dovecot-devel
%{_libdir}/%{name}/dovecot-config
%{_libdir}/%{name}/modules/*.a
%{_libdir}/%{name}/modules/*.la
%{_libdir}/%{name}/modules/imap/*.a
%{_libdir}/%{name}/modules/imap/*.la
%{_libdir}/%{name}/modules/lib/*.a
%{_libdir}/%{name}/modules/lib-mail/*.a
%{_libdir}/%{name}/modules/lib-storage/*.a
%{_includedir}/%{name}

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin