From 85819ab959db2d2c550f186bb8f0d2ff2f5408c6 Mon Sep 17 00:00:00 2001 From: Tru Huynh Date: Wed, 14 Mar 2018 21:03:53 +0100 Subject: [PATCH] initial version for build_installer for rpm --- dist/rpm/barrier.spec.in | 11 ++++--- dist/rpm/build_installer.sh.in | 55 ++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 4 deletions(-) create mode 100755 dist/rpm/build_installer.sh.in diff --git a/dist/rpm/barrier.spec.in b/dist/rpm/barrier.spec.in index b47c3fa2..2b358692 100644 --- a/dist/rpm/barrier.spec.in +++ b/dist/rpm/barrier.spec.in @@ -4,7 +4,8 @@ Version: @BARRIER_VERSION_MAJOR@.@BARRIER_VERSION_MINOR@.@BARRIER_VERSION_PATCH@ Summary: Keyboard and mouse sharing solution Group: Applications/Productivity URL: https://github.com/debauchee/barrier/ -Source: https://github.com/debauchee/barrier/archive/v@BARRIER_VERSION@.tar.gz +Source: Barrier-@BARRIER_VERSION@.tar.gz +#Source: https://github.com/debauchee/barrier/archive/v@BARRIER_VERSION@.tar.gz # workaround the git versionning and set to Release instead of the default Debug #Source1: build_env.sh Vendor: Debauchee ### FIXME ### @@ -31,7 +32,8 @@ Barrier allows you to share one mouse and keyboard between multiple computers. Work seamlessly across Windows, macOS and Linux. %prep -%setup -n %{name}-@BARRIER_VERSION@ +%setup -n %{name} +#%setup -n %{name}-@BARRIER_VERSION@ %build cp dist/rpm/build_env.sh . @@ -50,14 +52,15 @@ scl enable devtoolset-3 ./clean_build.sh %{__mkdir} -p %{buildroot}%{_bindir} %{buildroot}%{_datarootdir}/applications %{buildroot}%{_datarootdir}/icons/hicolor/scalable/apps %{__install} -t %{buildroot}%{_datarootdir}/applications res/barrier.desktop %{__install} -t %{buildroot}%{_datarootdir}/icons/hicolor/scalable/apps res/barrier.svg -%{__install} -t %{buildroot}%{_bindir} build/bin/{barrier,barrierc,barriers,barrierd,syntool} +%{__install} -t %{buildroot}%{_bindir} build/bin/{barrier,barrierc,barriers,syntool} +#%{__install} -t %{buildroot}%{_bindir} build/bin/{barrier,barrierc,barriers,barrierd,syntool} %files %defattr(755,root,root,-) %{_bindir}/barrier %{_bindir}/barrierc %{_bindir}/barriers -%{_bindir}/barrierd +#%{_bindir}/barrierd %{_bindir}/syntool %attr(644,-,-) %{_datarootdir}/applications/barrier.desktop %attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/barrier.svg diff --git a/dist/rpm/build_installer.sh.in b/dist/rpm/build_installer.sh.in new file mode 100755 index 00000000..3e8914b7 --- /dev/null +++ b/dist/rpm/build_installer.sh.in @@ -0,0 +1,55 @@ +#!/bin/sh + +# change this to rename the installer package +B_TARGZ="Barrier-@BARRIER_VERSION@.tar.gz" + +# sanity check so we don't distribute packages full of debug symbols +if [ "@CMAKE_BUILD_TYPE@" != "Release" ]; then + echo Will only build installers for Release builds + exit 1 +fi + +cd @CMAKE_CURRENT_SOURCE_DIR@/build/rpm || exit 1 + +B_SPECFILE=@CMAKE_CURRENT_SOURCE_DIR@/barrier.spec +if [ ! -f $B_SPECFILE ]; then + echo Missing spec file: $B_SPECFILE + exit 1 +fi + +# remove any old copies so there's no confusion about whether this +# process completes successfully or not +[ -f $B_TARGZ ] && rm -f $B_TARGZ + +cp build_env.sh $B_SPECFILE @CMAKE_CURRENT_SOURCE_DIR@ && +(cd @CMAKE_CURRENT_SOURCE_DIR@/.. && tar -czvf @CMAKE_CURRENT_SOURCE_DIR@/../$B_TARGZ \ +barrier/barrier.spec \ +barrier/Build.properties \ +barrier/CMakeLists.txt \ +barrier/ChangeLog \ +barrier/LICENSE \ +barrier/README.md \ +barrier/build_env.sh \ +barrier/build_installer.bat \ +barrier/clean_build.bat \ +barrier/clean_build.sh \ +barrier/cmake \ +barrier/debian \ +barrier/dist \ +barrier/doc \ +barrier/ext \ +barrier/osx_environment.sh \ +barrier/res \ +barrier/src \ + + +) + +# copy all executables +#cp @CMAKE_RUNTIME_OUTPUT_DIRECTORY@/* . || exit 1 + +# copy the qt platform plugin +# TODO: this is hacky and will probably break if there is more than one qt +# version installed. need a better way to find this library + +echo "Installer created successfully"