summaryrefslogtreecommitdiff
path: root/vpopmail.spec
blob: 94cf61e04ee0475d2f5ac5f2f6a79161b906733e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#
# Conditional build:
%bcond_with	ldap	# with LDAP support
%bcond_with	mysql	# with MySQL support
%bcond_without	sqweb	# don't use sqwebmail
%bcond_with	ucspi	# use ucspi-tcp
#
Summary:	Virtual domains for qmail
Summary(es.UTF-8):	Dominios virtuales para qmail
Summary(pl.UTF-8):	Domeny wirtualne dla qmaila
Name:		vpopmail
Version:	5.4.0
%define	bver	rc1
Release:	0.%{bver}.2
License:	GPL v2
Group:		Networking/Daemons
Source0:	http://dl.sourceforge.net/vpopmail/%{name}-%{version}-%{bver}.tar.gz
# Source0-md5:	3a9edac0e60e4fb1e06d009bd11ade3b
Patch0:		%{name}-nonroot.patch
Patch1:		%{name}-missing-qmail.patch
URL:		http://inter7.com/vpopmail.html
BuildRequires:	autoconf
BuildRequires:	automake
%{?with_mysql:BuildRequires:	mysql-devel}
%{?with_ldap:BuildRequires:	openldap-devel}
%{?with_ucspi:BuildRequires:	ucspi-tcp >= 0.88}
BuildRequires:	rpmbuild(macros) >= 1.202
Requires(pre):	/bin/id
Requires(pre):	/usr/bin/getgid
Requires(pre):	/usr/sbin/groupadd
Requires(pre):	/usr/sbin/useradd
Requires(postun):	/usr/sbin/groupdel
Requires(postun):	/usr/sbin/userdel
%{?with_ldap:Requires:	openldap}
Requires:	qmail >= 1.03
Requires:	qmail-pop3
%{?with_sqweb:Requires:	sqwebmail >= 3.0}
%{?with_ucspi:Requires:	ucspi-tcp >= 0.88}
Provides:	group(vchkpw)
Provides:	user(vpopmail)
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%define		varqmail	/var/qmail
%define		dest		/var/lib/vpopmail

%description
vpopmail is a collection of programs to automate creation and
maintence of non /etc/passwd virtual domain email and POP accounts
for qmail installations.

%description -l es.UTF-8
vpopmail es una colección de programas para automatizar la creación
y el mantenimiento de dominios virtuales de E-mail y cuentas POP
independientes de /etc/passwd.

%description -l pl.UTF-8
vpopmail to kolekcja programów służących automatyzacji tworzenia
i zarządzania kontami pocztowymi w domenach wirtualnych, odrębnych
od haseł składowanych w pliku /etc/passwd.

%package devel
Summary:	Vpopmail development includes
Summary(es.UTF-8):	Ficheros de desarrollo de vpopmail
Summary(pl.UTF-8):	Pliki nagłówkowe bibliotek vpopmail
Group:		Development/Libraries
#Requires:	%{name}-libs = %{version}

%description devel
This package contains header files for vpopmail library.

%description devel -l es.UTF-8
El paquete vpopmail contiene todos los ficheros de inclusión.

%description devel -l pl.UTF-8
Ten pakiet zawiera pliki nagłówkowe biblioteki vpopmail.

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

%build
%{__aclocal}
%{__autoconf}
%{__automake}
%configure \
	--prefix=%{dest} \
	--enable-qmaildir=%{varqmail} \
	--enable-qmail-newu=%{varqmail}/bin/qmail-newu \
	--enable-qmail-inject=%{varqmail}/bin/qmail-inject \
	--enable-qmail-newmrh=%{varqmail}/bin/qmail-newmrh \
	%{?with_ucspi:--enable-roaming-users=y} \
	%{?with_sqweb:--enable-sqwebmail-pass=y} \
	%{?with_ldap:--enable-ldap=y} \
	%{?with_mysql:--enable-auth-module=mysql=y} \
	--enable-vpopuser=vpopmail \
	--enable-vpopgroup=vchkpw \
	--enable-clear-passwd=n \
	--enable-logging=e \
	--enable-log-name=vpopmail \
	--enable-qmail-ext=y \
	--enable-defaultquota=100000 \
	%{?with_ucspi:--enable-tcpserver-file=/etc/vpopmail/tcp.smtp} \
	--enable-libdir=/usr/lib
%{__make}

%install
rm -rf $RPM_BUILD_ROOT

#%{__make} install \
#        DESTDIR=$RPM_BUILD_ROOT

install -d $RPM_BUILD_ROOT%{dest}/domains\
	%{?with_ucspi:$RPM_BUILD_ROOT/etc/vpopmail/} \
	$RPM_BUILD_ROOT%{_sbindir} \
	$RPM_BUILD_ROOT%{_includedir}/vpopmail \
	$RPM_BUILD_ROOT{%{_docdir},%{_libdir}}

install vpopmail.h	$RPM_BUILD_ROOT%{_includedir}/vpopmail
install config.h	$RPM_BUILD_ROOT%{_includedir}/vpopmail
install config.h	$RPM_BUILD_ROOT%{_includedir}/vpopmail/vpopmail_config.h
install vauth.h		$RPM_BUILD_ROOT%{_includedir}/vpopmail
install vchkpw vdelivermail clearopensmtp vadddomain \
	vdeldomain vpasswd vadduser vdeluser vaddaliasdomain vsetuserquota \
	vpopbull vdeloldusers vmoduser valias vuserinfo vmkpasswd vipmap \
	vdominfo vconvert vqmaillocal vkill \
	$RPM_BUILD_ROOT%{_sbindir}

install libvpopmail.a $RPM_BUILD_ROOT%{_libdir}
#install $RPM_BUILD_ROOT%{dest}/domains

%clean
rm -rf $RPM_BUILD_ROOT

%pre
%groupadd -g 121 vchkpw
%useradd -u 121 -g 121 -d /usr/share/empty -s /bin/false -c "VPOPMAIL user" vpopmail

%postun
if [ "$1" = "0" ]; then
	%userremove vpopmail
	%groupremove vchkpw
fi

%files
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog FAQ README* UPGRADE doc/doc_html doc/man_html ldap oracle
%attr(755,vpopmail,vchkpw) %{_sbindir}/*
%dir %{dest}
%attr(700,vpopmail,vchkpw) %dir %{dest}/domains
%{?with_ucspi:%attr(700,vpopmail,vchkpw) %dir /etc/vpopmail}

%files devel
%defattr(644,root,root,755)
%{_libdir}/libvpopmail.a
%{_includedir}/vpopmail