From b3d207833d75cc38735344bcb346aeeafe5cf761 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 30 Mar 2011 01:57:43 +0000 Subject: added libdir and install targets diff --git a/rhnop-server/Makefile b/rhnop-server/Makefile index a540d77..6ef5dac 100644 --- a/rhnop-server/Makefile +++ b/rhnop-server/Makefile @@ -58,6 +58,7 @@ distclean: clean find . -name *.o -exec rm -f {} \; find . -name "*.\~*" -exec rm -rf {} \; rm -f include.mk + rm -f config.h clean: rm -f *.o @@ -65,8 +66,8 @@ clean: rm -f *.d.* rm -f $(EXECUTABLE) -INSTALL_TARGETS := install-bin install-etc -REMOVE_TARGETS := remove-bin remove-etc +INSTALL_TARGETS := install-bin install-lib install-etc +REMOVE_TARGETS := remove-bin remove-lib remove-etc install: all $(INSTALL_TARGETS) @@ -74,8 +75,17 @@ install-bin: $(EXECUTABLE) $(INSTALL) -d $(DESTDIR)$(BINDIR) $(INSTALL) -m 755 $(EXECUTABLE) $(DESTDIR)$(BINDIR) +install-lib: + $(INSTALL) -d $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 644 conf.lua $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 644 playlog.lua $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 644 rddb.lua $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 644 qlistener.lua $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 644 tcpserver.lua $(DESTDIR)$(LIBDIR) + install-etc: - $(INSTALL) -d $(DESTDIR)$(ETCDIR)/$(EXECUTABLE) + $(INSTALL) -d $(DESTDIR)$(ETCDIR)/rhnop + $(INSTALL) -m 600 nopsyncd.conf $(DESTDIR)$(ETCDIR)/rhnop uninstall: remove @@ -84,8 +94,14 @@ remove: $(REMOVE_TARGETS) remove-bin: rm -f $(DESTDIR)$(BINDIR)/$(EXECUTABLE) +remove-lib: + rm -f $(DESTDIR)$(LIBDIR)/conf.lua + rm -f $(DESTDIR)$(LIBDIR)/playlog.lua + rm -f $(DESTDIR)$(LIBDIR)/rddb.lua + rm -f $(DESTDIR)$(LIBDIR)/qlistener.lua + rm -f $(DESTDIR)$(LIBDIR)/tcpserver.lua + remove-etc: - rm -f $(DESTDIR)$(ETCDIR)/init.d/$(EXECUTABLE) purge: remove - rm -rf $(DESTDIR)$(ETCDIR)/$(EXECUTABLE)/ + rm -rf $(DESTDIR)$(ETCDIR)/rhnop diff --git a/rhnop-server/configure b/rhnop-server/configure index 30145f2..0b0aa09 100755 --- a/rhnop-server/configure +++ b/rhnop-server/configure @@ -32,6 +32,7 @@ LUA='' PREFIX='/usr/local' BINDIR='' ETCDIR='' +LIBDIR='' print_usage() { echo "configure --help print this" @@ -39,6 +40,7 @@ print_usage() { echo " --prefix= the installation prefix (default: /usr/local)" echo " --bindir= the path to the bin directory (default: $PREFIX/bin)" echo " --sysconfdir= the path to the system configuration directory (default: $PREFIX/etc)" + echo " --libdir= the path to the lua library directory (default: $PREFIX/lib/rhnop-server)" echo " --with-lua= use this lua tree instead of system default" } @@ -57,6 +59,9 @@ do --sysconfdir=*) ETCDIR=${arg#--sysconfdir=} ;; + --libdir=*) + LIBDIR=${arg#--libdir=} + ;; --with-lua=*) LUA_DIR=${arg#--with-lua=} ;; @@ -82,6 +87,7 @@ if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then exit 1 fi +rm -f config.h rm -f include.mk case $TARGET in Linux) @@ -168,6 +174,10 @@ if [ -z "$ETCDIR" ]; then ETCDIR=$PREFIX/etc fi +if [ -z "$LIBDIR" ]; then + LIBDIR=$PREFIX/lib/rhnop-server +fi + cat > include.mk < config.h <