From a7c0101db8abee0022f76a969ddd84a3238ce6e7 Mon Sep 17 00:00:00 2001 From: KangLin Date: Mon, 27 May 2019 14:35:33 +0800 Subject: [PATCH] Modify icon for deb package --- App/App.pro | 10 +++++----- App/CMakeLists.txt | 1 + appveyor.yml | 2 +- ci/build.sh | 6 +++--- debian/LunarCalendar.desktop | 8 ++++---- debian/postinst | 6 ++++++ debian/postrm | 5 +++-- tag.sh | 2 +- 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/App/App.pro b/App/App.pro index c90c7c99..25bb8703 100644 --- a/App/App.pro +++ b/App/App.pro @@ -128,11 +128,11 @@ win32 { DESKTOP_FILE.CONFIG += directory no_check_exist # install icons - icon128.target = icon128 - icon128.files = Resource/image/calendar.png - icon128.path = $${PREFIX}/share/icons/hicolor/128x128/apps - icon128.CONFIG = directory no_check_exist - INSTALLS += DESKTOP_FILE icon128 + icon.target = icon + icon.files = Resource/image/calendar.png + icon.path = $${PREFIX}/share/pixmaps + icon.CONFIG = directory no_check_exist + INSTALLS += DESKTOP_FILE icon } OTHER_FILES += \ diff --git a/App/CMakeLists.txt b/App/CMakeLists.txt index 8783a536..2a11b46a 100644 --- a/App/CMakeLists.txt +++ b/App/CMakeLists.txt @@ -80,6 +80,7 @@ INSTALL(FILES ${OTHER_FILES} DESTINATION ".") if(UNIX) INSTALL(FILES ${CMAKE_SOURCE_DIR}/debian/LunarCalendar.desktop DESTINATION "share/applications") + INSTALL(FILES ${CMAKE_SOURCE_DIR}/Resource/image/calendar.png DESTINATION "share/pixmaps") endif() IF("Release" STREQUAL CMAKE_BUILD_TYPE AND WIN32) diff --git a/appveyor.yml b/appveyor.yml index 47b77a85..95758d53 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ #TODO: Change version -version: '0.0.4.{build}' +version: '0.0..{build}' environment: matrix: diff --git a/ci/build.sh b/ci/build.sh index 3314b97c..a41c40c8 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -100,8 +100,8 @@ if [ "${BUILD_TARGERT}" = "unix" ]; then fi if [ "$TRAVIS_TAG" != "" -a "${QT_VERSION_DIR}" = "512" ]; then cd debian/lunarcalendar/opt/LunarCalendar - sed -i "s/^\Icon=.*/Icon=calendar/g" share/applications/LunarCalendar.desktop - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${QT_ROOT}/bin:${QT_ROOT}/lib + + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${QT_ROOT}/bin:${QT_ROOT}/lib:`pwd`/debian/lunarcalendar/opt/LunarCalendar/bin:`pwd`/debian/lunarcalendar/opt/LunarCalendar/lib wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" chmod a+x linuxdeployqt-continuous-x86_64.AppImage export VERSION="0.0.4" @@ -110,7 +110,7 @@ if [ "${BUILD_TARGERT}" = "unix" ]; then wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - bash upload.sh lunarcalendar*.AppImage* + bash upload.sh Lunar*.AppImage fi exit 0 fi diff --git a/debian/LunarCalendar.desktop b/debian/LunarCalendar.desktop index 34ada72b..2dfa70b2 100755 --- a/debian/LunarCalendar.desktop +++ b/debian/LunarCalendar.desktop @@ -3,10 +3,10 @@ Type=Application Name=Lunar calendar GenericName=Lunar calendar Comment=Lunar calendar -Comment[zh_CN]=农历日历 -GenericName[zh_CN]=农历日历 -Comment[zh_CN]=农历日历 -Icon=/opt/LunarCalendar/share/icons/hicolor/128x128/apps/calendar.png +Name[zh_CN]=日历 +GenericName[zh_CN]=日历 +Comment[zh_CN]=日历(包含农历) +Icon=calendar Exec=/opt/LunarCalendar/bin/LunarCalendarApp Terminal=false StartupNotify=true diff --git a/debian/postinst b/debian/postinst index 0ebdbb85..9abd23c6 100644 --- a/debian/postinst +++ b/debian/postinst @@ -23,6 +23,12 @@ case "$1" in if [ ! -f /usr/share/applications/LunarCalendar.desktop ]; then ln -s /opt/LunarCalendar/share/applications/LunarCalendar.desktop /usr/share/applications/LunarCalendar.desktop fi + if [ ! -f /usr/share/pixmaps/calendar.png ]; then + if [ ! -d /usr/share/pixmaps ]; then + mkdir -p /usr/share/pixmaps + fi + ln -s /opt/LunarCalendar/share/pixmaps/calendar.png /usr/share/pixmaps/calendar.png + fi echo "/opt/LunarCalendar/lib" > /etc/ld.so.conf.d/LunarCalendar.conf echo "/opt/LunarCalendar/bin" >> /etc/ld.so.conf.d/LunarCalendar.conf echo "/opt/qt59/lib" >> /etc/ld.so.conf.d/LunarCalendar.conf diff --git a/debian/postrm b/debian/postrm index eda2a4d0..e1e6f9df 100644 --- a/debian/postrm +++ b/debian/postrm @@ -21,8 +21,9 @@ set -e case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - rm -fr /usr/share/applications/LunarCalendar.desktop - rm -fr /etc/ld.so.conf.d/LunarCalendar.conf + rm -f /usr/share/applications/LunarCalendar.desktop + rm -f /usr/share/pixmaps/calendar.png + rm -f /etc/ld.so.conf.d/LunarCalendar.conf ;; *) diff --git a/tag.sh b/tag.sh index 3fb93319..1e2a02d4 100755 --- a/tag.sh +++ b/tag.sh @@ -47,7 +47,7 @@ sed -i "s/^version: '.*{build}'/${APPVERYOR_VERSION}/g" ${SOURCE_DIR}/appveyor.y sed -i "s/^\ BUILD_VERSION=.*/\ BUILD_VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/App/App.pro sed -i "s/^\Standards-Version:.*/\Standards-Version:\"${VERSION}\"/g" ${SOURCE_DIR}/debian/control sed -i "s/^\ - export VERSION=.*/\ - export VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/.travis.yml -sed -i "s/rabbitcommon (.*)/rabbitcommon (${VERSION})/g" ${SOURCE_DIR}/debian/changelog +sed -i "s/lunarcalendar (.*)/lunarcalendar (${VERSION})/g" ${SOURCE_DIR}/debian/changelog sed -i "s/export VERSION=.*/export VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/ci/build.sh if [ -n "$1" ]; then