From f2ef1612613d5689be73e927cfaa28a1f750320b Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 22 Jun 2019 13:28:27 -0400 Subject: [PATCH] Override umask on install (fixes #326) --- ChangeLog | 3 +++ make/libtool.mk | 26 +++++++++++++------------- manual/qpdf-manual.xml | 8 ++++++++ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d6a0862..57eeee97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2019-06-22 Jay Berkenbilt + * The "make install" target explicitly sets a mode rather than + relying the user's umask. Fixes #326. + * When a file has linearization warnings but no errors, qpdf --check and --check-linearization now exit with code 3 instead of 2. Fixes #50. diff --git a/make/libtool.mk b/make/libtool.mk index 34b0fe2c..41944b70 100644 --- a/make/libtool.mk +++ b/make/libtool.mk @@ -107,11 +107,11 @@ endef # Install target install: all - ./mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig - ./mkinstalldirs $(DESTDIR)$(bindir) - ./mkinstalldirs $(DESTDIR)$(includedir)/qpdf - ./mkinstalldirs $(DESTDIR)$(docdir) - ./mkinstalldirs $(DESTDIR)$(mandir)/man1 + ./mkinstalldirs -m 0755 $(DESTDIR)$(libdir)/pkgconfig + ./mkinstalldirs -m 0755 $(DESTDIR)$(bindir) + ./mkinstalldirs -m 0755 $(DESTDIR)$(includedir)/qpdf + ./mkinstalldirs -m 0755 $(DESTDIR)$(docdir) + ./mkinstalldirs -m 0755 $(DESTDIR)$(mandir)/man1 $(LIBTOOL) --mode=install ./install-sh \ libqpdf/$(OUTPUT_DIR)/libqpdf.la \ $(DESTDIR)$(libdir)/libqpdf.la @@ -122,15 +122,15 @@ install: all $(LIBTOOL) --mode=install ./install-sh \ zlib-flate/$(OUTPUT_DIR)/zlib-flate \ $(DESTDIR)$(bindir)/zlib-flate - cp qpdf/fix-qdf $(DESTDIR)$(bindir) - cp include/qpdf/*.h $(DESTDIR)$(includedir)/qpdf - cp include/qpdf/*.hh $(DESTDIR)$(includedir)/qpdf - cp doc/stylesheet.css $(DESTDIR)$(docdir) - cp libqpdf.pc $(DESTDIR)$(libdir)/pkgconfig + ./install-sh -m 0755 qpdf/fix-qdf $(DESTDIR)$(bindir) + ./install-sh -m 0644 include/qpdf/*.h $(DESTDIR)$(includedir)/qpdf + ./install-sh -m 0644 include/qpdf/*.hh $(DESTDIR)$(includedir)/qpdf + ./install-sh -m 0644 doc/stylesheet.css $(DESTDIR)$(docdir) + ./install-sh -m 0644 libqpdf.pc $(DESTDIR)$(libdir)/pkgconfig if [ -f doc/qpdf-manual.html ]; then \ - cp doc/qpdf-manual.html $(DESTDIR)$(docdir); \ + ./install-sh -m 0644 doc/qpdf-manual.html $(DESTDIR)$(docdir); \ fi if [ -f doc/qpdf-manual.pdf ]; then \ - cp doc/qpdf-manual.pdf $(DESTDIR)$(docdir); \ + ./install-sh -m 0644 doc/qpdf-manual.pdf $(DESTDIR)$(docdir); \ fi - cp doc/*.1 $(DESTDIR)$(mandir)/man1 + ./install-sh -m 0644 doc/*.1 $(DESTDIR)$(mandir)/man1 diff --git a/manual/qpdf-manual.xml b/manual/qpdf-manual.xml index c0cbeb10..58d5d366 100644 --- a/manual/qpdf-manual.xml +++ b/manual/qpdf-manual.xml @@ -4370,6 +4370,14 @@ print "\n"; the library to make this safe. + + + QPDF's make install target explicitly + specifies the mode to use when installing files instead of + relying the user's umask. It was previously doing this for + some files but not others. + +