2 # Copyright 1998 - 2010 Double Precision, Inc. See COPYING for
3 # distribution information.
5 # No dist tag from mock; detect mandrake, redhat, etc. the old fashioned way
7 %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 %define courier_release
%{nil}
12 %define using_systemd %
(test -d
/etc
/systemd
&& echo 1 ||
echo 0)
14 ################################################################################
18 Release: 1%{?dist}%{?courier_release}
19 Summary: Courier authentication library
21 Group: System Environment
/Daemons
23 URL: http
://www.courier
-mta.org
25 ################################################################################
27 Source: http
://dl.sourceforge.net
/courier
/%{name}-%{version}.tar.bz2
29 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
31 ################################################################################
33 BuildRequires
: libtool
34 BuildRequires
: openldap
-devel
35 BuildRequires
: mysql
-devel zlib
-devel sqlite
-devel
36 BuildRequires
: postgresql
-devel
37 BuildRequires
: gdbm
-devel
38 BuildRequires
: pam
-devel
40 BuildRequires
: gcc
-c
++
41 BuildRequires
: redhat
-rpm
-config
43 BuildRequires
: %{_includedir}/ltdl.h
45 %if 0%
(rpm
-q redhat
-release
>/dev
/null
2>&1 || rpm
-q fedora
-release
>/dev
/null
2>&1 ||
exit 0; echo "
1"
)
46 BuildRequires
: redhat
-rpm
-config
50 Requires(post
): /bin
/systemctl
51 Requires(preun
): /bin
/systemctl
53 Requires(post
): /sbin
/chkconfig
54 Requires(preun
): /sbin
/chkconfig
57 ################################################################################
60 The Courier authentication library provides authentication services
for
61 other Courier applications.
63 ################################################################################
66 Summary: Development libraries
for the Courier authentication library
67 Group: Development
/Libraries
68 Requires: courier
-authlib
= 0:%{version}-%{release}
71 This package contains the development libraries and files needed to compile
72 Courier packages that use this authentication library. Install this
73 package
in order to build the rest of the Courier packages. After they are
74 built and installed this package can be removed. Files
in this package
75 are not needed at runtime.
77 ################################################################################
81 Summary: Userdb support
for the Courier authentication library
82 Group: System Environment
/Daemons
83 Requires: courier
-authlib
= 0:%{version}-%{release}
86 This package installs the userdb support
for the Courier authentication
87 library. Userdb is a simple way to manage virtual mail accounts using
88 a GDBM
-based database file.
89 Install this package
in order to be able to authenticate with userdb.
91 ################################################################################
95 Summary: LDAP support
for the Courier authentication library
96 Group: System Environment
/Daemons
97 Requires: courier
-authlib
= 0:%{version}-%{release}
100 This package installs LDAP support
for the Courier authentication library.
101 Install this package
in order to be able to authenticate using LDAP.
103 ################################################################################
107 Summary: MySQL support
for the Courier authentication library
108 Group: System Environment
/Daemons
109 Requires: courier
-authlib
= 0:%{version}-%{release}
112 This package installs MySQL support
for the Courier authentication library.
113 Install this package
in order to be able to authenticate using MySQL.
117 Summary: SQLite support
for the Courier authentication library
118 Group: System Environment
/Daemons
119 Requires: courier
-authlib
= 0:%{version}-%{release}
122 This package installs SQLite support
for the Courier authentication library.
123 Install this package
in order to be able to authenticate using an SQLite
-based
126 ################################################################################
130 Summary: PostgreSQL support
for the Courier authentication library
131 Group: System Environment
/Daemons
132 Requires: courier
-authlib
= 0:%{version}-%{release}
135 This package installs PostgreSQL support
for the Courier authentication
137 Install this package
in order to be able to authenticate using PostgreSQL.
139 ################################################################################
143 Summary: External authentication module that communicates via pipes
144 Group: System Environment
/Daemons
145 Requires: courier
-authlib
= 0:%{version}-%{release}
148 This package installs the authpipe module
, which is a generic plugin
149 that enables authentication requests to be serviced by an external
150 program
, then communicates through messages on stdin and stdout.
152 ################################################################################
156 PATH
=/usr
/bin
:$PATH
%configure -C
--with
-redhat
159 %{__make} -s %{_smp_mflags}
162 rm -rf $RPM_BUILD_ROOT
163 MAKEFLAGS
= %{__make} -j
1 install DESTDIR
=$RPM_BUILD_ROOT
164 %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/courier
-authlib
/*.a
165 %{__install} -m 555 sysconftool $RPM_BUILD_ROOT%{_libexecdir}/courier
-authlib
167 .
/courierauthconfig
--configfiles
>configtmp
171 cd $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon ||
exit 1
172 $d
/authmksock .
/socket ||
exit 1
174 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid.lock ||
exit 1
175 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid ||
exit 1
176 %{__chmod} 777 $RPM_BUILD_ROOT%{_localstatedir}/spool
/authdaemon
/socket ||
exit 1
178 cat
>configfiles.base
<<EOF
179 %defattr(-,$mailuser
,$mailgroup
,-)
180 %{_sysconfdir}/authlib
181 %{_libexecdir}/courier
-authlib
182 %dir %{_libdir}/courier
-authlib
183 %dir %attr(750,$mailuser
,$mailgroup
) %{_localstatedir}/spool
/authdaemon
186 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.mysql
187 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.sqlite
188 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.ldap
189 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pgsql
190 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.userdb
191 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pipe
192 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.devel
194 for f
in $RPM_BUILD_ROOT
%{_sbindir}/*
199 echo "
%{_sbindir}/$fn"
>>configfiles.userdb
202 echo "
%{_sbindir}/$fn"
>>configfiles.base
207 for f
in $RPM_BUILD_ROOT
%{_libdir}/courier
-authlib
/*
211 # Remove *.la for authentication modules, keep the ones
212 # for client libraries. Do this before we sort them into buckets,
230 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pipe
233 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
236 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.mysql
239 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.sqlite
242 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pgsql
245 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
248 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.userdb
251 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.base
256 %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}
257 %{__install} -m 555 courier-authlib.sysvinit $RPM_BUILD_ROOT%{_datadir}
259 %{__mkdir_p} $RPM_BUILD_ROOT
/lib
/systemd
/system
260 %{__install} -m
644 courier
-authlib.service $RPM_BUILD_ROOT
/lib
/systemd
/system
262 %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d
/init.d
263 %{__install} -m
555 courier
-authlib.sysvinit \
264 $RPM_BUILD_ROOT
%{_sysconfdir}/rc.d
/init.d
/courier
-authlib
268 %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib
/*.dist
>/dev
/null
270 if test -f
/etc
/init.d
/courier
-authlib
274 /sbin
/chkconfig
--del courier
-authlib
275 /bin
/systemctl stop courier
-authlib.service ||
:
278 /bin
/systemctl daemon
-reload ||
:
279 /bin
/systemctl
enable courier
-authlib.service
&> /dev
/null ||
:
281 /sbin
/chkconfig
--del courier
-authlib
282 /sbin
/chkconfig
--add courier
-authlib
285 if test -x
%{_sbindir}/authdaemond
287 %{_sbindir}/authdaemond stop
>/dev
/null
2>&1 ||
/bin
/true
293 /bin
/systemctl stop courier
-authlib.service
294 /bin
/systemctl disable courier
-authlib.service
296 /sbin
/chkconfig
--del courier
-authlib
302 /bin
/systemctl daemon
-reload ||
:
306 rm -rf $RPM_BUILD_ROOT
309 %files -f configfiles.base
310 %defattr(-,root
,root
,-)
311 %doc README README
*html README.authmysql.myownquery README.ldap
312 %doc NEWS COPYING
* AUTHORS ChangeLog
314 /lib
/systemd
/system
/*
315 %attr(755, bin
, bin
) %{_datadir}/courier
-authlib.sysvinit
319 %ghost %attr(600, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid.lock
320 %ghost %attr(644, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid
321 %ghost %attr(-, root
, root
) %{_localstatedir}/spool
/authdaemon
/socket
324 %files -f configfiles.userdb userdb
325 %{_mandir}/man8
/*userdb
*
327 %files -f configfiles.devel devel
328 %defattr(-,root
,root
,-)
329 %{_bindir}/courierauthconfig
332 %{_libdir}/courier
-authlib
/*.la
333 %doc authlib.html auth_
*.html
335 %files -f configfiles.ldap ldap
336 %defattr(-,root
,root
,-)
337 %doc authldap.schema authldap.ldif
339 %files -f configfiles.mysql mysql
341 %files -f configfiles.sqlite sqlite
343 %files -f configfiles.pgsql pgsql
345 %files -f configfiles.pipe pipe
349 * Thu Sep
7 2006 Chris Petersen
<rpm@forevermore.net
> 0.58-2
350 - Make the spec a little prettier
351 - Replace BuildPreReq with BuildRequires
352 - Remove period from summaries
(rpmlint
)
353 - Fix release tag to use
%{?dist} macro
if it's present
354 - Change distro
-detection to use "rh" and "
fc"
for version detection
, and add support
for mandriva
356 * Sun Oct
3 2004 Mr. Sam
<sam@email
-scan.com
> 0.50-1