##--------------------------------------------------------------------------## ## File: ## $Id: Makefile,v 1.18 2002/03/11 07:15:53 ehood Exp $ ## Description: ## Administrative makefile for mailing list archives. ##--------------------------------------------------------------------------## ## Copyright (C) 2001-2002 Earl Hood ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA ##--------------------------------------------------------------------------## .PHONY: default editidx rebuild rootidx dist enable disable readmail \ help editidxonly release clean distclean configure mhonarc-check READ_MAIL = bin/read-mail WEB_ARCHIVE = bin/web-archive MK_PROCMAILRC = bin/mk-procmailrc APPLY_CONFIG = bin/apply-config MHA_CHECK = bin/mhonarc-check CONFIG_SH = lib/config.sh LIST_DEF = lib/lists.def NO_ARCHIVE = .noarchive PROCMAIL_RC = .procmailrc CHMOD = chmod CP = cp FIND = find GZIP = gzip MKDIR = mkdir MV = mv PERL = perl RM = rm TAR = tar TOUCH = touch ##--------------------------------------------------------------------------## default: $(PROCMAIL_RC) $(PROCMAIL_RC): $(LIST_DEF) $(MK_PROCMAILRC) $(LIST_DEF) > $(PROCMAIL_RC).tmp $(MV) $(PROCMAIL_RC).tmp $(PROCMAIL_RC) editidx: disable -$(PERL) $(WEB_ARCHIVE) -debug -editidx -nosearch $(MLISTS) -@echo "=============================================================" -@echo "!!! Auto-archive processing is DISABLED !!!" -@echo "=============================================================" editidxonly: disable -$(PERL) $(WEB_ARCHIVE) -debug -editidxonly -nosearch $(MLISTS) -@echo "=============================================================" -@echo "!!! Auto-archive processing is DISABLED !!!" -@echo "=============================================================" rebuild: disable -$(PERL) $(WEB_ARCHIVE) -debug -rebuild $(MLISTS) -@echo "=============================================================" -@echo "!!! Auto-archive processing is DISABLED !!!" -@echo "=============================================================" rootidx: -$(PERL) $(WEB_ARCHIVE) -debug -editrootidx $(MLISTS) enable: @$(RM) -f $(NO_ARCHIVE) -@echo "=============================================================" -@echo "!!! Auto-archive processing is ENABLED !!!" -@echo "=============================================================" disable: @$(TOUCH) $(NO_ARCHIVE) -@echo "=============================================================" -@echo "!!! Auto-archive processing is DISABLED !!!" -@echo "=============================================================" readmail: WA_DEBUG=1 $(READ_MAIL) configure: mhonarc-check -@$(MKDIR) -p log mbox html @if [ ! -f $(CONFIG_SH) ]; then \ $(CP) $(CONFIG_SH).dist $(CONFIG_SH); \ $(CHMOD) u+w $(CONFIG_SH); \ fi @if [ ! -f $(LIST_DEF) ]; then \ $(CP) $(LIST_DEF).dist $(LIST_DEF); \ $(CHMOD) u+w $(LIST_DEF); \ fi $(APPLY_CONFIG) -verbose -@echo "=============================================================" -@echo "* Make sure to rerun 'make configure' when you change" -@echo "* lib/config.sh or change a .in template file." -@echo "=============================================================" mhonarc-check: @$(MHA_CHECK) help: -@echo "Target available:" -@echo " (default) Generate $(PROCMAIL_RC) from $(LIST_DEF)." -@echo " configure: Apply $(CONFIG_SH) settings." -@echo " disable: Disable automated processing of new messages." -@echo " editidx: Edit all mhonarc archive pages." -@echo " editidxonly: Edit only mhonarc archive index pages." -@echo " enable: Enable automated processing of new messages." -@echo " help: This message." -@echo " readmail: Process mail spool." -@echo " rebuild: Rebuild archives from raw message data." -@echo " rootidx: Regenerated top index for archives." -@echo "" -@echo "NOTE: Targets that modify archives run with debugging enabled." -@echo "NOTE: 'editidx', 'editidxonly', and 'rebuild' automatically" -@echo " disable auto-processing. Execute 'enable' target to" -@echo " reenable." -@echo "WARNING: The 'clean' target should not have to be invoked." -@echo " But if done, it removes all .in files. The" -@echo " 'configure' target can be executed to regenerate" -@echo " file from templates" -@echo "WARNING: The 'dist' and 'distclean' targets should only be" -@echo " invoked IF YOU KNOW WHAT YOU ARE DOING!" ##--------------------------------------------------------------------------## ## The following targets are mainly intended by mharc developers ## and used for creating releases ##--------------------------------------------------------------------------## DIST_BUNDLE = mharc-$(_RELEASE_VERSION).tar # List of files/dirs to be included in distribtion bundle # NOTE: The leading '.' is important. DIST_FILES = \ ./bin \ ./cgi-bin \ ./etc \ ./html/.PNM* \ ./lib \ ./Makefile \ ./TODO \ ./README \ ./NEWS \ ./COPYING \ # End DIST_FILES # List of files/dirs to explicitly exclude from distribtion bundle # NOTE: The leading '.' is important. DIST_EXC_FILES = \ ./etc/release-mharc \ # End DIST_EXC_FILES TAR_EXC_FILE = dist/.dist-exclude release: dist dist: @$(RM) -rf dist @$(MKDIR) -p dist/mharc @$(FIND) . -name 'CVS' -print > $(TAR_EXC_FILE) @for i in $(DIST_EXC_FILES); do \ echo $$i >> $(TAR_EXC_FILE); \ done @$(TAR) -c \ -X $(TAR_EXC_FILE) \ -f - $(DIST_FILES) | (cd dist/mharc; tar xfp -) @(cd dist/mharc && $(MAKE) distclean) @(cd dist/mharc; \ echo "$(_RELEASE_VERSION)" > VERSION ; \ $(TAR) cvf ../$(DIST_BUNDLE) . ; \ $(GZIP) ../$(DIST_BUNDLE) ) distclean: clean $(APPLY_CONFIG) -distclean -verbose $(RM) -f $(CONFIG_SH) $(LIST_DEF) VERSION $(RM) -rf dist clean: $(RM) -f $(PROCMAIL_RC) $(APPLY_CONFIG) -clean -verbose