Permalink
Browse files

build: use the proper targets for install hooks

Also always create directories before using them (for parallel install
compatibility), and fix one bad name.
  • Loading branch information...
1 parent 64e8cd5 commit bc5e1efcd77ceba0ba14325dbfc45776a185d555 @Flameeyes committed Jun 21, 2012
Showing with 9 additions and 5 deletions.
  1. +1 −0 configure.ac
  2. +3 −3 lib/Makefile.am
  3. +3 −1 login_duo/Makefile.am
  4. +2 −1 pam_duo/Makefile.am
View
@@ -36,6 +36,7 @@ AC_PROG_CC
AM_PROG_CC_C_O
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_INSTALL
+AC_PROG_MKDIR_P
LT_INIT
# Compiler options
View
@@ -22,12 +22,12 @@ noinst_PROGRAMS = testduo
testduo_LDADD = libduo.la
-install-exec-hook:
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)
-@if [ ! -f $(DESTDIR)$(sysconfdir)/duo.crt ]; then \
- mkdir -p -m 755 $(DESTDIR)$(sysconfdir); \
cp duo.crt $(DESTDIR)$(sysconfdir)/duo.crt; \
echo "Created ${DESTDIR}$(sysconfdir)/duo.crt"; \
else \
- echo "Found existing ${DESTDIR}$(sysconfdir)/login_duo.conf - skipping"; \
+ echo "Found existing ${DESTDIR}$(sysconfdir)/duo.crt - skipping"; \
fi
@@ -11,8 +11,10 @@ notrans_dist_man8_MANS = login_duo.8
install-exec-hook:
-chown root $(DESTDIR)$(sbindir)/login_duo && \
chmod 4755 $(DESTDIR)$(sbindir)/login_duo
+
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)
-@if [ ! -f $(DESTDIR)$(sysconfdir)/login_duo.conf ]; then \
- mkdir -p -m 755 $(DESTDIR)$(sysconfdir); \
cp login_duo.conf $(DESTDIR)$(sysconfdir)/login_duo.conf; \
echo "Created ${DESTDIR}$(sysconfdir)/login_duo.conf"; \
echo "Please edit it to add your Duo integration and secret keys"; \
View
@@ -11,7 +11,8 @@ pam_duo_la_LDFLAGS = -module -no-undefined -avoid-version -shared -export-symbol
notrans_dist_man8_MANS = pam_duo.8
-install-exec-hook:
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)
-@if [ ! -f $(DESTDIR)$(sysconfdir)/pam_duo.conf ]; then \
cp pam_duo.conf $(DESTDIR)$(sysconfdir)/pam_duo.conf; \
echo "Created ${DESTDIR}$(sysconfdir)/pam_duo.conf"; \

0 comments on commit bc5e1ef

Please sign in to comment.