aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara+fdio@cisco.com>2017-07-31 10:50:25 +0200
committerMauro Sardara <msardara+fdio@cisco.com>2017-07-31 10:50:25 +0200
commite4d3f8ca1c9e130c4cbb3211b9ac0850c2456973 (patch)
treea828202f37f70bed14316245979c35edca35f3d4
parent3e6678f9c692553e8902da4d6fb1fe6c087db1f4 (diff)
Revert cmake files and build-packages script to previous version.
Change-Id: If592880f899fb2148dfcb0046d6c4371a5a51b40 Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
-rw-r--r--emu-radio/lte-emulator/CMakeLists.txt73
-rw-r--r--emu-radio/scripts/build-package.sh37
-rw-r--r--emu-radio/wifi-emulator/CMakeLists.txt71
3 files changed, 106 insertions, 75 deletions
diff --git a/emu-radio/lte-emulator/CMakeLists.txt b/emu-radio/lte-emulator/CMakeLists.txt
index a265fff5..6b8113b0 100644
--- a/emu-radio/lte-emulator/CMakeLists.txt
+++ b/emu-radio/lte-emulator/CMakeLists.txt
@@ -39,51 +39,60 @@ 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)
-string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
+
+if (PACKAGE_VERSION)
+ string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
+else()
+ set(PACKAGE_VERSION 1.0)
+endif()
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 487f538a..c5019f79 100644
--- a/emu-radio/scripts/build-package.sh
+++ b/emu-radio/scripts/build-package.sh
@@ -3,6 +3,7 @@
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"}
@@ -153,6 +154,22 @@ 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
@@ -200,31 +217,31 @@ fi
BLD_NUMBER=${BUILD_NUMBER:-"1"}
-mkdir -p ../ns3-packages
-
# Install libns3
-pushd ../ns3-packages
+pushd ${SCRIPT_PATH}/../ns3-packages
sudo dpkg -i *.deb || true
sudo apt-get -f install -y --allow-unauthenticated || true
popd
# Build wifi-emualtor
-pushd ..
+pushd ${SCRIPT_PATH}/..
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 ..
+pushd ${SCRIPT_PATH}/..
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 ../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
+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
+
diff --git a/emu-radio/wifi-emulator/CMakeLists.txt b/emu-radio/wifi-emulator/CMakeLists.txt
index 558a751f..eb551fe2 100644
--- a/emu-radio/wifi-emulator/CMakeLists.txt
+++ b/emu-radio/wifi-emulator/CMakeLists.txt
@@ -38,46 +38,51 @@ 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)
-string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
+
+if (PACKAGE_VERSION)
+ string(STRIP ${PACKAGE_VERSION} PACKAGE_VERSION)
+else()
+ set(PACKAGE_VERSION 1.0)
+endif()
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)