Import Upstream version 0.69.0
[hcoop/debian/courier-authlib.git] / Makefile.am
CommitLineData
d9898ee8 1#
8d138742 2# Copyright 1998 - 2009 Double Precision, Inc. See COPYING for
d9898ee8 3# distribution information.
4
d9898ee8 5AUTOMAKE_OPTIONS=dist-bzip2
6
d50284c4 7SUBDIRS=libs/gdbmobj libs/bdbobj libs/md5 libs/sha1 libs/libhmac libs/numlib libs/makedat userdb libs/rfc822 libs/random128 libs/liblock liblog
d9898ee8 8
b0322a85 9AM_CPPFLAGS=-I liblock $(LTDLINCL)
d9898ee8 10
11modules=@LIBAUTHUSERDB@ \
12 @LIBAUTHPAM@ @LIBAUTHPWD@ @LIBAUTHSHADOW@ \
b0322a85 13 @LIBAUTHPGSQL@ @LIBAUTHLDAP@ @LIBAUTHMYSQL@ @LIBAUTHSQLITE@ \
ac40fd9e 14 @LIBAUTHCUSTOM@ @LIBAUTHPIPE@
d9898ee8 15
16pkglibexecdir=$(libexecdir)/courier-authlib
17pkglibexec_SCRIPTS=authsystem.passwd
18
19pkglib_LTLIBRARIES=libcourierauth.la \
0e333c05
CE
20 libcourierauthcommon.la libcourierauthsasl.la libcourierauthsaslclient.la \
21 $(modules)
d9898ee8 22sbin_SCRIPTS=authdaemond
23sbin_PROGRAMS=authtest authenumerate authpasswd
24bin_PROGRAMS=courierauthconfig
25
26EXTRA_LTLIBRARIES=libauthuserdb.la \
27 libauthpam.la libauthpwd.la libauthshadow.la \
d9898ee8 28 libauthpgsql.la \
29 libauthldap.la \
30 libauthmysql.la \
b0322a85 31 libauthsqlite.la \
d9898ee8 32 libauthcustom.la \
33 libauthpipe.la
34
b0322a85 35CLEANFILES=authldaprc.h authmysqlrc.h authsqliterc.h authdaemonrc.h \
d9898ee8 36 authpgsqlrc.h authpiperc.h authdaemon \
37 authlib.3 authlib.html packageversion.h \
38 authchangepwdir.h sbindir.h pkglibdir.h pkgincludedir.h \
39 mailusergroup.h authinfodaemondlist.c permissions.dat \
40 README.authdebug.html
41
42DISTCLEANFILES=dbobj.config README_authlib.html
43
44commonlibdep=libcourierauthcommon.la
ac40fd9e 45commonldflags=-module -rpath $(pkglibdir) -export-symbols-regex 'courier_auth.*_init' -avoid-version
d9898ee8 46commonlibadd=libcourierauthcommon.la
47
48libcourierauthcommon_t=@CRYPTLIBS@
49libcourierauthcommon_la_SOURCES= \
50 auth.h courierauth.h \
0e333c05
CE
51 authconfigfile.cpp \
52 authconfigfile.h \
d9898ee8 53 authpwdenumerate.c \
54 authsaslfrombase64.c authsasltobase64.c \
b0322a85 55 courierauthstaticlist.h \
d9898ee8 56 authsyschangepwd.c authsyscommon.c \
8d138742 57 authldapescape.c \
0e333c05 58 cramlib.c \
d9898ee8 59 checkpassword.c cryptpassword.c \
ac40fd9e 60 checkpasswordmd5.c checkpasswordsha1.c
d9898ee8 61
62libcourierauthcommon_la_DEPENDENCIES=libcourierauth.la
63libcourierauthcommon_la_LIBADD=libcourierauth.la
ac40fd9e 64libcourierauthcommon_la_LDFLAGS=$(libcourierauthcommon_t:%=-Wl,%) -avoid-version
d9898ee8 65
66libcourierauth_la_SOURCES=authdaemon.c authdaemonlib.c preauthdaemon.c \
67 authmoduser2.c authmoduser3.c debug.c \
68 courierauthdebug.h \
69 authoption.c
b0322a85
CE
70libcourierauth_la_LIBADD=libs/libhmac/libhmac.la libs/md5/libmd5.la libs/sha1/libsha1.la libs/numlib/libnumlib.la \
71 libs/random128/librandom128.la libs/rfc822/libencode.la
ac40fd9e 72libcourierauth_la_LDFLAGS=@NETLIBS@ -avoid-version
d9898ee8 73
74# The userdb module
75
76libauthuserdb_t=userdb/libuserdb.la @dblibrary@ @LIBGDBM@ @LIBDB@
77libauthuserdb_la_SOURCES=authuserdb.c preauthuserdb.c preauthuserdbcommon.c \
78 authuserdbpwd.c
79libauthuserdb_la_DEPENDENCIES=libcourierauthcommon.la @dblibrary@
80libauthuserdb_la_LIBADD=$(commonlibadd) $(libauthuserdb_t)
81libauthuserdb_la_LDFLAGS=$(commonldflags)
82
83# the authpam module
84
85libauthpam_t=-lpam @SHADOWLIBS@ @AUTHPAMCRYPT@ @LIBDL@
86
87libauthpam_la_SOURCES=authpam.c preauthpam.c authwait.h
88libauthpam_la_DEPENDENCIES=$(commonlibdep)
ac40fd9e 89libauthpam_la_LIBADD=$(commonlibadd) $(libauthpam_t)
90libauthpam_la_LDFLAGS=$(commonldflags)
d9898ee8 91
92# The authpwd module
93
94libauthpwd_la_SOURCES=authpwd.c preauthpwd.c
95libauthpwd_la_DEPENDENCIES=$(commonlibdep)
96libauthpwd_la_LIBADD=$(commonlibadd)
97libauthpwd_la_LDFLAGS=$(commonldflags)
98
99# The authshadow module
100
101libauthshadow_t=@SHADOWLIBS@
102
103libauthshadow_la_SOURCES=authshadow.c preauthshadow.c
104libauthshadow_la_DEPENDENCIES=$(commonlibdep)
ac40fd9e 105libauthshadow_la_LIBADD=$(commonlibadd) $(libauthshadow_t)
106libauthshadow_la_LDFLAGS=$(commonldflags)
d9898ee8 107
108# The authpgsql module
109
110libauthpgsql_t=@PGSQL_LIBS@ @LIBM@ @NETLIBS@
111
0e333c05 112libauthpgsql_la_SOURCES=authpgsql.c authpgsqllib.cpp authpgsql.h
d9898ee8 113libauthpgsql_la_DEPENDENCIES=$(commonlibdep)
ac40fd9e 114libauthpgsql_la_LIBADD=$(commonlibadd) $(libauthpgsql_t)
115libauthpgsql_la_LDFLAGS=$(commonldflags)
d9898ee8 116
d9898ee8 117if HAVE_AUTHPGSQL
118
119install-authpgsqlrc:
120 $(mkinstalldirs) $(DESTDIR)`dirname @authpgsqlrc@` || :
121 $(INSTALL_DATA) -m 660 $(srcdir)/authpgsqlrc \
122 $(DESTDIR)@authpgsqlrc@.dist
123 -chown @mailuser@ $(DESTDIR)@authpgsqlrc@.dist
124 -chgrp @mailgroup@ $(DESTDIR)@authpgsqlrc@.dist
125
126uninstall-authpgsqlrc:
127 rm -f $(DESTDIR)@authpgsqlrc@.dist
128
129else
130
131install-authpgsqlrc:
132 @:
133
134uninstall-authpgsqlrc:
135 @:
136endif
137
138authpgsqlrc.h:
139 echo "#define AUTHPGSQLRC \"@authpgsqlrc@\"" >authpgsqlrc.h
140
141
142# The authldap module
143
144libauthldap_t=@LDAPLIBS@ @NETLIBS@
0e333c05 145libauthldap_la_SOURCES=authldap.c preauthldap.c authldaplib.cpp authldap.h
d9898ee8 146libauthldap_la_DEPENDENCIES=$(commonlibdep)
ac40fd9e 147libauthldap_la_LIBADD=$(commonlibadd) $(libauthldap_t)
148libauthldap_la_LDFLAGS=$(commonldflags)
d9898ee8 149
d9898ee8 150if HAVE_LDAP
151
152install-authldaprc:
153 $(mkinstalldirs) $(DESTDIR)`dirname @authldaprc@` || :
154 $(INSTALL_DATA) -m 660 $(srcdir)/authldaprc \
155 $(DESTDIR)@authldaprc@.dist
156 -chown @mailuser@ $(DESTDIR)@authldaprc@.dist
157 -chgrp @mailgroup@ $(DESTDIR)@authldaprc@.dist
158
159uninstall-authldaprc:
160 rm -f $(DESTDIR)@authldaprc@.dist
161
162else
163install-authldaprc:
164 @:
165
166uninstall-authldaprc:
167 @:
168endif
169
170authldaprc.h:
171 echo "#define AUTHLDAPRC \"@authldaprc@\"" >authldaprc.h
172
173# The authmysql module
174
175libauthmysql_t=@MYSQL_LIBS@ @LIBM@ @NETLIBS@
176
0e333c05 177libauthmysql_la_SOURCES=authmysql.cpp preauthmysql.cpp authmysqllib.cpp authmysql.h
d9898ee8 178libauthmysql_la_DEPENDENCIES=$(commonlibdep)
ac40fd9e 179libauthmysql_la_LIBADD=$(commonlibadd) $(libauthmysql_t)
180libauthmysql_la_LDFLAGS=$(commonldflags)
d9898ee8 181
d9898ee8 182if HAVE_AUTHMYSQL
183install-authmysqlrc:
184 $(mkinstalldirs) $(DESTDIR)`dirname @authmysqlrc@` || :
185 $(INSTALL_DATA) -m 660 $(srcdir)/authmysqlrc \
186 $(DESTDIR)@authmysqlrc@.dist
187 -chown @mailuser@ $(DESTDIR)@authmysqlrc@.dist
188 -chgrp @mailgroup@ $(DESTDIR)@authmysqlrc@.dist
189
190uninstall-authmysqlrc:
191 rm -f $(DESTDIR)@authmysqlrc@.dist
192
193else
194install-authmysqlrc:
195 @:
196
197uninstall-authmysqlrc:
198 @:
199endif
200
201authmysqlrc.h:
202 echo "#define AUTHMYSQLRC \"@authmysqlrc@\"" >authmysqlrc.h
203
b0322a85
CE
204# The authsqlite module
205
206libauthsqlite_t=@SQLITE_LIBS@ @NETLIBS@
207
0e333c05 208libauthsqlite_la_SOURCES=authsqlite.cpp authsqlitelib.cpp authsqlite.h
b0322a85
CE
209libauthsqlite_la_DEPENDENCIES=$(commonlibdep)
210libauthsqlite_la_LIBADD=$(commonlibadd) $(libauthsqlite_t)
211libauthsqlite_la_LDFLAGS=$(commonldflags)
212
b0322a85
CE
213if HAVE_AUTHSQLITE
214install-authsqliterc:
215 $(mkinstalldirs) $(DESTDIR)`dirname @authsqliterc@` || :
216 $(INSTALL_DATA) -m 660 $(srcdir)/authsqliterc \
217 $(DESTDIR)@authsqliterc@.dist
218 -chown @mailuser@ $(DESTDIR)@authsqliterc@.dist
219 -chgrp @mailgroup@ $(DESTDIR)@authsqliterc@.dist
220
221uninstall-authsqliterc:
222 rm -f $(DESTDIR)@authsqliterc@.dist
223
224else
225install-authsqliterc:
226 @:
227
228uninstall-authsqliterc:
229 @:
230endif
231
232authsqliterc.h:
233 echo "#define AUTHSQLITERC \"@authsqliterc@\"" >authsqliterc.h
234
d9898ee8 235# The authcustom module
236
237libauthcustom_la_SOURCES=authcustom.c preauthcustom.c authcustom.h
238libauthcustom_la_DEPENDENCIES=$(commonlibdep)
239libauthcustom_la_LIBADD=$(commonlibadd)
240libauthcustom_la_LDFLAGS=$(commonldflags)
241
242# The authpipe module
243libauthpipe_la_SOURCES=authpipe.c authpipelib.h authpipelib.c
244libauthpipe_la_DEPENDENCIES=$(commonlibdep)
245libauthpipe_la_LIBADD=$(commonlibadd)
246libauthpipe_la_LDFLAGS=$(commonldflags)
247
248authpipelib.lo: authpipelib.c authpipelib.h authpiperc.h
249
250authpiperc.h:
251 echo "#define PIPE_PROGRAM \"@authProg@\"" >authpiperc.h
252
253
254#
255# AUTHMODULES should be listed in the best authentication order
256#
257
258noinst_PROGRAMS= \
259 authdaemontest authmksock \
260 authdaemondprog
261
d9898ee8 262install-authdaemonrc:
263 $(mkinstalldirs) $(DESTDIR)`dirname @authdaemonrc@` || :
264 sed 's/@ALLMODULES@/$(modules:lib%.la=%)/' <authdaemonrc >authdaemonrc.tmp
265 $(INSTALL_DATA) -m 660 authdaemonrc.tmp $(DESTDIR)@authdaemonrc@.dist
266 rm -f authdaemonrc.tmp
267 -chown @mailuser@ $(DESTDIR)@authdaemonrc@.dist
268 -chgrp @mailgroup@ $(DESTDIR)@authdaemonrc@.dist
269
270uninstall-authdaemonrc:
271 rm -f $(DESTDIR)@authdaemonrc@.dist
272
273authdaemonrc.h:
274 echo "#define AUTHDAEMONRC \"@authdaemonrc@\"" >authdaemonrc.h
275 echo "#define AUTHDAEMONVAR \"@authdaemonvar@\"" >>authdaemonrc.h
276 echo "#define AUTHDAEMONPID AUTHDAEMONVAR \"/pid\"" >>authdaemonrc.h
277 echo "#define AUTHDAEMONSOCK AUTHDAEMONVAR \"/socket\"" >>authdaemonrc.h
278 echo "#define AUTHDAEMONLOCK AUTHDAEMONVAR \"/lock\"" >>authdaemonrc.h
279
280HTMLFILES=README.html NEWS.html INSTALL.html \
b0322a85 281 README.authsqlite.html README.authmysql.html README.authpostgres.html
d9898ee8 282
0e333c05
CE
283
284if HAVE_SGML
285
286GITFILES=authldaprc authmysqlrc authpgsqlrc authsqliterc authdaemonrc.in
287
288$(GITFILES): %: %.git
289 perl -p -e 's/\$$Id:[^\$$]*/\$$Id: '"`git log --pretty=format:\"%H\" -n 1 -- $<`-`date +%Y%m%d%H%M%S`/" <$< >$@.tmp
290 mv -f $@.tmp $@
291endif
292
d9898ee8 293EXTRA_DIST=$(HTMLFILES) sysconftool COPYING COPYING.GPL\
294 authldap.schema \
8d138742 295 authldap.ldif \
0e333c05 296 $(GITFILES) README.ldap \
d9898ee8 297 README.authmysql.myownquery \
dd184caf 298 README.authdebug.html.in \
d9898ee8 299 courier-authlib.spec \
300 courier-authlib.lpspec pgpkeys.txt \
301 README_authlib.html.in \
302 authlib.html.in authlib.3.in \
303 authpasswd.html authpasswd.1 \
304 authtest.html authtest.1 \
8d138742 305 auth_sasl.html auth_sasl.3 auth_sasl_ex.3 \
d9898ee8 306 auth_generic.html auth_generic.3 \
307 auth_login.html auth_login.3 \
308 auth_passwd.html auth_passwd.3 \
309 auth_getuserinfo.html auth_getuserinfo.3 \
d50284c4 310 auth_mkhomedir.html auth_mkhomedir.3 \
d9898ee8 311 auth_enumerate.html auth_enumerate.3 \
312 auth_getoption.html auth_getoption.3 \
dd184caf 313 samplepipe.pl
d9898ee8 314
315README: README.html
dd184caf 316 links -dump -no-references README.html >README
d9898ee8 317
318NEWS: NEWS.html
dd184caf 319 links -dump -no-references NEWS.html >NEWS
d9898ee8 320
321INSTALL: INSTALL.html
dd184caf 322 rm -f INSTALL; links -dump -no-references INSTALL.html >INSTALL
d9898ee8 323
324libcourierauthsasl_la_SOURCES=\
325 authsasl.c courierauthsasl.h \
326 authsaslcram.c authsasllogin.c authsaslplain.c \
327 authsaslfrombase64.c authsasltobase64.c
b0322a85
CE
328libcourierauthsasl_la_LIBADD=libcourierauthcommon.la libcourierauth.la
329libcourierauthsasl_la_LDFLAGS=-export-symbols-regex '^auth_sasl|auth_sasl_ex|auth_sasl_extract_userid$$' -avoid-version
d9898ee8 330
331libcourierauthsaslclient_la_SOURCES=courierauthsaslclient.h \
332 authsaslclient.c authsaslclient.h authsaslclientcram.c \
333 authsaslclientcrammd5.c authsaslclientcramsha1.c \
334 authsaslclientlogin.c authsaslclientplain.c \
ac40fd9e 335 authsaslclientexternal.c \
d9898ee8 336 authsaslfrombase64.c authsasltobase64.c
337libcourierauthsaslclient_la_LIBADD=libcourierauth.la
ac40fd9e 338libcourierauthsaslclient_la_LDFLAGS=-export-symbols-regex '^auth_sasl_client$$' -avoid-version
d9898ee8 339
340include_HEADERS=courier_auth_config.h courierauth.h courierauthsasl.h \
b0322a85 341 courierauthsaslclient.h courierauthdebug.h courierauthstaticlist.h
d9898ee8 342
343courierauthconfig_SOURCES=authinfo.c
344
345authpasswd_SOURCES=authpasswd.c
346authpasswd_LDADD=libcourierauthcommon.la \
b0322a85 347 libs/libhmac/libhmac.la libs/md5/libmd5.la libs/sha1/libsha1.la libs/rfc822/libencode.la
d9898ee8 348
349authtest_SOURCES=authtest.c
350authtest_DEPENDENCIES=libcourierauth.la
351authtest_LDADD=libcourierauth.la
352
353authenumerate_SOURCES=authenumerate.c
354authenumerate_DEPENDENCIES = libcourierauth.la \
b0322a85 355 libs/numlib/libnumlib.la
d9898ee8 356authenumerate_LDADD = libcourierauth.la \
b0322a85 357 libs/numlib/libnumlib.la
d9898ee8 358authenumerate_LDFLAGS=
359
360#
361# The main daemon.
362
0e333c05
CE
363authdaemondprog_SOURCES=authdaemond.c authdaemondcpp.cpp
364
d9898ee8 365authdaemondprog_DEPENDENCIES=libcourierauthcommon.la \
0e333c05 366 libcourierauth.la \
b0322a85
CE
367 libs/liblock/liblock.la $(modules) \
368 libs/libhmac/libhmac.la libs/md5/libmd5.la libs/sha1/libsha1.la \
369 libs/rfc822/libencode.la libs/numlib/libnumlib.la
0e333c05 370authdaemondprog_LDADD=$(LIBLTDL) libcourierauthcommon.la libcourierauth.la libs/liblock/liblock.la \
b0322a85
CE
371 libs/libhmac/libhmac.la libs/md5/libmd5.la libs/sha1/libsha1.la \
372 libs/rfc822/libencode.la libs/numlib/libnumlib.la
d9898ee8 373authdaemondprog_LDFLAGS=-export-dynamic $(modules:%=-dlopen %) @NETLIBS@
374
375authdaemontest_SOURCES=authdaemontest.c
376authdaemontest_DEPENDENCIES=libcourierauthcommon.la
377authdaemontest_LDADD=libcourierauthcommon.la @NETLIBS@
378authdaemontest_LDFLAGS=-static
379
380authmksock_SOURCES=authmksock.c
381authmksock_LDADD=@NETLIBS@
382
d50284c4 383man3=authlib.3 auth_generic.3 auth_login.3 auth_getuserinfo.3 auth_mkhomedir.3 \
d9898ee8 384 auth_enumerate.3 auth_passwd.3 auth_getoption.3 auth_sasl.3
385man1=authpasswd.1 authtest.1
386
8d138742 387man_MANS=$(man1) $(man3) auth_sasl_ex.3
d9898ee8 388
389BUILT1=authlib.html authldaprc.h authmysqlrc.h authpgsqlrc.h authpiperc.h \
ac40fd9e 390 authdaemonrc.h packageversion.h \
d9898ee8 391 authchangepwdir.h sbindir.h \
392 pkglibdir.h pkgincludedir.h mailusergroup.h \
393 README_authlib.html
0e333c05
CE
394BUILT_SOURCES=$(BUILT1) $(GITFILES) $(man3:%.3=%.html) $(man1:%.1=%.html) \
395 authsqliterc.h authmysqlrc.h authpgsqlrc.h authldaprc.h
d9898ee8 396
397authchangepwdir.h: config.status
398 echo '#define AUTHCHANGEPWDIR "$(pkglibexecdir)"' >authchangepwdir.h
399
400sbindir.h: config.status
401 echo '#define SBINDIR "@sbindir@"' >sbindir.h
402
403pkglibdir.h: config.status
404 echo '#define PKGLIBDIR "$(pkglibdir)"' >pkglibdir.h
405
406packageversion.h: config.status
407 echo '#define PKGVERSION "@PACKAGE_VERSION@"' >packageversion.h
408
409pkgincludedir.h: config.status
410 echo '#define PKGINCLUDEDIR "$(includedir)"' >pkgincludedir.h
411
412mailusergroup.h: config.status
413 echo '#define MAILUSER "@mailuser@"' >mailusergroup.h
414 echo '#define MAILGROUP "@mailgroup@"' >>mailusergroup.h
415
416noinst_DATA=$(BUILT_SOURCES)
417
418dist-hook:
419 for f in $(BUILT1) ; do rm -f $(distdir)/$$f; done
420
421# automake still a bit stupid...
422
423install-data-hook: install-authdaemonrc install-authpgsqlrc \
b0322a85 424 install-authldaprc install-authmysqlrc install-authsqliterc
d9898ee8 425 :
426
427install-exec-hook:
428 $(mkinstalldirs) $(DESTDIR)$(bindir) || :
429 $(mkinstalldirs) $(DESTDIR)$(sbindir) || :
430 $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir) || :
b0322a85
CE
431 chmod 755 $(DESTDIR)$(pkglibexecdir)
432 -chown @mailuser@ $(DESTDIR)$(pkglibexecdir)
433 -chgrp @mailgroup@ $(DESTDIR)$(pkglibexecdir)
d9898ee8 434 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) authdaemondprog $(DESTDIR)$(pkglibexecdir)/authdaemond
435 $(mkinstalldirs) $(DESTDIR)@authdaemonvar@ || :
436 chmod 750 $(DESTDIR)@authdaemonvar@
437 -chown @mailuser@ $(DESTDIR)@authdaemonvar@
438 -chgrp @mailgroup@ $(DESTDIR)@authdaemonvar@
439 test "@LIBAUTHUSERDB@" = "" && exit 0 ;\
b0322a85 440 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) libs/makedat/makedatprog \
d9898ee8 441 $(DESTDIR)$(pkglibexecdir)/makedatprog ; \
d9898ee8 442 $(INSTALL_SCRIPT) userdb/pw2userdb \
443 $(DESTDIR)$(sbindir)/pw2userdb ; \
444 $(INSTALL_SCRIPT) userdb/makeuserdb \
445 $(DESTDIR)$(sbindir)/makeuserdb ; \
446 $(INSTALL_SCRIPT) userdb/userdb.pl \
447 $(DESTDIR)$(sbindir)/userdb ; \
448 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) userdb/userdbpw \
449 $(DESTDIR)$(sbindir)/userdbpw ; \
450 $(INSTALL_SCRIPT) userdb-test-cram-md5.pl \
451 $(DESTDIR)$(sbindir)/userdb-test-cram-md5
452
b0322a85 453uninstall-hook: uninstall-authldaprc uninstall-authdaemonrc uninstall-authmysqlrc uninstall-authpgsqlrc uninstall-authsqliterc
d9898ee8 454 rm -f $(DESTDIR)$(pkglibexecdir)/authdaemond
455 test "@AUTHUSERDB@" = "" && exit 0 ;\
456 rm -f $(DESTDIR)$(pkglibexecdir)/makedatprog \
d9898ee8 457 $(DESTDIR)$(sbindir)/pw2userdb \
458 $(DESTDIR)$(sbindir)/makeuserdb \
459 $(DESTDIR)$(sbindir)/userdb \
460 $(DESTDIR)$(sbindir)/userdbpw \
461 $(DESTDIR)$(sbindir)/userdb-test-cram-md5
462
463authlib.html: authlib.html.in
8d138742 464 $(SHELL) ./config.status --file=authlib.html
d9898ee8 465
466authlib.3: authlib.3.in
8d138742 467 $(SHELL) ./config.status --file=authlib.3
d9898ee8 468
469if HAVE_SGML
d50284c4 470
b0322a85
CE
471authpasswd.html: authpasswd.sgml libs/docbook/sgml2html
472 libs/docbook/sgml2html authpasswd.sgml authpasswd.html
d9898ee8 473
b0322a85
CE
474authpasswd.1: authpasswd.sgml libs/docbook/sgml2man
475 libs/docbook/sgml2man authpasswd.sgml authpasswd.1
d9898ee8 476
b0322a85
CE
477authtest.html: authtest.sgml libs/docbook/sgml2html
478 libs/docbook/sgml2html authtest.sgml authtest.html
d9898ee8 479
b0322a85
CE
480authtest.1: authtest.sgml libs/docbook/sgml2man
481 libs/docbook/sgml2man authtest.sgml authtest.1
d9898ee8 482
b0322a85
CE
483authlib.html.in: authlib.sgml libs/docbook/sgml2html
484 libs/docbook/sgml2html authlib.sgml authlib.html.in
d9898ee8 485
b0322a85
CE
486authlib.3.in: authlib.sgml libs/docbook/sgml2man
487 libs/docbook/sgml2man authlib.sgml authlib.3.in
8d138742 488 mv authlib.3 authlib.3.in
d9898ee8 489
b0322a85 490README_authlib.html.in: README_authlib.sgml optionlist.sgml libs/docbook/sgml2html
d50284c4 491 libs/docbook/sgml2html README_authlib.sgml README_authlib.html.in "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 492
b0322a85 493auth_generic.html: auth_generic.sgml authcallback.sgml optionlist.sgml libs/docbook/sgml2html
d50284c4 494 libs/docbook/sgml2html auth_generic.sgml auth_generic.html "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 495
b0322a85 496auth_generic.3: auth_generic.sgml authcallback.sgml optionlist.sgml libs/docbook/sgml2man
d50284c4 497 libs/docbook/sgml2man auth_generic.sgml auth_generic.3 "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 498
b0322a85 499auth_login.html: auth_login.sgml authcallback.sgml optionlist.sgml libs/docbook/sgml2html
d50284c4 500 libs/docbook/sgml2html auth_login.sgml auth_login.html "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 501
b0322a85 502auth_login.3: auth_login.sgml authcallback.sgml optionlist.sgml libs/docbook/sgml2man
d50284c4 503 libs/docbook/sgml2man auth_login.sgml auth_login.3 "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 504
b0322a85 505auth_getuserinfo.html: auth_getuserinfo.sgml authcallback.sgml optionlist.sgml libs/docbook/sgml2html
d50284c4 506 libs/docbook/sgml2html auth_getuserinfo.sgml auth_getuserinfo.html "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 507
b0322a85 508auth_getuserinfo.3: auth_getuserinfo.sgml authcallback.sgml optionlist.sgml libs/docbook/sgml2man
d50284c4
CE
509 libs/docbook/sgml2man auth_getuserinfo.sgml auth_getuserinfo.3 "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
510
511auth_mkhomedir.html: auth_mkhomedir.sgml authcallback.sgml optionlist.sgml libs/docbook/sgml2html
512 libs/docbook/sgml2html auth_mkhomedir.sgml auth_mkhomedir.html "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
513
514auth_mkhomedir.3: auth_mkhomedir.sgml authcallback.sgml optionlist.sgml libs/docbook/sgml2man
515 libs/docbook/sgml2man auth_mkhomedir.sgml auth_mkhomedir.3 "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 516
b0322a85 517auth_enumerate.html: auth_enumerate.sgml libs/docbook/sgml2html
d50284c4 518 libs/docbook/sgml2html auth_enumerate.sgml auth_enumerate.html "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 519
b0322a85 520auth_enumerate.3: auth_enumerate.sgml libs/docbook/sgml2man
d50284c4 521 libs/docbook/sgml2man auth_enumerate.sgml auth_enumerate.3 "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 522
b0322a85 523auth_passwd.html: auth_passwd.sgml libs/docbook/sgml2html
d50284c4 524 libs/docbook/sgml2html auth_passwd.sgml auth_passwd.html "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 525
b0322a85 526auth_passwd.3: auth_passwd.sgml libs/docbook/sgml2man
d50284c4 527 libs/docbook/sgml2man auth_passwd.sgml auth_passwd.3 "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 528
b0322a85 529auth_getoption.html: auth_getoption.sgml libs/docbook/sgml2html
d50284c4 530 libs/docbook/sgml2html auth_getoption.sgml auth_getoption.html "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 531
b0322a85 532auth_getoption.3: auth_getoption.sgml libs/docbook/sgml2man
d50284c4 533 libs/docbook/sgml2man auth_getoption.sgml auth_getoption.3 "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 534
b0322a85 535auth_sasl.html: auth_sasl.sgml libs/docbook/sgml2html
d50284c4 536 libs/docbook/sgml2html auth_sasl.sgml auth_sasl.html "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 537
b0322a85 538auth_sasl.3: auth_sasl.sgml libs/docbook/sgml2man
d50284c4 539 libs/docbook/sgml2man auth_sasl.sgml auth_sasl.3 "--stringparam man.base.url.for.relative.links http://www.courier-mta.org/authlib/"
d9898ee8 540
8d138742
CE
541auth_sasl_ex.3: auth_sasl.3
542 touch $@
d9898ee8 543
544endif
545
8d138742
CE
546authldap.ldif: authldap.schema
547 echo 'dn: cn=courier,cn=schema,cn=config' >authldap.ldif.tmp
548 echo 'objectClass: olcSchemaConfig' >>authldap.ldif.tmp
549 echo 'cn: courier' >>authldap.ldif.tmp
550 sed '/^#/d;s/^attributetype/olcAttributeTypes:/;s/^objectclass/olcObjectClasses:/;s/^$$/#/' <$(srcdir)/authldap.schema | tr '\011' ' ' >>authldap.ldif.tmp
551 mv -f authldap.ldif.tmp authldap.ldif
552
d9898ee8 553README_authlib.html: README_authlib.html.in config.status
8d138742 554 $(SHELL) ./config.status --file=README_authlib.html
d9898ee8 555
556authdaemond.o: authdaemonrc.h authdaemond.c
557
558
559install-migrate: authmigrate
560 @SHELL@ authmigrate
561
562install-configure:
563 test -f $(DESTDIR)@authdaemonrc@.dist && @SYSCONFTOOL@ $(DESTDIR)@authdaemonrc@.dist || true
564 test -f $(DESTDIR)@authmysqlrc@.dist && @SYSCONFTOOL@ $(DESTDIR)@authmysqlrc@.dist || true
565 test -f $(DESTDIR)@authpgsqlrc@.dist && @SYSCONFTOOL@ $(DESTDIR)@authpgsqlrc@.dist || true
566 test -f $(DESTDIR)@authldaprc@.dist && @SYSCONFTOOL@ $(DESTDIR)@authldaprc@.dist || true
b0322a85 567 test -f $(DESTDIR)@authsqliterc@.dist && @SYSCONFTOOL@ $(DESTDIR)@authsqliterc@.dist || true
d9898ee8 568
569# For maintainer's use only
570
571distrelease:
8d138742
CE
572 umask 022; $(MAKE) distcheck
573 $(MAKE) rpm
8d138742
CE
574 $(MAKE)
575 $(MAKE)
d9898ee8 576 rm -f @PACKAGE@.spec @PACKAGE@.lpspec
8d138742
CE
577 $(MAKE) @PACKAGE@.spec @PACKAGE@.lpspec
578 $(MAKE) dist
d9898ee8 579
d9898ee8 580rpm: rpm-build
581
582rpm-build:
8d138742
CE
583 $(MAKE) bump.rpm.release
584 $(MAKE) dist
585 $(MAKE) dorpm
d9898ee8 586
587lpm: lpm-build
588
589lpm-build:
8d138742
CE
590 $(MAKE) bump.rpm.release
591 $(MAKE) dist
592 $(MAKE) dolpm
d9898ee8 593
594dolpm:
595 rm -rf lpm
596 mkdir lpm
597 lpbuild `test "@REPOSITORY@" == "" || echo --define "repository=1"` --srcbuild -o lpm @PACKAGE@-@VERSION@.tar.bz2
598
599publish: publish-@REPOSITORY@
600
601publish-dev:
8d138742 602 $(MAKE) dopublish SUBDIR=dev
d9898ee8 603
604publish-prod:
8d138742 605 $(MAKE) dopublish SUBDIR=prod
d9898ee8 606
607dopublish:
608 lpbuild --resign lpm/*
609 rm -rf lpmtmp
610 mkdir lpmtmp
611 ln lpm/* lpmtmp
612 rm -f lpmtmp/*debuginfo*
613 mv lpmtmp/*.src.lp repository-$(SUBDIR)/`lpm -q --distribution`/sources
614 mv lpmtmp/*.lp repository-$(SUBDIR)/`lpm -q --distribution`/packages
615 rm -rf lpmtmp
616 ls -t repository-$(SUBDIR)/`lpm -q --distribution`/sources | tail -n +6 | xargs -r -n 1 lpm --erase repository-$(SUBDIR)
617 lpm --sync repository-$(SUBDIR)
618 rsync -a -v --delete-after repository-$(SUBDIR)/`lpm -q --distribution`/. headache:lpmtool.com/www/repositories/$(SUBDIR)/courier-authlib/`lpm -q --distribution`
619
620dorpm:
621 rm -rf rpm/BUILD/*
622 rm -f rpm/RPMS/*/*
623 rm -f rpm/SOURCES/*
624 rm -f rpm/SPECS/*
625 rm -f rpm/SRPMS/*
8d138742
CE
626 rpmbuild -ta --clean \
627 --define "_topdir `pwd`/rpm" \
628 --define '_rpmdir %{_topdir}/RPMS' \
629 --define '_srcrpmdir %{_topdir}/SRPMS' \
630 --define '_sourcedir %{_topdir}/SOURCES' \
631 --define '_specdir %{_topdir}/SPECS' \
632 --define '_builddir %{_topdir}/BUILD' \
633 --define '_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \
634 --define '_tmppath %{_var}/tmp' \
635 --define '__spec_prep_pre %{___build_pre}' \
636 @PACKAGE@-@VERSION@.tar.bz2
d9898ee8 637
638bump.rpm.release: @PACKAGE@.spec @PACKAGE@.lpspec
639 test -f $(srcdir)/rpm.release && . $(srcdir)/rpm.release; \
640 NEXT_RELEASE=0; \
641 test "$$VERSION" = "@VERSION@" && NEXT_RELEASE="$$RELEASE"; \
642 RELEASE=`expr $$NEXT_RELEASE + 1`; \
643 echo "VERSION=@VERSION@" >$(srcdir)/rpm.release; \
644 echo "RELEASE=$$RELEASE" >>$(srcdir)/rpm.release; \
dd184caf 645 sed 's/^Release: .*/Release: '$$RELEASE'%{?dist}%{?courier_release}/' \
d9898ee8 646 <@PACKAGE@.spec >@PACKAGE@.spec.new; \
647 mv @PACKAGE@.spec.new @PACKAGE@.spec; \
648 sed 's/^Release: .*/Release: '$$RELEASE'/' \
649 <@PACKAGE@.lpspec >@PACKAGE@.lpspec.new; \
650 mv @PACKAGE@.lpspec.new @PACKAGE@.lpspec
651
652upload-beta:
653 rm -f @PACKAGE@-@VERSION@.tar.bz2.sig; gpg --detach-sign --default-key mrsam@courier-mta.com @PACKAGE@-@VERSION@.tar.bz2; test -f @PACKAGE@-@VERSION@.tar.bz2.sig || exit 1
0e333c05 654 ~/src/sftools/release.pl mrsam courier authlib-devel `echo @VERSION@|sed 's/.*\(........\)/\1/'` @PACKAGE@-@VERSION@.tar.bz2 @PACKAGE@-@VERSION@.tar.bz2.sig
d9898ee8 655
656upload-dist:
b0322a85
CE
657 rm -f @PACKAGE@-@VERSION@.tar.bz2.sig; gpg --detach-sign --default-key mrsam@courier-mta.com @PACKAGE@-@VERSION@.tar.bz2; test -f @PACKAGE@-@VERSION@.tar.bz2.sig || exit 1
658 set -e; v="@PACKAGE@/@VERSION@/`date +%Y%m%d%H%M%S`"; git tag -s $$v -m 'Tag version @VERSION@'; cd libs; git tag -s $$v -m 'Tag version @VERSION@'
0e333c05 659 socksify ~/src/sftools/release.pl mrsam courier authlib @VERSION@ @PACKAGE@-@VERSION@.tar.bz2 @PACKAGE@-@VERSION@.tar.bz2.sig
d9898ee8 660
661HTMLDOCFILES=$(HTMLFILES) README.authdebug.html README_authlib.html \
b0322a85 662 $(man3:%.3=%.html) $(man1:%.1=%.html) userdb/userdb.html userdb/makeuserdb.html userdb/userdbpw.html
d9898ee8 663
664htmldoc: $(HTMLDOCFILES)
b0322a85 665 for f in $^; do d=`basename $$f`; test "$$d" = "README.html" && d="index.html"; tidy -i -q --tidy-mark no --doctype transitional --input-encoding utf8 --output-encoding utf8 -asxml <$$f >$$f.tmp ; xsltproc --nonet $$HOME/www/www.courier-mta.org/xsl/authlib.xsl $$f.tmp | perl -ne 's~\$(id):.*\$$~\$(id):'"$$h"'\$$~; print' >$$HOME/www/www.courier-mta.org/authlib/$$d; rm -f $$f.tmp; done