Skip to content

Commit 0e6b60a

Browse files
committed
install: add --disable-compressed-changelog option
Add option to control if ChangeLog documentation file should be installed compressed or not. Useful for installation on Gentoo where compression is handled by distribution mechanisms. Fixes #592 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
1 parent 55f89e3 commit 0e6b60a

File tree

8 files changed

+49
-19
lines changed

8 files changed

+49
-19
lines changed

.codespellrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ ignore-words-list = ans,ot,ue,fo,haa,varius,tthe,tbe,nin,desig,matchin,compre,in
1111
# lib/autom4te.cache/*
1212
# skip retrieved content: icdiff, lib/tcl.m4, tcl8.3.5, spack, miniconda3, OpenFOAM-dev
1313
# skip pdf papers: doc/paper/*.pdf
14-
skip = .git,ChangeLog.gz,modulecmd*.tcl,*doc/build,icdiff,*lib/tcl.m4,tcl8.3.5,spack,miniconda3,OpenFOAM-dev,modules.sum,modules.log,*lib/config.sub,*lib/config.guess,*lib/config.status,*lib/configure,*lib/autom4te.cache/*,*doc/paper/*.pdf
14+
skip = .git,ChangeLog*,modulecmd*.tcl,*doc/build,icdiff,*lib/tcl.m4,tcl8.3.5,spack,miniconda3,OpenFOAM-dev,modules.sum,modules.log,*lib/config.sub,*lib/config.guess,*lib/config.status,*lib/configure,*lib/autom4te.cache/*,*doc/paper/*.pdf

.github/workflows/linux_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
tcl85-2:
133133
runs-on: ubuntu-22.04
134134
env:
135-
CONFIGURE_OPTS: --with-tclsh=tclsh8.5 --prefix=/tmp/modules --with-tcl=/usr/local/lib --enable-quarantine-support --enable-silent-shell-debug-support --enable-modulespath --with-pager=more --with-dark-background-colors=hi --with-locked-configs=implicit_default --enable-wa-277 --enable-advanced-version-spec --disable-ml --disable-implicit-requirement --enable-set-shell-startup --enable-path-entry-reorder
135+
CONFIGURE_OPTS: --with-tclsh=tclsh8.5 --prefix=/tmp/modules --with-tcl=/usr/local/lib --enable-quarantine-support --enable-silent-shell-debug-support --enable-modulespath --with-pager=more --with-dark-background-colors=hi --with-locked-configs=implicit_default --enable-wa-277 --enable-advanced-version-spec --disable-ml --disable-implicit-requirement --enable-set-shell-startup --enable-path-entry-reorder --disable-compressed-changelog
136136
COVERAGE: y
137137
EXTRA_SCRIPT_PRETEST: make install-testinitrc-1 install-testetcrc install-testmodspath
138138
EXTRA_SCRIPT_POSTTEST: make uninstall-testconfig

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/modulecmd.tcl
2-
/ChangeLog.gz
2+
/ChangeLog*
33
/README
44
/Makefile.inc
55
/version.inc

INSTALL.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,15 @@ instance :instopt:`--disable-set-manpath<--enable-set-manpath>`):
554554
.. versionchanged:: 5.0
555555
Configuration option default set to ``yes``
556556

557+
.. instopt:: --enable-compressed-changelog
558+
559+
Control if ``ChangeLog`` documentation file should be installed in a
560+
compressed format or not. (default=yes)
561+
562+
.. only:: html or latex
563+
564+
.. versionadded:: 5.7
565+
557566
.. instopt:: --enable-conflict-unload
558567

559568
Apply automated unload of conflicting modulefiles when loading a module.

Makefile

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ ifneq ($(wildcard Makefile.inc),Makefile.inc)
5656
endif
5757
include Makefile.inc
5858

59-
INSTALL_PREREQ := modulecmd.tcl ChangeLog.gz README script/add.modules \
59+
ifeq ($(compressedchangelog),y)
60+
CHANGELOG := ChangeLog.gz
61+
else
62+
CHANGELOG := ChangeLog
63+
endif
64+
65+
INSTALL_PREREQ := modulecmd.tcl $(CHANGELOG) README script/add.modules \
6066
script/modulecmd
6167
TEST_PREREQ := $(MODULECMD)
6268
ifeq ($(COVERAGE),y)
@@ -580,17 +586,19 @@ modulecmd.tcl: tcl/cache.tcl tcl/coll.tcl tcl/envmngt.tcl tcl/init.tcl \
580586

581587
# generate an empty changelog file if not working from git repository
582588
ifeq ($(wildcard .git),.git)
583-
ChangeLog.gz: script/gitlog2changelog.py
589+
ChangeLog: script/gitlog2changelog.py
584590
$(ECHO_GEN)
585591
script/gitlog2changelog.py
586-
gzip -f -9 ChangeLog
587592
else
588-
ChangeLog.gz:
593+
ChangeLog:
589594
$(ECHO_GEN)
590-
echo "Please refer to the NEWS document to learn about main changes" >ChangeLog
591-
gzip -f -9 ChangeLog
595+
echo "Please refer to the NEWS document to learn about main changes" >$@
592596
endif
593597

598+
ChangeLog.gz: ChangeLog
599+
$(ECHO_GEN)
600+
gzip --keep --force -9 $<
601+
594602
README:
595603
$(ECHO_GEN)
596604
sed -e '181,187d' -e '1,10d' -e 's|\[\(.*\?\)\]\[[0-9]\]|\1|' $@.md > $@
@@ -723,7 +731,7 @@ endif
723731
ifeq ($(docinstall),y)
724732
$(INSTALL_DIR) '$(DESTDIR)$(docdir)'
725733
$(INSTALL_DATA) COPYING.GPLv2 '$(DESTDIR)$(docdir)/'
726-
$(INSTALL_DATA) ChangeLog.gz '$(DESTDIR)$(docdir)/'
734+
$(INSTALL_DATA) $(CHANGELOG) '$(DESTDIR)$(docdir)/'
727735
$(INSTALL_DATA) README '$(DESTDIR)$(docdir)/'
728736
endif
729737
ifeq ($(vimaddons),y)
@@ -800,7 +808,7 @@ ifeq ($(nagelfaraddons),y)
800808
-rmdir -p '$(DESTDIR)$(nagelfardatadir)'
801809
endif
802810
ifeq ($(docinstall),y)
803-
rm -f $(foreach docfile,ChangeLog.gz README COPYING.GPLv2,'$(DESTDIR)$(docdir)/$(docfile)')
811+
rm -f $(foreach docfile,$(CHANGELOG) README COPYING.GPLv2,'$(DESTDIR)$(docdir)/$(docfile)')
804812
ifeq ($(builddoc),n)
805813
rmdir '$(DESTDIR)$(docdir)'
806814
endif
@@ -827,12 +835,12 @@ endif
827835

828836
# include pre-generated documents not to require documentation build
829837
# tools when installing from dist tarball
830-
dist-tar: ChangeLog.gz share/rpm/environment-modules.spec pkgdoc
838+
dist-tar: $(CHANGELOG) share/rpm/environment-modules.spec pkgdoc
831839
$(ECHO_GEN2) $(DIST_PREFIX).tar
832840
git archive --prefix=$(DIST_PREFIX)/ --worktree-attributes \
833841
-o $(DIST_PREFIX).tar HEAD
834842
tar -rf $(DIST_PREFIX).tar --transform 's,^,$(DIST_PREFIX)/,' \
835-
lib/configure lib/config.h.in $(DIST_AUTORECONF_EXTRA) ChangeLog.gz \
843+
lib/configure lib/config.h.in $(DIST_AUTORECONF_EXTRA) $(CHANGELOG) \
836844
doc/build/MIGRATING.txt doc/build/changes.txt doc/build/INSTALL.txt \
837845
doc/build/INSTALL-win.txt doc/build/NEWS.txt doc/build/CONTRIBUTING.txt \
838846
doc/build/module.1.in doc/build/ml.1 doc/build/envml.1 \
@@ -850,7 +858,7 @@ dist-bzip2: dist-tar
850858
dist: dist-gzip
851859

852860
# dist zip ball for Windows platform with all pre-generated relevant files
853-
dist-win: modulecmd.tcl ChangeLog.gz README pkgdoc
861+
dist-win: modulecmd.tcl $(CHANGELOG) README pkgdoc
854862
$(ECHO_GEN2) $(DIST_WIN_PREFIX).zip
855863
$(INSTALL_DIR) $(DIST_WIN_PREFIX)
856864
$(INSTALL_DIR) $(DIST_WIN_PREFIX)/libexec
@@ -861,7 +869,7 @@ dist-win: modulecmd.tcl ChangeLog.gz README pkgdoc
861869
$(INSTALL_PROGRAM) script/envml.cmd $(DIST_WIN_PREFIX)/bin/
862870
$(INSTALL_DIR) $(DIST_WIN_PREFIX)/doc
863871
$(INSTALL_DATA) COPYING.GPLv2 $(DIST_WIN_PREFIX)/doc/
864-
$(INSTALL_DATA) ChangeLog.gz $(DIST_WIN_PREFIX)/doc/
872+
$(INSTALL_DATA) $(CHANGELOG) $(DIST_WIN_PREFIX)/doc/
865873
$(INSTALL_DATA) README $(DIST_WIN_PREFIX)/doc/
866874
$(INSTALL_DATA) doc/build/MIGRATING.txt $(DIST_WIN_PREFIX)/doc/
867875
$(INSTALL_DATA) doc/build/INSTALL-win.txt $(DIST_WIN_PREFIX)/doc/
@@ -892,7 +900,7 @@ clean:
892900
rm -rf coverage
893901
# do not clean generated docs if not in git repository
894902
ifeq ($(wildcard .git),.git)
895-
rm -f ChangeLog.gz
903+
rm -f ChangeLog*
896904
endif
897905
rm -f README
898906
rm -f modulecmd.tcl
@@ -1138,7 +1146,7 @@ $(V).SILENT: initdir pkgdoc doc version.inc share/rpm/environment-modules.spec \
11381146
tcl/cache.tcl_i tcl/coll.tcl_i tcl/envmngt.tcl_i tcl/init.tcl_i tcl/interp.tcl_i \
11391147
tcl/main.tcl_i tcl/mfcmd.tcl_i tcl/modfind.tcl_i tcl/modeval.tcl_i \
11401148
tcl/modscan.tcl_i tcl/modspec.tcl_i tcl/report.tcl_i tcl/subcmd.tcl_i \
1141-
tcl/util.tcl_i ChangeLog.gz README script/add.modules \
1149+
tcl/util.tcl_i ChangeLog ChangeLog.gz README script/add.modules \
11421150
script/gitlog2changelog.py script/modulecmd \
11431151
lib/libtclenvmodules$(SHLIB_SUFFIX) lib/libtestutil-closedir$(SHLIB_SUFFIX) \
11441152
lib/libtestutil-getpwuid$(SHLIB_SUFFIX) lib/libtestutil-getgroups$(SHLIB_SUFFIX) \

Makefile.inc.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ initconfin := @initconfin@
6363
builddoc := @builddoc@
6464
# able to use manpath cmd to get currently set manpath
6565
usemanpath := @usemanpath@
66+
# compress ChangeLog file
67+
compressedchangelog := @compressedchangelog@
6668

6769
# logger setup
6870
loggedevents := @loggedevents@

NEWS.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ Modules 5.7.0 (not yet released)
5050
* Doc: add manual page for :ref:`modulecmd(1)` command.
5151
* Make :mfcmd:`getenv` modulefile command available from module rc file
5252
evaluation context. (fix issue #588)
53+
* Install: add installation option
54+
:instopt:`--disable-compressed-changelog<--enable-compressed-changelog>` to
55+
cope with packaging process handling documentation file compression at their
56+
level. (fix issue #592)
5357

5458

5559
.. _5.6 release notes:

configure

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ listterseoutput editor variantshortcut bashcompletiondir fishcompletiondir \
4141
zshcompletiondir tcllinter tcllinteropts nagelfardatadir nagelfaraddons \
4242
stickypurge uniquenameloaded abortonerror sourcecache logger loggeropts \
4343
loggedevents conflictunload spideroutput spiderterseoutput spiderindepth \
44-
emacsdatadir emacsaddons requirevia"
44+
emacsdatadir emacsaddons requirevia compressedchangelog"
4545
libarglist=()
4646

4747
# flags to know if argument has been specified on command-line
@@ -88,6 +88,7 @@ PYTHON=python
8888
SPHINXBUILD=sphinx-build
8989
builddoc=y
9090
usemanpath=y
91+
compressedchangelog=y
9192
PS='ps'
9293
BASENAME='basename'
9394
RMDIR_IGN_NON_EMPTY='rmdir'
@@ -251,6 +252,9 @@ Optional Features:
251252
--enable-color control colored output. \`yes' equals to the \`auto'
252253
color mode. \`no' equals to the \`never' color mode
253254
[yes]
255+
--enable-compressed-changelog
256+
install \`ChangeLog' file in a compressed format
257+
[yes]
254258
--enable-conflict-unload
255259
set modulecmd.tcl to automatically unload modules
256260
that conflict with modules to load and the dependent
@@ -735,6 +739,9 @@ for arg in "$@"; do
735739
--enable-doc-install*|--disable-doc-install)
736740
# shellcheck disable=SC2034
737741
docinstall=$(get_feature_value "$arg") ;;
742+
--enable-compressed-changelog*|--disable-compressed-changelog)
743+
# shellcheck disable=SC2034
744+
compressedchangelog=$(get_feature_value "$arg") ;;
738745
--enable-vim-addons*|--disable-vim-addons)
739746
# shellcheck disable=SC2034
740747
vimaddons=$(get_feature_value "$arg") ;;
@@ -1086,7 +1093,7 @@ else
10861093
fi
10871094

10881095
# gzip is mandatory if installing from git repository to build ChangeLog.gz
1089-
if [ $work_from_git_repo -eq 0 ]; then
1096+
if [ "$compressedchangelog" = 'y' ] && [ $work_from_git_repo -eq 0 ]; then
10901097
check_requirement gzip
10911098
fi
10921099

0 commit comments

Comments
 (0)