diff --git a/usr/Makefile.am b/usr/Makefile.am index bced120..20352d5 100644 --- a/usr/Makefile.am +++ b/usr/Makefile.am @@ -5,6 +5,6 @@ endif SUBDIRS = lib $(DAEMONDIRS) install-data-hook: - $(MKDIR_P) $(lockdir) - $(CHGRP) pkcs11 $(lockdir) - $(CHMOD) 0770 $(lockdir) + $(MKDIR_P) $(DESTDIR)$(lockdir) + $(CHGRP) pkcs11 $(DESTDIR)$(lockdir) + $(CHMOD) 0770 $(DESTDIR)$(lockdir) diff --git a/usr/Makefile.am b/usr/Makefile.am index 20352d5..5d42b0f 100644 --- a/usr/Makefile.am +++ b/usr/Makefile.am @@ -6,5 +6,9 @@ SUBDIRS = lib $(DAEMONDIRS) install-data-hook: $(MKDIR_P) $(DESTDIR)$(lockdir) - $(CHGRP) pkcs11 $(DESTDIR)$(lockdir) - $(CHMOD) 0770 $(DESTDIR)$(lockdir) + if test `id` = 0; then \ + $(CHGRP) pkcs11 $(DESTDIR)$(lockdir); \ + $(CHMOD) 0770 $(DESTDIR)$(lockdir); \ + else \ + echo "Not running as root, you must set the correct group and mode manually!"; \ + fi