From a4f8c83213a4051c80a72e166aa380d997018109 Mon Sep 17 00:00:00 2001 From: Gurkengewuerz Date: Mon, 13 May 2019 20:38:41 +0200 Subject: [PATCH] added makedeb to linux ci --- .circleci/config.yml | 17 ++++++++++++++- packages/deb/DEBIAN/control | 2 +- packages/makedeb.sh | 42 +++++++++++++++++++++++-------------- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83bed3a..98e8239 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,5 +53,20 @@ jobs: cd build && pwd && ls; qmake ..; make -j2; + cd ..; + - run: + name: Create Artifact Path + command: mkdir /kshare + - run: + name: Store Build + command: cp build/src/kshare /kshare/ + - run: + name: Build Debian Package + command: | + cd packages/; + pwd; + ls -lah; + /root/project/packages/makedebian.sh ci; + cp *.deb /kshare/ - store_artifacts: - path: /root/project/build/src/kshare + path: /kshare/ \ No newline at end of file diff --git a/packages/deb/DEBIAN/control b/packages/deb/DEBIAN/control index b5ff103..a0a6f3c 100644 --- a/packages/deb/DEBIAN/control +++ b/packages/deb/DEBIAN/control @@ -4,6 +4,6 @@ Architecture: all Essential: no Section: contrib Priority: optional -Depends: libqt5gui5 (>=5.7.0), libqt5svg5 (>=5.7.0), libqt5x11extras5 (>=5.7.0), libavcodec57 (>=3.2.0), libavformat57 (>=3.2.0), libswscale4 (>=3.2.0), libavutil55 (>=3.2.0), libxcb-cursor0 (>=0.1.0), libxcb1 (>=1.11.0), libxcb-xfixes0 (>=1.11.0), libxcb-util0 (>=0.3.8)|libxcb-util1 (>=0.3.8), libxcb-xfixes0 (>=1.11.0) +Depends: libqt5gui5 (>=5.7.0), libqt5svg5 (>=5.7.0), libqt5x11extras5 (>=5.7.0), libqt5multimedia5 (>=5.7.0), libqt5multimedia5-plugins (>=5.7.0), libnotify-bin (>=0.7), libavcodec57 (>=3.2.0), libavformat57 (>=3.2.0), libswscale4 (>=3.2.0), libavutil55 (>=3.2.0), libxcb-cursor0 (>=0.1.0), libxcb1 (>=1.11.0), libxcb-xfixes0 (>=1.11.0), libxcb-util0 (>=0.3.8)|libxcb-util1 (>=0.3.8), libxcb-xfixes0 (>=1.11.0) Maintainer: ArsenArsen Description: The free open source and cross platform screen sharing software diff --git a/packages/makedeb.sh b/packages/makedeb.sh index 63c0d85..d47ff1f 100755 --- a/packages/makedeb.sh +++ b/packages/makedeb.sh @@ -1,26 +1,36 @@ #!/usr/bin/env bash +VERSION=$(grep setApplicationVersion ../src/main.cpp | head -n1 | cut -d \" -f2) +echo "Make Debian package for v$VERSION" >&2 + +cp deb work -r +sed "s/%ver/$VERSION/g" deb/DEBIAN/control > work/DEBIAN/control +mkdir -p work/usr/bin + if [[ "$1" == "" ]] then - echo "Provide a version with arg1" >&2 - exit 1 -fi -cp deb work -r -sed "s/%ver/$1/g" deb/DEBIAN/control > work/DEBIAN/control -mkdir -p work/usr/bin -mkdir compiling -cd compiling -qmake ../../KShare.pro -if make -then -cd .. -cp compiling/src/kshare work/usr/bin/kshare + echo "Fresh Compile Binary" >&2 + mkdir compiling + cd compiling + qmake ../../KShare.pro + if make + then + cd .. + cp compiling/src/kshare work/usr/bin/kshare + else + rm -rf compiling + echo "Failed to make!" + exit 2 + fi else - rm -rf compiling - echo "Failed to make!" - exit 2 + echo "Using pre-compiled binary (please only use in circleci)" >&2 + pwd + + cp ../build/src/kshare work/usr/bin/kshare fi + cd work md5sum usr/bin/kshare usr/share/applications/KShare.desktop > DEBIAN/md5sums cd .. dpkg-deb -b work/ +mv work.deb kshare_v${VERSION}.deb rm -rf work