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
42 BuildRequires
: courier
-unicode
-devel
44 BuildRequires
: %{_includedir}/ltdl.h
46 %if 0%
(rpm
-q redhat
-release
>/dev
/null
2>&1 || rpm
-q fedora
-release
>/dev
/null
2>&1 ||
exit 0; echo "
1"
)
47 BuildRequires
: redhat
-rpm
-config
51 Requires(post
): systemd
52 Requires(preun
): systemd
53 Requires(postun
): systemd
55 Requires(post
): /sbin
/chkconfig
56 Requires(preun
): /sbin
/chkconfig
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.
119 Summary: SQLite support
for the Courier authentication library
120 Group: System Environment
/Daemons
121 Requires: courier
-authlib
= 0:%{version}-%{release}
124 This package installs SQLite support
for the Courier authentication library.
125 Install this package
in order to be able to authenticate using an SQLite
-based
128 ################################################################################
132 Summary: PostgreSQL support
for the Courier authentication library
133 Group: System Environment
/Daemons
134 Requires: courier
-authlib
= 0:%{version}-%{release}
137 This package installs PostgreSQL support
for the Courier authentication
139 Install this package
in order to be able to authenticate using PostgreSQL.
141 ################################################################################
145 Summary: External authentication module that communicates via pipes
146 Group: System Environment
/Daemons
147 Requires: courier
-authlib
= 0:%{version}-%{release}
150 This package installs the authpipe module
, which is a generic plugin
151 that enables authentication requests to be serviced by an external
152 program
, then communicates through messages on stdin and stdout.
154 ################################################################################
158 PATH
=/usr
/bin
:$PATH
%configure -C
--with
-redhat
161 %{__make} -s %{_smp_mflags}
164 rm -rf $RPM_BUILD_ROOT
165 MAKEFLAGS
= %{__make} -j
1 install DESTDIR
=$RPM_BUILD_ROOT
166 %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/courier
-authlib
/*.a
167 %{__install} -m 555 sysconftool $RPM_BUILD_ROOT%{_libexecdir}/courier
-authlib
169 .
/courierauthconfig
--configfiles
>configtmp
173 cd $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon ||
exit 1
174 $d
/authmksock .
/socket ||
exit 1
176 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid.lock ||
exit 1
177 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid ||
exit 1
178 %{__chmod} 777 $RPM_BUILD_ROOT%{_localstatedir}/spool
/authdaemon
/socket ||
exit 1
180 cat
>configfiles.base
<<EOF
181 %defattr(-,$mailuser
,$mailgroup
,-)
182 %{_sysconfdir}/authlib
183 %{_libexecdir}/courier
-authlib
184 %dir %{_libdir}/courier
-authlib
185 %dir %attr(750,$mailuser
,$mailgroup
) %{_localstatedir}/spool
/authdaemon
188 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.mysql
189 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.sqlite
190 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.ldap
191 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pgsql
192 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.userdb
193 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pipe
194 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.devel
196 for f
in $RPM_BUILD_ROOT
%{_sbindir}/*
201 echo "
%{_sbindir}/$fn"
>>configfiles.userdb
204 echo "
%{_sbindir}/$fn"
>>configfiles.base
209 for f
in $RPM_BUILD_ROOT
%{_libdir}/courier
-authlib
/*
213 # Remove *.la for authentication modules, keep the ones
214 # for client libraries. Do this before we sort them into buckets,
232 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pipe
235 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
238 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.mysql
241 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.sqlite
244 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pgsql
247 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
250 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.userdb
253 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.base
258 %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}
259 %{__install} -m 555 courier-authlib.sysvinit $RPM_BUILD_ROOT%{_datadir}
261 %{__mkdir_p} $RPM_BUILD_ROOT
/lib
/systemd
/system
262 %{__install} -m
644 courier
-authlib.service $RPM_BUILD_ROOT
/lib
/systemd
/system
264 %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d
/init.d
265 %{__install} -m
555 courier
-authlib.sysvinit \
266 $RPM_BUILD_ROOT
%{_sysconfdir}/rc.d
/init.d
/courier
-authlib
270 %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib
/*.dist
>/dev
/null
272 if test -f
/etc
/init.d
/courier
-authlib
276 /sbin
/chkconfig
--del courier
-authlib
277 /bin
/systemctl stop courier
-authlib.service ||
:
279 %systemd_post courier
-authlib.service
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 %systemd_preun courier
-authlib.service
295 /sbin
/chkconfig
--del courier
-authlib
301 %systemd_postun_with_restart courier
-authlib.service
305 rm -rf $RPM_BUILD_ROOT
308 %files -f configfiles.base
309 %defattr(-,root
,root
,-)
310 %doc README README
*html README.authmysql.myownquery README.ldap
311 %doc NEWS COPYING
* AUTHORS ChangeLog
313 /lib
/systemd
/system
/*
314 %attr(755, bin
, bin
) %{_datadir}/courier
-authlib.sysvinit
318 %ghost %attr(600, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid.lock
319 %ghost %attr(644, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid
320 %ghost %attr(-, root
, root
) %{_localstatedir}/spool
/authdaemon
/socket
323 %files -f configfiles.userdb userdb
324 %{_mandir}/man8
/*userdb
*
326 %files -f configfiles.devel devel
327 %defattr(-,root
,root
,-)
328 %{_bindir}/courierauthconfig
331 %{_libdir}/courier
-authlib
/*.la
332 %doc authlib.html auth_
*.html
334 %files -f configfiles.ldap ldap
335 %defattr(-,root
,root
,-)
336 %doc authldap.schema authldap.ldif
338 %files -f configfiles.mysql mysql
340 %files -f configfiles.sqlite sqlite
342 %files -f configfiles.pgsql pgsql
344 %files -f configfiles.pipe pipe
348 * Thu Sep
7 2006 Chris Petersen
<rpm@forevermore.net
> 0.58-2
349 - Make the spec a little prettier
350 - Replace BuildPreReq with BuildRequires
351 - Remove period from summaries
(rpmlint
)
352 - Fix release tag to use
%{?dist} macro
if it's present
353 - Change distro
-detection to use "rh" and "
fc"
for version detection
, and add support
for mandriva
355 * Sun Oct
3 2004 Mr. Sam
<sam@email
-scan.com
> 0.50-1