1 # $Id: courier-authlib.spec.in,v 1.18 2009/12/18 04:24:20 mrsam Exp $
3 # Copyright 1998 - 2008 Double Precision, Inc. See COPYING for
4 # distribution information.
6 # No dist tag from mock; detect mandrake, redhat, etc. the old fashioned way
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"
)
10 %define courier_release
%{nil}
13 ################################################################################
17 Release: 1%{?dist}%{?courier_release}
18 Summary: Courier authentication library
20 Group: System Environment
/Daemons
22 URL: http
://www.courier
-mta.org
24 ################################################################################
26 Source: http
://dl.sourceforge.net
/courier
/%{name}-%{version}.tar.bz2
28 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
30 ################################################################################
32 BuildRequires
: libtool
33 BuildRequires
: openldap
-devel
34 BuildRequires
: mysql
-devel zlib
-devel
35 BuildRequires
: postgresql
-devel
36 BuildRequires
: gdbm
-devel
37 BuildRequires
: pam
-devel
39 BuildRequires
: gcc
-c
++
40 BuildRequires
: redhat
-rpm
-config
42 BuildRequires
: %{_includedir}/ltdl.h
44 %if 0%
(rpm
-q redhat
-release
>/dev
/null
2>&1 || rpm
-q fedora
-release
>/dev
/null
2>&1 ||
exit 0; echo "
1"
)
45 BuildRequires
: redhat
-rpm
-config
49 Requires(post
): /sbin
/chkconfig
50 Requires(preun
): /sbin
/chkconfig
52 # Provides by symlinks in this release, for compatibility with 0.60,
53 # will be removed in 0.62. This is temporary hack:
55 %define dummysuffix %
(test "
%{_lib}"
= "lib64"
&& echo '
()(64bit
)'
)
57 Provides: libcourierauth.so
.0%{dummysuffix} libcourierauthsasl.so.0%{dummysuffix} libcourierauthsaslclient.so.0%{dummysuffix} libcourierauthcommon.so.0%{dummysuffix}
59 ################################################################################
62 The Courier authentication library provides authentication services
for
63 other Courier applications.
65 ################################################################################
68 Summary: Development libraries
for the Courier authentication library
69 Group: Development
/Libraries
70 Requires: courier
-authlib
= 0:%{version}-%{release}
73 This package contains the development libraries and files needed to compile
74 Courier packages that use this authentication library. Install this
75 package
in order to build the rest of the Courier packages. After they are
76 built and installed this package can be removed. Files
in this package
77 are not needed at runtime.
79 ################################################################################
83 Summary: userdb support
for the Courier authentication library
84 Group: System Environment
/Daemons
85 Requires: courier
-authlib
= 0:%{version}-%{release}
88 This package installs the userdb support
for the Courier authentication
89 library. Userdb is a simple way to manage virtual mail accounts using
90 a GDBM
-based database file.
91 Install this package
in order to be able to authenticate with userdb.
93 ################################################################################
97 Summary: LDAP support
for the Courier authentication library
98 Group: System Environment
/Daemons
99 Requires: courier
-authlib
= 0:%{version}-%{release}
102 This package installs LDAP support
for the Courier authentication library.
103 Install this package
in order to be able to authenticate using LDAP.
105 ################################################################################
109 Summary: MySQL support
for the Courier authentication library
110 Group: System Environment
/Daemons
111 Requires: courier
-authlib
= 0:%{version}-%{release}
114 This package installs MySQL support
for the Courier authentication library.
115 Install this package
in order to be able to authenticate using MySQL.
117 ################################################################################
121 Summary: MySQL support
for the Courier authentication library
122 Group: System Environment
/Daemons
123 Requires: courier
-authlib
= 0:%{version}-%{release}
126 This package installs PostgreSQL support
for the Courier authentication
128 Install this package
in order to be able to authenticate using PostgreSQL.
130 ################################################################################
134 Summary: External authentication module that communicates via pipes
135 Group: System Environment
/Daemons
136 Requires: courier
-authlib
= 0:%{version}-%{release}
139 This package installs the authpipe module
, which is a generic plugin
140 that enables authentication requests to be serviced by an external
141 program
, then communicates through messages on stdin and stdout.
143 ################################################################################
147 %configure -C
--with
-redhat
150 %{__make} -s %{_smp_mflags}
153 rm -rf $RPM_BUILD_ROOT
154 MAKEFLAGS
= %{__make} -j
1 install DESTDIR
=$RPM_BUILD_ROOT
155 %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/courier
-authlib
/*.a
156 %{__install} -m 555 sysconftool $RPM_BUILD_ROOT%{_libexecdir}/courier
-authlib
158 .
/courierauthconfig
--configfiles
>configtmp
162 cd $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon ||
exit 1
163 $d
/authmksock .
/socket ||
exit 1
165 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid.lock ||
exit 1
166 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid ||
exit 1
167 %{__chmod} 777 $RPM_BUILD_ROOT%{_localstatedir}/spool
/authdaemon
/socket ||
exit 1
169 cat
>configfiles.base
<<EOF
170 %defattr(-,$mailuser
,$mailgroup
,-)
171 %{_sysconfdir}/authlib
172 %{_libexecdir}/courier
-authlib
173 %dir %{_libdir}/courier
-authlib
174 %dir %attr(750,$mailuser
,$mailgroup
) %{_localstatedir}/spool
/authdaemon
177 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.mysql
178 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.ldap
179 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pgsql
180 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.userdb
181 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pipe
182 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.devel
184 for f
in $RPM_BUILD_ROOT
%{_sbindir}/*
189 echo "
%{_sbindir}/$fn"
>>configfiles.userdb
192 echo "
%{_sbindir}/$fn"
>>configfiles.base
197 for f
in $RPM_BUILD_ROOT
%{_libdir}/courier
-authlib
/*
202 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pipe
205 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
208 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.mysql
211 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pgsql
214 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
217 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.userdb
220 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.base
224 %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d
/init.d
225 %{__install} -m
555 courier
-authlib.sysvinit \
226 $RPM_BUILD_ROOT
%{_sysconfdir}/rc.d
/init.d
/courier
-authlib
229 %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib
/*.dist
>/dev
/null
231 /sbin
/chkconfig
--del courier
-authlib
232 /sbin
/chkconfig
--add courier
-authlib
235 if test -x
%{_sbindir}/authdaemond
237 %{_sbindir}/authdaemond
>/dev
/null
2>&1 ||
/bin
/true
242 /sbin
/chkconfig
--del courier
-authlib
246 rm -rf $RPM_BUILD_ROOT
249 %files -f configfiles.base
250 %defattr(-,root
,root
,-)
251 %doc README README
*html README.authmysql.myownquery README.ldap
252 %doc NEWS COPYING
* AUTHORS ChangeLog
254 %ghost %attr(600, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid.lock
255 %ghost %attr(644, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid
256 %ghost %attr(-, root
, root
) %{_localstatedir}/spool
/authdaemon
/socket
259 %files -f configfiles.userdb userdb
260 %{_mandir}/man8
/*userdb
*
262 %files -f configfiles.devel devel
263 %defattr(-,root
,root
,-)
264 %{_bindir}/courierauthconfig
267 %doc authlib.html auth_
*.html
269 %files -f configfiles.ldap ldap
270 %defattr(-,root
,root
,-)
271 %doc authldap.schema authldap.ldif
273 %files -f configfiles.mysql mysql
275 %files -f configfiles.pgsql pgsql
277 %files -f configfiles.pipe pipe
281 * Thu Sep
7 2006 Chris Petersen
<rpm@forevermore.net
> 0.58-2
282 - Make the spec a little prettier
283 - Replace BuildPreReq with BuildRequires
284 - Remove period from summaries
(rpmlint
)
285 - Fix release tag to use
%{?dist} macro
if it's present
286 - Change distro
-detection to use "rh" and "
fc"
for version detection
, and add support
for mandriva
288 * Sun Oct
3 2004 Mr. Sam
<sam@email
-scan.com
> 0.50-1