Skip to content

Commit

Permalink
Add install appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Jun 3, 2019
1 parent 776a7bb commit 99add9b
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ before_install:
- sudo Xvfb :99 -ac &
- export DISPLAY=:99.0
- mkdir ${SOURCE_DIR}/Tools
- export VERSION="0.0.4"
- export VERSION="0.0.5"

install:
- cd ${SOURCE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion App/App.pro
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ isEmpty(BUILD_VERSION) {
}
}
isEmpty(BUILD_VERSION){
BUILD_VERSION="0.0.4"
BUILD_VERSION="0.0.5"
}
message("BUILD_VERSION:$$BUILD_VERSION")
DEFINES += BUILD_VERSION=\"\\\"$$quote($$BUILD_VERSION)\\\"\"
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CONFIGURE_FILE(
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake")

SET(BUILD_VERSION "0.0.4")
SET(BUILD_VERSION "0.0.5")
# Find Git Version Patch
IF(EXISTS "${CMAKE_SOURCE_DIR}/.git")
if(NOT GIT)
Expand Down
2 changes: 1 addition & 1 deletion Install/Install.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "LunarCalendar"
!define PRODUCT_APP_NAME "LunarCalendarApp"
!define PRODUCT_VERSION "0.0.4"
!define PRODUCT_VERSION "0.0.5"
!define PRODUCT_PUBLISHER "KangLin studio"
!define PRODUCT_WEB_SITE "https://github.com/KangLin/${PRODUCT_NAME}"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_NAME}.exe"
Expand Down
27 changes: 27 additions & 0 deletions Install/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Use to install appimage in linux

case "$1" in
remove)
echo "remove ..."
rm -f /usr/share/applications/LunarCalendar.desktop
rm -f /usr/share/pixmaps/LunarCalendar.png
;;

install|*)
echo "install ..."
if [ ! -f /usr/share/applications/LunarCalendar.desktop ]; then
ln -s `pwd`/share/applications/LunarCalendar.desktop /usr/share/applications/LunarCalendar.desktop
sed -i "s/Exec=.*//g" /usr/share/applications/LunarCalendar.desktop
echo "Exec=`pwd`/Lunar_calendar-x86_64.AppImage" >> /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 `pwd`/share/pixmaps/LunarCalendar.png /usr/share/pixmaps/LunarCalendar.png
fi
;;

esac
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,34 @@ If you build app. Qt does not provide openssl dynamic library for copyright reas
### Download
https://github.com/KangLin/LunarCalendar/releases/latest

- Lunar_calendar-*-x86_64.AppImag
- LunarCalendar_0.0.5.tar.gz
The AppImage format executable can be run directly on the Linux system, see: https://appimage.org/
usage:

1. Decompress
```
mkdir LunarCalendar
cd LunarCalendar
tar xvfz LunarCalendar_0.0.5.tar.gz
```
2. install
```
install.sh install
```
3. If you want to uninstall
```
install.sh remove
```

- lunarcalendar_*_amd64.deb
- lunarcalendar_0.0.5_amd64.deb
Deb installation package for Ubuntu

- LunarCalendar-Setup-*.exe
- LunarCalendar-Setup-0.0.5.exe
Windows installation package, support for Windows xp and above

------------------------------------------------
Expand Down
30 changes: 25 additions & 5 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,33 @@ Qt因为版权原因,没有提供openssl动态库,所以必须自己复制op
### 下载
https://github.com/KangLin/LunarCalendar/releases/latest

- Lunar_calendar-*-x86_64.AppImage
- LunarCalendar_0.0.5.tar.gz
AppImage格式的执行程序,可直接运行在linux系统,详见:https://appimage.org/

- lunarcalendar_*_amd64.deb
deb 安装包,可用于 Ubuntu
用法:
1. 解压

```
mkdir LunarCalendar
cd LunarCalendar
tar xvfz LunarCalendar_0.0.5.tar.gz
```
2. 运行 install.sh install 安装

```
install.sh install
```
3. 如果要卸载,运行 install.sh remove

```
install.sh remove
```
- lunarcalendar_0.0.5_amd64.deb
deb 安装包,可用于 Ubuntu

- LunarCalendar-Setup-*.exe
- LunarCalendar-Setup-0.0.5.exe
Windows安装包,支持 Windows xp 以上系统

------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#TODO: Change version
version: '0.0.4.{build}'
version: '0.0..{build}'

environment:
matrix:
Expand Down
39 changes: 21 additions & 18 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,32 +84,35 @@ if [ "${BUILD_TARGERT}" = "unix" ]; then
sudo dpkg -i ../lunarcalendar*_amd64.deb
$SOURCE_DIR/test/test_linux.sh

