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