1 # $Id: courier-authlib.spec.in,v 1.8 2007/04/22 18:38:04 mrsam Exp $
3 # Copyright 1998 - 2006 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"
)
11 ################################################################################
15 Release: 10%{courier_release}
16 Summary: Courier authentication library
18 Group: System Environment
/Daemons
20 URL: http
://www.courier
-mta.org
22 ################################################################################
24 Source: http
://dl.sourceforge.net
/courier
/%{name}-%{version}.tar.bz2
26 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
28 ################################################################################
30 BuildRequires
: libtool
31 BuildRequires
: openldap
-devel
32 BuildRequires
: mysql
-devel zlib
-devel
33 BuildRequires
: postgresql
-devel
34 BuildRequires
: gdbm
-devel
35 BuildRequires
: pam
-devel
37 BuildRequires
: gcc
-c
++
39 BuildRequires
: %{_includedir}/ltdl.h
41 %if 0%
(rpm
-q redhat
-release
>/dev
/null
2>&1 || rpm
-q fedora
-release
>/dev
/null
2>&1 ||
exit 0; echo "
1"
)
42 BuildRequires
: redhat
-rpm
-config
46 Requires(post
): /sbin
/chkconfig
47 Requires(preun
): /sbin
/chkconfig
49 ################################################################################
52 The Courier authentication library provides authentication services
for
53 other Courier applications.
55 ################################################################################
58 Summary: Development libraries
for the Courier authentication library
59 Group: Development
/Libraries
60 Requires: courier
-authlib
= 0:%{version}-%{release}
63 This package contains the development libraries and files needed to compile
64 Courier packages that use this authentication library. Install this
65 package
in order to build the rest of the Courier packages. After they are
66 built and installed this package can be removed. Files
in this package
67 are not needed at runtime.
69 ################################################################################
73 Summary: userdb support
for the Courier authentication library
74 Group: System Environment
/Daemons
75 Requires: courier
-authlib
= 0:%{version}-%{release}
78 This package installs the userdb support
for the Courier authentication
79 library. Userdb is a simple way to manage virtual mail accounts using
80 a GDBM
-based database file.
81 Install this package
in order to be able to authenticate with userdb.
83 ################################################################################
87 Summary: LDAP support
for the Courier authentication library
88 Group: System Environment
/Daemons
89 Requires: courier
-authlib
= 0:%{version}-%{release}
92 This package installs LDAP support
for the Courier authentication library.
93 Install this package
in order to be able to authenticate using LDAP.
95 ################################################################################
99 Summary: MySQL support
for the Courier authentication library
100 Group: System Environment
/Daemons
101 Requires: courier
-authlib
= 0:%{version}-%{release}
104 This package installs MySQL support
for the Courier authentication library.
105 Install this package
in order to be able to authenticate using MySQL.
107 ################################################################################
111 Summary: MySQL support
for the Courier authentication library
112 Group: System Environment
/Daemons
113 Requires: courier
-authlib
= 0:%{version}-%{release}
116 This package installs PostgreSQL support
for the Courier authentication
118 Install this package
in order to be able to authenticate using PostgreSQL.
120 ################################################################################
124 Summary: External authentication module that communicates via pipes
125 Group: System Environment
/Daemons
126 Requires: courier
-authlib
= 0:%{version}-%{release}
129 This package installs the authpipe module
, which is a generic plugin
130 that enables authentication requests to be serviced by an external
131 program
, then communicates through messages on stdin and stdout.
133 ################################################################################
137 %configure --with
-redhat
140 %{__make} %{_smp_mflags}
143 rm -rf $RPM_BUILD_ROOT
144 MAKEFLAGS
= %{__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
149 .
/courierauthconfig
--configfiles
>configtmp
152 .
/authmksock $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/socket ||
exit 1
153 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid.lock ||
exit 1
154 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid ||
exit 1
155 %{__chmod} 777 $RPM_BUILD_ROOT%{_localstatedir}/spool
/authdaemon
/socket ||
exit 1
157 cat
>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
165 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.mysql
166 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.ldap
167 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pgsql
168 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.userdb
169 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pipe
170 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.devel
172 for f
in $RPM_BUILD_ROOT
%{_sbindir}/*
177 echo "
%{_sbindir}/$fn"
>>configfiles.userdb
180 echo "
%{_sbindir}/$fn"
>>configfiles.base
185 for f
in $RPM_BUILD_ROOT
%{_libdir}/courier
-authlib
/*
190 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pipe
193 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
196 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.mysql
199 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pgsql
202 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
205 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.userdb
208 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.base
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
217 %{_libexecdir}/courier
-authlib
/authmigrate
>/dev
/null
218 %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib
/*.dist
>/dev
/null
220 /sbin
/chkconfig
--del courier
-authlib
221 /sbin
/chkconfig
--add courier
-authlib
224 if test -x
%{_sbindir}/authdaemond
226 %{_sbindir}/authdaemond
>/dev
/null
2>&1 ||
/bin
/true
231 /sbin
/chkconfig
--del courier
-authlib
235 rm -rf $RPM_BUILD_ROOT
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
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
248 %files -f configfiles.userdb userdb
249 %{_mandir}/man8
/*userdb
*
251 %files -f configfiles.devel devel
252 %defattr(-,root
,root
,-)
253 %{_bindir}/courierauthconfig
256 %doc authlib.html auth_
*.html
258 %files -f configfiles.ldap ldap
259 %defattr(-,root
,root
,-)
262 %files -f configfiles.mysql mysql
264 %files -f configfiles.pgsql pgsql
266 %files -f configfiles.pipe pipe
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
277 * Sun Oct
3 2004 Mr. Sam
<sam@email
-scan.com
> 0.50-1