Skip to content

Commit 796f46b

Browse files
authored
Merge pull request #10258 from jsquyres/pr/dont-0755-install-dir-tree
docs: do not set HTML install tree to 0755 perms
2 parents c3d3797 + 1867a72 commit 796f46b

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

docs/Makefile.am

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,32 @@ man1_MANS += \
889889
man3_MANS += $(OSHMEM_MAN3_BUILT)
890890
endif
891891

892+
# We do not know the names of all the generated HTML files: we only
893+
# know that the generated tree will of files be in _build/html/.
894+
# Unfortunately, Automake's installation process only handles
895+
# individual files -- not entire trees of files. Hence, we use a
896+
# "find ..." to copy the entire generated tree to the target
897+
# directory.
898+
#
899+
# Note: we do not use "cp -r ..." because if the source directory is
900+
# write-protected (e.g., during "make distcheck"), then the cp -r will
901+
# also write-protect the target directory. Instead, use the
902+
# Automake-provided install macros to set desirable permissions on the
903+
# target directories and files.
904+
#
905+
# Since this might be a VPATH build, first check to see if _build/html
906+
# exists in the source tree. If not, do the find+install from the
907+
# build tree.
892908
install-data-hook:
893909
$(MKDIR_P) $(DESTDIR)$(docdir)
894-
cp -r $(srcdir)/_build/html $(DESTDIR)$(docdir)
895-
find $(DESTDIR)$(docdir) -type d -exec chmod 0755 {} \;
896-
find $(DESTDIR)$(docdir) -type f -exec chmod 0644 {} \;
910+
if test -d $(srcdir)/_build/html; then \
911+
topdir=$(srcdir)/_build; \
912+
else \
913+
topdir=_build; \
914+
fi; \
915+
cd $$topdir; \
916+
find html -type d -exec $(mkinstalldirs) $(DESTDIR)$(docdir)/{} \; ; \
917+
find html -type f -exec $(INSTALL_DATA) {} $(DESTDIR)$(docdir)/{} \;
897918

898919
uninstall-hook:
899920
rm -rf $(DESTDIR)$(docdir)

0 commit comments

Comments
 (0)