Skip to content

Commit

Permalink
Merge pull request #13 from yahoo/candidate_release_1_3
Browse files Browse the repository at this point in the history
Release 1 3
  • Loading branch information
juen1jp committed Jul 10, 2020
2 parents 6b6e70f + 21efcd4 commit 3071241
Show file tree
Hide file tree
Showing 316 changed files with 44,496 additions and 6,648 deletions.
65 changes: 44 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
cmake_minimum_required(VERSION 2.6)

cmake_minimum_required(VERSION 3.11)
project("NetCHASM")
include(ExternalProject)
include(GNUInstallDirs)
enable_testing()
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--enable-new-dtags")
set(OBJECT_DIR ${CMAKE_BINARY_DIR})
set(CMAKE_INSTALL_PREFIX "/bin")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE)
endif()
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(MAJOR_VERSION 1)
set(MINOR_VERSION 3)
set(PATCH_VERSION 0)

option(ASAN "enable ASAN options" OFF)
option(COV "enable CODE COVERAGE options" OFF)

include_directories(include/NetCHASM)
include_directories(include/internal)
option(SKIP-LIBEVENT "skip LIBEVENT library and related code" OFF)
option(SKIP-ARES "skip ARES library and related code" OFF)
option(SKIP-MDBM "skip MDBM library and related code" OFF)
option(SKIP-KAFKA "skip KAFKA library and related code" OFF)
option(SKIP-IPV6 "skip IPv6 tests" OFF)

link_directories(/lib64)

link_libraries(curl)
link_libraries(ssl)
link_libraries(crypto)
link_libraries(cares)
link_libraries(mdbm)
link_libraries(yaml-cpp)
link_libraries(cppunit)
link_libraries(pthread)
link_libraries(event)
link_libraries(event_openssl)
link_libraries (gcov)
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
INCLUDE(InstallRequiredSystemLibraries)
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CMAKE_INSTALL_TMPDIR /tmp CACHE PATH "Output dir for tmp")
set(CPACK_PACKAGE_NAME "NetCHASM")
set(CPACK_RPM_DIST_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_RPM_DEVEL_PACKAGE_NAME ${CPACK_PACKAGE_NAME}-devel)
set(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION})
set(CPACK_GENERATOR "RPM")
set(CPACK_SOURCE_IGNORE_FILES "rdkafka")
set(CPACK_COMPONENTS_ALL DIST DEVEL)
set(CPACK_PACKAGE_RELOCATABLE NO)
set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
set(CPACK_RPM_PACKAGE_REQUIRES "curl >= 7.61.0, yaml-cpp >= 0.6, librdkafka >= 1.2, protobuf >= 3.6, c-ares")
set(CPACK_RPM_PACKAGE_REQUIRES_PRE "curl, yaml-cpp, librdkafka, protobuf, c-ares")
set(CPACK_RPM_PACKAGE_REQUIRES_POSTUN "curl, yaml-cpp, librdkafka, protobuf, c-ares")
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_RPM_PACKAGE_AUTOREQPROV NO)
set(CPACK_RPM_PACKAGE_URL "https://github.com/yahoo/NetCHASM")
set(CPACK_RPM_DIST_FILE_NAME "${CPACK_RPM_DIST_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}${RELEASE-STR}.rpm")
set(CPACK_RPM_DEVEL_FILE_NAME "${CPACK_RPM_DEVEL_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}${RELEASE-STR}.rpm")
include(CPack)
endif()

add_custom_target(build
COMMAND ${CMAKE_MAKE_PROGRAM}
Expand All @@ -50,11 +72,12 @@ add_custom_command(TARGET testbuild
COMMAND genhtml netchasm.info -o report
)

add_subdirectory(proto)
add_subdirectory(src/internal)
add_subdirectory(src/api)
add_subdirectory(src/NetCHASMDaemon)
add_subdirectory(src/hm_command)
add_subdirectory(src/hm_configure)
add_subdirectory(src/hm_reload)
add_subdirectory(src/hm_set)
add_subdirectory(src/hm_remote)
add_subdirectory(src/hm_staticdns)
add_subdirectory(tests EXCLUDE_FROM_ALL)
30 changes: 18 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,35 @@ help:
@echo "Without and target, the daemon, library and tools will be built."
@echo "The following additional makefile targets are supported:"
@echo ""
@echo " help - display this help message."
@echo " clean - cleans all build files."
@echo " build - builds the daemon, library and tools."
@echo " doc - build the doxygen."
@echo " all - builds the daemon, library and tools, conducts unit tests, and generates the doxygen."
@echo " install - installs the daemon, library and tools."
@echo " test - build and run the unit tests."
@echo " help - display this help message."
@echo " clean - cleans all build files."
@echo " build - builds the daemon, library and tools."
@echo " slimbuild - builds the daemon, library and tools without ARES, MDBM & LibEvent."
@echo " package - create rpm packages."
@echo " doc - build the doxygen."
@echo " all - builds the daemon, library and tools, conducts unit tests, and generates the doxygen."
@echo " install - installs the daemon, library and tools."
@echo " test - build and run the unit tests."

clean:
rm -rf build; rm -rf build_test; rm -rf deps;
rm -rf build; rm -rf build_test; rm -rf api/netchasm;rm -rf proto/netchasm/*.cc; rm -rf proto/netchasm/*.h;

doc:
doxygen DoxyFile

build:
mkdir -p build; cd build; cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc; make build; cd ..;
mkdir -p build; cd build; cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE=RelWithDebInfo; make build; cd ..;

slimbuild:
mkdir -p build; cd build; cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DSKIP-MDBM=ON -DSKIP-ARES=ON -DSKIP-LIBEVENT=ON -DSKIP-KAFKA=ON -DSKIP-RAPIDXML=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo; make build; cd ..;

test:
mkdir -p build_test; cd build_test; cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCOV=ON; make testbuild; cd ..;
mkdir -p build_test; cd build_test; cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCOV=ON -DSKIP-IPV6=ON -DCMAKE_BUILD_TYPE=Debug; make testbuild; cd ..;

package:
mkdir -p build; cd build; cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE=RelWithDebInfo; make package; cd ..;

all: build test doc

install: build
cd build; make install; cd ..;


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Other dependencies can be installed via package utilities.
For example, on Fedora/CentOS:

```
dnf install openssl-devel c-ares c-ares-devel yaml-cpp yaml-cpp-devel libevent libevent-devel make cmake gcc-c++ rapidxml-devel curl-devel cppunit-devel lcov
dnf install openssl-devel c-ares c-ares-devel yaml-cpp yaml-cpp-devel libevent libevent-devel make cmake gcc-c++ rapidxml-devel curl-devel cppunit-devel lcov protobuf protobuf-devel librdkafka librdkafka-devel rpm-build
make build
sudo make install
Expand Down
1 change: 1 addition & 0 deletions api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit 3071241

Please sign in to comment.