Группа :: Система/Серверы
Пакет: dovecot
Главная Изменения Спек Патчи Загрузить Bugs and FR
%define _ssldir %(openssl-config --openssldir)
Name: dovecot
Version: 1.0
Release: alt11.alt0.M24.1
Summary: Dovecot secure IMAP/POP3 server
License: GPL
Group: System/Servers
Url: http://%name.org/
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
# End of the statements to describe relations with other POP3/IMAP server pkgs
########################################
Source0: %name-1.0.tar.gz
Source1: %name.init
Source2: %name.pam
Source4: %name-wiki.tar.gz
# ALT patches
Patch0: %name-1.0.rc29-alt-mkcert.patch
Patch1: %name-1.0-rc24-alt-conf.patch
BuildPreReq: automake_1.8
# Automatically added by buildreq on Sun Apr 08 2007
BuildRequires: gcc-c++ glib2 libMySQL-devel libldap-devel libpam-devel libpq3-devel libsasl2-devel libssl-devel libstdc++-devel openssl pkgconfig 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
%package -n dovecot-doc
Summary: local copy of dovecot-wiki, created from http://wiki.dovecot.org/
Group: System/Servers
%description -n dovecot-devel
Headers and static libraries for Dovecot
%description -n dovecot-doc
local copy of dovecot-wiki, created from http://wiki.dovecot.org/
%prep
%setup -n %name-1.0 -q
%patch0 -p1
%patch1 -p1
%setup -n %name-1.0 -T -D -a 4
mv dovecot-wiki/*txt doc/wiki/
rm -f dovecot-wiki/error.log
rmdir dovecot-wiki
cd doc/wiki
cp -f Makefile.am.in Makefile.am
echo *.txt | sed 's/ / \\\n /g' >> Makefile.am
%build
%set_automake_version 1.8
export CPPFLAGS="`pkg-config --cflags-only-I openssl`"
export LDFLAGS="`pkg-config --libs-only-L openssl`"
%__aclocal
%__autoheader
%__libtoolize --force
%__automake --add-missing
%__autoconf
%configure \
--localstatedir=%_var \
--libexecdir=%_libdir \
--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
%__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
# 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
# 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
%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/%name.conf
%config(noreplace) %_sysconfdir/%name/dovecot-openssl.cnf
%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
%dir %_libdir/%name
%_libdir/%name/checkpassword-reply
%_libdir/%name/deliver
%_libdir/%name/dict
%_libdir/%name/dovecot-auth
%_libdir/%name/gdbhelper
%_libdir/%name/imap
%_libdir/%name/imap-login
%_libdir/%name/pop3
%_libdir/%name/pop3-login
%_libdir/%name/rawlog
%_libdir/%name/ssl-build-param
%_libdir/%name/idxview
%_libdir/%name/logview
%_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}
%files -n dovecot-doc
%doc doc/wiki/*.txt
%changelog
…
Полный changelog можно просмотреть здесь
Name: dovecot
Version: 1.0
Release: alt11.alt0.M24.1
Summary: Dovecot secure IMAP/POP3 server
License: GPL
Group: System/Servers
Url: http://%name.org/
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
# End of the statements to describe relations with other POP3/IMAP server pkgs
########################################
Source0: %name-1.0.tar.gz
Source1: %name.init
Source2: %name.pam
Source4: %name-wiki.tar.gz
# ALT patches
Patch0: %name-1.0.rc29-alt-mkcert.patch
Patch1: %name-1.0-rc24-alt-conf.patch
BuildPreReq: automake_1.8
# Automatically added by buildreq on Sun Apr 08 2007
BuildRequires: gcc-c++ glib2 libMySQL-devel libldap-devel libpam-devel libpq3-devel libsasl2-devel libssl-devel libstdc++-devel openssl pkgconfig 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
%package -n dovecot-doc
Summary: local copy of dovecot-wiki, created from http://wiki.dovecot.org/
Group: System/Servers
%description -n dovecot-devel
Headers and static libraries for Dovecot
%description -n dovecot-doc
local copy of dovecot-wiki, created from http://wiki.dovecot.org/
%prep
%setup -n %name-1.0 -q
%patch0 -p1
%patch1 -p1
%setup -n %name-1.0 -T -D -a 4
mv dovecot-wiki/*txt doc/wiki/
rm -f dovecot-wiki/error.log
rmdir dovecot-wiki
cd doc/wiki
cp -f Makefile.am.in Makefile.am
echo *.txt | sed 's/ / \\\n /g' >> Makefile.am
%build
%set_automake_version 1.8
export CPPFLAGS="`pkg-config --cflags-only-I openssl`"
export LDFLAGS="`pkg-config --libs-only-L openssl`"
%__aclocal
%__autoheader
%__libtoolize --force
%__automake --add-missing
%__autoconf
%configure \
--localstatedir=%_var \
--libexecdir=%_libdir \
--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
%__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
# 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
# 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
%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/%name.conf
%config(noreplace) %_sysconfdir/%name/dovecot-openssl.cnf
%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
%dir %_libdir/%name
%_libdir/%name/checkpassword-reply
%_libdir/%name/deliver
%_libdir/%name/dict
%_libdir/%name/dovecot-auth
%_libdir/%name/gdbhelper
%_libdir/%name/imap
%_libdir/%name/imap-login
%_libdir/%name/pop3
%_libdir/%name/pop3-login
%_libdir/%name/rawlog
%_libdir/%name/ssl-build-param
%_libdir/%name/idxview
%_libdir/%name/logview
%_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}
%files -n dovecot-doc
%doc doc/wiki/*.txt
%changelog
…
Полный changelog можно просмотреть здесь