Skip to content

Commit

Permalink
修改deb打包
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed May 6, 2015
1 parent 0fcaf1e commit e73bb17
Show file tree
Hide file tree
Showing 29 changed files with 81 additions and 63 deletions.
46 changes: 20 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ ENDIF()
MESSAGE("\n")

#判断 qt 版本
FIND_PACKAGE(Qt5 5.3 CONFIG REQUIRED Gui Core Network Xml Multimedia Widgets LinguistTools)
SET(QT_INSTALL_DIR "${Qt5_DIR}/../../..")
SET(QT_COMPONENTS Core Gui Widgets Network Xml Multimedia)
FIND_PACKAGE(Qt5 CONFIG REQUIRED ${QT_COMPONENTS} LinguistTools)
FOREACH(_COMPONENT ${QT_COMPONENTS})
FIND_PACKAGE(Qt5${_COMPONENT} REQUIRED)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${Qt5${_COMPONENT}_LIBRARIES})
ENDFOREACH()
FIND_PACKAGE(Qt5WebKitWidgets)
IF(Qt5WebKitWidgets_FOUND)
ADD_DEFINITIONS(-DRABBITIM_WEBKIT)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebKitWidgets_LIBRARIES})
ENDIF(Qt5WebKitWidgets_FOUND)

if(NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -167,7 +173,8 @@ ELSEIF(ANDROID)
SET(TOOLCHAIN_NAME android)
ADD_DEFINITIONS(-DMOBILE)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/android/jni)
FIND_PACKAGE(Qt5 CONFIG REQUIRED AndroidExtras)
FIND_PACKAGE(Qt5AndroidExtras REQUIRED)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${Qt5AndroidExtras_LIBRARIES})
#SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -Wa,--noexecstack -gdwarf-2 -marm -fno-omit-frame-pointer -Wall -Wno-psabi -W -fPIE)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,-z,noexecstack -shared --sysroot=${ANDROID_SYSROOT}")
ELSE(LINUX OR UNIX)
Expand Down Expand Up @@ -366,11 +373,8 @@ SET(RABBITIM_LIBS
${SPEEX_LIBRARIES}
${CURL_LIBRARIES}
${OPENSSL_LIBRARIES}
Qt5::Widgets
Qt5::Network
Qt5::Multimedia
Qt5::Xml
Qt5::Core)
${QT_LIBRARIES}
)

include(cmake/install_version.cmake)
include(cmake/cmake_build_file.cmake)
Expand All @@ -384,10 +388,7 @@ IF(ANDROID)
${RABBITIM_RCC_FILES}
${RABBITIM_UIS}
)
SET(RABBITIM_LIBS
${RABBITIM_LIBS}
Qt5::AndroidExtras)
qt5_wrap_ui(RABBITIM_UIS ${RABBITIM_UIS})
#qt5_wrap_ui(RABBITIM_UIS ${RABBITIM_UIS})
ELSEIF(WIN32)
add_executable(${PROJECT_NAME} WIN32
${RABBITIM_SOURCES}
Expand All @@ -401,11 +402,6 @@ ELSE()
${RABBITIM_UIS}
)
ENDIF()
IF(Qt5WebKitWidgets_FOUND)
SET(RABBITIM_LIBS
${RABBITIM_LIBS}
Qt5::WebKitWidgets)
ENDIF(Qt5WebKitWidgets_FOUND)
message("RABBITIM_LIBS:${RABBITIM_LIBS}\n")
#链接库
target_link_libraries(${PROJECT_NAME}
Expand Down Expand Up @@ -457,7 +453,7 @@ IF(NOT CMAKE_BUILD_TYPE MATCHES Debug)
#安装3:qt库
IF(WIN32 AND CMAKE_HOST_WIN32)
IF(MINGW)
#windeployqt 分发时,是根据是否 strip 来判断是否是 DEBUG 版本
#windeployqt 分发时,是根据是否 strip 来判断是否是 DEBUG 版本,而用mingw编译时,qt没有自动 strip
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND strip "${PROJECT_BINARY_DIR}/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}"
)
Expand All @@ -482,20 +478,18 @@ IF(NOT CMAKE_BUILD_TYPE MATCHES Debug)
# WORKING_DIRECTORY .)"
# )
ELSEIF(NOT ANDROID)
SET(QT_LIBS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network Qt5::Multimedia Qt5::Xml)
SET(QT_PLUGINS Qt5Core_PLUGINS
Qt5Gui_PLUGINS
Qt5Widgets_PLUGINS
Qt5Network_PLUGINS
Qt5Multimedia_PLUGINS
Qt5Xml_PLUGINS)
Qt5Gui_PLUGINS
Qt5Widgets_PLUGINS
Qt5Network_PLUGINS
Qt5Multimedia_PLUGINS
Qt5Xml_PLUGINS)
IF(Qt5WebKitWidgets_FOUND)
SET(QT_LIBS ${QT_LIBS} Qt5::WebKitWidgets)
SET(QT_PLUGINS ${QT_PLUGINS} Qt5WebKitWidgets_PLUGINS)
ENDIF(Qt5WebKitWidgets_FOUND)
INSTALL_QT_LIBRARYS(${QT_LIBS})
INSTALL_QT_LIBRARYS(${QT_LIBRARIES})
INSTALL_QT_PLUGINS(${QT_PLUGINS})
ENDIF(WIN32)
ENDIF()
ENDIF(NOT CMAKE_BUILD_TYPE MATCHES Debug)

