set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+option(BUILD_WLDR "build with WLDR" ON)
+message("-- Building with WLDR: " ${BUILD_WLDR})
+
+if( BUILD_WLDR )
+ set(WLDR ON CACHE BOOL, "-- Compiling with WLDR")
+endif( BUILD_WLDR )
+
if( UNIX )
link_libraries(m)
endif( UNIX )
SET(PACKAGE_MAINTAINER "Mauro Sardara" CACHE STRING "Maintainer")
SET(PACKAGE_VERSION "1.0" CACHE STRING "Version")
SET(BUILD_NUMBER "1" CACHE STRING "Build Number")
-STRING(TOLOWER ${CMAKE_PROJECT_NAME} PACKAGE_NAME)
+STRING(TOLOWER ${CMAKE_PROJECT_NAME}-forwarder PACKAGE_NAME)
SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
SET(CPACK_PACKAGE_VERSION_MAJOR ${${CMAKE_PROJECT_NAME}_VERSION_MAJOR})
SET(TYPE "RPM")
SET(GENERATOR "RPM")
SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${BUILD_NUMBER}.${DISTRIBUTION}.${ARCHITECTURE}")
- SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages")
+ SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages" "/lib/systemd/system" "/lib" "/lib/systemd")
SET(CPACK_${TYPE}_PACKAGE_REQUIRES "longbow >= 1.0, libevent >= 2.0, openssl >= 1.0, libparc >= 1.0, libccnx-common >= 1.0")
else()
RETURN()
endif()
+# Install also configuration files
+set (METIS_CONFIG ${PROJECT_SOURCE_DIR}/config/ccnx_metis.conf)
+set (METIS_SERVICE ${PROJECT_SOURCE_DIR}/config/metis-forwarder.service)
+
+install(FILES ${METIS_CONFIG} DESTINATION /etc/ccnx)
+install(FILES ${METIS_SERVICE} DESTINATION /lib/systemd/system)
+
SET(CPACK_GENERATOR ${GENERATOR})
SET(CPACK_${TYPE}_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
SET(CPACK_${TYPE}_PACKAGE_NAME ${PACKAGE_NAME})
--- /dev/null
+# Copyright (c) 2017 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+[Unit]
+Description=Metis is a CCNx socket based forwarder.
+#Documentation=man:metis-forwarder
+
+[Service]
+Environment=PORT=9596
+Environment=LOG_FILE=/tmp/ccnx-metis.log
+Environment=CS_SIZE=1000
+Environment=CONFIG=/etc/ccnx/ccnx_metis.conf
+# This will overrride the default environment
+EnvironmentFile=-/etc/default/metis-forwarder
+ExecStart=/usr/bin/metis_daemon --port ${PORT} --log-file ${LOG_FILE} --capacity ${CS_SIZE} --config ${CONFIG}
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target