From: Maksym Mamontov Date: Sun, 19 Jan 2020 10:23:02 +0000 (+0200) Subject: Remove some old stuff. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/4077971cebaa4f3d876e53e82a7f60024f4690c2?ds=inline Remove some old stuff. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0872ec22..4f543f1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ option ( BUILD_MOD_CAP_PCAP "Build PCap capture STG module." OFF ) option ( BUILD_MOD_CAP_NFQUEUE "Build NFQueue capture STG module." OFF ) option ( BUILD_MOD_RADIUS "Build rlm_stg backend STG module." OFF ) +# Grouping option ( BUILD_ALL_MODS "Build all modules." OFF ) option ( BUILD_ALL_LIBS "Build all libraries." OFF ) option ( BUILD_TESTS "Build tests." OFF ) @@ -80,17 +81,6 @@ if ( BUILD_STG OR BUILD_ALL_LIBS ) set ( BUILD_LIB_DOTCONFPP ON ) set ( BUILD_LIB_LOGGER ON ) set ( BUILD_LIB_SCRIPTEXECUTER ON ) - - # if ( BUILD_STG ) - # set ( BUILD_MOD_AO ON ) - # set ( BUILD_MOD_IA ON ) - # set ( BUILD_MOD_SGCONFIG ON ) - # set ( BUILD_MOD_PING ON ) - # set ( BUILD_MOD_RSCRYPT ON ) - # set ( BUILD_MOD_SMUX ON ) - # set ( BUILD_MOD_STORE_FILES ON ) - # set ( BUILD_MOD_CAP_NF ON ) - #endif ( BUILD_STG ) endif ( BUILD_STG OR BUILD_ALL_LIBS ) if ( BUILD_ALL_MODS ) @@ -149,9 +139,6 @@ endif () include_directories ( include ) -#find_package ( OpenSSL 1.0.0 REQUIRED ) -#find_package ( Boost 1.66.0 REQUIRED COMPONENTS system unit_test_framework ) - add_subdirectory ( libs ) if ( BUILD_RLM_STG ) diff --git a/include/Makefile b/include/Makefile deleted file mode 100644 index e8fbe640..00000000 --- a/include/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -include ../Makefile.conf - -INCS = stg/admin_conf.h \ - stg/admin_conf.inc.h \ - stg/admin.h \ - stg/admins.h \ - stg/auth.h \ - stg/const.h \ - stg/corp_conf.h \ - stg/corporations.h \ - stg/ia_packets.h \ - stg/message.h \ - stg/module_settings.h \ - stg/noncopyable.h \ - stg/notifer.h \ - stg/os_int.h \ - stg/plugin.h \ - stg/plugin_creator.h \ - stg/rad_packets.h \ - stg/raw_ip_packet.h \ - stg/resetable.h \ - stg/rs_packets.h \ - stg/service_conf.h \ - stg/services.h \ - stg/settings.h \ - stg/store.h \ - stg/tariff_conf.h \ - stg/tariff.h \ - stg/tariffs.h \ - stg/traffcounter.h \ - stg/user_conf.h \ - stg/user.h \ - stg/user_ips.h \ - stg/user_property.h \ - stg/users.h \ - stg/user_stat.h \ - stg/user_traff.h \ - stg/utime.h \ - stg/version.h - -install: install-bin - -install-bin: - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/include/stg - install -m $(DATA_MODE) -o $(OWNER) $(INCS) $(PREFIX)/usr/include/stg/ diff --git a/rlm_stg/Makefile b/rlm_stg/Makefile deleted file mode 100644 index 27f486b4..00000000 --- a/rlm_stg/Makefile +++ /dev/null @@ -1,116 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.5 2009/03/03 15:49:34 faust Exp $ -############################################################################### - -include ../../Makefile.conf - -LIB_NAME = rlm_stg - -PROG = $(LIB_NAME).so - -SRCS = rlm_stg.c \ - iface.cpp \ - stg_client.cpp \ - conn.cpp \ - radlog.c - -STGLIBS = crypto \ - common \ - json - -STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) -STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) - -LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV) - -ifeq ($(OS),linux) -LIBS += -ldl \ - -lyajl -else -LIBS += -lintl \ - -lc \ - -lyajl -endif - -SEARCH_DIRS = -I ../../include - -OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) - -CFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS) - -.PHONY: all clean distclean libs install uninstall install-bin uninstall-bin -all: libs $(PROG) ../../Makefile.conf - -libs: - $(MAKE) -C $(DIR_LIBSRC) - -$(PROG): $(OBJS) - $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS) - -clean: - rm -f deps $(PROG) *.o tags *.*~ .OS - rm -f .OS - rm -f core* - $(MAKE) -C $(DIR_LIBSRC) clean - -distclean: clean - rm -f ../../Makefile.conf - -install: install-bin - -install-bin: -ifeq ($(DEBUG), yes) -ifeq ($(OS), linux) - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius - install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG) -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib - install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(PROG) -endif -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG) -ifeq ($(OS), linux) - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/freeradius - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG) -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG) -endif -endif - $(MAKE) -C $(DIR_LIBSRC) install - -uninstall: uninstall-bin - -uninstall-bin: -ifeq ($(OS), linux) - rm -f $(PREFIX)/usr/lib/freeradius/$(PROG) -else - rm -f $(PREFIX)/usr/lib/$(PROG) -endif - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),uninstall) --include deps -endif -endif -endif - -deps: $(SRCS) ../../Makefile.conf - $(MAKE) -C $(DIR_LIBSRC) - @>deps ;\ - for file in $(SRCS); do\ - echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? -eq 0 ];\ - then\ - echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\ - else\ - echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\ - fi;\ - done diff --git a/rlm_stg/build b/rlm_stg/build deleted file mode 100755 index 8d63ae64..00000000 --- a/rlm_stg/build +++ /dev/null @@ -1,250 +0,0 @@ -#!/bin/sh - -# $Author: faust $ -# $Revision: 1.13 $ -# $Date: 2010/04/14 08:58:44 $ -###################################################### - -OS=unknown -sys=`uname -s` -release=`uname -r | cut -b1` -BUILD_DIR=`pwd` -CONFFILE="../../Makefile.conf" -PREFIX="/" -BIN_MODE=0755 -DATA_MODE=0644 -DIR_MODE=0755 -OWNER=root - -if [ "$1" = "debug" ] -then - DEFS="$DEFS -DDEBUG" - MAKEOPTS="$MAKEOPTS -j1" - CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra" - CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra" - DEBUG="yes" -else - DEFS="$DEFS -DNDEBUG" - DEBUG="no" -fi - -CFLAGS="$CFLAGS -I/usr/local/include" -CXXFLAGS="$CXXFLAGS -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" - -if [ "$sys" = "Linux" ] -then - OS=linux - release="" - MAKE="make" -fi - -if [ "$sys" = "FreeBSD" ] -then - case $release in - 4) OS=bsd;; - 5) OS=bsd5;; - 6) OS=bsd5;; - 7) OS=bsd7;; - *) OS=bsd7;; - esac - MAKE="gmake" -fi - -if [ "$OS" = "unknown" ] -then - printf "#############################################################################\n" - printf "# Sorry, but rlm_stg currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #\n" - printf "#############################################################################\n" - exit 1 -fi - -printf "#############################################################################\n" -printf " Building rlm_stg for $sys $release\n" -printf "#############################################################################\n" - -STG_LIBS="crypto.lib common.lib json.lib" - -if [ "$OS" = "linux" ] -then - DEFS="$DEFS -DLINUX" - LIB_THREAD=-lpthread -else - LIBICONV="-liconv" - if [ "$OS" = "bsd" ] - then - DEFS="$DEFS -DFREE_BSD" - else - DEFS="$DEFS -DFREE_BSD5" - if [ "$OS" = "bsd7" ] - then - LIB_THREAD=-lpthread - else - LIB_THREAD=-lc_r - fi - fi - CXXFLAGS="$CXXFLAGS -DHAVE_CLOSEFROM" -fi - -if [ -z "$CC" ] -then - CC=gcc -fi - -if [ -z "$CXX" ] -then - CXX=g++ -fi - -printf "Checking CC... " -$CC --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CC not found\n" - exit; -fi -printf "found\n" -printf "Checking CXX... " -$CXX --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CXX not found\n" - exit; -fi -printf "found\n" - -printf "Checking endianess... " -printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "Endianess checking failed\n" - exit; -else - ./fake - if [ $? = 1 ] - then - ARCH=le - CXXFLAGS="$CXXFLAGS -DARCH_LE" - CFLAGS="$CFLAGS -DARCH_LE" - printf "Little Endian\n" - else - ARCH=be - CXXFLAGS="$CXXFLAGS -DARCH_BE" - CFLAGS="$CFLAGS -DARCH_BE" - printf "Big Endian\n" - fi -fi -rm -f fake - -printf "Checking for iconv 2nd argument... " -printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "non-const\n" -else - DEFS="$DEFS -DCONST_ICONV" - printf "const\n" -fi -rm -f fake - -printf "Checking for -lyajl... " -pkg-config --version > /dev/null 2> /dev/null -if [ "$?" = "0" ] -then - pkg-config --atleast-version=2.0.0 yajl - if [ "$?" != "0" ] - then - CHECK_YAJL=no - printf "no\n" - exit; - else - CHECK_YAJL=yes - printf `pkg-config --modversion yajl`"\n" - fi -else - printf "#include \n" > build_check.c - printf "#include \n" >> build_check.c - printf "int main() { printf(\"%%d\", yajl_version()); return 0; }\n" >> build_check.c - $CC $CFLAGS $LDFLAGS build_check.c -lyajl -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_YAJL=no - printf "no\n" - exit; - else - YAJL_VERSION=`./fake` - if [ $YAJL_VERSION -ge 20000 ] - then - CHECK_YAJL=yes - printf "${YAJL_VERSION}\n" - else - CHECK_YAJL=no - printf "no. Need at least version 2.0.0, existing version is ${YAJL_VERSION}\n" - exit; - fi - fi - rm -f fake -fi - -printf "Checking for boost::scoped_ptr... " -printf "#include \nint main() { boost::scoped_ptr test(new int(1)); return 0; }\n" > build_check.cpp -$CXX $CXXFLAGS $LDFLAGS build_check.cpp -o fake # > /dev/null 2> /dev/null -if [ $? != 0 ] -then - CHECK_BOOST_SCOPED_PTR=no - printf "no\n" - exit; -else - CHECK_BOOST_SCOPED_PTR=yes - printf "yes\n" -fi -rm -f fake - -rm -f build_check.c -rm -f build_check.cpp - -if [ "$CHECK_YAJL" = "yes" -a "$CHECK_BOOST_SCOPED_PTR" = "yes" ] -then - STG_LIBS="$STG_LIBS - json.lib" -fi - -printf "OS=$OS\n" > $CONFFILE -printf "STG_TIME=yes\n" >> $CONFFILE -printf "DEBUG=$DEBUG\n" >> $CONFFILE -printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE -printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE -printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE -printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE -printf "ARCH=$ARCH\n" >> $CONFFILE -printf "DEFS=$DEFS\n" >> $CONFFILE -printf "STG_LIBS=" >> $CONFFILE -for lib in $STG_LIBS -do - printf "$lib " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "CC=$CC\n" >> $CONFFILE -printf "CXX=$CXX\n" >> $CONFFILE -printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE -printf "CFLAGS=$CFLAGS\n" >> $CONFFILE -printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE -printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE -printf "LIBICONV=$LIBICONV\n" >> $CONFFILE -printf "PREFIX=$PREFIX\n" >> $CONFFILE -printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE -printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE -printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE -printf "OWNER=$OWNER\n" >> $CONFFILE - -if [ "$1" != "debug" ] -then - $MAKE $MAKEOPTS -else - printf "\n\n\nDebug build. Type $MAKE explicitly\n" -fi diff --git a/rscriptd/Makefile b/rscriptd/Makefile deleted file mode 100644 index 98b2f5e4..00000000 --- a/rscriptd/Makefile +++ /dev/null @@ -1,115 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.18 2010/02/11 12:22:01 faust Exp $ -############################################################################### - -include ../../Makefile.conf - -PROG = rscriptd - -SRCS = ./main.cpp \ - ./listener.cpp \ - ./pidfile.cpp - -STGLIBS = scriptexecuter \ - conffiles \ - logger \ - crypto \ - common - -STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) -STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) - -LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV) - -SEARCH_DIRS = -I ../../include - -OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) - -CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) - -ifneq ($(OS),darwin) -LDFLAGS += -Wl,-E -endif - -LDFLAGS += $(STGLIBS_LIBS) - -.PHONY: all clean distclean libs install uninstall -all: libs $(PROG) ../../Makefile.conf - -libs: - $(MAKE) -C $(DIR_LIBSRC) - -$(PROG): $(OBJS) - $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG) - -clean: - rm -f deps $(PROG) *.o tags *.*~ .OS - rm -f .OS - rm -f .store - rm -f .db.sql - rm -f core* - $(MAKE) -C $(DIR_LIBSRC) clean - -distclean: clean - rm -f ../../Makefile.conf - -install: install-bin install-data - -install-bin: -ifeq ($(DEBUG), yes) - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) -endif - $(MAKE) -C $(DIR_LIBSRC) install - -install-data: - # Install etc - mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd - install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf -ifeq ($(OS), linux) - mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd - install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/ - install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/ -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd - install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/ - install -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/ -endif - -uninstall: uninstall-bin uninstall-data - -uninstall-bin: - rm -f $(PREFIX)/usr/sbin/$(PROG) - -uninstall-data: - # Uninstall etc - rm -f $(PREFIX)/etc/rscriptd/rscriptd.conf - rm -f $(PREFIX)/etc/rscriptd/OnConnect - rm -f $(PREFIX)/etc/rscriptd/OnDisconnect - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),uninstall) --include deps -endif -endif -endif - -deps: $(SRCS) ../../Makefile.conf - $(MAKE) -C $(DIR_LIBSRC) - @>deps ;\ - for file in $(SRCS); do\ - echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? -eq 0 ];\ - then\ - echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\ - else\ - echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\ - fi;\ - done diff --git a/rscriptd/build b/rscriptd/build deleted file mode 100755 index 995a9373..00000000 --- a/rscriptd/build +++ /dev/null @@ -1,206 +0,0 @@ -#!/bin/sh - -# $Author: faust $ -# $Revision: 1.21 $ -# $Date: 2010/04/14 08:58:52 $ -###################################################### - -OS=unknown -sys=`uname -s` -release=`uname -r` -major=`printf "%s" "$release" | cut -d. -f1` -BUILD_DIR=`pwd` -CONFFILE="../../Makefile.conf" -PREFIX="/" -BIN_MODE=0755 -DATA_MODE=0644 -DIR_MODE=0755 -OWNER=root - -if [ "$1" = "debug" ] -then - DEFS="$DEFS -DDEBUG" - MAKEOPTS="$MAKEOPTS -j1" - CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra" - CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra" - DEBUG="yes" -else - DEFS="$DEFS -DNDEBUG" - DEBUG="no" -fi - -CFLAGS="$CFLAGS -I/usr/local/include" -CXXFLAGS="$CXXFLAGS -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" - -if [ "$sys" = "Linux" ] -then - OS=linux - MAKE="make" -fi - -if [ "$sys" = "FreeBSD" ] -then - case $major in - 4) OS=bsd;; - 5) OS=bsd5;; - 6) OS=bsd5;; - 7) OS=bsd7;; - *) OS=bsd7;; - esac - MAKE="gmake" -fi - -if [ "$sys" = "Darwin" ] -then - OS=darwin - ETC_DIR="./inst/freebsd/etc/stargazer" - MAKE="gmake" -fi - -if [ "$OS" = "unknown" ] -then - printf "#############################################################################\n" - printf "# Sorry, but rscriptd is currently supported by Linux, FreeBSD and Darwin. #\n" - printf "#############################################################################\n" - exit 1 -fi - -printf "#############################################################################\n" -printf " Building rscriptd for $sys $release\n" -printf "#############################################################################\n" - -STG_LIBS="logger.lib - crypto.lib - common.lib - scriptexecuter.lib - conffiles.lib" - -if [ "$OS" = "linux" ] -then - DEFS="$DEFS -DLINUX" - LIB_THREAD=-lpthread -else - LIBICONV="-liconv" - if [ "$OS" = "bsd" ] - then - DEFS="$DEFS -DFREE_BSD" - else - if [ "$OS" = "bsd7" ] - then - DEFS="$DEFS -DFREE_BSD5" - LIB_THREAD=-lpthread - else - if [ "$OS" == "darwin" ] - then - DEFS="$DEFS -DDARWIN" - LIB_THREAD=-lpthread - else - LIB_THREAD=-lc_r - fi - fi - fi -fi - -if [ -z "$CC" ] -then - CC=gcc -fi - -if [ -z "$CXX" ] -then - CXX=g++ -fi - -printf "Checking CC... " -$CC --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CC not found\n" - exit; -fi -printf "found\n" -printf "Checking CXX... " -$CXX --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CXX not found\n" - exit; -fi -printf "found\n" - -printf "Checking endianess... " -printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "Endianess checking failed\n" - exit; -else - ./fake - if [ $? = 1 ] - then - ARCH=le - CXXFLAGS="$CXXFLAGS -DARCH_LE" - CFLAGS="$CFLAGS -DARCH_LE" - printf "Little Endian\n" - else - ARCH=be - CXXFLAGS="$CXXFLAGS -DARCH_BE" - CFLAGS="$CFLAGS -DARCH_BE" - printf "Big Endian\n" - fi -fi -rm -f fake - -printf "Checking for iconv 2nd argument... " -printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "non-const\n" -else - DEFS="$DEFS -DCONST_ICONV" - printf "const\n" -fi -rm -f fake - -rm -f build_check.c - -printf "OS=$OS\n" > $CONFFILE -printf "STG_TIME=yes\n" >> $CONFFILE -printf "DEBUG=$DEBUG\n" >> $CONFFILE -printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE -printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE -printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE -printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE -printf "ARCH=$ARCH\n" >> $CONFFILE -printf "DEFS=$DEFS\n" >> $CONFFILE -printf "STG_LIBS=" >> $CONFFILE -for lib in $STG_LIBS -do - printf "$lib " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE -printf "CC=$CC\n" >> $CONFFILE -printf "CXX=$CXX\n" >> $CONFFILE -printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE -printf "CFLAGS=$CFLAGS\n" >> $CONFFILE -printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE -printf "LIBICONV=$LIBICONV\n" >> $CONFFILE -printf "PREFIX=$PREFIX\n" >> $CONFFILE -printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE -printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE -printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE -printf "OWNER=$OWNER\n" >> $CONFFILE - -if [ "$1" != "debug" ] -then - $MAKE $MAKEOPTS -else - printf "\n\n\nDebug build. Type $MAKE explicitly\n" -fi diff --git a/sgauth/Makefile b/sgauth/Makefile deleted file mode 100644 index d6c844e0..00000000 --- a/sgauth/Makefile +++ /dev/null @@ -1,107 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.18 2009/08/06 12:50:55 faust Exp $ -############################################################################### - -include ../../Makefile.conf - -PROG = sgauth - -SRCS = ./main.cpp \ - ./settings_impl.cpp \ - ./web.cpp - -STGLIBS = conffiles \ - ia \ - crypto \ - common - -STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) -STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) - -LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV) - -ifeq ($(OS),linux) -else -LIBS += -lintl \ - -lc -endif - -SEARCH_DIRS = -I ../../include - -OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) - -CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -LDFLAGS += $(STGLIBS_LIBS) - -.PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data -all: libs $(PROG) ../../Makefile.conf - -libs: - $(MAKE) -C $(DIR_LIBSRC) - -$(PROG): $(OBJS) - $(CXX) $^ $(LDFLAGS) -o $(PROG) $(LIBS) - -clean: - rm -f deps $(PROG) *.o tags *.*~ .OS - rm -f .OS - rm -f .store - rm -f .db.sql - rm -f core* - rm -f css.h - $(MAKE) -C $(DIR_LIBSRC) clean - -distclean: clean - rm -f ../../Makefile.conf - -install: install-bin install-data - -install-bin: -ifeq ($(DEBUG), yes) - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) -endif - $(MAKE) -C $(DIR_LIBSRC) install - -install-data: - # Install etc - mkdir -m $(DIR_MODE) -p $(PREFIX)/etc - install -m $(DATA_MODE) -o $(OWNER) ./sgauth.conf $(PREFIX)/etc/sgauth.conf - -uninstall: uninstall-bin uninstall-data - -uninstall-bin: - rm -f $(PREFIX)/usr/sbin/$(PROG) - -uninstall-data: - # Uninstall etc - rm -f $(PREFIX)/etc/sgauth.conf - - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),uninstall) --include deps -endif -endif -endif - -deps: $(SRCS) ../../Makefile.conf sgauth.css - $(MAKE) -C $(DIR_LIBSRC) - @>deps ;\ - ./make_css.sh ;\ - for file in $(SRCS); do\ - echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? -eq 0 ];\ - then\ - echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\ - else\ - echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\ - fi;\ - done diff --git a/sgauth/build b/sgauth/build deleted file mode 100755 index 5f8821b0..00000000 --- a/sgauth/build +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/sh - -# $Author: faust $ -# $Revision: 1.24 $ -# $Date: 2010/04/14 08:59:02 $ -###################################################### - -OS=unknown -sys=`uname -s` -release=`uname -r` -major=`printf "%s" "$release" | cut -d. -f1` -BUILD_DIR=`pwd` -CONFFILE="../../Makefile.conf" -PREFIX="/" -BIN_MODE=0755 -DATA_MODE=0644 -DIR_MODE=0755 -OWNER=root - -if [ "$1" = "debug" ] -then - DEFS="$DEFS -DDEBUG" - MAKEOPTS="$MAKEOPTS -j1" - CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra" - CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra" - DEBUG="yes" -else - DEFS="$DEFS -DNDEBUG" - DEBUG="no" -fi - -CFLAGS="$CFLAGS -I/usr/local/include" -CXXFLAGS="$CXXFLAGS -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" - -if [ "$sys" = "Linux" ] -then - OS=linux - MAKE="make" -fi - -if [ "$sys" = "FreeBSD" ] -then - case $major in - 4) OS=bsd;; - 5) OS=bsd5;; - 6) OS=bsd5;; - 7) OS=bsd7;; - *) OS=bsd7;; - esac - MAKE="gmake" -fi - -if [ "$sys" = "Darwin" ] -then - OS=darwin - ETC_DIR="./inst/freebsd/etc/stargazer" - MAKE="gmake" - CFLAGS="$CFLAGS -I/opt/local/include" - CXXFLAGS="$CFLAGS -I/opt/local/include" - LDFLAGS="$LDFLAGS -L/opt/local/lib" -fi - -if [ "$OS" = "unknown" ] -then - printf "#############################################################################\n" - printf "# Sorry, but sgauth is currently supported by Linux, FreeBSD and Darwin. #\n" - printf "#############################################################################\n" - exit 1 -fi - -printf "#############################################################################\n" -printf " Building sgauth for $sys $release\n" -printf "#############################################################################\n" - -STG_LIBS="crypto.lib - common.lib - conffiles.lib - ia.lib" - -if [ "$OS" = "linux" ] -then - DEFS="$DEFS -DLINUX" - LIB_THREAD=-lpthread -else - LIBICONV="-liconv" - if [ "$OS" = "bsd" ] - then - DEFS="$DEFS -DFREE_BSD" - else - if [ "$OS" = "bsd7" ] - then - DEFS="$DEFS -DFREE_BSD5" - LIB_THREAD=-lpthread - else - if [ "$OS" == "darwin" ] - then - DEFS="$DEFS -DDARWIN" - LIB_THREAD=-lpthread - else - LIB_THREAD=-lc_r - fi - fi - fi -fi - -if [ -z "$CC" ] -then - CC=gcc -fi - -if [ -z "$CXX" ] -then - CXX=g++ -fi - -printf "Checking CC... " -$CC --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CC not found\n" - exit; -fi -printf "found\n" -printf "Checking CXX... " -$CXX --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CXX not found\n" - exit; -fi -printf "found\n" - -printf "Checking endianess... " -printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "Endianess checking failed\n" - exit; -else - ./fake - if [ $? = 1 ] - then - ARCH=le - CXXFLAGS="$CXXFLAGS -DARCH_LE" - CFLAGS="$CFLAGS -DARCH_LE" - printf "Little Endian\n" - else - ARCH=be - CXXFLAGS="$CXXFLAGS -DARCH_BE" - CFLAGS="$CFLAGS -DARCH_BE" - printf "Big Endian\n" - fi -fi -rm -f fake - -printf "Checking for iconv 2nd argument... " -printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "non-const\n" -else - DEFS="$DEFS -DCONST_ICONV" - printf "const\n" -fi -rm -f fake - -rm -f build_check.c - -printf "OS=$OS\n" > $CONFFILE -printf "STG_TIME=yes\n" >> $CONFFILE -printf "DEBUG=$DEBUG\n" >> $CONFFILE -printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE -printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE -printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE -printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE -printf "ARCH=$ARCH\n" >> $CONFFILE -printf "DEFS=$DEFS\n" >> $CONFFILE -printf "STG_LIBS=" >> $CONFFILE -for lib in $STG_LIBS -do - printf "$lib " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE -printf "CC=$CC\n" >> $CONFFILE -printf "CXX=$CXX\n" >> $CONFFILE -printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE -printf "CFLAGS=$CFLAGS\n" >> $CONFFILE -printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE -printf "LIBICONV=$LIBICONV\n" >> $CONFFILE -printf "PREFIX=$PREFIX\n" >> $CONFFILE -printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE -printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE -printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE -printf "OWNER=$OWNER\n" >> $CONFFILE - -if [ "$1" != "debug" ] -then - $MAKE $MAKEOPTS -else - printf "\n\n\nDebug build. Type $MAKE explicitly\n" -fi diff --git a/sgconf/Makefile b/sgconf/Makefile deleted file mode 100644 index 3a64cb61..00000000 --- a/sgconf/Makefile +++ /dev/null @@ -1,113 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.21 2010/02/11 12:34:14 faust Exp $ -############################################################################### - -include ../../Makefile.conf - -PROG = sgconf - -SRCS = ./main.cpp \ - ./options.cpp \ - ./api_action.cpp \ - ./actions.cpp \ - ./admins.cpp \ - ./tariffs.cpp \ - ./users.cpp \ - ./services.cpp \ - ./corps.cpp \ - ./info.cpp \ - ./xml.cpp - -STGLIBS = srvconf \ - crypto \ - common - -STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) -STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) - -LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD) - -ifeq ($(OS),linux) -else -LIBS += -lc \ - -liconv -endif - -SEARCH_DIRS = -I ../../include - -ifeq ($(OS),bsd) -SEARCH_DIRS += -I/usr/local/include -CXXFLAGS += -DHAVE_DECL_GETOPT=1 -endif - -ifeq ($(OS),bsd5) -SEARCH_DIRS += -I/usr/local/include -CXXFLAGS += -DHAVE_DECL_GETOPT=1 -endif - -OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) - -CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -LDFLAGS += $(STGLIBS_LIBS) - -ifneq ($(OS),darwin) -LDFLAGS += -Wl,-E -endif - -.PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data -all: libs $(PROG) ../../Makefile.conf - -libs: - $(MAKE) -C $(DIR_LIBSRC) - -$(PROG): $(OBJS) - $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG) - -clean: - rm -f deps $(PROG) *.o - $(MAKE) -C $(DIR_LIBSRC) clean - -distclean: clean - rm -f ../../Makefile.conf - -install: install-bin - -install-bin: -ifeq ($(DEBUG), yes) - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) -endif - $(MAKE) -C $(DIR_LIBSRC) install - -uninstall: uninstall-bin - -uninstall-bin: - rm -f $(PREFIX)/usr/sbin/$(PROG) - - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),uninstall) --include deps -endif -endif -endif - -deps: $(SRCS) ../../Makefile.conf - $(MAKE) -C $(DIR_LIBSRC) - @>deps ;\ - for file in $(SRCS); do\ - echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? -eq 0 ];\ - then\ - echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\ - else\ - echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\ - fi;\ - done diff --git a/sgconf/build b/sgconf/build deleted file mode 100755 index 7ac18e3c..00000000 --- a/sgconf/build +++ /dev/null @@ -1,225 +0,0 @@ -#!/bin/sh - -# $Author: faust $ -# $Revision: 1.21 $ -# $Date: 2010/04/14 08:59:11 $ -###################################################### - -OS=unknown -sys=`uname -s` -release=`uname -r` -major=`printf "%s" "$release" | cut -d. -f1` -BUILD_DIR=`pwd` -CONFFILE="../../Makefile.conf" -PREFIX="/" -BIN_MODE=0755 -DATA_MODE=0644 -DIR_MODE=0755 -OWNER=root - -if [ "$1" = "debug" ] -then - DEFS="$DEFS -DDEBUG" - MAKEOPTS="$MAKEOPTS -j1" - CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra" - CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra" - DEBUG="yes" -else - DEFS="$DEFS -DNDEBUG" - DEBUG="no" -fi - -CFLAGS="$CFLAGS -I/usr/local/include" -CXXFLAGS="$CXXFLAGS -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" - -if [ "$sys" = "Linux" ] -then - OS=linux - MAKE="make" -fi - -if [ "$sys" = "FreeBSD" ] -then - case $major in - 4) OS=bsd;; - 5) OS=bsd5;; - 6) OS=bsd5;; - 7) OS=bsd7;; - *) OS=bsd7;; - esac - MAKE="gmake" -fi - -if [ "$sys" = "Darwin" ] -then - OS=darwin - ETC_DIR="./inst/freebsd/etc/stargazer" - MAKE="gmake" -fi - -if [ "$OS" = "unknown" ] -then - printf "#############################################################################\n" - printf "# Sorry, but sgconf is currently supported by Linux, FreeBSD and Darwin. #\n" - printf "#############################################################################\n" - exit 1 -fi - -printf "#############################################################################\n" -printf " Building sgconf for $sys $release\n" -printf "#############################################################################\n" - -STG_LIBS="conffiles.lib - crypto.lib - common.lib - srvconf.lib" - -if [ "$OS" = "linux" ] -then - DEFS="$DEFS -DLINUX" - LIB_THREAD=-lpthread -else - LIBICONV="-liconv" - if [ "$OS" = "bsd" ] - then - DEFS="$DEFS -DFREE_BSD" - else - if [ "$OS" = "bsd7" ] - then - DEFS="$DEFS -DFREE_BSD5" - LIB_THREAD=-lpthread - else - if [ "$OS" == "darwin" ] - then - DEFS="$DEFS -DDARWIN" - LIB_THREAD=-lpthread - else - LIB_THREAD=-lc_r - fi - fi - fi -fi - -if [ -z "$CC" ] -then - CC=gcc -fi - -if [ -z "$CXX" ] -then - CXX=g++ -fi - -printf "Checking CC... " -$CC --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CC not found\n" - exit; -fi -printf "found\n" -printf "Checking CXX... " -$CXX --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CXX not found\n" - exit; -fi -printf "found\n" - -printf "Checking endianess... " -printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "Endianess checking failed\n" - exit; -else - ./fake - if [ $? = 1 ] - then - ARCH=le - CXXFLAGS="$CXXFLAGS -DARCH_LE" - CFLAGS="$CFLAGS -DARCH_LE" - printf "Little Endian\n" - else - ARCH=be - CXXFLAGS="$CXXFLAGS -DARCH_BE" - CFLAGS="$CFLAGS -DARCH_BE" - printf "Big Endian\n" - fi -fi -rm -f fake - -printf "Checking for -lexpat... " -printf "int main() { return 0; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - CHECK_EXPAT=no - printf "no\n" -else - CHECK_EXPAT=yes - printf "yes\n" -fi -rm -f fake - -printf "Checking for iconv 2nd argument... " -printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "non-const\n" -else - DEFS="$DEFS -DCONST_ICONV" - printf "const\n" -fi -rm -f fake - -rm -f build_check.c - -if [ "$CHECK_EXPAT" != "yes" ] -then - printf "-lexpat not found!\n" - exit 1 -fi - -printf "OS=$OS\n" > $CONFFILE -printf "STG_TIME=yes\n" >> $CONFFILE -printf "DEBUG=$DEBUG\n" >> $CONFFILE -printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE -printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE -printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE -printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE -printf "ARCH=$ARCH\n" >> $CONFFILE -printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE -printf "DEFS=$DEFS\n" >> $CONFFILE -printf "STG_LIBS=" >> $CONFFILE -for lib in $STG_LIBS -do - printf "$lib " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE -printf "CC=$CC\n" >> $CONFFILE -printf "CXX=$CXX\n" >> $CONFFILE -printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE -printf "CFLAGS=$CFLAGS\n" >> $CONFFILE -printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE -printf "LIBICONV=$LIBICONV\n" >> $CONFFILE -printf "PREFIX=$PREFIX\n" >> $CONFFILE -printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE -printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE -printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE -printf "OWNER=$OWNER\n" >> $CONFFILE - -if [ "$1" != "debug" ] -then - $MAKE $MAKEOPTS -else - printf "\n\n\nDebug build. Type $MAKE explicitly\n" -fi diff --git a/stargazer/Makefile b/stargazer/Makefile deleted file mode 100644 index e127d4f8..00000000 --- a/stargazer/Makefile +++ /dev/null @@ -1,162 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.50 2010/10/07 18:27:27 faust Exp $ -############################################################################### - -include ../../Makefile.conf - -PROG = stargazer - -SRCS = ./admin_impl.cpp \ - ./admins_impl.cpp \ - ./corps_impl.cpp \ - ./eventloop.cpp \ - ./main.cpp \ - ./pidfile.cpp \ - ./plugin_runner.cpp \ - ./plugin_mgr.cpp \ - ./settings_impl.cpp \ - ./services_impl.cpp \ - ./stg_timer.cpp \ - ./store_loader.cpp \ - ./tariff_impl.cpp \ - ./tariffs_impl.cpp \ - ./traffcounter_impl.cpp \ - ./user_impl.cpp \ - ./user_property.cpp \ - ./users_impl.cpp - -STGLIBS = scriptexecuter \ - dotconfpp \ - logger \ - common - -STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) -STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) - -LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV) - -ifeq ($(OS),linux) -LIBS += -ldl -else -LIBS += -lc -endif - -SEARCH_DIRS = -I ../../include - -OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) - -CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) - -ifneq ($(OS),darwin) -LDFLAGS += -Wl,-E -endif - -LDFLAGS += $(STGLIBS_LIBS) - -.PHONY: all clean distclean libs plugins install uninstall install-bin install-data -all: libs plugins $(PROG) - -libs: - $(MAKE) -C $(DIR_LIBSRC) - -plugins: libs - $(MAKE) -C $(DIR_PLUGINS) - -$(PROG): $(OBJS) - $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG) - -clean: - rm -f deps $(PROG) *.o tags *.*~ .OS - rm -f .OS - rm -f .store - rm -f .db.sql - rm -f core* - $(MAKE) -C $(DIR_LIBSRC) clean - $(MAKE) -C $(DIR_PLUGINS) clean - -distclean: clean - rm -f $(DIR_MOD)/* - rm -f ../../Makefile.conf - -install: install-bin install-data - -install-bin: $(PROG) -ifeq ($(DEBUG), yes) - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) -endif - $(MAKE) -C $(DIR_INCLUDE) install - $(MAKE) -C $(DIR_LIBSRC) install - $(MAKE) -C $(DIR_PLUGINS) install - -install-data: - # Install etc - mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/stargazer - mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/stargazer/conf-available.d - mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/stargazer/conf-enabled.d - install -m $(DATA_MODE) -o $(OWNER) $(ETC_DIR)/stargazer.conf $(PREFIX)/etc/stargazer/stargazer.conf - install -m $(DATA_MODE) -o $(OWNER) $(ETC_DIR)/conf-available.d/*.conf $(PREFIX)/etc/stargazer/conf-available.d - ln -sf ../conf-available.d/mod_ao.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_ao.conf - ln -sf ../conf-available.d/mod_ia.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_ia.conf - ln -sf ../conf-available.d/mod_ping.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_ping.conf - ln -sf ../conf-available.d/mod_sg.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_sg.conf - ln -sf ../conf-available.d/store_files.conf $(PREFIX)/etc/stargazer/conf-enabled.d/store_files.conf - -ifeq ($(OS),linux) - ln -sf ../conf-available.d/mod_cap_ether.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_cap_ether.conf -else - ln -sf ../conf-available.d/mod_cap_bpf.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_cap_bpf.conf -endif - - install -m $(DATA_MODE) -o $(OWNER) $(ETC_DIR)/rules $(PREFIX)/etc/stargazer/rules - install -m $(BIN_MODE) -o $(OWNER) $(ETC_DIR)/On* $(PREFIX)/etc/stargazer/ - - # Install file db - mkdir -m $(DIR_MODE) -p $(PREFIX)/var/stargazer/admins - mkdir -m $(DIR_MODE) -p $(PREFIX)/var/stargazer/tariffs - mkdir -m $(DIR_MODE) -p $(PREFIX)/var/stargazer/users/test - install -m $(DATA_MODE) -o $(OWNER) $(VAR_DIR)/admins/admin.adm $(PREFIX)/var/stargazer/admins/admin.adm - install -m $(DATA_MODE) -o $(OWNER) $(VAR_DIR)/tariffs/tariff.tf $(PREFIX)/var/stargazer/tariffs/tariff.tf - install -m $(DATA_MODE) -o $(OWNER) $(VAR_DIR)/users/test/conf $(PREFIX)/var/stargazer/users/test/conf - install -m $(DATA_MODE) -o $(OWNER) $(VAR_DIR)/users/test/stat $(PREFIX)/var/stargazer/users/test/stat - -uninstall: uninstall-bin uninstall-data - -uninstall-bin: - rm -f $(PREFIX)/usr/sbin/$(PROG) - $(MAKE) -C $(DIR_LIBSRC) uninstall - $(MAKE) -C $(DIR_PLUGINS) uninstall - rm -rf $(PREFIX)/usr/lib/stg - -uninstall-data: - # Uninstall etc - rm -rf $(PREFIX)/etc/stargazer - rm -rf $(PREFIX)/var/stargazer - - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),uninstall) --include deps -endif -endif -endif - -deps: $(SRCS) ../../Makefile.conf - $(MAKE) -C $(DIR_LIBSRC) - @>deps ;\ - for file in $(SRCS); do\ - echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? -eq 0 ];\ - then\ - echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\ - else\ - echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\ - fi;\ - done diff --git a/stargazer/build b/stargazer/build deleted file mode 100755 index b5e13df6..00000000 --- a/stargazer/build +++ /dev/null @@ -1,639 +0,0 @@ -#!/bin/sh - -# $Revision: 1.57 $ -# $Author: faust $ -# $Date: 2010/05/09 12:39:01 $ -###################################################### - -# Installation path prefix - -#PREFIX="" - -# Binaries access bits - -BIN_MODE=0755 - -# Data files access bits - -DATA_MODE=0644 - -# Dir access bits - -DIR_MODE=0755 - -# Binaries and data files owner - -OWNER=root - -OS=unknown -sys=`uname -s` -release=`uname -r` -major=`printf "%s" "$release" | cut -d. -f1` -BUILD_DIR=`pwd` -CONFFILE="../../Makefile.conf" -VAR_DIR="./inst/var/stargazer" -MIN_XMLRPCC_VERSION="1.06.27" -XMLRPC_FEATURES="c++2 abyss-server" - - -if [ "$1" = "debug" ] -then - DEFS="$DEFS -DDEBUG" - MAKEOPTS="$MAKEOPTS -j1" - CFLAGS="$CFLAGS -ggdb3 -W -Wall" - CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall" - DEBUG="yes" -else - DEFS="$DEFS -DNDEBUG" - DEBUG="no" -fi - -CFLAGS="$CFLAGS -I/usr/local/include" -CXXFLAGS="$CXXFLAGS -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" - -if [ "$sys" = "Linux" ] -then - OS=linux - ETC_DIR="./inst/linux/etc/stargazer" - MAKE="make" -fi - -if [ "$sys" = "FreeBSD" ] -then - case $major in - 4) OS=bsd;; - 5) OS=bsd5;; - 6) OS=bsd5;; - 7) OS=bsd7;; - *) OS=bsd7;; - esac - ETC_DIR="./inst/freebsd/etc/stargazer" - MAKE="gmake" -fi - -if [ "$sys" = "Darwin" ] -then - OS=darwin - ETC_DIR="./inst/freebsd/etc/stargazer" - MAKE="gmake" -fi - -if [ "$OS" = "unknown" ] -then - printf "#############################################################################\n" - printf "# Sorry, but stargazer is currently supported by Linux, FreeBSD and Darwin. #\n" - printf "#############################################################################\n" - exit 1 -fi - -printf "#############################################################################\n" -printf " Building STG 2.4 for $sys $release\n" -printf "#############################################################################\n" - -STG_LIBS="logger.lib - crypto.lib - common.lib - scriptexecuter.lib - conffiles.lib - pinger.lib - dotconfpp.lib - smux.lib" - -PLUGINS="authorization/ao - authorization/inetaccess - configuration/sgconfig - other/ping - other/rscript - other/smux - store/files - capture/cap_nf" - -if [ "$OS" = "linux" ] -then - DEFS="$DEFS -DLINUX" - PLUGINS="$PLUGINS - capture/ether_linux" - LIB_THREAD=-lpthread -else - LIBICONV="-liconv" - if [ "$OS" = "bsd" ] - then - DEFS="$DEFS -DFREE_BSD" - LIB_THREAD=-lc_r - else - if [ "$OS" = "bsd7" ] - then - DEFS="$DEFS -DFREE_BSD5" - LIB_THREAD=-lpthread - else - if [ "$OS" == "darwin" ] - then - DEFS="$DEFS -DDARWIN" - LIB_THREAD=-lpthread - else - LIB_THREAD=-lc_r - fi - fi - fi - PLUGINS="$PLUGINS - capture/ether_freebsd - capture/divert_freebsd" -fi - -if [ -z "$CC" ] -then - CC=gcc -fi - -if [ -z "$CXX" ] -then - CXX=g++ -fi - -printf "Checking CC... " -$CC --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CC not found\n" - exit; -fi -printf "found\n" -printf "Checking CXX... " -$CXX --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CXX not found\n" - exit; -fi -printf "found\n" - -printf "Checking endianess... " -printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -o fake -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "Endianess checking failed\n" - exit; -else - ./fake - if [ $? = 1 ] - then - ARCH=le - CXXFLAGS="$CXXFLAGS -DARCH_LE" - CFLAGS="$CFLAGS -DARCH_LE" - printf "Little Endian\n" - else - ARCH=be - CXXFLAGS="$CXXFLAGS -DARCH_BE" - CFLAGS="$CFLAGS -DARCH_BE" - printf "Big Endian\n" - fi -fi -rm -f fake - -printf "Checking for -lexpat... " -printf "#include \nint main() { return 0; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - CHECK_EXPAT=no - printf "no\n" -else - CHECK_EXPAT=yes - printf "yes\n" -fi -rm -f fake - -printf "Checking for iconv 2nd argument... " -printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "non-const\n" -else - DEFS="$DEFS -DCONST_ICONV" - printf "const\n" -fi -rm -f fake - -printf "Checking for fb_config... " -FB_VERSION=`fb_config --version 2> /dev/null` -if [ "$?" != "0" ] -then - printf "no\n" - printf "Checking for -lfbclient... " - printf "int main() { return 0; }\n" > build_check.c - $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - FB_CFLAGS="" - FB_LDFLAGS="-lfbclient" - CHECK_FBCLIENT=yes - printf "yes\n" - fi - rm -f fake -else - printf "yes\n" - printf "Checking for fb_config --cflags... " - FB_CFLAGS=`fb_config --cflags` - if [ "$?" != "0" ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - printf "[$FB_CFLAGS]\n" - printf "Checking for fb_config --libs " - FB_LDFLAGS=`fb_config --libs` - if [ "$?" != "0" ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - CHECK_FBCLIENT=yes - printf "[$FB_LDFLAGS]\n" - fi - fi -fi - - -printf "Checking for mysql_config... " -printf "#include \nint main() { return 0; }\n" > build_check.c -MYSQL_VERSION=`mysql_config --version 2> /dev/null` -if [ $? != 0 ] -then - printf "no\n"; - printf "Checking for -lmysqlclient... " - $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_MYSQLCLIENT=no - printf "no\n" - else - CHECK_MYSQLCLIENT=yes - MYSQL_CFLAGS="" - MYSQL_LDFLAGS="-lmysqlclient_r" - printf "yes\n" - fi - rm -f fake -else - printf "yes\n" - printf "Checking for mysql_config --cflags... " - MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null` - if [ $? != 0 ] - then - CHECK_MYSQLCLIENT=no - printf "no\n" - else - printf "[$MYSQL_CFLAGS]\n" - printf "Checking for mysql_config --libs_r... " - MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null` - if [ $? != 0 ] - then - CHECK_MYSQLCLIENT=no - printf "no\n" - else - CHECK_MYSQLCLIENT=yes - printf "[$MYSQL_LDFLAGS]\n" - fi - fi -fi - -printf "Checking for pg_config... " -printf "#include \nint main() { return 0; }\n" > build_check.c -PG_VERSION=`pg_config --version 2> /dev/null` -if [ $? != 0 ] -then - printf "no\n"; - printf "Checking for -lpq... " - $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_PQ=no - printf "no\n" - else - CHECK_PQ=yes - printf "yes\n" - fi - rm -f fake -else - printf "yes\n"; - printf "Checking for pg_config --includedir... " - PG_CFLAGS="-I"`pg_config --includedir 2> /dev/null` - if [ $? != 0 ] - then - CHECK_PQ=no - printf "no\n" - else - printf "[$PG_CFLAGS]\n" - printf "Checking for pg_config --libdir... " - PG_LDFLAGS="-L"`pg_config --libdir 2> /dev/null` - if [ $? != 0 ] - then - CHECK_PQ=no - printf "no\n" - else - CHECK_PQ=yes - printf "[$PG_LDFLAGS]\n" - fi - fi -fi - -printf "Checking for xmlrpc-c-config... " -printf "#include \nint main() { return 0; }\n" > build_check.c -XMLRPCC_VERSION=`xmlrpc-c-config $XMLRPC_FEATURES --version 2> /dev/null` -if [ $? != 0 ] -then - printf "no\n"; - printf "Checking for -lxmlrpc... " - $CC $CFLAGS $LDFLAGS build_check.c -lxmlrpc $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_XMLRPC=no - printf "no\n" - else - CHECK_XMLRPC=yes - printf "yes\n" - fi - rm -f fake -elif [ "$XMLRPCC_VERSION" \< "$MIN_XMLRPCC_VERSION" ] -then - printf "no (need at least $MIN_XMLRPCC_VERSION, actual $XMLRPCC_VERSION)\n"; - CHECK_XMLRPC=no -else - printf "yes (version $XMLRPCC_VERSION)\n"; - printf "Checking for xmlrpc-c-config --cflags... " - XMLRPC_CFLAGS=`xmlrpc-c-config $XMLRPC_FEATURES --cflags 2> /dev/null` - if [ $? != 0 ] - then - CHECK_XMLRPC=no - printf "no\n" - else - printf "[$XMLRPC_CFLAGS]\n" - printf "Checking for xmlrpc-c-config --libs... " - XMLRPC_LDFLAGS=`xmlrpc-c-config $XMLRPC_FEATURES --libs 2> /dev/null` - if [ $? != 0 ] - then - CHECK_XMLRPC=no - printf "no\n" - else - CHECK_XMLRPC=yes - printf "[$XMLRPC_LDFLAGS]\n" - fi - fi -fi - -printf "Checking for -lpcap... " -printf "#include \nint main() { return 0; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -lpcap -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - CHECK_PCAP=no - printf "no\n" -else - CHECK_PCAP=yes - printf "yes\n" -fi -rm -f fake - -printf "Checking for -lnfnetlink... " -printf "#include \n#include \n#include \nint main() { return 0; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -lnfnetlink -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - CHECK_NFNETLINK=no - printf "no\n" -else - CHECK_NFNETLINK=yes - NETLINK_LDFLAGS="-lnfnetlink" - printf "yes\n" -fi -rm -f fake - -printf "Checking for -lnetfilter_queue... " -printf "#include \n#include \nint main() { return 0; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -lnetfilter_queue -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - CHECK_NFQ=no - printf "no\n" -else - CHECK_NFQ=yes - NFQ_LDFLAGS="-lnetfilter_queue" - printf "yes\n" -fi -rm -f fake - -printf "Checking for -lyajl... " -pkg-config --version > /dev/null 2> /dev/null -if [ "$?" = "0" ] -then - pkg-config --atleast-version=2.0.0 yajl - if [ "$?" != "0" ] - then - CHECK_YAJL=no - printf "no\n" - else - CHECK_YAJL=yes - printf `pkg-config --modversion yajl`"\n" - fi -else - printf "#include \n" > build_check.c - printf "#include \n" >> build_check.c - printf "int main() { printf(\"%%d\", yajl_version()); return 0; }\n" >> build_check.c - $CC $CFLAGS $LDFLAGS build_check.c -lyajl -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_YAJL=no - printf "no\n" - else - YAJL_VERSION=`./fake` - if [ $YAJL_VERSION -ge 20000 ] - then - CHECK_YAJL=yes - printf "${YAJL_VERSION}\n" - else - CHECK_YAJL=no - printf "no. Need at least version 2.0.0, existing version is ${YAJL_VERSION}\n" - fi - fi - rm -f fake -fi - -printf "Checking for boost::scoped_ptr... " -printf "#include \nint main() { boost::scoped_ptr test(new int(1)); return 0; }\n" > build_check.cpp -$CXX $CXXFLAGS $LDFLAGS build_check.cpp -o fake # > /dev/null 2> /dev/null -if [ $? != 0 ] -then - CHECK_BOOST_SCOPED_PTR=no - printf "no\n" -else - CHECK_BOOST_SCOPED_PTR=yes - printf "yes\n" -fi -rm -f fake - -if [ "$OS" = "linux" ] -then - printf "Checking for linux/netfilter_ipv4/ip_queue.h... " - printf "#include \n" > build_check.c - printf "#include \n" >> build_check.c - printf "int main() { return 0; }\n" >> build_check.c - $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_IP_QUEUE_H=no - printf "no\n" - else - CHECK_IP_QUEUE_H=yes - DEFS="$DEFS -DHAS_IP_QUEUE_H" - PLUGINS="$PLUGINS - capture/ipq_linux" - printf "yes\n" - fi - rm -f fake -fi - -rm -f build_check.c -rm -f build_check.cpp - -if [ "$CHECK_EXPAT" != "yes" ] -then - printf -- "-lexpat not found!\n" - exit 1 -fi - -if [ "$CHECK_FBCLIENT" = "yes" ] -then - STG_LIBS="$STG_LIBS - ibpp.lib" - PLUGINS="$PLUGINS - store/firebird" -fi - -if [ "$CHECK_PQ" = "yes" ] -then - PLUGINS="$PLUGINS - store/postgresql" -fi - -if [ "$CHECK_MYSQLCLIENT" = "yes" ] -then - PLUGINS="$PLUGINS - store/mysql" -fi - -if [ "$CHECK_XMLRPC" = "yes" ] -then - PLUGINS="$PLUGINS - configuration/rpcconfig" -fi - -if [ "$CHECK_PCAP" = "yes" ] -then - PLUGINS="$PLUGINS - capture/pcap" -fi - -if [ "$CHECK_NFNETLINK" = "yes" -a "$CHECK_NFQ" = "yes" ] -then - PLUGINS="$PLUGINS - capture/nfqueue" -fi - -if [ "$CHECK_YAJL" = "yes" -a "$CHECK_BOOST_SCOPED_PTR" = "yes" ] -then - PLUGINS="$PLUGINS - other/radius" - STG_LIBS="$STG_LIBS - json.lib" -fi - -printf "OS=$OS\n" > $CONFFILE -printf "STG_TIME=yes\n" >> $CONFFILE -printf "DEBUG=$DEBUG\n" >> $CONFFILE -printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE -printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE -printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE -printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE -printf "DIR_MOD=\$(DIR_BUILD)/modules\n" >> $CONFFILE -printf "DIR_PLUGINS=\$(DIR_BUILD)/plugins\n" >> $CONFFILE -printf "ARCH=$ARCH\n" >> $CONFFILE -printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE -printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE -if [ "$CHECK_FBCLIENT" = "yes" ] -then - printf "FB_CFLAGS=$FB_CFLAGS\n" >> $CONFFILE - printf "FB_LDFLAGS=$FB_LDFLAGS\n" >> $CONFFILE -fi -printf "CHECK_MYSQLCLIENT=$CHECK_MYSQLCLIENT\n" >> $CONFFILE -if [ "$CHECK_MYSQLCLIENT" = "yes" ] -then - printf "MYSQL_CFLAGS=$MYSQL_CFLAGS\n" >> $CONFFILE - printf "MYSQL_LDFLAGS=$MYSQL_LDFLAGS\n" >> $CONFFILE -fi -printf "CHECK_PQ=$CHECK_PQ\n" >> $CONFFILE -if [ "$CHECK_PQ" = "yes" ] -then - printf "PG_CFLAGS=$PG_CFLAGS\n" >> $CONFFILE - printf "PG_LDFLAGS=$PG_LDFLAGS\n" >> $CONFFILE -fi -printf "CHECK_XMLRPC=$CHECK_XMLRPC\n" >> $CONFFILE -if [ "$CHECK_XMLRPC" = "yes" ] -then - printf "XMLRPC_CFLAGS=$XMLRPC_CFLAGS\n" >> $CONFFILE - printf "XMLRPC_LDFLAGS=$XMLRPC_LDFLAGS\n" >> $CONFFILE -fi -printf "CHECK_PCAP=$CHECK_PCAP\n" >> $CONFFILE -printf "CHECK_NFNETLINK=$CHECK_NFNETLINK\n" >> $CONFFILE -if [ "$CHECK_NFNETLINK" = "yes" ] -then - printf "NETLINK_LDFLAGS=$NETLINK_LDFLAGS\n" >> $CONFFILE -fi -printf "CHECK_NFQ=$CHECK_NFQ\n" >> $CONFFILE -if [ "$CHECK_NFQ" = "yes" ] -then - printf "NFQ_LDFLAGS=$NFQ_LDFLAGS\n" >> $CONFFILE -fi -printf "DEFS=$DEFS\n" >> $CONFFILE -printf "STG_LIBS=" >> $CONFFILE -for lib in $STG_LIBS -do - printf "$lib " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "PLUGINS=" >> $CONFFILE -for plugin in $PLUGINS -do - printf "$plugin " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "CC=$CC\n" >> $CONFFILE -printf "CXX=$CXX\n" >> $CONFFILE -printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE -printf "CFLAGS=$CFLAGS\n" >> $CONFFILE -printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE -printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE -printf "LIBICONV=$LIBICONV\n" >> $CONFFILE -printf "PREFIX=$PREFIX\n" >> $CONFFILE -printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE -printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE -printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE -printf "OWNER=$OWNER\n" >> $CONFFILE -printf "VAR_DIR=$VAR_DIR\n" >> $CONFFILE -printf "ETC_DIR=$ETC_DIR\n" >> $CONFFILE - -mkdir -p modules - -if [ "$1" != "debug" ] -then - $MAKE $MAKEOPTS -else - printf "\n\n\nDebug build. Type $MAKE explicitly\n" -fi diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 2fca2809..00000000 --- a/tests/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -INCS = -I . \ - -I ../include \ - -I ../stglibs/common.lib/include \ - -I ../stglibs/conffiles.lib/include \ - -I ../stglibs/logger.lib/include \ - -I ../stglibs/scriptexecuter.lib/include \ - -I ../stglibs/crypto.lib/include \ - -I ../projects/stargazer -DEFS = -DLINUX \ - -DUSE_ABSTRACT_SETTINGS -CFLAGS += -g3 -Wall -W -Wextra -Wno-unused-function $(INCS) $(DEFS) -CXXFLAGS += $(CFLAGS) -LIBS = -lpthread -PROG = tests - -SOURCES = main.cpp \ - test_raw_ip.cpp \ - test_admin_conf.cpp \ - test_tariff.cpp \ - test_conffiles.cpp \ - test_fee_charge_rules.cpp \ - test_reconnect_on_tariff_change.cpp \ - test_disable_session_log.cpp \ - test_filter_params_log.cpp \ - test_crypto.cpp \ - test_bfstream.cpp \ - ../projects/stargazer/tariff_impl.cpp \ - ../projects/stargazer/user_impl.cpp \ - ../projects/stargazer/user_property.cpp \ - ../stglibs/conffiles.lib/conffiles.cpp \ - ../stglibs/common.lib/common.cpp \ - ../stglibs/common.lib/strptime.cpp \ - ../stglibs/logger.lib/logger.cpp \ - ../stglibs/scriptexecuter.lib/scriptexecuter.cpp \ - ../stglibs/crypto.lib/bfstream.cpp \ - ../stglibs/crypto.lib/blowfish.c - -.PHONY: all clean - -all: $(PROG) - -$(PROG): $(addsuffix .o,$(basename $(SOURCES))) - $(CXX) $(LDFLAGS) $^ $(LIBS) -o $@ - -clean: - rm -f $(addsuffix .o,$(basename $(SOURCES))) $(addsuffix .d,$(SOURCES)) $(PROG) - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) --include $(addsuffix .d,$(SOURCES)) -endif -endif - -%.cpp.d: %.cpp - @$(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \ - sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - -%.c.d: %.c - @$(CC) -MM $(CFLAGS) $< > $@.$$$$; \ - sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ diff --git a/tests/Makefile.darwin b/tests/Makefile.darwin deleted file mode 100644 index d53db9b2..00000000 --- a/tests/Makefile.darwin +++ /dev/null @@ -1,62 +0,0 @@ -INCS = -I . \ - -I ../include \ - -I ../stglibs/common.lib/include \ - -I ../stglibs/conffiles.lib/include \ - -I ../stglibs/logger.lib/include \ - -I ../stglibs/scriptexecuter.lib/include \ - -I ../stglibs/crypto.lib/include \ - -I ../projects/stargazer -DEFS = -DDARWIN \ - -DUSE_ABSTRACT_SETTINGS -CFLAGS += -g3 -Wall -W -Wextra $(INCS) $(DEFS) -CXXFLAGS += $(CFLAGS) -LIBS = -lpthread -liconv -PROG = tests - -SOURCES = main.cpp \ - test_raw_ip.cpp \ - test_admin_conf.cpp \ - test_tariff.cpp \ - test_conffiles.cpp \ - test_fee_charge_rules.cpp \ - test_reconnect_on_tariff_change.cpp \ - test_disable_session_log.cpp \ - test_filter_params_log.cpp \ - test_crypto.cpp \ - test_bfstream.cpp \ - ../projects/stargazer/tariff_impl.cpp \ - ../projects/stargazer/user_impl.cpp \ - ../projects/stargazer/user_property.cpp \ - ../stglibs/conffiles.lib/conffiles.cpp \ - ../stglibs/common.lib/common.cpp \ - ../stglibs/common.lib/strptime.cpp \ - ../stglibs/logger.lib/logger.cpp \ - ../stglibs/scriptexecuter.lib/scriptexecuter.cpp \ - ../stglibs/crypto.lib/bfstream.cpp \ - ../stglibs/crypto.lib/blowfish.c - -.PHONY: all clean - -all: $(PROG) - -$(PROG): $(addsuffix .o,$(basename $(SOURCES))) - $(CXX) $(LDFLAGS) $^ $(LIBS) -o $@ - -clean: - rm -f $(addsuffix .o,$(basename $(SOURCES))) $(addsuffix .d,$(SOURCES)) $(PROG) - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) --include $(addsuffix .d,$(SOURCES)) -endif -endif - -%.cpp.d: %.cpp - @$(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \ - sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - -%.c.d: %.c - @$(CC) -MM $(CFLAGS) $< > $@.$$$$; \ - sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$