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