IF(ANDROID)
Expand Down
6 changes: 3 additions & 3 deletions ThirdLibary/build_script/build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/sh
#!/bin/bash

#bash用法:
# 在用一sh进程中执行脚本script.sh:
# source script.sh
# . script.sh
# 注意这种用法,script.sh开头一行不能包含 #!/bin/sh
# 注意这种用法,script.sh开头一行不能包含 #!/bin/bash

# 新建一个sh进程执行脚本script.sh:
# sh script.sh
# ./script.sh
# 注意这种用法,script.sh开头一行必须包含 #!/bin/sh
# 注意这种用法,script.sh开头一行必须包含 #!/bin/bash

#作者:康林

Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_ffmpeg.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#bash用法:
# 在用一sh进程中执行脚本script.sh:
# source script.sh
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_icu.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_libcurl.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_libopus.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_libsodium.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_libvpx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_libyuv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_opencv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_openssl.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_qt.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_qxmpp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
4 changes: 2 additions & 2 deletions ThirdLibary/build_script/build_rabbitim.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down Expand Up @@ -141,7 +141,7 @@ else #cmake编译
CMAKE_PARA=""
;;
unix)
PARA="-DCMAKE_INSTALL_PREFIX=/usr/local/RabbitIm"
PARA="${PARA} -DCMAKE_INSTALL_PREFIX=/usr/local/RabbitIm" #设置打包的安装路径
;;
windows_msvc)
#因为用Visual Studio 2013生成的目标路径与配置有关,这影响到安装文件的生成,所以用nmake生成
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_speex.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_speexdsp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_toxcore.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/build_x264.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#作者:康林
#参数:
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/travis/build-and-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e

function function_common()
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/travis/build-before.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#下载编译好的第三方依赖库

set -e
Expand Down
2 changes: 1 addition & 1 deletion ThirdLibary/build_script/travis/build-depends.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e

function function_common()
Expand Down
3 changes: 2 additions & 1 deletion cmake/RabbitImUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ ENDMACRO(INSTALL_QT_PLUGINS)
MACRO(INSTALL_QT_LIBRARYS _LIBS)
FOREACH(_file ${ARGV})
get_target_property(_location ${_file} LOCATION)
MESSAGE("Libs:${_location};link:${_location_LINK}")
get_target_property(_LINK ${_file} IMPORTED_SONAME_RELEASE)
MESSAGE("Libs:${_location};link:${_LINK}")
IF(EXISTS ${_location})
INSTALL(FILES ${_location} DESTINATION .)
ENDIF(EXISTS ${_location})
Expand Down
19 changes: 10 additions & 9 deletions cmake/install_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENDIF()

