]>
Commit | Line | Data |
---|---|---|
905c8d0b JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without ldap # do not include LDAP support | |
4 | ||
8cd33d7f | 5 | Summary: Courier authentication library |
868d4675 | 6 | Summary(pl.UTF-8): Biblioteka uwierzytelniania Couriera |
8cd33d7f | 7 | Name: courier-authlib |
bf3b44bd | 8 | Version: 0.63.0 |
8d1c46ec | 9 | Release: 4 |
8cd33d7f AA |
10 | License: GPL |
11 | Group: Networking/Daemons | |
7c5b4b59 | 12 | Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2 |
bf3b44bd | 13 | # Source0-md5: 411a927d178f783a1e8fab9964ce0dd2 |
aa89654a | 14 | Source1: %{name}.init |
7ab176aa | 15 | Patch0: %{name}-md5sum-passwords.patch |
16 | Patch1: %{name}-authdaemonrc.patch | |
17 | Patch2: %{name}-nostatic.patch | |
18 | Patch3: %{name}-ltdl.patch | |
7c5b4b59 AA |
19 | URL: http://www.courier-mta.org/authlib/ |
20 | BuildRequires: autoconf | |
21 | BuildRequires: automake | |
22 | BuildRequires: db-devel | |
8cd33d7f | 23 | BuildRequires: expect |
8e8bec71 | 24 | BuildRequires: libltdl-devel |
109ce427 | 25 | BuildRequires: libtool |
8cd33d7f | 26 | BuildRequires: mysql-devel |
905c8d0b | 27 | %{?with_ldap:BuildRequires: openldap-devel >= 2.3.0} |
8cd33d7f AA |
28 | BuildRequires: pam-devel |
29 | BuildRequires: postgresql-devel | |
259e6fd9 | 30 | BuildRequires: rpmbuild(macros) >= 1.304 |
b556d988 | 31 | BuildRequires: sysconftool |
8cd33d7f | 32 | BuildRequires: zlib-devel |
109ce427 | 33 | Requires(post,postun): /sbin/ldconfig |
df8ebb36 | 34 | Requires(post,preun): /sbin/chkconfig |
109ce427 ER |
35 | Requires: %{name}-libs = %{version}-%{release} |
36 | Requires: /sbin/chkconfig | |
37 | Requires: rc-scripts | |
7c5b4b59 AA |
38 | Obsoletes: sqwebmail-auth-cram |
39 | Obsoletes: sqwebmail-auth-pam | |
40 | Obsoletes: sqwebmail-auth-pwd | |
41 | Obsoletes: sqwebmail-auth-shadow | |
8cd33d7f AA |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
43 | ||
c259485d ER |
44 | %define schemadir /usr/share/openldap/schema |
45 | ||
8cd33d7f AA |
46 | %description |
47 | The Courier authentication library provides authentication services | |
48 | for other Courier applications. | |
49 | ||
61e470ec JR |
50 | %description -l pl.UTF-8 |
51 | Biblioteka uwierzytelniania Couriera dostarcza usługi uwierzytelniania | |
5626c9aa | 52 | dla innych aplikacji Couriera. |
8cd33d7f | 53 | |
109ce427 ER |
54 | %package libs |
55 | Summary: Courier authentication library | |
868d4675 | 56 | Summary(pl.UTF-8): Biblioteka uwierzytelniania Couriera |
109ce427 ER |
57 | Group: Libraries |
58 | Requires(post,postun): /sbin/ldconfig | |
59 | ||
60 | %description libs | |
61 | The Courier authentication library provides authentication services | |
62 | for other Courier applications. | |
63 | ||
64 | This package contains libcourierauth.so which client programs link | |
65 | against. | |
66 | ||
61e470ec JR |
67 | %description libs -l pl.UTF-8 |
68 | Biblioteka uwierzytelniania Couriera dostarcza usługi uwierzytelniania | |
109ce427 ER |
69 | dla innych aplikacji Couriera. |
70 | ||
8cd33d7f | 71 | %package devel |
5626c9aa | 72 | Summary: Development files for the Courier authentication library |
868d4675 | 73 | Summary(pl.UTF-8): Pliki programistyczne dla biblioteki uwierzytelniania Couriera |
8cd33d7f AA |
74 | Group: Development/Libraries |
75 | Requires: %{name} = %{version}-%{release} | |
905c8d0b | 76 | %{?with_ldap:Requires: %{name}-authldap = %{version}-%{release}} |
7c5b4b59 AA |
77 | Requires: %{name}-authmysql = %{version}-%{release} |
78 | Requires: %{name}-authpgsql = %{version}-%{release} | |
a25e80b2 AM |
79 | Requires: %{name}-authuserdb = %{version}-%{release} |
80 | Requires: %{name}-authpipe = %{version}-%{release} | |
8cd33d7f AA |
81 | |
82 | %description devel | |
5626c9aa JB |
83 | This package contains the development files needed to compile Courier |
84 | packages that use this authentication library. Install this package in | |
85 | order to build the rest of the Courier packages. After they are built | |
86 | and installed this package can be removed. Files in this package are | |
87 | not needed at runtime. | |
8cd33d7f | 88 | |
61e470ec | 89 | %description devel -l pl.UTF-8 |
5626c9aa | 90 | Ten pakiet zawiera pliki programistyczne potrzebne do kompilacji |
61e470ec JR |
91 | pakietów Couriera używających biblioteki uwierzytelniania. Należy go |
92 | zainstalować aby zbudować resztę pakietów Couriera. Po ich zbudowaniu | |
93 | i zainstalowaniu ten pakiet można usunąć. Pliki z tego pakietu nie są | |
94 | potrzebne w czasie działania programów. | |
8cd33d7f AA |
95 | |
96 | %package authldap | |
7c5b4b59 | 97 | Summary: LDAP support for the Courier authentication library |
868d4675 | 98 | Summary(pl.UTF-8): Obsługa LDAP dla biblioteki uwierzytelniania Couriera |
7c5b4b59 | 99 | Group: Networking/Daemons |
99b3aadf | 100 | Requires(pre,postun): sed >= 4.0 |
109ce427 | 101 | Requires: %{name} = %{version}-%{release} |
7c5b4b59 AA |
102 | Obsoletes: courier-authldap |
103 | Obsoletes: courier-imap-authldap | |
104 | Obsoletes: sqwebmail-auth-ldap | |
8cd33d7f AA |
105 | |
106 | %description authldap | |
107 | This package installs LDAP support for the Courier authentication | |
108 | library. Install this package in order to be able to authenticate | |
109 | using LDAP. | |
110 | ||
61e470ec JR |
111 | %description authldap -l pl.UTF-8 |
112 | Ten pakiet dodaje obsługę LDAP do biblioteki uwierzytelniania | |
113 | Couriera. Należy go zainstalować aby móc uwierzytelniać się z użyciem | |
5626c9aa | 114 | LDAP. |
8cd33d7f AA |
115 | |
116 | %package authmysql | |
5626c9aa | 117 | Summary: MySQL support for the Courier authentication library |
868d4675 | 118 | Summary(pl.UTF-8): Obsługa MySQL dla biblioteki uwierzytelniania Couriera |
8cd33d7f | 119 | Group: Networking/Daemons |
99b3aadf | 120 | Requires(pre,postun): sed >= 4.0 |
109ce427 | 121 | Requires: %{name} = %{version}-%{release} |
7c5b4b59 AA |
122 | Obsoletes: courier-authmysql |
123 | Obsoletes: courier-imap-authmysql | |
124 | Obsoletes: sqwebmail-auth-mysql | |
8cd33d7f AA |
125 | |
126 | %description authmysql | |
127 | This package installs MySQL support for the Courier authentication | |
128 | library. Install this package in order to be able to authenticate | |
129 | using MySQL. | |
130 | ||
61e470ec JR |
131 | %description authmysql -l pl.UTF-8 |
132 | Ten pakiet dodaje obsługę MySQL do biblioteki uwierzytelniania | |
133 | Couriera. Należy go zainstalować aby móc uwierzytelniać się z użyciem | |
5626c9aa | 134 | MySQL. |
8cd33d7f AA |
135 | |
136 | %package authpgsql | |
137 | Summary: PostgreSQL support for the Courier authentication library | |
868d4675 | 138 | Summary(pl.UTF-8): Obsługa PostgreSQL dla biblioteki uwierzytelniania Couriera |
8cd33d7f | 139 | Group: Networking/Daemons |
99b3aadf | 140 | Requires(pre,postun): sed >= 4.0 |
109ce427 | 141 | Requires: %{name} = %{version}-%{release} |
7c5b4b59 AA |
142 | Obsoletes: courier-authpgsql |
143 | Obsoletes: courier-imap-authpgsql | |
144 | Obsoletes: sqwebmail-auth-pgsql | |
8cd33d7f AA |
145 | |
146 | %description authpgsql | |
147 | This package installs PostgreSQL support for the Courier | |
148 | authentication library. Install this package in order to be able to | |
149 | authenticate using PostgreSQL. | |
150 | ||
61e470ec JR |
151 | %description authpgsql -l pl.UTF-8 |
152 | Ten pakiet dodaje obsługę PostgreSQL do biblioteki uwierzytelniania | |
153 | Couriera. Należy go zainstalować aby móc uwierzytelniać się z użyciem | |
5626c9aa | 154 | PostgreSQL. |
8cd33d7f | 155 | |
a25e80b2 | 156 | %package authuserdb |
7c5b4b59 | 157 | Summary: Userdb support for the Courier authentication library |
868d4675 | 158 | Summary(pl.UTF-8): Obsługa userdb dla biblioteki uwierzytelniania Couriera |
7c5b4b59 | 159 | Group: Networking/Daemons |
99b3aadf | 160 | Requires(pre,postun): sed >= 4.0 |
109ce427 | 161 | Requires: %{name} = %{version}-%{release} |
a25e80b2 | 162 | Obsoletes: courier-authlib-userdb |
7c5b4b59 AA |
163 | Obsoletes: courier-imap-userdb |
164 | Obsoletes: sqwebmail-auth-userdb | |
8cd33d7f | 165 | |
a25e80b2 | 166 | %description authuserdb |
8cd33d7f AA |
167 | This package installs the userdb support for the Courier |
168 | authentication library. Userdb is a simple way to manage virtual mail | |
169 | accounts using a GDBM-based database file. | |
170 | ||
171 | Install this package in order to be able to authenticate with userdb. | |
172 | ||
a25e80b2 | 173 | %description authuserdb -l pl.UTF-8 |
61e470ec JR |
174 | Ten pakiet dodaje obsługę userdb do biblioteki uwierzytelniania |
175 | Couriera. Userdb to prosty sposób zarządzania wirtualnymi kontami | |
176 | pocztowymi przy użyciu pliku bazy danych opartej na GDBM. | |
5626c9aa | 177 | |
61e470ec | 178 | Należy go zainstalować aby móc uwierzytelniać się z użyciem userdb. |
8cd33d7f | 179 | |
a25e80b2 | 180 | %package authpipe |
8d3b74ac | 181 | Summary: External authentication module that communicates via pipes |
868d4675 | 182 | Summary(pl.UTF-8): Zewnętrzny moduł uwierzytelniający komunikujący się przez potoki |
8d3b74ac | 183 | Group: Networking/Daemons |
99b3aadf | 184 | Requires(pre,postun): sed >= 4.0 |
109ce427 | 185 | Requires: %{name} = %{version}-%{release} |
a25e80b2 | 186 | Obsoletes: courier-authlib-authpipe |
8d3b74ac | 187 | |
a25e80b2 | 188 | %description authpipe |
8d3b74ac AA |
189 | This package installs the authpipe module, which is a generic plugin |
190 | that enables authentication requests to be serviced by an external | |
191 | program, then communicates through messages on stdin and stdout. | |
192 | ||
a25e80b2 | 193 | %description authpipe -l pl.UTF-8 |
61e470ec JR |
194 | Pakiet ten instaluje moduł authpipe, który jest ogólną wtyczką |
195 | umożliwiającą obsługę żądań uwierzytelnienia przez zewnętrzny program | |
196 | komunikujący się poprzez wiadomości wysyłane na stdin i stdout. | |
8d3b74ac | 197 | |
c259485d ER |
198 | %package -n openldap-schema-courier |
199 | Summary: Courier LDAP schema | |
868d4675 | 200 | Summary(pl.UTF-8): Schemat LDAP Couriera |
c259485d ER |
201 | Group: Networking/Daemons |
202 | Requires(post,postun): sed >= 4.0 | |
203 | Requires: openldap-servers | |
109ce427 | 204 | Requires: sed >= 4.0 |
c259485d ER |
205 | |
206 | %description -n openldap-schema-courier | |
207 | This package contains Courier authldap.schema for openldap. | |
208 | ||
61e470ec | 209 | %description -n openldap-schema-courier -l pl.UTF-8 |
49c922ca JB |
210 | Ten pakiet zawiera schemat Couriera authldap.schema dla openldapa. |
211 | ||
8cd33d7f | 212 | %prep |
7c5b4b59 AA |
213 | %setup -q |
214 | %patch0 -p1 | |
2a2a0b32 | 215 | %patch1 -p1 |
99b3aadf | 216 | %patch2 -p1 |
eae3d21d | 217 | %patch3 -p1 |
dfa792b6 ER |
218 | |
219 | rm -rf libltdl | |
8cd33d7f AA |
220 | |
221 | %build | |
a682a4df | 222 | # Change Makefile.am files and force recreate Makefile.in's. |
223 | OLDDIR=`pwd` | |
224 | find -type f -a \( -name configure.in -o -name configure.ac \) | while read FILE; do | |
225 | cd "`dirname "$FILE"`" | |
64587e2b | 226 | |
a682a4df | 227 | if [ -f Makefile.am ]; then |
228 | sed -i -e '/_[L]DFLAGS=-static/d' Makefile.am | |
229 | fi | |
64587e2b | 230 | |
eae3d21d ER |
231 | %{__libtoolize} |
232 | %{__aclocal} | |
233 | %{__autoconf} | |
a682a4df | 234 | if grep -q AC_CONFIG_HEADER configure.in; then |
235 | %{__autoheader} | |
236 | fi | |
eae3d21d | 237 | %{__automake} |
64587e2b | 238 | |
a682a4df | 239 | cd "$OLDDIR" |
eae3d21d ER |
240 | done |
241 | ||
7c5b4b59 | 242 | %configure \ |
5b2ed3a5 | 243 | --enable-ltdl-install=no \ |
905c8d0b | 244 | %{!?with_ldap:--without-authldap} \ |
7c5b4b59 AA |
245 | --with-db=db \ |
246 | --with-mailuser=daemon \ | |
247 | --with-mailgroup=daemon | |
8cd33d7f | 248 | |
a682a4df | 249 | %{__make} -j1 \ |
7ffb40c2 | 250 | LDFLAGS="%{rpmldflags} -lcrypt" |
8cd33d7f AA |
251 | |
252 | %install | |
253 | rm -rf $RPM_BUILD_ROOT | |
254 | ||
a682a4df | 255 | %{__make} -j1 install \ |
8cd33d7f AA |
256 | DESTDIR=$RPM_BUILD_ROOT |
257 | ||
eae3d21d | 258 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/authlib/userdb,%{schemadir},%{_bindir}} |
8cd33d7f | 259 | |
aa89654a | 260 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-authlib |
c259485d | 261 | install authldap.schema $RPM_BUILD_ROOT%{schemadir}/courier.schema |
eae3d21d | 262 | install makedat/makedat $RPM_BUILD_ROOT%{_bindir}/makedat |
8cd33d7f AA |
263 | |
264 | # make config files | |
265 | ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/authlib/*.dist | |
266 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/authlib/*.dist | |
267 | ||
73c4092d ER |
268 | touch $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/socket |
269 | ||
8cd33d7f | 270 | # remove static library - for now |
eae3d21d | 271 | rm $RPM_BUILD_ROOT%{_libdir}/courier-authlib/*.a |
8cd33d7f | 272 | |
5626c9aa JB |
273 | %clean |
274 | rm -rf $RPM_BUILD_ROOT | |
275 | ||
8cd33d7f | 276 | %post |
7c5b4b59 | 277 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
8cd33d7f AA |
278 | /sbin/chkconfig --add courier-authlib |
279 | ||
24593e93 | 280 | %service courier-authlib restart "authlib daemon" |
8cd33d7f | 281 | |
7c5b4b59 | 282 | %preun |
5626c9aa | 283 | if [ "$1" = "0" ]; then |
8cd33d7f | 284 | /sbin/chkconfig --del courier-authlib |
24593e93 | 285 | %service courier-authlib stop |
7c5b4b59 AA |
286 | fi |
287 | ||
288 | %postun | |
289 | /sbin/ldconfig %{_libexecdir}/courier-authlib | |
290 | ||
109ce427 ER |
291 | %post libs |
292 | /sbin/ldconfig %{_libexecdir}/courier-authlib | |
293 | ||
294 | %postun libs | |
295 | /sbin/ldconfig %{_libexecdir}/courier-authlib | |
296 | ||
7c5b4b59 | 297 | %post authldap |
99b3aadf ER |
298 | if [ "$1" = 1 ]; then |
299 | # add to authmodulelist list if package is first installed | |
eae3d21d | 300 | %{__sed} -i -e '/^authmodulelist=/{/\bauthldap\b/!s/"$/ authldap"/}' /etc/authlib/authdaemonrc |
99b3aadf | 301 | fi |
7c5b4b59 | 302 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 303 | %service -q courier-authlib restart |
7c5b4b59 AA |
304 | |
305 | %postun authldap | |
99b3aadf ER |
306 | if [ "$1" = 0 ]; then |
307 | # remove from authmodulelist if package is removed | |
eae3d21d | 308 | %{__sed} -i -e '/^authmodulelist=/{s/ \?\bauthldap\b \?//}' /etc/authlib/authdaemonrc |
99b3aadf | 309 | fi |
7c5b4b59 | 310 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 311 | %service -q courier-authlib restart |
7c5b4b59 AA |
312 | |
313 | %post authmysql | |
99b3aadf ER |
314 | if [ "$1" = 1 ]; then |
315 | # add to authmodulelist list if package is first installed | |
eae3d21d | 316 | %{__sed} -i -e '/^authmodulelist=/{/\bauthmysql\b/!s/"$/ authmysql"/}' /etc/authlib/authdaemonrc |
99b3aadf | 317 | fi |
7c5b4b59 | 318 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 319 | %service -q courier-authlib restart |
7c5b4b59 AA |
320 | |
321 | %postun authmysql | |
99b3aadf ER |
322 | if [ "$1" = 0 ]; then |
323 | # remove from authmodulelist if package is removed | |
eae3d21d | 324 | %{__sed} -i -e '/^authmodulelist=/{s/ \?\bauthmysql\b \?//}' /etc/authlib/authdaemonrc |
99b3aadf | 325 | fi |
7c5b4b59 | 326 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 327 | %service -q courier-authlib restart |
7c5b4b59 AA |
328 | |
329 | %post authpgsql | |
99b3aadf ER |
330 | if [ "$1" = 1 ]; then |
331 | # add to authmodulelist list if package is first installed | |
eae3d21d | 332 | %{__sed} -i -e '/^authmodulelist=/{/\bauthpgsql\b/!s/"$/ authpgsql"/}' /etc/authlib/authdaemonrc |
99b3aadf | 333 | fi |
7c5b4b59 | 334 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 335 | %service -q courier-authlib restart |
7c5b4b59 AA |
336 | |
337 | %postun authpgsql | |
99b3aadf ER |
338 | if [ "$1" = 0 ]; then |
339 | # remove from authmodulelist if package is removed | |
eae3d21d | 340 | %{__sed} -i -e '/^authmodulelist=/{s/ \?\bauthpgsql\b \?//}' /etc/authlib/authdaemonrc |
99b3aadf | 341 | fi |
7c5b4b59 | 342 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 343 | %service -q courier-authlib restart |
7c5b4b59 | 344 | |
a25e80b2 | 345 | %post authuserdb |
99b3aadf ER |
346 | if [ "$1" = 1 ]; then |
347 | # add to authmodulelist list if package is first installed | |
eae3d21d | 348 | %{__sed} -i -e '/^authmodulelist=/{/\buserdb\b/!s/"$/ userdb"/}' /etc/authlib/authdaemonrc |
99b3aadf | 349 | fi |
7c5b4b59 | 350 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 351 | %service -q courier-authlib restart |
7c5b4b59 | 352 | |
a25e80b2 | 353 | %postun authuserdb |
99b3aadf ER |
354 | if [ "$1" = 0 ]; then |
355 | # remove from authmodulelist if package is removed | |
eae3d21d | 356 | %{__sed} -i -e '/^authmodulelist=/{s/ \?\buserdb\b \?//}' /etc/authlib/authdaemonrc |
99b3aadf | 357 | fi |
7c5b4b59 | 358 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 359 | %service -q courier-authlib restart |
7c5b4b59 | 360 | |
a25e80b2 | 361 | %post authpipe |
99b3aadf ER |
362 | if [ "$1" = 1 ]; then |
363 | # add to authmodulelist list if package is first installed | |
eae3d21d | 364 | %{__sed} -i -e '/^authmodulelist=/{/\bpipe\b/!s/"$/ pipe"/}' /etc/authlib/authdaemonrc |
99b3aadf | 365 | fi |
8d3b74ac | 366 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 367 | %service -q courier-authlib restart |
8d3b74ac | 368 | |
a25e80b2 | 369 | %postun authpipe |
99b3aadf ER |
370 | if [ "$1" = 0 ]; then |
371 | # remove from authmodulelist if package is removed | |
eae3d21d | 372 | %{__sed} -i -e '/^authmodulelist=/{s/ \?\bpipe\b \?//}' /etc/authlib/authdaemonrc |
99b3aadf | 373 | fi |
8d3b74ac | 374 | /sbin/ldconfig %{_libexecdir}/courier-authlib |
24593e93 | 375 | %service -q courier-authlib restart |
8d3b74ac | 376 | |
c259485d | 377 | %post -n openldap-schema-courier |
259e6fd9 | 378 | %openldap_schema_register %{schemadir}/courier.schema -d nis,cosine |
24593e93 | 379 | %service -q ldap restart |
c259485d ER |
380 | |
381 | %postun -n openldap-schema-courier | |
382 | if [ "$1" = "0" ]; then | |
259e6fd9 | 383 | %openldap_schema_unregister %{schemadir}/courier.schema |
24593e93 | 384 | %service -q ldap restart |
c259485d ER |
385 | fi |
386 | ||
7c5b4b59 AA |
387 | %triggerin -- courier < 0.48 |
388 | if [ -f /etc/courier/authdaemonrc ]; then | |
ec099892 | 389 | . /etc/courier/authdaemonrc |
7c5b4b59 | 390 | |
eae3d21d | 391 | %{__sed} -i s/^authmodulelist=.*/"authmodulelist=\"`echo $authmodulelist \ |
ec099892 | 392 | | sed s/'authcram'/''/ | sed s/' '/' '/`\""/ /etc/authlib/authdaemonrc |
eae3d21d | 393 | %{__sed} -i s/^authmodulelistorig=.*/"authmodulelistorig=\"`echo $authmodulelistorig\ |
ec099892 | 394 | | sed s/'authcram'/''/ | sed s/' '/' '/`\""/ /etc/authlib/authdaemonrc |
eae3d21d | 395 | %{__sed} -i s/^daemons=.*/"daemons=$daemons"/ /etc/authlib/authdaemonrc |
7c5b4b59 AA |
396 | fi |
397 | if [ -f /var/lock/subsys/courier ]; then | |
ec099892 ER |
398 | if [ -f /var/spool/courier/authdaemon/pid ]; then |
399 | kill `cat /var/spool/courier/authdaemon/pid` | |
400 | rm -f /var/spool/courier/authdaemon/* | |
24593e93 | 401 | /sbin/service courier-authlib start |
ec099892 | 402 | fi |
7c5b4b59 AA |
403 | fi |
404 | ||
405 | %triggerin -- courier-imap-common < 4.0.0 | |
406 | if [ -f /etc/courier-imap/authdaemonrc ]; then | |
ec099892 | 407 | . /etc/courier-imap/authdaemonrc |
7c5b4b59 | 408 | |
eae3d21d | 409 | %{__sed} -i s/^authmodulelist=.*/"authmodulelist=\"`echo $authmodulelist \ |
ec099892 | 410 | | sed s/'authcram'/''/ | sed s/' '/' '/`\""/ /etc/authlib/authdaemonrc |
eae3d21d | 411 | %{__sed} -i s/^authmodulelistorig=.*/"authmodulelistorig=\"`echo $authmodulelistorig\ |
ec099892 | 412 | | sed s/'authcram'/''/ | sed s/' '/' '/`\""/ /etc/authlib/authdaemonrc |
eae3d21d | 413 | %{__sed} -i s/^daemons=.*/"daemons=$daemons"/ /etc/authlib/authdaemonrc |
7c5b4b59 AA |
414 | fi |
415 | if [ -f /var/lock/subsys/courier-imap ]; then | |
ec099892 ER |
416 | if [ -f /var/lib/authdaemon/pid ]; then |
417 | kill `cat /var/lib/authdaemon/pid` | |
418 | rm -f /var/lib/authdaemon/* | |
24593e93 | 419 | /sbin/service courier-authlib start |
ec099892 | 420 | fi |
7c5b4b59 AA |
421 | fi |
422 | ||
423 | %triggerin -- sqwebmail < 5.0.0 | |
424 | if [ -f /etc/sqwebmail/authdaemonrc ]; then | |
ec099892 | 425 | . /etc/sqwebmail/authdaemonrc |
7c5b4b59 | 426 | |
eae3d21d | 427 | %{__sed} -i s/^authmodulelist=.*/"authmodulelist=\"`echo $authmodulelist \ |
ec099892 | 428 | | sed s/'authcram'/''/ | sed s/' '/' '/`\""/ /etc/authlib/authdaemonrc |
eae3d21d | 429 | %{__sed} -i s/^authmodulelistorig=.*/"authmodulelistorig=\"`echo $authmodulelistorig\ |
ec099892 | 430 | | sed s/'authcram'/''/ | sed s/' '/' '/`\""/ /etc/authlib/authdaemonrc |
eae3d21d | 431 | %{__sed} -i s/^daemons=.*/"daemons=$daemons"/ /etc/authlib/authdaemonrc |
7c5b4b59 AA |
432 | fi |
433 | if [ -f /var/lock/subsys/sqwebmail ]; then | |
ec099892 ER |
434 | if [ -f /var/spool/sqwebmail/authdaemon/pid ]; then |
435 | kill `cat /var/spool/sqwebmail/authdaemon/pid` | |
436 | rm -f /var/spool/sqwebmail/authdaemon/* | |
24593e93 | 437 | /sbin/service courier-authlib start |
ec099892 | 438 | fi |
7c5b4b59 AA |
439 | fi |
440 | ||
441 | %triggerin -n %{name}-authldap -- courier-authldap < 0.48 | |
442 | if [ -f /etc/courier/authldaprc ]; then | |
ec099892 ER |
443 | mv -f /etc/authlib/authldaprc /etc/authlib/authldaprc.new |
444 | cp -f /etc/courier/authldaprc /etc/authlib/authldaprc | |
24593e93 | 445 | %service -q courier-authlib restart |
7c5b4b59 AA |
446 | fi |
447 | ||
448 | %triggerin -n %{name}-authldap -- courier-imap-authldap < 4.0.0 | |
449 | if [ -f /etc/courier-imap/authldaprc ]; then | |
ec099892 ER |
450 | mv -f /etc/authlib/authldaprc /etc/authlib/authldaprc.new |
451 | cp -f /etc/courier-imap/authldaprc /etc/authlib/authldaprc | |
24593e93 | 452 | %service -q courier-authlib restart |
7c5b4b59 AA |
453 | fi |
454 | ||
455 | %triggerin -n %{name}-authldap -- sqwebmail-auth-ldap < 5.0.0 | |
456 | if [ -f /etc/sqwebmail/authldaprc ]; then | |
ec099892 ER |
457 | mv -f /etc/authlib/authldaprc /etc/authlib/authldaprc.new |
458 | cp -f /etc/sqwebmail/authldaprc /etc/authlib/authldaprc | |
24593e93 | 459 | %service -q courier-authlib restart |
7c5b4b59 AA |
460 | fi |
461 | ||
462 | %triggerin -n %{name}-authmysql -- courier-authmysql < 0.48 | |
463 | if [ -f /etc/courier/authmysqlrc ]; then | |
ec099892 ER |
464 | mv -f /etc/authlib/authmysqlrc /etc/authlib/authmysqlrc.new |
465 | cp -f /etc/courier/authmysqlrc /etc/authlib/authmysqlrc | |
24593e93 | 466 | %service -q courier-authlib restart |
7c5b4b59 AA |
467 | fi |
468 | ||
469 | %triggerin -n %{name}-authmysql -- courier-imap-authmysql < 4.0.0 | |
470 | if [ -f /etc/courier-imap/authmysqlrc ]; then | |
ec099892 ER |
471 | mv -f /etc/authlib/authmysqlrc /etc/authlib/authmysqlrc.new |
472 | cp -f /etc/courier-imap/authmysqlrc /etc/authlib/authmysqlrc | |
24593e93 | 473 | %service -q courier-authlib restart |
7c5b4b59 AA |
474 | fi |
475 | ||
476 | %triggerin -n %{name}-authmysql -- sqwebmail-auth-mysql < 5.0.0 | |
477 | if [ -f /etc/sqwebmail/authmysqlrc ]; then | |
ec099892 ER |
478 | mv -f /etc/authlib/authmysqlrc /etc/authlib/authmysqlrc.new |
479 | cp -f /etc/sqwebmail/authmysqlrc /etc/authlib/authmysqlrc | |
24593e93 | 480 | %service -q courier-authlib restart |
7c5b4b59 AA |
481 | fi |
482 | ||
483 | %triggerin -n %{name}-authpgsql -- courier-authpgsql < 0.48 | |
484 | if [ -f /etc/courier/authpgsqlrc ]; then | |
ec099892 ER |
485 | mv -f /etc/authlib/authpgsqlrc /etc/authlib/authpgsqlrc.new |
486 | cp -f /etc/courier/authpgsqlrc /etc/authlib/authpgsqlrc | |
24593e93 | 487 | %service -q courier-authlib restart |
7c5b4b59 AA |
488 | fi |
489 | ||
490 | %triggerin -n %{name}-authpgsql -- courier-imap-authpgsql < 4.0.0 | |
491 | if [ -f /etc/courier-imap/authpgsqlrc ]; then | |
ec099892 ER |
492 | mv -f /etc/authlib/authpgsqlrc /etc/authlib/authpgsqlrc.new |
493 | cp -f /etc/courier-imap/authpgsqlrc /etc/authlib/authpgsqlrc | |
24593e93 | 494 | %service -q courier-authlib restart |
7c5b4b59 AA |
495 | fi |
496 | ||
497 | %triggerin -n %{name}-authpgsql -- sqwebmail-auth-pgsql < 5.0.0 | |
498 | if [ -f /etc/sqwebmail/authpgsqlrc ]; then | |
ec099892 ER |
499 | mv -f /etc/authlib/authpgsqlrc /etc/authlib/authpgsqlrc.new |
500 | cp -f /etc/sqwebmail/authpgsqlrc /etc/authlib/authpgsqlrc | |
24593e93 | 501 | %service -q courier-authlib restart |
7c5b4b59 AA |
502 | fi |
503 | ||
a25e80b2 | 504 | %triggerin -n %{name}-authuserdb -- courier < 0.48 |
7c5b4b59 | 505 | if [ -d /etc/courier/userdb ]; then |
ec099892 ER |
506 | mv -f /etc/courier/userdb/* /etc/authlib/userdb |
507 | makeuserdb | |
7c5b4b59 AA |
508 | fi |
509 | if [ -f /etc/courier/userdb ]; then | |
ec099892 ER |
510 | mv -f /etc/courier/userdb /etc/authlib/userdb |
511 | makeuserdb | |
7c5b4b59 AA |
512 | fi |
513 | ||
a25e80b2 | 514 | %triggerin -n %{name}-authuserdb -- courier-imap-userdb < 4.0.0 |
7c5b4b59 | 515 | if [ -d /etc/courier-imap/userdb ]; then |
ec099892 ER |
516 | mv -f /etc/courier-imap/userdb/* /etc/authlib/userdb |
517 | makeuserdb | |
7c5b4b59 AA |
518 | fi |
519 | if [ -f /etc/courier-imap/userdb ]; then | |
ec099892 ER |
520 | mv -f /etc/courier-imap/userdb /etc/authlib/userdb |
521 | makeuserdb | |
7c5b4b59 AA |
522 | fi |
523 | ||
a25e80b2 | 524 | %triggerin -n %{name}-authuserdb -- sqwebmail-auth-userdb < 5.0.0 |
7c5b4b59 | 525 | if [ -d /etc/sqwebmail/userdb ]; then |
ec099892 ER |
526 | mv -f /etc/sqwebmail/userdb/* /etc/authlib/userdb |
527 | makeuserdb | |
7c5b4b59 AA |
528 | fi |
529 | if [ -f /etc/sqwebmail/userdb ]; then | |
ec099892 ER |
530 | mv -f /etc/sqwebmail/userdb /etc/authlib/userdb |
531 | makeuserdb | |
7c5b4b59 | 532 | fi |
d8024fa3 | 533 | |
8cd33d7f AA |
534 | %files |
535 | %defattr(644,root,root,755) | |
5b23ae53 JB |
536 | # COPYING contains only note |
537 | %doc AUTHORS COPYING ChangeLog NEWS README README*html README.authmysql.myownquery authldap.schema | |
eae3d21d | 538 | %attr(755,root,root) %{_bindir}/makedat |
8cd33d7f | 539 | %dir %{_sysconfdir}/authlib |
e19cf09a | 540 | %attr(754,root,root) /etc/rc.d/init.d/courier-authlib |
c6288251 | 541 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authdaemonrc |
8cd33d7f AA |
542 | %attr(755,root,root) %{_libexecdir}/courier-authlib/authdaemond |
543 | %attr(755,root,root) %{_libexecdir}/courier-authlib/authsystem.passwd | |
544 | %attr(755,root,root) %{_libexecdir}/courier-authlib/makedatprog | |
a682a4df | 545 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libauthcustom.so |
5c08e216 | 546 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthcustom.so.0 |
a682a4df | 547 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libauthpam.so |
5c08e216 | 548 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthpam.so.0 |
a682a4df | 549 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauthcommon.so |
5c08e216 | 550 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libcourierauthcommon.so.0 |
a682a4df | 551 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauthsasl.so |
5c08e216 | 552 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libcourierauthsasl.so.0 |
a682a4df | 553 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauthsaslclient.so |
5c08e216 | 554 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libcourierauthsaslclient.so.0 |
d8024fa3 AA |
555 | %{_libexecdir}/courier-authlib/libauthcustom.la |
556 | %{_libexecdir}/courier-authlib/libauthpam.la | |
557 | %{_libexecdir}/courier-authlib/libcourierauth.la | |
558 | %{_libexecdir}/courier-authlib/libcourierauthcommon.la | |
559 | %{_libexecdir}/courier-authlib/libcourierauthsasl.la | |
560 | %{_libexecdir}/courier-authlib/libcourierauthsaslclient.la | |
8cd33d7f | 561 | %attr(770,root,daemon) %dir %{_localstatedir}/spool/authdaemon |
73c4092d | 562 | %attr(777,root,root) %ghost %{_localstatedir}/spool/authdaemon/socket |
8cd33d7f AA |
563 | %attr(755,root,root) %{_sbindir}/authdaemond |
564 | %attr(755,root,root) %{_sbindir}/authenumerate | |
fff07340 | 565 | %attr(755,root,root) %{_sbindir}/authpasswd |
8cd33d7f AA |
566 | %attr(755,root,root) %{_sbindir}/authtest |
567 | %attr(755,root,root) %{_sbindir}/courierlogger | |
568 | %{_mandir}/man1/* | |
569 | ||
109ce427 ER |
570 | %files libs |
571 | %defattr(644,root,root,755) | |
572 | %dir %{_libexecdir}/courier-authlib | |
a682a4df | 573 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauth.so |
5c08e216 | 574 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libcourierauth.so.0 |
109ce427 | 575 | |
8cd33d7f AA |
576 | %files devel |
577 | %defattr(644,root,root,755) | |
578 | %doc authlib.html auth_*.html | |
579 | %attr(755,root,root) %{_bindir}/courierauthconfig | |
580 | %{_includedir}/* | |
581 | %{_mandir}/man3/* | |
d24cdae7 | 582 | %attr(755,root,root) %{_libexecdir}/courier-authlib/*.so |
8cd33d7f | 583 | |
905c8d0b | 584 | %if %{with ldap} |
8cd33d7f AA |
585 | %files authldap |
586 | %defattr(644,root,root,755) | |
587 | %doc authldap.schema README.ldap | |
c6288251 | 588 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authldaprc |
a682a4df | 589 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libauthldap.so |
5c08e216 | 590 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthldap.so.0 |
d8024fa3 | 591 | %{_libexecdir}/courier-authlib/libauthldap.la |
905c8d0b | 592 | %endif |
8cd33d7f AA |
593 | |
594 | %files authmysql | |
595 | %defattr(644,root,root,755) | |
c6288251 | 596 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authmysqlrc |
a682a4df | 597 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libauthmysql.so |
5c08e216 | 598 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthmysql.so.0 |
d8024fa3 | 599 | %{_libexecdir}/courier-authlib/libauthmysql.la |
8cd33d7f AA |
600 | |
601 | %files authpgsql | |
602 | %defattr(644,root,root,755) | |
c6288251 | 603 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authpgsqlrc |
a682a4df | 604 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libauthpgsql.so |
5c08e216 | 605 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthpgsql.so.0 |
d8024fa3 | 606 | %{_libexecdir}/courier-authlib/libauthpgsql.la |
8cd33d7f | 607 | |
a25e80b2 | 608 | %files authuserdb |
8cd33d7f | 609 | %defattr(644,root,root,755) |
7c5b4b59 | 610 | %attr(700,root,root) %dir %{_sysconfdir}/authlib/userdb |
8cd33d7f | 611 | %attr(755,root,root) %{_sbindir}/makeuserdb |
7c5b4b59 | 612 | %attr(755,root,root) %{_sbindir}/pw2userdb |
8cd33d7f | 613 | %attr(755,root,root) %{_sbindir}/userdb |
7c5b4b59 | 614 | %attr(755,root,root) %{_sbindir}/userdb-test-cram-md5 |
8cd33d7f | 615 | %attr(755,root,root) %{_sbindir}/userdbpw |
a682a4df | 616 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libauthuserdb.so |
5c08e216 | 617 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthuserdb.so.0 |
d8024fa3 | 618 | %{_libexecdir}/courier-authlib/libauthuserdb.la |
8cd33d7f | 619 | %{_mandir}/man8/*userdb* |
8d3b74ac | 620 | |
a25e80b2 | 621 | %files authpipe |
8d3b74ac | 622 | %defattr(644,root,root,755) |
a682a4df | 623 | %attr(755,root,root) %{_libexecdir}/courier-authlib/libauthpipe.so |
5c08e216 | 624 | %attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthpipe.so.0 |
8d3b74ac | 625 | %{_libexecdir}/courier-authlib/libauthpipe.la |
c259485d | 626 | |
905c8d0b | 627 | %if %{with ldap} |
c259485d ER |
628 | %files -n openldap-schema-courier |
629 | %defattr(644,root,root,755) | |
630 | %{schemadir}/*.schema | |
905c8d0b | 631 | %endif |