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