summaryrefslogtreecommitdiff
path: root/rhnop-server
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2011-03-30 01:57:43 (GMT)
committerChristian Pointner <equinox@helsinki.at>2011-03-30 01:57:43 (GMT)
commitb3d207833d75cc38735344bcb346aeeafe5cf761 (patch)
tree7c40a863a3f8826e4f46402e92034321d6197b39 /rhnop-server
parent4e12953dd22d862efd3882e4e8a51139ec504994 (diff)
added libdir and install targets
Diffstat (limited to 'rhnop-server')
-rw-r--r--rhnop-server/Makefile26
-rwxr-xr-xrhnop-server/configure32
-rw-r--r--[-rwxr-xr-x]rhnop-server/qlistener.lua0
-rw-r--r--[-rwxr-xr-x]rhnop-server/tcpserver.lua0
4 files changed, 53 insertions, 5 deletions
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=<PREFIX> the installation prefix (default: /usr/local)"
echo " --bindir=<DIR> the path to the bin directory (default: $PREFIX/bin)"
echo " --sysconfdir=<DIR> the path to the system configuration directory (default: $PREFIX/etc)"
+ echo " --libdir=<DIR> the path to the lua library directory (default: $PREFIX/lib/rhnop-server)"
echo " --with-lua=<DIR> 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 <<EOF
# this file was created automatically
# do not edit this file directly
@@ -185,6 +195,28 @@ INSTALL := install
PREFIX := '$PREFIX'
BINDIR := '$BINDIR'
ETCDIR := '$ETCDIR'
+LIBDIR := '$LIBDIR'
+EOF
+
+cat > config.h <<EOF
+/*
+ * nopsyncd version info
+ *
+ * this file was created automatically
+ * do not edit this file directly
+ * use ./configure instead
+ */
+
+#ifndef NOPSYNCD_config_h_INCLUDED
+#define NOPSYNCD_config_h_INCLUDED
+
+#define TARGET "$TARGET"
+#define PREFIX "$PREFIX"
+#define BINDIR "$BINDIR"
+#define ETCDIR "$ETCDIR"
+#define LIBDIR "$LIBDIR"
+
+#endif
EOF
exit 0
diff --git a/rhnop-server/qlistener.lua b/rhnop-server/qlistener.lua
index 8f2c0e2..8f2c0e2 100755..100644
--- a/rhnop-server/qlistener.lua
+++ b/rhnop-server/qlistener.lua
diff --git a/rhnop-server/tcpserver.lua b/rhnop-server/tcpserver.lua
index bd945b6..bd945b6 100755..100644
--- a/rhnop-server/tcpserver.lua
+++ b/rhnop-server/tcpserver.lua