1 # $Id: courier-authlib.spec.in,v 1.12 2007/10/07 02:50:45 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"
)
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 ################################################################################
55 The Courier authentication library provides authentication services
for
56 other Courier applications.
58 ################################################################################
61 Summary: Development libraries
for the Courier authentication library
62 Group: Development
/Libraries
63 Requires: courier
-authlib
= 0:%{version}-%{release}
66 This package contains the development libraries and files needed to compile
67 Courier packages that use this authentication library. Install this
68 package
in order to build the rest of the Courier packages. After they are
69 built and installed this package can be removed. Files
in this package
70 are not needed at runtime.
72 ################################################################################
76 Summary: userdb support
for the Courier authentication library
77 Group: System Environment
/Daemons
78 Requires: courier
-authlib
= 0:%{version}-%{release}
81 This package installs the userdb support
for the Courier authentication
82 library. Userdb is a simple way to manage virtual mail accounts using
83 a GDBM
-based database file.
84 Install this package
in order to be able to authenticate with userdb.
86 ################################################################################
90 Summary: LDAP support
for the Courier authentication library
91 Group: System Environment
/Daemons
92 Requires: courier
-authlib
= 0:%{version}-%{release}
95 This package installs LDAP support
for the Courier authentication library.
96 Install this package
in order to be able to authenticate using LDAP.
98 ################################################################################
102 Summary: MySQL support
for the Courier authentication library
103 Group: System Environment
/Daemons
104 Requires: courier
-authlib
= 0:%{version}-%{release}
107 This package installs MySQL support
for the Courier authentication library.
108 Install this package
in order to be able to authenticate using MySQL.
110 ################################################################################
114 Summary: MySQL support
for the Courier authentication library
115 Group: System Environment
/Daemons
116 Requires: courier
-authlib
= 0:%{version}-%{release}
119 This package installs PostgreSQL support
for the Courier authentication
121 Install this package
in order to be able to authenticate using PostgreSQL.
123 ################################################################################
127 Summary: External authentication module that communicates via pipes
128 Group: System Environment
/Daemons
129 Requires: courier
-authlib
= 0:%{version}-%{release}
132 This package installs the authpipe module
, which is a generic plugin
133 that enables authentication requests to be serviced by an external
134 program
, then communicates through messages on stdin and stdout.
136 ################################################################################
140 %configure --with
-redhat
143 %{__make} -s %{_smp_mflags}
146 rm -rf $RPM_BUILD_ROOT
147 MAKEFLAGS
= %{__make} -j
1 install DESTDIR
=$RPM_BUILD_ROOT
148 %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/courier
-authlib
/*.a
149 %{__install} -m 555 sysconftool $RPM_BUILD_ROOT%{_libexecdir}/courier
-authlib
150 %{__install} -m 555 authmigrate $RPM_BUILD_ROOT%{_libexecdir}/courier
-authlib
152 .
/courierauthconfig
--configfiles
>configtmp
155 .
/authmksock $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/socket ||
exit 1
156 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid.lock ||
exit 1
157 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid ||
exit 1
158 %{__chmod} 777 $RPM_BUILD_ROOT%{_localstatedir}/spool
/authdaemon
/socket ||
exit 1
160 cat
>configfiles.base
<<EOF
161 %defattr(-,$mailuser
,$mailgroup
,-)
162 %{_sysconfdir}/authlib
163 %{_libexecdir}/courier
-authlib
164 %dir %{_libdir}/courier
-authlib
165 %dir %attr(750,$mailuser
,$mailgroup
) %{_localstatedir}/spool
/authdaemon
168 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.mysql
169 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.ldap
170 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pgsql
171 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.userdb
172 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pipe
173 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.devel
175 for f
in $RPM_BUILD_ROOT
%{_sbindir}/*
180 echo "
%{_sbindir}/$fn"
>>configfiles.userdb
183 echo "
%{_sbindir}/$fn"
>>configfiles.base
188 for f
in $RPM_BUILD_ROOT
%{_libdir}/courier
-authlib
/*
193 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pipe
196 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
199 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.mysql
202 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pgsql
205 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
208 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.userdb
211 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.base
215 %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d
/init.d
216 %{__install} -m
555 courier
-authlib.sysvinit \
217 $RPM_BUILD_ROOT
%{_sysconfdir}/rc.d
/init.d
/courier
-authlib
220 %{_libexecdir}/courier
-authlib
/authmigrate
>/dev
/null
221 %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib
/*.dist
>/dev
/null
223 /sbin
/chkconfig
--del courier
-authlib
224 /sbin
/chkconfig
--add courier
-authlib
227 if test -x
%{_sbindir}/authdaemond
229 %{_sbindir}/authdaemond
>/dev
/null
2>&1 ||
/bin
/true
234 /sbin
/chkconfig
--del courier
-authlib
238 rm -rf $RPM_BUILD_ROOT
241 %files -f configfiles.base
242 %defattr(-,root
,root
,-)
243 %doc README README
*html README.authmysql.myownquery README.ldap
244 %doc NEWS COPYING
* AUTHORS ChangeLog authldap.schema
246 %ghost %attr(600, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid.lock
247 %ghost %attr(644, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid
248 %ghost %attr(-, root
, root
) %{_localstatedir}/spool
/authdaemon
/socket
251 %files -f configfiles.userdb userdb
252 %{_mandir}/man8
/*userdb
*
254 %files -f configfiles.devel devel
255 %defattr(-,root
,root
,-)
256 %{_bindir}/courierauthconfig
259 %doc authlib.html auth_
*.html
261 %files -f configfiles.ldap ldap
262 %defattr(-,root
,root
,-)
265 %files -f configfiles.mysql mysql
267 %files -f configfiles.pgsql pgsql
269 %files -f configfiles.pipe pipe
273 * Thu Sep
7 2006 Chris Petersen
<rpm@forevermore.net
> 0.58-2
274 - Make the spec a little prettier
275 - Replace BuildPreReq with BuildRequires
276 - Remove period from summaries
(rpmlint
)
277 - Fix release tag to use
%{?dist} macro
if it's present
278 - Change distro
-detection to use "rh" and "
fc"
for version detection
, and add support
for mandriva
280 * Sun Oct
3 2004 Mr. Sam
<sam@email
-scan.com
> 0.50-1