Update changelog.
[hcoop/debian/courier-authlib.git] / courier-authlib.spec.in
1 # $Id: courier-authlib.spec.in,v 1.14 2008/07/13 14:53:39 mrsam Exp $
2 #
3 # Copyright 1998 - 2008 Double Precision, Inc. See COPYING for
4 # distribution information.
5
6 # No dist tag from mock; detect mandrake, redhat, etc. the old fashioned way
7 %if 0%{!?dist:1}
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")
9 %else
10 %define courier_release %{nil}
11 %endif
12
13 ################################################################################
14
15 Name: courier-authlib
16 Version: @VERSION@
17 Release: 1%{?dist}%{?courier_release}
18 Summary: Courier authentication library
19
20 Group: System Environment/Daemons
21 License: GPL
22 URL: http://www.courier-mta.org
23
24 ################################################################################
25
26 Source: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
27
28 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
29
30 ################################################################################
31
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
38 BuildRequires: expect
39 BuildRequires: gcc-c++
40 BuildRequires: redhat-rpm-config
41
42 BuildRequires: %{_includedir}/ltdl.h
43
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
46 %endif
47
48
49 Requires(post): /sbin/chkconfig
50 Requires(preun): /sbin/chkconfig
51
52 # Provides by symlinks in this release, for compatibility with 0.60,
53 # will be removed in 0.62. This is temporary hack:
54
55 %define dummysuffix %(test "%{_lib}" = "lib64" && echo '()(64bit)')
56
57 Provides: libcourierauth.so.0%{dummysuffix} libcourierauthsasl.so.0%{dummysuffix} libcourierauthsaslclient.so.0%{dummysuffix} libcourierauthcommon.so.0%{dummysuffix}
58
59 ################################################################################
60
61 %description
62 The Courier authentication library provides authentication services for
63 other Courier applications.
64
65 ################################################################################
66
67 %package devel
68 Summary: Development libraries for the Courier authentication library
69 Group: Development/Libraries
70 Requires: courier-authlib = 0:%{version}-%{release}
71
72 %description devel
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.
78
79 ################################################################################
80
81 %package userdb
82
83 Summary: userdb support for the Courier authentication library
84 Group: System Environment/Daemons
85 Requires: courier-authlib = 0:%{version}-%{release}
86
87 %description userdb
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.
92
93 ################################################################################
94
95 %package ldap
96
97 Summary: LDAP support for the Courier authentication library
98 Group: System Environment/Daemons
99 Requires: courier-authlib = 0:%{version}-%{release}
100
101 %description ldap
102 This package installs LDAP support for the Courier authentication library.
103 Install this package in order to be able to authenticate using LDAP.
104
105 ################################################################################
106
107 %package mysql
108
109 Summary: MySQL support for the Courier authentication library
110 Group: System Environment/Daemons
111 Requires: courier-authlib = 0:%{version}-%{release}
112
113 %description mysql
114 This package installs MySQL support for the Courier authentication library.
115 Install this package in order to be able to authenticate using MySQL.
116
117 ################################################################################
118
119 %package pgsql
120
121 Summary: MySQL support for the Courier authentication library
122 Group: System Environment/Daemons
123 Requires: courier-authlib = 0:%{version}-%{release}
124
125 %description pgsql
126 This package installs PostgreSQL support for the Courier authentication
127 library.
128 Install this package in order to be able to authenticate using PostgreSQL.
129
130 ################################################################################
131
132 %package pipe
133
134 Summary: External authentication module that communicates via pipes
135 Group: System Environment/Daemons
136 Requires: courier-authlib = 0:%{version}-%{release}
137
138 %description pipe
139 This package installs the authpipe module, which is a generic plugin
140 that enables authentication requests to be serviced by an external
141 program, then communicates through messages on stdin and stdout.
142
143 ################################################################################
144
145 %prep
146 %setup -q
147 %configure --with-redhat
148
149 %build
150 %{__make} -s %{_smp_mflags}
151
152 %install
153 rm -rf $RPM_BUILD_ROOT
154 MAKEFLAGS= %{__make} -j 1 install DESTDIR=$RPM_BUILD_ROOT
155 %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/courier-authlib/*.a
156 %{__install} -m 555 sysconftool $RPM_BUILD_ROOT%{_libexecdir}/courier-authlib
157 %{__install} -m 555 authmigrate $RPM_BUILD_ROOT%{_libexecdir}/courier-authlib
158
159 ./courierauthconfig --configfiles >configtmp
160 . configtmp
161
162 ./authmksock $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/socket || exit 1
163 touch $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/pid.lock || exit 1
164 touch $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/pid || exit 1
165 %{__chmod} 777 $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/socket || exit 1
166
167 cat >configfiles.base <<EOF
168 %defattr(-,$mailuser,$mailgroup,-)
169 %{_sysconfdir}/authlib
170 %{_libexecdir}/courier-authlib
171 %dir %{_libdir}/courier-authlib
172 %dir %attr(750,$mailuser,$mailgroup) %{_localstatedir}/spool/authdaemon
173 EOF
174
175 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.mysql
176 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.ldap
177 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.pgsql
178 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.userdb
179 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.pipe
180 echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.devel
181
182 for f in $RPM_BUILD_ROOT%{_sbindir}/*
183 do
184 fn=`basename $f`
185 case "$fn" in
186 *userdb*)
187 echo "%{_sbindir}/$fn" >>configfiles.userdb
188 ;;
189 *)
190 echo "%{_sbindir}/$fn" >>configfiles.base
191 ;;
192 esac
193 done
194
195 for f in $RPM_BUILD_ROOT%{_libdir}/courier-authlib/*
196 do
197 fn=`basename $f`
198 case "$fn" in
199 libauthpipe*)
200 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.pipe
201 ;;
202 libauthldap*)
203 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap
204 ;;
205 libauthmysql*)
206 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.mysql
207 ;;
208 libauthpgsql*)
209 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.pgsql
210 ;;
211 libauthldap*)
212 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap
213 ;;
214 libauthuserdb*)
215 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.userdb
216 ;;
217 *)
218 echo "%{_libdir}/courier-authlib/$fn" >>configfiles.base
219 ;;
220 esac
221 done
222 %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
223 %{__install} -m 555 courier-authlib.sysvinit \
224 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/courier-authlib
225
226 %post
227 %{_libexecdir}/courier-authlib/authmigrate >/dev/null
228 %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib/*.dist >/dev/null
229
230 /sbin/chkconfig --del courier-authlib
231 /sbin/chkconfig --add courier-authlib
232
233 %preun
234 if test -x %{_sbindir}/authdaemond
235 then
236 %{_sbindir}/authdaemond >/dev/null 2>&1 || /bin/true
237 fi
238
239 if test "$1" = "0"
240 then
241 /sbin/chkconfig --del courier-authlib
242 fi
243
244 %clean
245 rm -rf $RPM_BUILD_ROOT
246
247
248 %files -f configfiles.base
249 %defattr(-,root,root,-)
250 %doc README README*html README.authmysql.myownquery README.ldap
251 %doc NEWS COPYING* AUTHORS ChangeLog authldap.schema
252 /etc/rc.d/init.d/*
253 %ghost %attr(600, root, root) %{_localstatedir}/spool/authdaemon/pid.lock
254 %ghost %attr(644, root, root) %{_localstatedir}/spool/authdaemon/pid
255 %ghost %attr(-, root, root) %{_localstatedir}/spool/authdaemon/socket
256 %{_mandir}/man1/*
257
258 %files -f configfiles.userdb userdb
259 %{_mandir}/man8/*userdb*
260
261 %files -f configfiles.devel devel
262 %defattr(-,root,root,-)
263 %{_bindir}/courierauthconfig
264 %{_includedir}/*
265 %{_mandir}/man3/*
266 %doc authlib.html auth_*.html
267
268 %files -f configfiles.ldap ldap
269 %defattr(-,root,root,-)
270 %doc authldap.schema
271
272 %files -f configfiles.mysql mysql
273
274 %files -f configfiles.pgsql pgsql
275
276 %files -f configfiles.pipe pipe
277
278 %changelog
279
280 * Thu Sep 7 2006 Chris Petersen <rpm@forevermore.net> 0.58-2
281 - Make the spec a little prettier
282 - Replace BuildPreReq with BuildRequires
283 - Remove period from summaries (rpmlint)
284 - Fix release tag to use %{?dist} macro if it's present
285 - Change distro-detection to use "rh" and "fc" for version detection, and add support for mandriva
286
287 * Sun Oct 3 2004 Mr. Sam <sam@email-scan.com> 0.50-1
288 - Initial build.
289