File vpopmail.spec of Package vpopmail

#
 # spec file for package vpopmail
 #
 # This file and all modifications and additions to the pristine
 # package are under the same license as the package itself.
 #
# norootforbuild

Name:		vpopmail
Summary:	Automating virtual domains for qmail
Version:	5.4.25
Release:	1
License:	GPL
Group:		Networking/Other
URL:		http://www.inter7.com/vpopmail
Source0:	vpopmail-%{version}.tar.bz2
Patch0:		vpopmail-5.4.17.patch
Patch1:		vpopmail.no-root-needed.5.4.25.patch.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
Conflicts:	set-toaster checkpassword postfix
Packager:	Johannes Weberhofer <linux@weberhofer.at>  

Requires:	qmail-skel
Provides:	vpopmail-toaster-doc = %{version}.%{release}
Obsoletes:	vpopmail-toaster-doc < %{version}.%{release}
Provides:	vpopmail-toaster = %{version}.%{release}
Obsoletes:	vpopmail-toaster < %{version}.%{release}

%define		vdir /home/vpopmail
%define		qdir /var/qmail

BuildRequires:	automake pam-devel zlib-devel mysql-devel
BuildRequires:	qmail-skel-devel

%if 0%{?suse_version} > 1100
BuildRequires: -post-build-checks
%endif


%if 0%{?suse_version}
# suse stuff
Requires:		pwdutils
%else
# redhat and mandriva
Requires:		shadow-utils
%endif

%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
# redhat distributions
%if 0%{?fedora_version} >= 8
Requires:	mysql-libs
%else
Requires:	mysql
%endif
%endif

%if 0%{?suse_version} 
#oss distributions
%if 0%{?suse_version} > 1100
BuildRequires: -post-build-checks
Requires:       mysql-client
%else
Requires:       mysql-shared
%endif
BuildRequires:	mysql-client
%endif

%if 0%{?mandriva_version}
# mandriva distributions
Requires:	MySQL-shared
%endif


%description
vpopmail (vchkpw) is a collection of programs and a library to automate 
the creation and maintence of virtual domain email for qmail 
installations using either a single UID/GID, or any valid UID/GID in 
/etc/passwd with a home directory. All the features are provided in the 
library for other applications which need to maintain virtual domain 
email accounts. 

It supports named or IP based domains. It works with vqadmin, 
qmailadmin, vqregister, sqwebmail, and courier-imap. 

It supports MySQL, Sybase, Oracle, LDAP, and file-based (DJB constant 
database) authentication. It handles 1 to 23 million users per domain, 
and up to 23 million domains. 


%package devel
Group:			Development/Languages/C and C++
Summary:		Development tools for %{name}
Requires:		%{name} = %{version}-%{release}
Requires:		mysql-devel


%description devel
Development tools for %{name}

vpopmail (vchkpw)  is a collection  of programs  and a library to automate
the creation and maintence of virtual domain email for qmail installations
using either a single UID/GID, or any valid  UID/GID in /etc/passwd with a
home directory. All the  features  are  provided  in the library for other
applications which need to maintain virtual domain email accounts.


%prep
%setup -q -n %{name}-%{version}
%patch0 -p0
%patch1 -p0


%build
%{__aclocal}
%{__automake}
./configure \
	--prefix=%{vdir} \
	--enable-vpopuser=vpopmail \
	--enable-vpopgroup=vchkpw \
	--disable-roaming-users \
	--enable-tcprules-prog=/usr/bin/tcprules \
	--enable-tcpserver-file=/etc/tcprules.d/tcp.smtp \
	--enable-make-seekable \
	--disable-clear-passwd \
	--disable-users-big-dir \
	--enable-qmail-ext \
	--disable-ip-alias-domains \
	--enable-auth-module=mysql \
	--disable-passwd \
	--enable-logging=v \
	--enable-log-name=vpopmail \
	--disable-mysql-limits \
	--enable-valias \
	--disable-many-domains \
	--enable-non-root-build \
%if 0%{?mandriva_version} || 0%{?suse_version} >= 1100  
	--enable-libdir=%{_libdir}
%else
	--enable-libdir=%{_libdir}/mysql
%endif
%{__make} CFLAGS="$RPM_OPT_FLAGS"


%install
%{__make} DESTDIR=%{buildroot} install

# change defaults for vpopmail MySQL-configuration file
%{__sed} -i -e 's/root/vpopmail/ ; s/secret/SsEeCcRrEeTt/' %{buildroot}%{vdir}/etc/vpopmail.mysql; 

# Install default domain quota messages
for i in overquota.msg quotawarn.msg; do
 %{__install} $i %{buildroot}%{vdir}/domains/.$i
done

#mv %{buildroot}%{vdir}/domains/overquota.msg %{buildroot}%{vdir}/domains/.overquota.msg
#mv %{buildroot}%{vdir}/domains/quotawarn.msg %{buildroot}%{vdir}/domains/.quotawarn.msg


%pre


%preun


%post


%clean
[ -d %{buildroot} ] && %{__rm} -rf %{buildroot}


%files
%defattr (0755,vpopmail,vchkpw)
%dir %{vdir}/bin
%dir %{vdir}/etc
%dir %{vdir}/doc
%dir %{vdir}/doc/doc_html
%dir %{vdir}/doc/man_html

%defattr (0750,vpopmail,vchkpw)
%{vdir}/bin/*

%defattr (0660,vpopmail,vchkpw)
%{vdir}/domains/.quotawarn.msg
%{vdir}/domains/.overquota.msg
%config(noreplace) %{vdir}/etc/vlimits.default
%attr (0440,vpopmail,vchkpw) %config(noreplace) %{vdir}/etc/vpopmail.mysql

%defattr (0444,vpopmail,vchkpw)
%doc %{vdir}/doc/doc_html/*
%doc %{vdir}/doc/man_html/*


%files devel
%defattr (0755,vpopmail,vchkpw)
%dir %{vdir}/include
%dir %{vdir}/lib

%defattr (0444,vpopmail,vchkpw)
%{vdir}/etc/inc_deps
%{vdir}/etc/lib_deps
%{vdir}/include/*
%{vdir}/lib/libvpopmail.a
openSUSE Build Service is sponsored by