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