summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author刘学利 <[email protected]>2020-07-01 11:46:01 +0800
committer刘学利 <[email protected]>2020-07-01 11:46:01 +0800
commitd8317e984b8858e298bfc6ad7543406f115e7c1e (patch)
tree41de157ab3a72244b8f48605ec7fa078935793ea
parent5bdc5d8d53fc4938df325b5ce9b69638240622b7 (diff)
parent9097cfbbf231ff167a2f0e9a032ea00fb85da1e3 (diff)
Merge branch 'develop' into 'master'v2.0.6
Develop See merge request MESA_Platform/dns!4
-rw-r--r--.gitlab-ci.yml1
-rw-r--r--CMakeLists.txt25
-rw-r--r--ci/travis.sh11
-rw-r--r--cmake/Package.cmake2
-rw-r--r--cmake/preInstall.sh5
-rw-r--r--cmake/preUninstall.sh14
6 files changed, 32 insertions, 26 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c5f6f91..1d0f21e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -76,6 +76,7 @@ release_build_release:
BUILD_TYPE: RelWithDebInfo
PACKAGE: 1
UPLOAD: 1
+ SYMBOL_TARGET: dns
PULP3_REPO_NAME: protocol-stable-x86_64.el7
PULP3_DIST_NAME: protocol-stable-x86_64.el7
extends: .build_by_travis
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 041ea2c..5ca1afc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,7 @@ include_directories(/opt/MESA/include/MESA/)
file(GLOB SRC
"src/*.cpp"
)
-
+set(CMAKE_INSTALL_PREFIX /home/mesasoft/sapp_run)
set(DNS_DEPEND_DYN_LIB MESA_handle_logger MESA_field_stat2 MESA_prof_load)
# Shared Library Output
@@ -46,10 +46,9 @@ else()
set_target_properties(dns PROPERTIES OUTPUT_NAME ${lib_name})
endif()
-set(CPACK_RPM_USER_FILELIST "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/plug/protocol/dns/dns.inf"
- "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/conf/dns/dns.conf"
- "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/entrylist.conf"
- "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/plug/conflist.inf ")
+set(CPACK_RPM_LIBRARY_USER_FILELIST "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/plug/protocol/dns/dns.inf"
+ "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/conf/dns/dns.conf"
+ )
set(CMAKE_INSTALL_PREFIX /home/mesasoft/sapp_run)
install(TARGETS dns LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/protocol/dns COMPONENT LIBRARY)
@@ -58,15 +57,15 @@ install(FILES bin/dns.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/conf/dns COMPONEN
install(FILES include/dns.h DESTINATION /opt/MESA/include/MESA COMPONENT HEADER)
-file(GLOB DEMO
- "test/src/*.c"
-)
+#file(GLOB DEMO
+# "test/src/*.c"
+#)
-add_library(dns_test SHARED ${DEMO})
-set_target_properties(dns_test PROPERTIES PREFIX "")
-target_link_libraries(dns_test ${DNS_DEPEND_DYN_LIB})
+#add_library(dns_test SHARED ${DEMO})
+#set_target_properties(dns_test PROPERTIES PREFIX "")
+#target_link_libraries(dns_test ${DNS_DEPEND_DYN_LIB})
-install(TARGETS dns_test LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/dns_test COMPONENT LIBRARY)
-install(FILES test/bin/dns_test.inf DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/dns_test COMPONENT PROFILE)
+#install(TARGETS dns_test LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/dns_test COMPONENT LIBRARY)
+#install(FILES test/bin/dns_test.inf DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/dns_test COMPONENT PROFILE)
include(Package)
diff --git a/ci/travis.sh b/ci/travis.sh
index 40a2780..ccfe6b2 100644
--- a/ci/travis.sh
+++ b/ci/travis.sh
@@ -55,10 +55,9 @@ fi
if [ -n "${UPLOAD}" ]; then
cp ~/rpm_upload_tools.py ./
python3 rpm_upload_tools.py ${PULP3_REPO_NAME} ${PULP3_DIST_NAME} *.rpm
-fi
-#if [ -n "${UPLOAD_SYMBOL_FILES}" ]; then
-# rpm -i tfe*debuginfo*.rpm
-# cp /usr/lib/debug/opt/tsg/tfe/bin/tfe.debug /tmp/tfe.debuginfo.${CI_COMMIT_SHORT_SHA}
-# sentry-cli upload-dif -t elf /tmp/tfe.debuginfo.${CI_COMMIT_SHORT_SHA}
-#fi
+ rpm -i $SYMBOL_TARGET*debuginfo*.rpm
+ _symbol_file=`find /usr/lib/debug/ -name "$SYMBOL_TARGET*.so*.debug"`
+ cp $_symbol_file ${_symbol_file}info.${CI_COMMIT_SHORT_SHA}
+ sentry-cli upload-dif -t elf ${_symbol_file}info.${CI_COMMIT_SHORT_SHA}
+fi
diff --git a/cmake/Package.cmake b/cmake/Package.cmake
index edb4258..2b4179e 100644
--- a/cmake/Package.cmake
+++ b/cmake/Package.cmake
@@ -49,6 +49,8 @@ set(CPACK_RPM_HEADER_PACKAGE_CONFLICTS ${CPACK_RPM_HEADER_PACKAGE_NAME})
set(CPACK_COMPONENTS_ALL LIBRARY HEADER PROFILE)
+SET(CPACK_RPM_LIBRARY_PRE_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/cmake/preInstall.sh")
+SET(CPACK_RPM_LIBRARY_PRE_UNINSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/cmake/preUninstall.sh")
set(CPACK_BUILD_SOURCE_DIRS "${CMAKE_SOURCE_DIR}")
diff --git a/cmake/preInstall.sh b/cmake/preInstall.sh
index ecbbac3..3519753 100644
--- a/cmake/preInstall.sh
+++ b/cmake/preInstall.sh
@@ -1,11 +1,12 @@
#!/bin/sh
DST=${RPM_INSTALL_PREFIX}
mkdir -p ${DST}/plug/protocol/
+mkdir -p ${DST}/etc/
touch ${DST}/plug/conflist.inf
touch ${DST}/etc/entrylist.conf
if [[ -z `grep -rn 'dns.inf' ${DST}/plug/conflist.inf` ]];then
sed -i '/\[protocol\]/a\./plug/protocol/dns/dns.inf' ${DST}/plug/conflist.inf
fi
-if [[ -z `grep -rn 'DNS' ${DST}etc/entrylist.conf` ]];then
- echo "DNS" >> ${DST}etc/entrylist.conf
+if [[ -z `grep -rn 'DNS' ${DST}/etc/entrylist.conf` ]];then
+ echo "DNS" >> ${DST}/etc/entrylist.conf
fi
diff --git a/cmake/preUninstall.sh b/cmake/preUninstall.sh
index 186466f..94ddb0d 100644
--- a/cmake/preUninstall.sh
+++ b/cmake/preUninstall.sh
@@ -1,6 +1,10 @@
#!/bin/sh
-DST=${RPM_INSTALL_PREFIX}
-mkdir -p ${DST}/plug/business/
-touch ${DST}/plug/conflist.inf
-sed -i '/dns.inf/d' ${DST}/plug/conflist.inf
-sed -i '/DNS/d' ${DST}etc/entrylist.conf
+if [ $1 == 0 ]; then
+ DST=${RPM_INSTALL_PREFIX}
+
+ mkdir -p ${DST}/plug/business/
+ touch ${DST}/plug/conflist.inf
+
+ sed -i '/dns.inf/d' ${DST}/plug/conflist.inf
+ sed -i '/DNS/d' ${DST}etc/entrylist.conf
+fi