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