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