# Project Info
SET(PROJECT_DESCRIPTION "Rabbit instant messaging")
SET(PROJECT_COPYRIGHT "Copyright (C) 2009-2015 KangLin studio")
SET(PROJECT_COPYRIGHT "Copyright (C) 2014-2015 KangLin studio") #TODO:修改日期
SET(PROJECT_CONTACT "[email protected]")
SET(PROJECT_VENDOR "KangLin studio")
SET(PROJECT_WEBSITE "https://github.com/KangLin/rabbitim")
Expand Down Expand Up @@ -112,17 +112,18 @@ IF(DPKG_FOUND AND NOT WIN32 AND NOT ANDROID)
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "${PROJECT_VENDOR} <${PROJECT_CONTACT}>")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_DEBUG OFF)
SET(RABBITIM_PACKAGE_REQUIRES "libavcodec-dev, libavformat-dev, libavutil-dev, libswscale-dev, libc6 (>= 2.14), libcurl3 (>= 7.16.2), libegl1-mesa (>= 7.8.1) | libegl1-x11, libfontconfig1 (>= 2.9.0), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.1.1), libgl1-mesa-glx | libgl1, libglib2.0-0 (>= 2.22.0), libgtk2.0-0 (>= 2.24.0), libice6 (>= 1:1.0.0), libicu52 (>= 52~m1-1~), libpango-1.0-0 (>= 1.14.0), libpulse0 (>= 1:0.99.1), libsm6, libssl1.0.0 (>= 1.0.0), libstdc++6 (>= 4.6), libvpx1 (>= 1.0.0), libx11-6, libx11-xcb1, libxcb1, libxi6 (>= 2:1.2.99.4), libxrender1")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${RABBITIM_PACKAGE_REQUIRES}")
SET(CPACK_DEBIAN_PACKAGE_SECTION "x11")
SET(CPACK_DEBIAN_PACKAGE_SECTION "Applications/Network/Communication")
SET(CPACK_SET_DESTDIR TRUE)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/debian/control.template.cmake
${PROJECT_BINARY_DIR}/control
@ONLY
)
SET(CONTROL_EXTRA
"${CMAKE_SOURCE_DIR}/debian/menu;${PROJECT_BINARY_DIR}/control")
#configure_file(
# ${CMAKE_CURRENT_SOURCE_DIR}/debian/control.template.cmake
# ${PROJECT_BINARY_DIR}/control
# @ONLY
#)
SET(CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/debian/menu")
#SET(CONTROL_EXTRA "${CONTROL_EXTRA};${PROJECT_BINARY_DIR}/control")
SET(CONTROL_EXTRA
"${CONTROL_EXTRA};${CMAKE_SOURCE_DIR}/debian/preinst;${CMAKE_SOURCE_DIR}/debian/postinst")
SET(CONTROL_EXTRA
Expand Down
2 changes: 1 addition & 1 deletion debian/menu
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
?package(rabbitim):needs="X11|text|vc|wm" section="Applications/Network/Communication"\
?package(RabbitIm):needs="X11|text|vc|wm" section="Applications/Network/Communication"\
title="RabbitIm" command="/usr/bin/RabbitIm"
22 changes: 19 additions & 3 deletions debian/postinst
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# postinst script for rabbitim
#
# see: dh_installdeb(1)
Expand All @@ -17,16 +17,32 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

function EnumerateDicectory(){
for _file in `ls $1`
do
if [ -d "$1/${_file}" ]; then
echo "$1/${_file}" >> /etc/ld.so.conf.d/RabbitIm.conf
EnumerateDicectory "$1/${_file}"
fi
done
}

case "$1" in
configure)
;;
RABBITIM_INSTALL_PREFIX="/usr/local/RabbitIm"
echo "${RABBITIM_INSTALL_PREFIX}" > /etc/ld.so.conf.d/RabbitIm.conf
echo "${RABBITIM_INSTALL_PREFIX}/plugins" >> /etc/ld.so.conf.d/RabbitIm.conf
EnumerateDicectory "${RABBITIM_INSTALL_PREFIX}/plugins"
ldconfig
;;

abort-upgrade|abort-remove|abort-deconfigure)
rm -f /etc/ld.so.conf.d/RabbitIm.conf
ldconfig
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
echo "postinst called with unknown argument '$1'" >&2
exit 1
;;
esac
Expand Down
2 changes: 2 additions & 0 deletions debian/postrm
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ set -e

case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
rm -f /etc/ld.so.conf.d/RabbitIm.conf
ldconfig
;;

*)
Expand Down
Empty file modified debian/preinst
100644 → 100755
Empty file.
Empty file modified debian/prerm
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions docs/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
重构好友消息抽象
重构系统提示TIP抽象
用doxygen文档化
linux下deb安装包:
qt依赖库安装 qtwebkitwidge 有依赖其它qt库,插件找不到
应用程序快捷图标
rpm安装包建立

v0.2.0
---------
Expand Down

0 comments on commit e73bb17

Please sign in to comment.