cd debian/lunarcalendar/opt/LunarCalendar

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.5"
./linuxdeployqt-continuous-x86_64.AppImage share/applications/*.desktop \
-qmake=${QT_ROOT}/bin/qmake -appimage

cp $SOURCE_DIR/Install/install.sh .
ln -s Lunar_calendar-${VERSION}-x86_64.AppImage Lunar_calendar-x86_64.AppImage
tar -czf LunarCalendar_${VERSION}.tar.gz \
Lunar_calendar-x86_64.AppImage \
Lunar_calendar-${VERSION}-x86_64.AppImage \
Lunar_calendar-x86_64.AppImage \
install.sh share

if [ "$TRAVIS_TAG" != "" -a "${QT_VERSION_DIR}" = "512" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/debian/lunarcalendar/opt/LunarCalendar/bin
MD5=`md5sum ../lunarcalendar*_amd64.deb|awk '{print $1}'`
MD5=`md5sum $SOURCE_DIR/../lunarcalendar*_amd64.deb|awk '{print $1}'`
echo "MD5:${MD5}"
./debian/lunarcalendar/opt/LunarCalendar/bin/LunarCalendarApp \
./bin/LunarCalendarApp \
-f "`pwd`/update_linux.xml" \
--md5 ${MD5}
export UPLOADTOOL_BODY="Release LunarCalendar-${VERSION}"
#export UPLOADTOOL_PR_BODY=
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash upload.sh ../lunarcalendar*_amd64.deb update_linux.xml
fi
bash upload.sh $SOURCE_DIR/../lunarcalendar*_amd64.deb update_linux.xml

if [ "$TRAVIS_TAG" != "" -a "${QT_VERSION_DIR}" = "512" ]; then
cd debian/lunarcalendar/opt/LunarCalendar

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"
./linuxdeployqt-continuous-x86_64.AppImage share/applications/*.desktop \
-qmake=${QT_ROOT}/bin/qmake -appimage

wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh

bash upload.sh Lunar*.AppImage
bash upload.sh LunarCalendar_${VERSION}.tar.gz
fi
exit 0
fi
Expand Down
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lunarcalendar (0.0.4) stable; urgency=medium
lunarcalendar (0.0.5) stable; urgency=medium

* Initial Release.

Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Section: main
Priority: optional
Maintainer: Kang Lin <[email protected]>
Build-Depends: debhelper (>= 6)
Standards-Version:"0.0.4"
Standards-Version:"0.0.5"
Homepage: https://github.com/KangLin/LunarCalendar
Vcs-Git: https://github.com/KangLin/LunarCalendar.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/lunarcalendar.git
Expand Down
2 changes: 1 addition & 1 deletion debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case "$1" in
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
echo "/opt/qt59/lib" >> /etc/ld.so.conf.d/LunarCalendar.conf
ldconfig
;;

Expand Down
6 changes: 4 additions & 2 deletions tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ EOF

sed -i "s/^\SET(BUILD_VERSION.*/\SET(BUILD_VERSION \"${VERSION}\")/g" ${SOURCE_DIR}/CMakeLists.txt
sed -i "s/^\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"${VERSION}\"/g" ${SOURCE_DIR}/Install/Install.nsi
APPVERYOR_VERSION="version: '${VERSION}.{build}'"
sed -i "s/^version: '.*{build}'/${APPVERYOR_VERSION}/g" ${SOURCE_DIR}/appveyor.yml
sed -i "s/^version: '.*{build}'/version: '${VERSION}.{build}'/g" ${SOURCE_DIR}/appveyor.yml
sed -i "s/^\ - export VERSION=.*/\ - export VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/.travis.yml
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/lunarcalendar (.*)/lunarcalendar (${VERSION})/g" ${SOURCE_DIR}/debian/changelog
sed -i "s/export VERSION=.*/export VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/ci/build.sh
sed -i "s/LunarCalendar_.*tar.gz/LunarCalendar_${VERSION}.tar.gz/g" ${SOURCE_DIR}/README*.md
sed -i "s/lunarcalendar_.*_amd64.deb/lunarcalendar_${VERSION}_amd64.deb/g" ${SOURCE_DIR}/README*.md
sed -i "s/LunarCalendar-Setup-.*exe/LunarCalendar-Setup-${VERSION}.exe/g" ${SOURCE_DIR}/README*.md

if [ -n "$1" ]; then
git add .
Expand Down
4 changes: 2 additions & 2 deletions test/test_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ -n "$1" ]; then
PROJECT_NAME=$1
fi

if [ ! -f /opt/share/applications/${PROJECT_NAME}.desktop ]; then
if [ ! -f /opt/${PROJECT_NAME}/share/applications/${PROJECT_NAME}.desktop ]; then
echo "There are not /opt/share/applications/${PROJECT_NAME}.desktop"
EXIT_CODE=$[EXIT_CODE+1]
fi
Expand All @@ -18,7 +18,7 @@ if [ ! -f /usr/share/applications/${PROJECT_NAME}.desktop ]; then
EXIT_CODE=$[EXIT_CODE+1]
fi

if [ ! -f /opt/share/pixmaps/${PROJECT_NAME}.png ]; then
if [ ! -f /opt/${PROJECT_NAME}/share/pixmaps/${PROJECT_NAME}.png ]; then
echo "There are not /opt/share/pixmaps/${PROJECT_NAME}.png"
EXIT_CODE=$[EXIT_CODE+1]
fi
Expand Down

0 comments on commit 99add9b

Please sign in to comment.