Skip to contentSkip to conversation

'make install' target issues

PATCH In review Dan McGee 2 participants 4 messages Oct 28, 2009

Subsystems (2)
lore
Share & tools
lore

Dan McGee

author
#0 lore raw

I was updating the PKGBUILD for sparse for Arch Linux in the AUR tonight (http://aur.archlinux.org/packages.php?ID=11999), and I noticed something odd- all files were getting installed with 755 permissions, including headers, .a libraries, etc. It looks like the following commit is the offender:

commit bb54f9a83eaa7c683e292a90fdfeebb54381c313
Author: Christopher Li <[email protected]>
Date: Fri Dec 26 01:37:01 2008 -0800
Subject: Clean up Makefile long lines

Is there something I am missing? By default, the install program installs all files with rwxr-xr-x. I'd be happy to submit a patch to fix this.

-Dan

$ tar tvf /home/makepkg/packages/sparse-0.4.2-1-x86_64.pkg.tar.gz
-rw-r--r-- root/root       477 2009-10-27 19:37 .PKGINFO
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/include/
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/share/
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/lib/
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/bin/
-rwxr-xr-x root/root    279776 2009-10-27 19:37 usr/bin/sparse
-rwxr-xr-x root/root    217280 2009-10-27 19:37 usr/bin/c2xml
-rwxr-xr-x root/root      9475 2009-10-27 19:37 usr/bin/cgcc
-rwxr-xr-x root/root    584320 2009-10-27 19:37 usr/lib/libsparse.a
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/lib/pkgconfig/
-rwxr-xr-x root/root       167 2009-10-27 19:37 usr/lib/pkgconfig/sparse.pc
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/share/licenses/
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/share/man/
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/share/man/man1/
-rwxr-xr-x root/root      3401 2009-10-27 19:37 usr/share/man/man1/sparse.1.gz
-rwxr-xr-x root/root       565 2009-10-27 19:37 usr/share/man/man1/cgcc.1.gz
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/share/licenses/sparse/
-rw-r--r-- root/root     11013 2009-10-27 19:37
usr/share/licenses/sparse/LICENSE
drwxr-xr-x root/root         0 2009-10-27 19:37 usr/include/sparse/
-rwxr-xr-x root/root       768 2009-10-27 19:37 usr/include/sparse/dissect.h
-rwxr-xr-x root/root      8771 2009-10-27 19:37 usr/include/sparse/ptrlist.h
-rwxr-xr-x root/root      1749 2009-10-27 19:37 usr/include/sparse/storage.h
-rwxr-xr-x root/root      2269 2009-10-27 19:37 usr/include/sparse/allocate.h
-rwxr-xr-x root/root      1392 2009-10-27 19:37 usr/include/sparse/flow.h
-rwxr-xr-x root/root       713 2009-10-27 19:37 usr/include/sparse/compat.h
-rwxr-xr-x root/root      3521 2009-10-27 19:37 usr/include/sparse/ident-list.h
-rwxr-xr-x root/root      1436 2009-10-27 19:37 usr/include/sparse/bitmap.h
-rwxr-xr-x root/root      7065 2009-10-27 19:37 usr/include/sparse/linearize.h
-rwxr-xr-x root/root       993 2009-10-27 19:37 usr/include/sparse/target.h
-rwxr-xr-x root/root      5273 2009-10-27 19:37 usr/include/sparse/expression.h
-rwxr-xr-x root/root       951 2009-10-27 19:37 usr/include/sparse/scope.h
-rwxr-xr-x root/root     10363 2009-10-27 19:37 usr/include/sparse/symbol.h
-rwxr-xr-x root/root      6005 2009-10-27 19:37 usr/include/sparse/lib.h
-rwxr-xr-x root/root      3555 2009-10-27 19:37 usr/include/sparse/parse.h
-rwxr-xr-x root/root      4934 2009-10-27 19:37 usr/include/sparse/token.h
author
#1 lore raw

PATCH 1/1 Makefile: fix permissions mixup on install

install by default uses 755 permissions; for everything but executables we want to use 644 permissions.

---
 Makefile |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
Makefile +9 -6
index 571673e..f6b0d2c 100644
@@ -79,9 +79,12 @@ QUIET_LINK    = $(Q:@=@echo    '     LINK     '$@;)
 QUIET_INST_SH = $(Q:@=echo -n  '     INSTALL  ';)
 QUIET_INST    = $(Q:@=@echo -n '     INSTALL  ';)
 
-define INSTALL_CMD
+define INSTALL_PROG
 	$(Q)$(QUIET_INST_SH)install -v $1 $(DESTDIR)$2/$1 || exit 1;
+endef
 
+define INSTALL_OTHER
+	$(Q)$(QUIET_INST_SH)install -v -m 644 $1 $(DESTDIR)$2/$1 || exit 1;
 endef
 
 SED_PC_CMD = 's|@version@|$(VERSION)|g;		\
@@ -103,11 +106,11 @@ install: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
 	$(Q)install -d $(DESTDIR)$(MAN1DIR)
 	$(Q)install -d $(DESTDIR)$(INCLUDEDIR)/sparse
 	$(Q)install -d $(DESTDIR)$(PKGCONFIGDIR)
-	$(foreach f,$(INST_PROGRAMS),$(call INSTALL_CMD,$f,$(BINDIR)))
-	$(foreach f,$(INST_MAN1),$(call INSTALL_CMD,$f,$(MAN1DIR)))
-	$(foreach f,$(LIBS),$(call INSTALL_CMD,$f,$(LIBDIR)))
-	$(foreach f,$(LIB_H),$(call INSTALL_CMD,$f,$(INCLUDEDIR)/sparse))
-	$(call INSTALL_CMD,sparse.pc,$(PKGCONFIGDIR))
+	$(foreach f,$(INST_PROGRAMS),$(call INSTALL_PROG,$f,$(BINDIR)))
+	$(foreach f,$(INST_MAN1),$(call INSTALL_OTHER,$f,$(MAN1DIR)))
+	$(foreach f,$(LIBS),$(call INSTALL_OTHER,$f,$(LIBDIR)))
+	$(foreach f,$(LIB_H),$(call INSTALL_OTHER,$f,$(INCLUDEDIR)/sparse))
+	$(call INSTALL_OTHER,sparse.pc,$(PKGCONFIGDIR))
 
 sparse.pc: sparse.pc.in
 	$(QUIET_GEN)sed $(SED_PC_CMD) sparse.pc.in > sparse.pc
Signature · 1 line
1.6.5.1
maintainer
#2 lore raw

Re: [PATCH] Makefile: fix permissions mixup on install

Quoted 2 lines · Dan McGee

install by default uses 755 permissions; for everything but executables we want to use 644 permissions.

So far so good.

Makefile QUIET_LINK = $(Q:@=@echo ' LINK '$@;) · line 82

Quoted 2 lines
Makefile +1 -1
-define INSTALL_CMD
+define INSTALL_PROG

I rename it to INSTALL_EXEC and INSTALL_FILE respectively.

Quoted 2 lines

       $(Q)$(QUIET_INST_SH)install -v $1 $(DESTDIR)$2/$1 || exit 1; +endef

Your patch remove a newline which is critical here. It is very subtle when using it inside a $(foreach ) loop. $(foreach ) blindly concatenate loop both. '@' only have special meaning after a newline. I get "@echo" command not found without this new line.

The others look good. I apply a version with the rename and newline changes in chrisl branch. Let me know that works for you or not. If you have other feed back of the change, I can still change it.

Thanks

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw
In reply to Dan McGee
Quoted 8 lines · Dan McGee

commit bb54f9a83eaa7c683e292a90fdfeebb54381c313
Author: Christopher Li <[email protected]>
Date:   Fri Dec 26 01:37:01 2008 -0800
Subject: Clean up Makefile long lines

Is there something I am missing? By default, the install program installs all files with rwxr-xr-x. I'd be happy to submit a patch to fix this.

That is a bug. Thanks for catching it.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html