Revert the disabling of pam_setcred so that IMAP works as expected.
[hcoop/debian/courier-authlib.git] / courier-authlib.spec
CommitLineData
d9898ee8 1# $Id: courier-authlib.spec.in,v 1.8 2007/04/22 18:38:04 mrsam Exp $
2#
3# Copyright 1998 - 2006 Double Precision, Inc. See COPYING for
4# distribution information.
5
6# No dist tag from mock; detect mandrake, redhat, etc. the old fashioned way
7%if 0%{!?dist:1}
8%define courier_release %(test -e /etc/mandrake-release -o -e /etc/mandriva-release && release="mdk" ; if test $? != 0; then release="`rpm -q --queryformat='.rh%{VERSION}' redhat-release 2>/dev/null`" ; if test $? != 0 ; then release="`rpm -q --queryformat='.fc%{VERSION}' fedora-release 2>/dev/null`" ; if test $? != 0 ; then release="" ; fi ; fi ; fi ; echo "$release")
9%endif
10
11################################################################################
12
13Name: courier-authlib
14Version: 0.59.3
15Release: 10%{courier_release}
16Summary: Courier authentication library
17
18Group: System Environment/Daemons
19License: GPL
20URL: http://www.courier-mta.org
21
22################################################################################
23
24Source: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
25
26BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
27
28################################################################################
29
30BuildRequires: libtool
31BuildRequires: openldap-devel
32BuildRequires: mysql-devel zlib-devel
33BuildRequires: postgresql-devel
34BuildRequires: gdbm-devel
35BuildRequires: pam-devel
36BuildRequires: expect
37BuildRequires: gcc-c++
38
39BuildRequires: %{_includedir}/ltdl.h
40
41%if 0%(rpm -q redhat-release >/dev/null 2>&1 || rpm -q fedora-release >/dev/null 2>&1 || exit 0; echo "1")
42BuildRequires: redhat-rpm-config
43%endif
44
45
46Requires(post): /sbin/chkconfig
47Requires(preun): /sbin/chkconfig
48
49################################################################################
50
51%description
52The Courier authentication library provides authentication services for
53other Courier applications.
54
55################################################################################
56
57%package devel
58Summary: Development libraries for the Courier authentication library
59Group: Development/Libraries
60Requires: courier-authlib = 0:%{version}-%{release}
61
62%description devel
63This package contains the development libraries and files needed to compile
64Courier packages that use this authentication library. Install this
65package in order to build the rest of the Courier packages. After they are
66built and installed this package can be removed. Files in this package
67are not needed at runtime.
68
69################################################################################
70
71%package userdb
72
73Summary: userdb support for the Courier authentication library
74Group: System Environment/Daemons
75Requires: courier-authlib = 0:%{version}-%{release}
76
77%description userdb
78This package installs the userdb support for the Courier authentication
79library. Userdb is a simple way to manage virtual mail accounts using
80a GDBM-based database file.
81Install this package in order to be able to authenticate with userdb.
82
83################################################################################
84
85%package ldap
86
87Summary: LDAP support for the Courier authentication library
88Group: System Environment/Daemons
89Requires: courier-authlib = 0:%{version}-%{release}
90
91%description ldap
92This package installs LDAP support for the Courier authentication library.
93Install this package in order to be able to authenticate using LDAP.
94
95################################################################################
96
97%package mysql
98
99Summary: MySQL support for the Courier authentication library
100Group: System Environment/Daemons
101Requires: courier-authlib = 0:%{version}-%{release}
102
103%description mysql
104This package installs MySQL support for the Courier authentication library.
105Install this package in order to be able to authenticate using MySQL.
106
107################################################################################
108
109%package pgsql
110
111Summary: MySQL support for the Courier authentication library
112Group: System Environment/Daemons
113Requires: courier-authlib = 0:%{version}-%{release}
114
115%description pgsql
116This package installs PostgreSQL support for the Courier authentication
117library.
118Install this package in order to be able to authenticate using PostgreSQL.
119
120################################################################################
121
122%package pipe
123
124Summary: External authentication module that communicates via pipes
125Group: System Environment/Daemons
126Requires: courier-authlib = 0:%{version}-%{release}
127
128%description pipe
129This package installs the authpipe module, which is a generic plugin
130that enables authentication requests to be serviced by an external
131program, then communicates through messages on stdin and stdout.
132
133################################################################################
134
135%prep
136%setup -q
137%configure --with-redhat
138
139%build
140%{__make} %{_smp_mflags}
141
142%install
143rm -rf $RPM_BUILD_ROOT
144MAKEFLAGS= %{__make} -j 1 install DESTDIR=$RPM_BUILD_ROOT
145%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/courier-authlib/*.a
146%{__install} -m 555 sysconftool $RPM_BUILD_ROOT%{_libexecdir}/courier-authlib
147%{__install} -m 555 authmigrate $RPM_BUILD_ROOT%{_libexecdir}/courier-authlib
148
149./courierauthconfig --configfiles >configtmp
150. configtmp
151
152./authmksock $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/socket || exit 1
153touch $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/pid.lock || exit 1
154touch $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/pid || exit 1
155%{__chmod} 777 $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/socket || exit 1
156
157cat >configfiles.base <<EOF
158%defattr(-,$mailuser,$mailgroup,-)
159%{_sysconfdir}/authlib
160%{_libexecdir}/courier-authlib
161%dir %{_libdir}/courier-authlib
162%dir %attr(750,$mailuser,$mailgroup) %{_localstatedir}/spool/authdaemon
163EOF
164
165echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.mysql
166echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.ldap
167echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.pgsql
168echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.userdb
169echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.pipe
170echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.devel
171
172for f in $RPM_BUILD_ROOT%{_sbindir}/*
173do
174 fn=`basename $f`
175 case "$fn" in
176 *userdb*)
177 echo "%{_sbindir}/$fn" >>configfiles.userdb
178 ;;
179 *)
180 echo "%{_sbindir}/$fn" >>configfiles.base
181 ;;
182 esac
183done
184
185for f in $RPM_BUILD_ROOT%{_libdir}/courier-authlib/*
186do
187 fn=`basename $f`
188 case "$fn" in
189 libauthpipe*)
190 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.pipe
191 ;;
192 libauthldap*)
193 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap
194 ;;
195 libauthmysql*)
196 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.mysql
197 ;;
198 libauthpgsql*)
199 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.pgsql
200 ;;
201 libauthldap*)
202 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap
203 ;;
204 libauthuserdb*)
205 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.userdb
206 ;;
207 *)
208 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.base
209 ;;
210 esac
211done
212%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
213%{__install} -m 555 courier-authlib.sysvinit \
214 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/courier-authlib
215
216%post
217%{_libexecdir}/courier-authlib/authmigrate >/dev/null
218%{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib/*.dist >/dev/null
219
220/sbin/chkconfig --del courier-authlib
221/sbin/chkconfig --add courier-authlib
222
223%preun
224if test -x %{_sbindir}/authdaemond
225then
226 %{_sbindir}/authdaemond >/dev/null 2>&1 || /bin/true
227fi
228
229if test "$1" = "0"
230then
231 /sbin/chkconfig --del courier-authlib
232fi
233
234%clean
235rm -rf $RPM_BUILD_ROOT
236
237
238%files -f configfiles.base
239%defattr(-,root,root,-)
240%doc README README*html README.authmysql.myownquery README.ldap
241%doc NEWS COPYING* AUTHORS ChangeLog authldap.schema
242/etc/rc.d/init.d/*
243%ghost %attr(600, root, root) %{_localstatedir}/spool/authdaemon/pid.lock
244%ghost %attr(644, root, root) %{_localstatedir}/spool/authdaemon/pid
245%ghost %attr(-, root, root) %{_localstatedir}/spool/authdaemon/socket
246%{_mandir}/man1/*
247
248%files -f configfiles.userdb userdb
249%{_mandir}/man8/*userdb*
250
251%files -f configfiles.devel devel
252%defattr(-,root,root,-)
253%{_bindir}/courierauthconfig
254%{_includedir}/*
255%{_mandir}/man3/*
256%doc authlib.html auth_*.html
257
258%files -f configfiles.ldap ldap
259%defattr(-,root,root,-)
260%doc authldap.schema
261
262%files -f configfiles.mysql mysql
263
264%files -f configfiles.pgsql pgsql
265
266%files -f configfiles.pipe pipe
267
268%changelog
269
270* Thu Sep 7 2006 Chris Petersen <rpm@forevermore.net> 0.58-2
271- Make the spec a little prettier
272- Replace BuildPreReq with BuildRequires
273- Remove period from summaries (rpmlint)
274- Fix release tag to use %{?dist} macro if it's present
275- Change distro-detection to use "rh" and "fc" for version detection, and add support for mandriva
276
277* Sun Oct 3 2004 Mr. Sam <sam@email-scan.com> 0.50-1
278- Initial build.
279