From c3aecc6bc7ec70645e2309a23c7c4ed4677fe72a Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 13 Mar 2016 05:38:53 +0100 Subject: fixed configure and makefile diff --git a/Makefile b/Makefile index fa8e225..1a0a6d5 100644 --- a/Makefile +++ b/Makefile @@ -37,13 +37,15 @@ distclean: clean clean: -INSTALL_TARGETS := install-bin install-share +INSTALL_TARGETS := install-bin install-share install-etc REMOVE_TARGETS := remove-bin remove-share +PURGE_TARGETS := remove remove-etc install: $(INSTALL_TARGETS) install-bin: $(INSTALL) -d $(DESTDIR)$(BINDIR) + $(INSTALL) -m 755 $(EXECUTABLE) $(DESTDIR)$(BINDIR) $(INSTALL) -m 755 $(EXECUTABLES) $(DESTDIR)$(BINDIR) @for exe in $(EXECUTABLES); do \ sed s#/usr/local/share/rhautoimport/#$(SHAREDIR)/$(EXECUTABLE)/#g -i $(DESTDIR)$(BINDIR)/$$exe ; \ @@ -53,12 +55,27 @@ install-share: $(INSTALL) -d $(DESTDIR)$(SHAREDIR)/$(EXECUTABLE) $(INSTALL) -m 644 rhautoimport.pm $(DESTDIR)$(SHAREDIR)/$(EXECUTABLE) +install-etc: + $(INSTALL) -d $(DESTDIR)$(ETCDIR)/$(EXECUTABLE) + $(INSTALL) -m 644 cron $(DESTDIR)$(ETCDIR)/$(EXECUTABLE) + + uninstall: remove + remove: $(REMOVE_TARGETS) remove-bin: - rm -f $(DESTDIR)$(BINDIR)/$(EXECUTABLES) + rm -f $(DESTDIR)$(BINDIR)/$(EXECUTABLE) + @for exe in $(EXECUTABLES); do \ + rm -f $(DESTDIR)$(BINDIR)/$$exe ; \ + done remove-share: rm -rf $(DESTDIR)$(SHAREDIR)/$(EXECUTABLE) + +remove-etc: + rm -rf $(DESTDIR)$(ETCDIR) + + +purge: $(PURGE_TARGETS) diff --git a/configure b/configure index 32c2ae9..4b3e92b 100755 --- a/configure +++ b/configure @@ -21,15 +21,19 @@ # along with rhautoimport. If not, see . # +EBUILD_COMPAT=0 + PREFIX='/usr/local' BINDIR='' SHAREDIR='' +ETCDIR='' print_usage() { echo "configure --help print this" echo " --prefix= the installation prefix (default: /usr/local)" echo " --bindir= the path to the bin directory (default: $PREFIX/bin)" echo " --sharedir= the path to shared resources (default: $PREFIX/share" + echo " --sysconfdir= the path to the system configuration directory (default: $PREFIX/etc)" } for arg @@ -44,6 +48,12 @@ do --sharedir=*) SHAREDIR=${arg#--sharedir=} ;; + --sysconfdir=*) + ETCDIR=${arg#--sysconfdir=} + ;; + --ebuild-compat) + EBUILD_COMPAT=1 + ;; --help) print_usage exit 0 @@ -72,6 +82,10 @@ if [ -z "$SHAREDIR" ]; then SHAREDIR=$PREFIX/share fi +if [ -z "$ETCDIR" ]; then + ETCDIR=$PREFIX/etc +fi + cat >> include.mk <