From 17c62fa8decb49ea2cdea67e690bf3acac2a2a6d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 12 May 2015 02:11:16 +0200 Subject: installing *.lua file into /usr/share/rhnop and not lib diff --git a/src/Makefile b/src/Makefile index e9af20a..d9d7506 100644 --- a/src/Makefile +++ b/src/Makefile @@ -77,20 +77,20 @@ install-bin: $(EXECUTABLE) $(INSTALL) -m 755 noprml $(DESTDIR)$(BINDIR) $(INSTALL) -m 755 nopcollectd $(DESTDIR)$(BINDIR) $(SED) -e 's#^conffile = "nopcollectd#conffile = "$(ETCDIR)/rhnop/nopcollectd#' -i $(DESTDIR)$(BINDIR)/nopcollectd - $(SED) -e 's#_rhnoplibdir_/?.lua#$(LIBDIR)/?.lua#' -i $(DESTDIR)$(BINDIR)/nopcollectd + $(SED) -e 's#_rhnoplibdir_/?.lua#$(DATAROOTDIR)/rhnop/?.lua#' -i $(DESTDIR)$(BINDIR)/nopcollectd $(INSTALL) -m 755 nopsysstated $(DESTDIR)$(BINDIR) $(SED) -e 's#^conffile = "nopsysstated#conffile = "$(ETCDIR)/rhnop/nopsysstated#' -i $(DESTDIR)$(BINDIR)/nopsysstated - $(SED) -e 's#_rhnoplibdir_/?.lua#$(LIBDIR)/?.lua#' -i $(DESTDIR)$(BINDIR)/nopsysstated + $(SED) -e 's#_rhnoplibdir_/?.lua#$(DATAROOTDIR)/rhnop/?.lua#' -i $(DESTDIR)$(BINDIR)/nopsysstated install-lib: - $(INSTALL) -d $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 644 conf.lua $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 644 db.lua $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 644 playlog.lua $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 644 rddb.lua $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 644 qlistener.lua $(DESTDIR)$(LIBDIR) - $(SED) -e 's#^conffile = "nopsyncd#conffile = "$(ETCDIR)/rhnop/nopsyncd#' -i $(DESTDIR)$(LIBDIR)/qlistener.lua - $(INSTALL) -m 644 tcpserver.lua $(DESTDIR)$(LIBDIR) + $(INSTALL) -d $(DESTDIR)$(DATAROOTDIR)/rhnop + $(INSTALL) -m 644 conf.lua $(DESTDIR)$(DATAROOTDIR)/rhnop + $(INSTALL) -m 644 db.lua $(DESTDIR)$(DATAROOTDIR)/rhnop + $(INSTALL) -m 644 playlog.lua $(DESTDIR)$(DATAROOTDIR)/rhnop + $(INSTALL) -m 644 rddb.lua $(DESTDIR)$(DATAROOTDIR)/rhnop + $(INSTALL) -m 644 qlistener.lua $(DESTDIR)$(DATAROOTDIR)/rhnop + $(SED) -e 's#^conffile = "nopsyncd#conffile = "$(ETCDIR)/rhnop/nopsyncd#' -i $(DESTDIR)$(DATAROOTDIR)/rhnop/qlistener.lua + $(INSTALL) -m 644 tcpserver.lua $(DESTDIR)$(DATAROOTDIR)/rhnop install-etc: $(INSTALL) -d $(DESTDIR)$(ETCDIR)/rhnop @@ -109,12 +109,12 @@ remove-bin: rm -f $(DESTDIR)$(BINDIR)/nopsysstated remove-lib: - rm -f $(DESTDIR)$(LIBDIR)/conf.lua - rm -f $(DESTDIR)$(LIBDIR)/db.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 + rm -f $(DESTDIR)$(DATAROOTDIR)/rhnop/conf.lua + rm -f $(DESTDIR)$(DATAROOTDIR)/rhnop/db.lua + rm -f $(DESTDIR)$(DATAROOTDIR)/rhnop/playlog.lua + rm -f $(DESTDIR)$(DATAROOTDIR)/rhnop/rddb.lua + rm -f $(DESTDIR)$(DATAROOTDIR)/rhnop/qlistener.lua + rm -f $(DESTDIR)$(DATAROOTDIR)/rhnop/tcpserver.lua remove-etc: diff --git a/src/configure b/src/configure index dd60d70..1cd11fd 100755 --- a/src/configure +++ b/src/configure @@ -32,7 +32,7 @@ LUA_VER='' PREFIX='/usr/local' BINDIR='' ETCDIR='' -LIBDIR='' +DATAROOTDIR='' print_usage() { echo "configure --help print this" @@ -40,7 +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)" + echo " --datarootdir= the path to the native lua libs (default: $PREFIX/share)" echo " --with-lua= use this lua tree instead of system default" echo " --lua-version=nnn set fixed Lua version for automatic detection (501 -> 5.1, 502 -> 5.2)" echo " --use-clang use clang/llvm as compiler/linker" @@ -64,8 +64,8 @@ do --sysconfdir=*) ETCDIR=${arg#--sysconfdir=} ;; - --libdir=*) - LIBDIR=${arg#--libdir=} + --datarootdir=*) + DATAROOTDIR=${arg#--datarootdir=} ;; --with-lua=*) LUA_DIR=${arg#--with-lua=} @@ -210,8 +210,8 @@ if [ -z "$ETCDIR" ]; then ETCDIR=$PREFIX/etc fi -if [ -z "$LIBDIR" ]; then - LIBDIR=$PREFIX/lib/rhnop +if [ -z "$DATAROOTDIR" ]; then + DATAROOTDIR=$PREFIX/share fi cat > include.mk < config.h < config.h < 501 static const luaL_Reg nopsyncd_lualibs[] = { @@ -92,7 +92,7 @@ int init_main_loop(lua_State *L, const char* filename) return -1; } - lua_pushstring(L, LIBDIR); + lua_pushstring(L, DATAROOTDIR); lua_setglobal(L, "rhnoplibdir"); ret = lua_pcall(L, 0, 0, 0); -- cgit v0.10.2