aboutsummaryrefslogtreecommitdiffstats
path: root/emu-radio
diff options
context:
space:
mode:
Diffstat (limited to 'emu-radio')
-rw-r--r--emu-radio/lte-emulator/CMakeLists.txt73
-rw-r--r--emu-radio/scripts/build-package.sh36
-rw-r--r--emu-radio/wifi-emulator/CMakeLists.txt71
3 files changed, 75 insertions, 105 deletions
diff --git a/emu-radio/lte-emulator/CMakeLists.txt b/emu-radio/lte-emulator/CMakeLists.txt
index 6b8113b0..a265fff5 100644
--- a/emu-radio/lte-emulator/CMakeLists.txt
+++ b/emu-radio/lte-emulator/CMakeLists.txt
@@ -39,60 +39,51 @@ add_executable(lte_emulator ${SOURCE_FILES} ${COMMON_FILES})
target_link_libraries(lte_emulator ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${Lte_Ns3_LIBRARIES})
install(TARGETS lte_emulator DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
-install(FILES ${PROJECT_SOURCE_DIR}/fading-traces/fading_trace_EPA_3kmph.fad DESTINATION share/lte-emulator)
-install(FILES ${PROJECT_SOURCE_DIR}/fading-traces/fading_trace_ETU_3kmph.fad DESTINATION share/lte-emulator)
-install(FILES ${PROJECT_SOURCE_DIR}/fading-traces/fading_trace_EVA_60kmph.fad DESTINATION share/lte-emulator)
-install(FILES ${PROJECT_SOURCE_DIR}/fading-traces/fading_trace_generator.m DESTINATION share/lte-emulator)
# Generate DEB / RPM packages
option(DEB_PACKAGE "Create deb package" OFF)
option(RPM_PACKAGE "Create deb package" OFF)
-set(VENDOR "Cisco Systems" CACHE STRING "Vendor")
-set(CONTACT "msardara@cisco.com" CACHE STRING "Contact")
-set(DISTRIBUTION "xenial" CACHE STRING "Distribution")
-set(ARCHITECTURE "amd64" CACHE STRING "Architecture")
-set(PACKAGE_MAINTAINER "Mauro Sardara (msardara@cisco.com)" CACHE STRING "Maintainer")
-set(BUILD_NUMBER "1" CACHE STRING "Build Number")
-set(PACKAGE_NAME lte-emulator)
-set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
-set(CPACK_PACKAGE_VENDOR ${VENDOR})
-set(CPACK_PACKAGE_CONTACT ${CONTACT})
+SET(VENDOR "Cisco Systems" CACHE STRING "Vendor")
+SET(CONTACT "msardara@cisco.com" CACHE STRING "Contact")
+SET(DISTRIBUTION "xenial" CACHE STRING "Distribution")
+SET(ARCHITECTURE "amd64" CACHE STRING "Architecture")
+SET(PACKAGE_MAINTAINER "Mauro Sardara (msardara@cisco.com)" CACHE STRING "Maintainer")
+SET(BUILD_NUMBER "1" CACHE STRING "Build Number")
+SET(PACKAGE_NAME lte-emulator)
+SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
+SET(CPACK_PACKAGE_VENDOR ${VENDOR})
+SET(CPACK_PACKAGE_CONTACT ${CONTACT})
# Get the version
execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/version
OUTPUT_VARIABLE PACKAGE_VERSION)
-
-if (PACKAGE_VERSION)
- string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
-else()
- set(PACKAGE_VERSION 1.0)
-endif()
+string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
if(DEB_PACKAGE)
- set(TYPE "DEBIAN")
- set(GENERATOR "DEB")
- set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_${ARCHITECTURE}")
- set(CPACK_${TYPE}_PACKAGE_DEPENDS "libns3sx-3v5, ns3sx, libboost-system1.58.0")
+ SET(TYPE "DEBIAN")
+ SET(GENERATOR "DEB")
+ SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_${ARCHITECTURE}")
+ SET(CPACK_${TYPE}_PACKAGE_DEPENDS "libns3sx-3v5, ns3sx, libboost-system1.58.0")
elseif(RPM_PACKAGE)
- set(TYPE "RPM")
- set(GENERATOR "RPM")
- set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}.${ARCHITECTURE}")
- set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages")
- set(CPACK_${TYPE}_PACKAGE_REQUIRES "")
+ SET(TYPE "RPM")
+ SET(GENERATOR "RPM")
+ SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}.${ARCHITECTURE}")
+ SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages")
+ SET(CPACK_${TYPE}_PACKAGE_REQUIRES "")
else()
- return()
+ RETURN()
endif()
-set(CPACK_GENERATOR ${GENERATOR})
-set(CPACK_${TYPE}_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
-set(CPACK_${TYPE}_PACKAGE_NAME ${PACKAGE_NAME})
-set(CPACK_${TYPE}_PACKAGE_VERSION ${PACKAGE_VERSION})
-set(CPACK_${TYPE}_PACKAGE_ARCHITECTURE ${ARCHITECTURE})
-set(CPACK_${TYPE}_PACKAGE_RELEASE 1)
-set(CPACK_${TYPE}_PACKAGE_VENDOR ${VENDOR})
-set(CPACK_${TYPE}_PACKAGE_DESCRIPTION "LTE channel emulator.")
-set(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Vicn")
-
-include(CPack)
+SET(CPACK_GENERATOR ${GENERATOR})
+SET(CPACK_${TYPE}_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
+SET(CPACK_${TYPE}_PACKAGE_NAME ${PACKAGE_NAME})
+SET(CPACK_${TYPE}_PACKAGE_VERSION ${PACKAGE_VERSION})
+SET(CPACK_${TYPE}_PACKAGE_ARCHITECTURE ${ARCHITECTURE})
+SET(CPACK_${TYPE}_PACKAGE_RELEASE 1)
+SET(CPACK_${TYPE}_PACKAGE_VENDOR ${VENDOR})
+SET(CPACK_${TYPE}_PACKAGE_DESCRIPTION "LTE channel emulator.")
+SET(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Vicn")
+
+INCLUDE(CPack)
diff --git a/emu-radio/scripts/build-package.sh b/emu-radio/scripts/build-package.sh
index 1aa828d0..487f538a 100644
--- a/emu-radio/scripts/build-package.sh
+++ b/emu-radio/scripts/build-package.sh
@@ -3,7 +3,6 @@
set -euxo pipefail
IFS=$'\n\t'
-SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
APT_PATH=`which apt-get` || true
apt_get=${APT_PATH:-"/usr/local/bin/apt-get"}
@@ -154,22 +153,6 @@ build() {
make
}
-change_version() {
- OLD_PACKAGE=$1
- NEW_PACKAGE=$2
- B_NUMBER=$3
-
- mkdir tmp
- pushd tmp
- ar p ../${OLD_PACKAGE} control.tar.gz | tar -xz
- sed -i s/3.24.1-8/3.24.1-${B_NUMBER}/g control
- mv ../${OLD_PACKAGE} ../${NEW_PACKAGE}
- tar czf control.tar.gz *[!z]
- ar r ../${NEW_PACKAGE} control.tar.gz
- popd
- rm -rf tmp
-}
-
ARCHITECTURE=`uname -m`
# Figure out what system we are running on
@@ -217,30 +200,31 @@ fi
BLD_NUMBER=${BUILD_NUMBER:-"1"}
+mkdir -p ../ns3-packages
+
# Install libns3
-pushd ${SCRIPT_PATH}/../ns3-packages
+pushd ../ns3-packages
sudo dpkg -i *.deb || true
sudo apt-get -f install -y --allow-unauthenticated || true
popd
# Build wifi-emualtor
-pushd ${SCRIPT_PATH}/..
+pushd ..
build "-DWIFI=ON -DLTE=OFF"
make package
find . -not -name '*.deb' -not -name '*.rpm' -print0 | xargs -0 rm -rf -- || true
popd
# Build lte-emualtor
-pushd ${SCRIPT_PATH}/..
+pushd ..
build "-DLTE=ON -DWIFI=OFF"
make package
find . -not -name '*.deb' -not -name '*.rpm' -print0 | xargs -0 rm -rf -- || true
popd
# Change build number to ns3 packages
-pushd ${SCRIPT_PATH}/../ns3-packages
-
-change_version libns3sx-3v5_3.24.1-8~xenial_amd64.deb libns3sx-3v5_3.24.1-$BLD_NUMBER~xenial_amd64.deb ${BLD_NUMBER} || true
-change_version libns3sx-dev_3.24.1-8~xenial_amd64.deb libns3sx-dev_3.24.1-$BLD_NUMBER~xenial_amd64.deb ${BLD_NUMBER} || true
-change_version ns3sx_3.24.1-8~xenial_amd64.deb ns3sx_3.24.1-$BLD_NUMBER~xenial_amd64.deb ${BLD_NUMBER} || true
-popd
+pushd ../ns3-packages
+mv libns3sx-3v5_3.24.1-6~xenial_amd64.deb libns3sx-3v5_3.24.1-$BLD_NUMBER~xenial_amd64.deb || true
+mv libns3sx-dev_3.24.1-6~xenial_amd64.deb libns3sx-dev_3.24.1-$BLD_NUMBER~xenial_amd64.deb || true
+mv ns3sx_3.24.1-6~xenial_amd64.deb ns3sx_3.24.1-$BLD_NUMBER~xenial_amd64.deb || true
+popd \ No newline at end of file
diff --git a/emu-radio/wifi-emulator/CMakeLists.txt b/emu-radio/wifi-emulator/CMakeLists.txt
index eb551fe2..558a751f 100644
--- a/emu-radio/wifi-emulator/CMakeLists.txt
+++ b/emu-radio/wifi-emulator/CMakeLists.txt
@@ -38,51 +38,46 @@ install(TARGETS wifi_emulator DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
option(DEB_PACKAGE "Create deb package" OFF)
option(RPM_PACKAGE "Create deb package" OFF)
-set(VENDOR "Cisco Systems" CACHE STRING "Vendor")
-set(CONTACT "msardara@cisco.com" CACHE STRING "Contact")
-set(DISTRIBUTION "xenial" CACHE STRING "Distribution")
-set(ARCHITECTURE "amd64" CACHE STRING "Architecture")
-set(PACKAGE_MAINTAINER "Mauro Sardara (msardara@cisco.com)" CACHE STRING "Maintainer")
-set(BUILD_NUMBER "1" CACHE STRING "Build Number")
-set(PACKAGE_NAME wifi-emulator)
-
-set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
-set(CPACK_PACKAGE_VENDOR ${VENDOR})
-set(CPACK_PACKAGE_CONTACT ${CONTACT})
+SET(VENDOR "Cisco Systems" CACHE STRING "Vendor")
+SET(CONTACT "msardara@cisco.com" CACHE STRING "Contact")
+SET(DISTRIBUTION "xenial" CACHE STRING "Distribution")
+SET(ARCHITECTURE "amd64" CACHE STRING "Architecture")
+SET(PACKAGE_MAINTAINER "Mauro Sardara (msardara@cisco.com)" CACHE STRING "Maintainer")
+SET(BUILD_NUMBER "1" CACHE STRING "Build Number")
+SET(PACKAGE_NAME wifi-emulator)
+
+SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
+SET(CPACK_PACKAGE_VENDOR ${VENDOR})
+SET(CPACK_PACKAGE_CONTACT ${CONTACT})
# Get the version
execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/version
OUTPUT_VARIABLE PACKAGE_VERSION)
-
-if (PACKAGE_VERSION)
- string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
-else()
- set(PACKAGE_VERSION 1.0)
-endif()
+string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
if(DEB_PACKAGE)
- set(TYPE "DEBIAN")
- set(GENERATOR "DEB")
- set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_${ARCHITECTURE}")
- set(CPACK_${TYPE}_PACKAGE_DEPENDS "libns3sx-3v5, ns3sx, libboost-system1.58.0")
+ SET(TYPE "DEBIAN")
+ SET(GENERATOR "DEB")
+ SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_${ARCHITECTURE}")
+ SET(CPACK_${TYPE}_PACKAGE_DEPENDS "libns3sx-3v5, ns3sx, libboost-system1.58.0")
elseif(RPM_PACKAGE)
- set(TYPE "RPM")
- set(GENERATOR "RPM")
- set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}.${ARCHITECTURE}")
- set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages")
- set(CPACK_${TYPE}_PACKAGE_REQUIRES "")
+ SET(TYPE "RPM")
+ SET(GENERATOR "RPM")
+ SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}.${ARCHITECTURE}")
+ SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/etc" "/usr/lib/python2.7" "/usr/lib/python2.7/site-packages")
+ SET(CPACK_${TYPE}_PACKAGE_REQUIRES "")
else()
- return()
+ RETURN()
endif()
-set(CPACK_GENERATOR ${GENERATOR})
-set(CPACK_${TYPE}_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
-set(CPACK_${TYPE}_PACKAGE_NAME ${PACKAGE_NAME})
-set(CPACK_${TYPE}_PACKAGE_VERSION ${PACKAGE_VERSION})
-set(CPACK_${TYPE}_PACKAGE_ARCHITECTURE ${ARCHITECTURE})
-set(CPACK_${TYPE}_PACKAGE_RELEASE 1)
-set(CPACK_${TYPE}_PACKAGE_VENDOR ${VENDOR})
-set(CPACK_${TYPE}_PACKAGE_DESCRIPTION "Wifi N channel emulator.")
-set(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Vicn")
-
-include(CPack)
+SET(CPACK_GENERATOR ${GENERATOR})
+SET(CPACK_${TYPE}_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
+SET(CPACK_${TYPE}_PACKAGE_NAME ${PACKAGE_NAME})
+SET(CPACK_${TYPE}_PACKAGE_VERSION ${PACKAGE_VERSION})
+SET(CPACK_${TYPE}_PACKAGE_ARCHITECTURE ${ARCHITECTURE})
+SET(CPACK_${TYPE}_PACKAGE_RELEASE 1)
+SET(CPACK_${TYPE}_PACKAGE_VENDOR ${VENDOR})
+SET(CPACK_${TYPE}_PACKAGE_DESCRIPTION "Wifi N channel emulator.")
+SET(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Vicn")
+
+INCLUDE(CPack)