Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37728317
en ru br
ALT Linux repositórios
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

Outros repositórios
Upstream:1.0.13

Group :: Sistema/Servidores
RPM: dovecot

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

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

Name: dovecot
Version: 0.99.14
Release: alt2

Summary: Dovecot secure IMAP/POP3 server
License: GPL
Group: System/Servers
Url: http://%name.org/releases/%name-%version.tar.gz

Packager: Sergey Ivanov <seriv at altlinux.ru>

PreReq: shadow-utils, service, openssl >= 0.9.6g-alt2

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

# 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

# Conflict with all other real pkgs which provide the same services

# (they should specify the origin the same way, so the epoch-version-release
# of the virtual pkgs POP3D & IMAPD will always differ from that of ours if
# they are provided by a different real pkg):
Conflicts: IMAPD < %name:%version-%release
Conflicts: IMAPD > %name:%version-%release
Conflicts: POP3D < %name:%version-%release
Conflicts: 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

# ALT patches

Patch0: %name-0.99.10.2-alt-mkcert.patch
Patch1: %name-0.99.14-alt-conf.patch

# Upstream patches

# Unapplied
Patch5: auth-lmpass.patch

BuildPreReq: automake_1.4
# Automatically added by buildreq on Sun Dec 05 2004
BuildRequires: gcc-c++ glib2 libldap-devel libpam-devel libpq-devel libsasl2-devel libssl-devel libstdc++-devel openssl pkgconfig postgresql-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.

%prep
%setup -q
%patch0 -p1
%patch1 -p1

#%patch5 -p1


%build
%set_automake_version 1.4

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

%__automake
%__autoconf

%configure \
--localstatedir=%_var \
--without-vpopmail \
--with-ldap \
--with-pgsql \
--with-cyrus-sasl2 \
--with-rawlog \
--with-storages='maildir,mbox' \
--with-ssl=openssl --with-ssldir=%_ssldir

%make_build

%install
%makeinstall

## Cleanup


# We will make our own %%doc set

%__rm -rf %buildroot%_datadir/%name/doc

## 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{-example,}.conf

# OpenSSL stuff

# Need more working on it.
%__mv doc/dovecot-openssl.cnf %buildroot%_sysconfdir/%name
%__install -m 0755 doc/mkcert.sh %buildroot%_datadir/%name/mkcert

# 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

# 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 ||:

%post
# adjust config for generating SSL certs
#HOSTNAME=`hostname -f`
#  %__subst "s|^CN=.*$|CN=$HOSTNAME|g;s|^emailAddress=.*$|emailAddress=root at $HOSTNAME|g" %_sysconfdir/%name/.cnf

# generate SSL certs

#    if [ ! -f %_pemdir/imapd.pem ]; then
#        echo -n "Generating SSL cert for imapd-ssl: "
#        cmd="%_datadir/%name/mk"$i"cert"
#        $cmd >/dev/null 2>&1
#        echo "%_pemdir/imapd.pem - done."
#    fi

echo "Generating SSL cert for imapd-ssl"
%_datadir/%name/mkcert

%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
%config(noreplace) %_sysconfdir/%name.conf
%config(noreplace) %_sysconfdir/pam.d/%name
%config(noreplace) %_initdir/%name

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

%_libdir/%name
%_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

%changelog

Todas as alterações você pod ver aqui

 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009