2 # Copyright 1998 - 2017 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
://downloads.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
48 BuildRequires
: /usr
/bin
/ps
52 Requires(post
): systemd
53 Requires(preun
): systemd
54 Requires(postun
): systemd
56 Requires(post
): /sbin
/chkconfig
57 Requires(preun
): /sbin
/chkconfig
60 %define need_perl_generators %
(if rpm
-q fedora
-release
>/dev
/null
2>/dev
/null
; then echo "
1"
; exit 0; fi; echo "
1"
; exit 1)
62 %if %need_perl_generators
63 BuildRequires
: perl
-generators
66 ################################################################################
69 The Courier authentication library provides authentication services
for
70 other Courier applications.
72 ################################################################################
75 Summary: Development libraries
for the Courier authentication library
76 Group: Development
/Libraries
77 Requires: courier
-authlib
= 0:%{version}-%{release}
80 This package contains the development libraries and files needed to compile
81 Courier packages that use this authentication library. Install this
82 package
in order to build the rest of the Courier packages. After they are
83 built and installed this package can be removed. Files
in this package
84 are not needed at runtime.
86 ################################################################################
90 Summary: Userdb support
for the Courier authentication library
91 Group: System Environment
/Daemons
92 Requires: courier
-authlib
= 0:%{version}-%{release}
95 This package installs the userdb support
for the Courier authentication
96 library. Userdb is a simple way to manage virtual mail accounts using
97 a GDBM
-based database file.
98 Install this package
in order to be able to authenticate with userdb.
100 ################################################################################
104 Summary: LDAP support
for the Courier authentication library
105 Group: System Environment
/Daemons
106 Requires: courier
-authlib
= 0:%{version}-%{release}
109 This package installs LDAP support
for the Courier authentication library.
110 Install this package
in order to be able to authenticate using LDAP.
112 ################################################################################
116 Summary: MySQL support
for the Courier authentication library
117 Group: System Environment
/Daemons
118 Requires: courier
-authlib
= 0:%{version}-%{release}
121 This package installs MySQL support
for the Courier authentication library.
122 Install this package
in order to be able to authenticate using MySQL.
126 Summary: SQLite support
for the Courier authentication library
127 Group: System Environment
/Daemons
128 Requires: courier
-authlib
= 0:%{version}-%{release}
131 This package installs SQLite support
for the Courier authentication library.
132 Install this package
in order to be able to authenticate using an SQLite
-based
135 ################################################################################
139 Summary: PostgreSQL support
for the Courier authentication library
140 Group: System Environment
/Daemons
141 Requires: courier
-authlib
= 0:%{version}-%{release}
144 This package installs PostgreSQL support
for the Courier authentication
146 Install this package
in order to be able to authenticate using PostgreSQL.
148 ################################################################################
152 Summary: External authentication module that communicates via pipes
153 Group: System Environment
/Daemons
154 Requires: courier
-authlib
= 0:%{version}-%{release}
157 This package installs the authpipe module
, which is a generic plugin
158 that enables authentication requests to be serviced by an external
159 program
, then communicates through messages on stdin and stdout.
161 ################################################################################
165 PATH
=/usr
/bin
:$PATH
%configure -C
--with
-redhat
168 %{__make} -s %{_smp_mflags}
171 rm -rf $RPM_BUILD_ROOT
172 MAKEFLAGS
= %{__make} -j
1 install DESTDIR
=$RPM_BUILD_ROOT
173 %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/courier
-authlib
/*.a
174 %{__install} -m 555 sysconftool $RPM_BUILD_ROOT%{_libexecdir}/courier
-authlib
176 .
/courierauthconfig
--configfiles
>configtmp
180 cd $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon ||
exit 1
181 $d
/authmksock .
/socket ||
exit 1
183 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid.lock ||
exit 1
184 touch $RPM_BUILD_ROOT
%{_localstatedir}/spool
/authdaemon
/pid ||
exit 1
185 %{__chmod} 777 $RPM_BUILD_ROOT%{_localstatedir}/spool
/authdaemon
/socket ||
exit 1
187 cat
>configfiles.base
<<EOF
188 %defattr(-,$mailuser
,$mailgroup
,-)
189 %{_sysconfdir}/authlib
190 %{_libexecdir}/courier
-authlib
191 %dir %{_libdir}/courier
-authlib
192 %dir %attr(750,$mailuser
,$mailgroup
) %{_localstatedir}/spool
/authdaemon
195 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.mysql
196 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.sqlite
197 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.ldap
198 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pgsql
199 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.userdb
200 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.pipe
201 echo "
%defattr(-,$mailuser
,$mailgroup
,-)"
>configfiles.devel
203 for f
in $RPM_BUILD_ROOT
%{_sbindir}/*
208 echo "
%{_sbindir}/$fn"
>>configfiles.userdb
211 echo "
%{_sbindir}/$fn"
>>configfiles.base
216 for f
in $RPM_BUILD_ROOT
%{_libdir}/courier
-authlib
/*
220 # Remove *.la for authentication modules, keep the ones
221 # for client libraries. Do this before we sort them into buckets,
239 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pipe
242 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
245 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.mysql
248 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.sqlite
251 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.pgsql
254 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.ldap
257 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.userdb
260 echo "
%{_libdir}/courier
-authlib
/$fn"
>>configfiles.base
265 %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}
266 %{__install} -m 555 courier-authlib.sysvinit $RPM_BUILD_ROOT%{_datadir}
268 %{__mkdir_p} $RPM_BUILD_ROOT
/lib
/systemd
/system
269 %{__install} -m
644 courier
-authlib.service $RPM_BUILD_ROOT
/lib
/systemd
/system
271 %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d
/init.d
272 %{__install} -m
555 courier
-authlib.sysvinit \
273 $RPM_BUILD_ROOT
%{_sysconfdir}/rc.d
/init.d
/courier
-authlib
277 %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib
/*.dist
>/dev
/null
279 if test -f
/etc
/init.d
/courier
-authlib
283 /sbin
/chkconfig
--del courier
-authlib
284 /bin
/systemctl stop courier
-authlib.service ||
:
286 %systemd_post courier
-authlib.service
289 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
292 /sbin
/chkconfig
--del courier
-authlib
293 /sbin
/chkconfig
--add courier
-authlib
299 %systemd_preun courier
-authlib.service
301 /sbin
/chkconfig
--del courier
-authlib
309 /bin
/systemctl daemon
-reload
311 %systemd_postun_with_restart courier
-authlib.service
315 rm -rf $RPM_BUILD_ROOT
318 %files -f configfiles.base
319 %defattr(-,root
,root
,-)
320 %doc README README
*html README.authmysql.myownquery README.ldap
321 %doc NEWS COPYING
* AUTHORS ChangeLog
323 /lib
/systemd
/system
/*
324 %attr(755, bin
, bin
) %{_datadir}/courier
-authlib.sysvinit
328 %ghost %attr(600, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid.lock
329 %ghost %attr(644, root
, root
) %{_localstatedir}/spool
/authdaemon
/pid
330 %ghost %attr(-, root
, root
) %{_localstatedir}/spool
/authdaemon
/socket
333 %files -f configfiles.userdb userdb
334 %{_mandir}/man8
/*userdb
*
336 %files -f configfiles.devel devel
337 %defattr(-,root
,root
,-)
338 %{_bindir}/courierauthconfig
341 %{_libdir}/courier
-authlib
/*.la
342 %doc authlib.html auth_
*.html
344 %files -f configfiles.ldap ldap
345 %defattr(-,root
,root
,-)
346 %doc authldap.schema authldap.ldif
348 %files -f configfiles.mysql mysql
350 %files -f configfiles.sqlite sqlite
352 %files -f configfiles.pgsql pgsql
354 %files -f configfiles.pipe pipe
358 * Thu Sep
7 2006 Chris Petersen
<rpm@forevermore.net
> 0.58-2
359 - Make the spec a little prettier
360 - Replace BuildPreReq with BuildRequires
361 - Remove period from summaries
(rpmlint
)
362 - Fix release tag to use
%{?dist} macro
if it's present
363 - Change distro
-detection to use "rh" and "
fc"
for version detection
, and add support
for mandriva
365 * Sun Oct
3 2004 Mr. Sam
<sam@email
-scan.com
> 0.50-1