dd184caf |
1 | # $Id: courier-authlib.lpspec.in,v 1.10 2007/07/21 20:05:54 mrsam Exp $ |
d9898ee8 |
2 | # |
3 | # Copyright 2005 Double Precision, Inc. See COPYING for |
4 | # distribution information. |
5 | |
6 | Name: courier-authlib |
7 | Version: @VERSION@ |
8 | Release: 1 |
9 | |
10 | License: GPL |
11 | URL: http://www.courier-mta.org |
12 | |
13 | ################################################################################ |
14 | |
15 | Source: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2 |
16 | |
17 | ################################################################################ |
18 | |
19 | BuildRequires: libtool |
20 | BuildRequires: openldap-devel |
21 | BuildRequires: mysql-devel zlib-devel |
22 | BuildRequires: postgresql-devel |
23 | BuildRequires: gdbm-devel |
24 | BuildRequires: pam-devel |
25 | BuildRequires: expect |
26 | BuildRequires: gcc-c++ |
27 | |
28 | BuildRequires: /usr/include/ltdl.h |
29 | |
30 | |
31 | %{?repository: Repository(pgpkeys.txt): http://download.lpmtool.com/@REPOSITORY@/courier-authlib} |
32 | |
33 | %package |
34 | Summary: Courier authentication library |
35 | Group: System Environment/Daemons |
36 | Requires: /sbin/chkconfig |
37 | |
38 | The Courier authentication library provides authentication services for |
39 | other Courier applications. |
40 | |
41 | %package devel |
42 | Summary: Development libraries for the Courier authentication library |
43 | Group: Development/Libraries |
44 | Requires: courier-authlib = %{__version}-%{__release} |
45 | |
46 | This package contains the development libraries and files needed to compile |
47 | Courier packages that use this authentication library. Install this |
48 | package in order to build the rest of the Courier packages. After they are |
49 | built and installed this package can be removed. Files in this package |
50 | are not needed at runtime. |
51 | |
52 | ################################################################################ |
53 | %package userdb |
54 | Summary: userdb support for the Courier authentication library |
55 | Group: System Environment/Daemons |
56 | Requires: courier-authlib = %{__version}-%{__release} |
57 | |
58 | This package installs the userdb support for the Courier authentication |
59 | library. Userdb is a simple way to manage virtual mail accounts using |
60 | a GDBM-based database file. |
61 | <p> |
62 | Install this package in order to be able to authenticate with userdb. |
63 | |
64 | ################################################################################ |
65 | %package ldap |
66 | Summary: LDAP support for the Courier authentication library |
67 | Group: System Environment/Daemons |
68 | Requires: courier-authlib = %{__version}-%{__release} |
69 | |
70 | This package installs LDAP support for the Courier authentication library. |
71 | Install this package in order to be able to authenticate using LDAP. |
72 | |
73 | ################################################################################ |
74 | %package mysql |
75 | Summary: MySQL support for the Courier authentication library |
76 | Group: System Environment/Daemons |
77 | Requires: courier-authlib = %{__version}-%{__release} |
78 | |
79 | This package installs MySQL support for the Courier authentication library. |
80 | Install this package in order to be able to authenticate using MySQL. |
81 | |
82 | ################################################################################ |
83 | %package pgsql |
84 | Summary: MySQL support for the Courier authentication library |
85 | Group: System Environment/Daemons |
86 | Requires: courier-authlib = %{__version}-%{__release} |
87 | |
88 | This package installs PostgreSQL support for the Courier authentication |
89 | library. |
90 | Install this package in order to be able to authenticate using PostgreSQL. |
91 | |
92 | %begin |
93 | %setup |
94 | %configure --with-redhat |
95 | %begin build |
dd184caf |
96 | %{__make} -s %{_smp_mflags} |
d9898ee8 |
97 | |
98 | %begin install |
99 | rm -rf $__installdir |
100 | MAKEFLAGS= %{__make} -j 1 install DESTDIR=$__installdir |
101 | %{__rm} -f $__installdir%{_libdir}/courier-authlib/*.a |
102 | %{__install} -m 555 sysconftool $__installdir%{_libexecdir}/courier-authlib |
103 | %{__install} -m 555 authmigrate $__installdir%{_libexecdir}/courier-authlib |
104 | |
105 | ./courierauthconfig --configfiles >configtmp |
106 | . configtmp |
107 | |
108 | ./authmksock $__installdir%{_localstatedir}/spool/authdaemon/socket || exit 1 |
109 | touch $__installdir%{_localstatedir}/spool/authdaemon/pid.lock || exit 1 |
110 | touch $__installdir%{_localstatedir}/spool/authdaemon/pid || exit 1 |
111 | %{__chmod} 777 $__installdir%{_localstatedir}/spool/authdaemon/socket || exit 1 |
112 | |
113 | cat >configfiles.base <<EOF |
114 | %defattr(-,$mailuser,$mailgroup,-) |
115 | %{_sysconfdir}/authlib |
116 | %{_libexecdir}/courier-authlib |
117 | %dir %{_libdir}/courier-authlib |
118 | %dir %attr(750,$mailuser,$mailgroup) %{_localstatedir}/spool/authdaemon |
119 | EOF |
120 | |
121 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.mysql |
122 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.ldap |
123 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.pgsql |
124 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.userdb |
125 | echo "%defattr(-,$mailuser,$mailgroup,-)" >configfiles.devel |
126 | |
127 | for f in $__installdir%{_sbindir}/* |
128 | do |
129 | fn=`basename $f` |
130 | case "$fn" in |
131 | *userdb*) |
132 | echo "%{_sbindir}/$fn" >>configfiles.userdb |
133 | ;; |
134 | *) |
135 | echo "%{_sbindir}/$fn" >>configfiles.base |
136 | ;; |
137 | esac |
138 | done |
139 | |
140 | for f in $__installdir%{_libdir}/courier-authlib/* |
141 | do |
142 | fn=`basename $f` |
143 | case "$fn" in |
144 | libauthldap*) |
145 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap |
146 | ;; |
147 | libauthmysql*) |
148 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.mysql |
149 | ;; |
150 | libauthpgsql*) |
151 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.pgsql |
152 | ;; |
153 | libauthldap*) |
154 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.ldap |
155 | ;; |
156 | libauthuserdb*) |
157 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.userdb |
158 | ;; |
159 | *) |
160 | echo "%{_libdir}/courier-authlib/$fn" >>configfiles.base |
161 | ;; |
162 | esac |
163 | done |
164 | %{__mkdir_p} $__installdir%{_sysconfdir}/rc.d/init.d |
165 | %{__install} -m 555 courier-authlib.sysvinit \ |
166 | $__installdir%{_sysconfdir}/rc.d/init.d/courier-authlib |
167 | |
168 | %post |
169 | %{_libexecdir}/courier-authlib/authmigrate >/dev/null |
170 | %{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib/*.dist >/dev/null |
171 | |
172 | /sbin/chkconfig --del courier-authlib |
173 | /sbin/chkconfig --add courier-authlib |
174 | |
175 | %preun |
176 | if test -x %{_sbindir}/authdaemond |
177 | then |
178 | %{_sbindir}/authdaemond >/dev/null 2>&1 || /bin/true |
179 | fi |
180 | |
181 | if test "$1" = "0" |
182 | then |
183 | /sbin/chkconfig --del courier-authlib |
184 | fi |
185 | |
186 | %files -f configfiles.base |
187 | %defattr(-,root,root,-) |
188 | %doc README README*html README.authmysql.myownquery README.ldap |
189 | %doc NEWS COPYING* AUTHORS ChangeLog authldap.schema |
190 | /etc/rc.d/init.d/* |
191 | %ghost %attr(600, root, root) %{_localstatedir}/spool/authdaemon/pid.lock |
192 | %ghost %attr(644, root, root) %{_localstatedir}/spool/authdaemon/pid |
193 | %ghost %attr(-, root, root) %{_localstatedir}/spool/authdaemon/socket |
194 | %{_mandir}/man1/* |
195 | |
196 | %files -f configfiles.userdb userdb |
197 | %{_mandir}/man8/*userdb* |
198 | |
199 | %files -f configfiles.devel devel |
200 | %defattr(-,root,root,-) |
201 | %{_bindir}/courierauthconfig |
202 | %{_includedir}/* |
203 | %{_mandir}/man3/* |
204 | %doc authlib.html auth_*.html |
205 | |
206 | %files -f configfiles.ldap ldap |
207 | %defattr(-,root,root,-) |
208 | %doc authldap.schema |
209 | |
210 | %files -f configfiles.mysql mysql |
211 | |
212 | %files -f configfiles.pgsql pgsql |
213 | |
214 | %changelog |
215 | * Thu Sep 7 2006 Chris Petersen <rpm@forevermore.net> 0.58-2 |
216 | - Make the spec a little prettier |
217 | - Replace BuildPreReq with BuildRequires |
218 | - Remove period from summaries (rpmlint) |
219 | - Fix release tag to use %{?dist} macro if it's present |
220 | - Change distro-detection to use "rh" and "fc" for version detection, and add support for mandriva |
221 | |
222 | * Sun Oct 3 2004 Mr. Sam <sam@email-scan.com> 0.50-1 |
223 | - Initial build. |
224 | |