commit acd27055c5a5bed5afd7ba4fa20601a47b403cd0 Author: Jacob Welsh AuthorDate: Fri Nov 18 04:13:12 2022 +0000 Commit: Jacob Welsh CommitDate: Fri Nov 18 04:13:12 2022 +0000 Type: new structure add doc/Makefile, adjusting & correcting src/Makefile to harmonize Avoid ".new" suffix for generated temporaries to reduce chance of conflict with humans. diff --git a/Makefile b/Makefile index 42057974d7..314edad444 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -MAKE_SUBDIRS = $(MAKE) -C src $@ +MAKE_SUBDIRS = $(MAKE) -C src $@ && $(MAKE) -C doc $@ all: $(MAKE_SUBDIRS) diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000000..df4defe7b7 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,119 @@ +prefix = /usr/local +rundir = /var/run +pkgrundir = $(rundir)/dovecot +datadir = $(prefix)/share +mandir = $(datadir)/man +docdir = $(datadir)/doc/dovecot +exampledir = $(docdir)/example-config +sysconfdir = $(prefix)/etc +pkgsysconfdir = $(sysconfdir)/dovecot +libexecdir = $(prefix)/libexec +pkglibexecdir = $(libexecdir)/dovecot + +EXAMPLE_CONF_FILES = \ + example-config/dovecot-dict-auth.conf.ext \ + example-config/dovecot-dict-sql.conf.ext \ + example-config/dovecot-ldap.conf.ext \ + example-config/dovecot-sql.conf.ext \ + example-config/dovecot.conf \ + +DOC_FILES = \ + documentation.txt \ + dovecot-openssl.cnf \ + mkcert.sh \ + securecoding.txt \ + solr-config-7.7.0.xml \ + solr-schema-7.7.0.xml \ + solr-schema.xml \ + thread-refs.txt \ + +MAN_INCLUDES = \ + man/global-options-formatter.inc \ + man/global-options.inc \ + man/option-A.inc \ + man/option-F-file.inc \ + man/option-S-socket.inc \ + man/option-u-user.inc \ + man/reporting-bugs.inc \ + +MAN1_FILES = \ + man/deliver.1 \ + man/doveadm-backup.1 \ + man/doveadm-config.1 \ + man/doveadm-copy.1 \ + man/doveadm-reload.1 \ + man/doveadm-stop.1 \ + man/dsync.1 \ + +MAN7_FILES = \ + man/doveadm-search-query.7 \ + +BUILT_MAN1_FILES = \ + man/doveadm-acl.1 \ + man/doveadm-altmove.1 \ + man/doveadm-auth.1 \ + man/doveadm-batch.1 \ + man/doveadm-deduplicate.1 \ + man/doveadm-director.1 \ + man/doveadm-dump.1 \ + man/doveadm-exec.1 \ + man/doveadm-expunge.1 \ + man/doveadm-fetch.1 \ + man/doveadm-flags.1 \ + man/doveadm-force-resync.1 \ + man/doveadm-fs.1 \ + man/doveadm-fts.1 \ + man/doveadm-help.1 \ + man/doveadm-import.1 \ + man/doveadm-index.1 \ + man/doveadm-instance.1 \ + man/doveadm-kick.1 \ + man/doveadm-log.1 \ + man/doveadm-mailbox-cryptokey.1 \ + man/doveadm-mailbox.1 \ + man/doveadm-move.1 \ + man/doveadm-penalty.1 \ + man/doveadm-proxy.1 \ + man/doveadm-purge.1 \ + man/doveadm-pw.1 \ + man/doveadm-quota.1 \ + man/doveadm-rebuild.1 \ + man/doveadm-replicator.1 \ + man/doveadm-save.1 \ + man/doveadm-search.1 \ + man/doveadm-stats.1 \ + man/doveadm-sync.1 \ + man/doveadm-user.1 \ + man/doveadm-who.1 \ + man/doveadm.1 \ + man/doveconf.1 \ + man/dovecot-lda.1 \ + man/dovecot-sysreport.1 \ + man/dovecot.1 \ + +all: example-config/README $(BUILT_MAN1_FILES) + +example-config/README: example-config/README.in + cat $< | sed "s|@exampledir@|$(exampledir)|" > $@ + +%.1: %.1.in $(MAN_INCLUDES) + $(SHELL) man/sed.sh man $(pkgrundir) $(pkgsysconfdir) $(pkglibexecdir) < $< > $@._tmp_ + mv -f $@._tmp_ $@ + +install: all + install -d $(DESTDIR)$(pkgsysconfdir) + install -m 644 example-config/README $(DESTDIR)$(pkgsysconfdir)/ + install -d $(DESTDIR)$(docdir)/example-config/conf.d + for f in $(DOC_FILES); do install -m 644 $$f $(DESTDIR)$(docdir)/; done + for f in $(EXAMPLE_CONF_FILES); do install -m 644 $$f $(DESTDIR)$(docdir)/example-config/; done + cp -r example-config/conf.d $(DESTDIR)$(docdir)/example-config/ + cp -r wiki $(DESTDIR)$(docdir)/ + install -d $(DESTDIR)$(mandir)/man1 + for f in $(MAN1_FILES) $(BUILT_MAN1_FILES); do install -m 644 $$f $(DESTDIR)$(mandir)/man1/; done + install -d $(DESTDIR)$(mandir)/man7 + for f in $(MAN7_FILES); do install -m 644 $$f $(DESTDIR)$(mandir)/man7/; done + +check: all + +clean: + $(RM) example-config/README $(BUILT_MAN1_FILES) diff --git a/src/Makefile b/src/Makefile index 4af0c6827e..f8a8704732 100644 --- a/src/Makefile +++ b/src/Makefile @@ -21,11 +21,12 @@ rundir = /var/run pkgrundir = $(rundir)/dovecot statedir = /var/lib pkgstatedir = $(statedir)/dovecot -sysconfdir = $(prefix)/etc/dovecot +sysconfdir = $(prefix)/etc +pkgsysconfdir = $(sysconfdir)/dovecot libexecdir = $(prefix)/libexec pkglibexecdir = $(libexecdir)/dovecot -mandir = $(prefix)/man datadir = $(prefix)/share +mandir = $(datadir)/man pkgdatadir = $(datadir)/dovecot # Build programs @@ -86,7 +87,7 @@ CPPFLAGS = -DHAVE_CONFIG_H -I.. -I. \ -DPKG_LIBEXECDIR=\"$(pkglibexecdir)\" \ -DPKG_RUNDIR=\"$(pkgrundir)\" \ -DPKG_STATEDIR=\"$(pkgstatedir)\" \ - -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DSYSCONFDIR=\"$(pkgsysconfdir)\" \ -DMANDIR=\"$(mandir)\" \ -DDATADIR=\"$(pkgdatadir)\" \ @@ -1489,8 +1490,8 @@ all: $(ALL_PROGS) lib/unichar.o: lib/unichar.c lib/unicodemap.c lib/unicodemap.c: lib/unicodemap.pl lib/UnicodeData.txt - $(PERL) lib/unicodemap.pl < lib/UnicodeData.txt > $@.new - mv -f $@.new $@ + $(PERL) lib/unicodemap.pl < lib/UnicodeData.txt > $@._tmp_ + mv -f $@._tmp_ $@ %.c: %.l $(FLEX) -o $@ $< @@ -1501,18 +1502,18 @@ lib/unicodemap.c: lib/unicodemap.pl lib/UnicodeData.txt lib/event-filter-lexer.o: lib/event-filter-lexer.c lib/event-filter-parser.c config/all-settings.c: config/settings-get.pl $(SETTING_FILES) - $(PERL) config/settings-get.pl $(SETTING_FILES) > $@.new - mv -f $@.new $@ + $(PERL) config/settings-get.pl $(SETTING_FILES) > $@._tmp_ + mv -f $@._tmp_ $@ lib-fts/fts-tokenizer-generic.o: lib-fts/fts-tokenizer-generic.c lib-fts/word-boundary-data.c lib-fts/word-break-data.c lib-fts/word-boundary-data.c: lib-fts/word-properties.pl lib-fts/WordBreakProperty.txt - $(PERL) lib-fts/word-properties.pl boundaries lib-fts/WordBreakProperty.txt > $@.new - mv -f $@.new $@ + $(PERL) lib-fts/word-properties.pl boundaries lib-fts/WordBreakProperty.txt > $@._tmp_ + mv -f $@._tmp_ $@ lib-fts/word-break-data.c: lib-fts/word-properties.pl lib-fts/PropList.txt - $(PERL) lib-fts/word-properties.pl breaks lib-fts/PropList.txt > $@.new - mv -f $@.new $@ + $(PERL) lib-fts/word-properties.pl breaks lib-fts/PropList.txt > $@._tmp_ + mv -f $@._tmp_ $@ # # Program definitions @@ -2008,7 +2009,7 @@ check: all env NOCHILDREN=yes $(RUN_TEST) ./lib-program-client/test-program-client-local env NOCHILDREN=yes $(RUN_TEST) ./lib-smtp/test-smtp-submit -install: +install: all install -d $(DESTDIR)$(bindir) install $(BIN_PROGS) $(DESTDIR)$(bindir)/ install util/dovecot-sysreport $(DESTDIR)$(bindir)/ @@ -2018,9 +2019,7 @@ install: install util/health-check.sh $(DESTDIR)$(pkglibexecdir)/ install plugins/fts/decode2text.sh $(DESTDIR)$(pkglibexecdir)/ install -d $(DESTDIR)$(pkgdatadir)/stopwords - for LANG in da de en es fi fr it nl no pt ro ru sv tr ; do - install -m 644 lib-fts/stopwords/stopwords_$$LANG.txt $(DESTDIR)$(pkgdatadir)/stopwords/ - done + for LANG in da de en es fi fr it nl no pt ro ru sv tr; do install -m 644 lib-fts/stopwords/stopwords_$$LANG.txt $(DESTDIR)$(pkgdatadir)/stopwords/; done clean: $(RM) libdovecot.a $(ALL_PROGS) */*.o config/all-settings.c lib-fts/word-boundary-data.c lib-fts/word-break-data.c lib/unicodemap.c lib/event-filter-lexer.c lib/event-filter-parser.c lib/event-filter-parser.h