From 49d2835f89c99b8177b1aff24a7cb978bd520f9e Mon Sep 17 00:00:00 2001 From: Tru Huynh Date: Fri, 23 Feb 2018 20:37:00 +0100 Subject: [PATCH 1/3] adding some buildrequires for Centos-{6,7} --- dist/rpm/barrier.spec.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dist/rpm/barrier.spec.in b/dist/rpm/barrier.spec.in index b175ded8..7e4f778f 100644 --- a/dist/rpm/barrier.spec.in +++ b/dist/rpm/barrier.spec.in @@ -9,6 +9,20 @@ Packager: Debauchee License: GPLv2 Release: @BARRIER_BUILD_NUMBER@@BARRIER_SNAPSHOT_INFO@%{?dist} +# bonjour headers: dns_sd.h at least for CentOS-7 and CentOS-6 +BuildRequires: avahi-compat-libdns_sd-devel + +# possible issue here for cmake: on CentOS-7, cmake is cmake 2.x and barrier needs cmake 3.x +# which is available from EPEL as cmake3, that might not be the case for other RPMS based distro +%if 0%{?rhel} == 7 +BuildRequires: cmake3 +%endif + +# EPEL also provide cmake3 for CentOS-6, but I have tried to build barrier on CentOS-6 yet +%if 0%{?rhel} == 6 +BuildRequires: cmake3 +%endif + %description Barrier allows you to share one mouse and keyboard between multiple computers. Work seamlessly across Windows, macOS and Linux. From 31554e0d0eda621d6d1ef5a42fafbce9dd31fc7b Mon Sep 17 00:00:00 2001 From: Tru Huynh Date: Fri, 23 Feb 2018 22:39:18 +0100 Subject: [PATCH 2/3] Update barrier.spec.in --- dist/rpm/barrier.spec.in | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/dist/rpm/barrier.spec.in b/dist/rpm/barrier.spec.in index 7e4f778f..6f629602 100644 --- a/dist/rpm/barrier.spec.in +++ b/dist/rpm/barrier.spec.in @@ -9,24 +9,46 @@ Packager: Debauchee License: GPLv2 Release: @BARRIER_BUILD_NUMBER@@BARRIER_SNAPSHOT_INFO@%{?dist} -# bonjour headers: dns_sd.h at least for CentOS-7 and CentOS-6 +# at least for CentOS-7 and CentOS-6 +BuildRequires: git cmake3 make gcc gcc-c++ curl-devel openssl-devel +BuildRequires: qt5-qtbase-devel BuildRequires: avahi-compat-libdns_sd-devel +BuildREquires: libXtst-devel libXinerama-devel libICE-devel libXrandr-devel # possible issue here for cmake: on CentOS-7, cmake is cmake 2.x and barrier needs cmake 3.x # which is available from EPEL as cmake3, that might not be the case for other RPMS based distro -%if 0%{?rhel} == 7 -BuildRequires: cmake3 -%endif -# EPEL also provide cmake3 for CentOS-6, but I have tried to build barrier on CentOS-6 yet +# CXX14 %if 0%{?rhel} == 6 -BuildRequires: cmake3 +BuildRequires: centos-release-scl-rh devtoolset-3-gcc-c++.x86_64 %endif %description Barrier allows you to share one mouse and keyboard between multiple computers. Work seamlessly across Windows, macOS and Linux. +%prep +# TO BE DONE need a Source tarball and not git.. + +%build +git clone https://github.com/debauchee/barrier/ + +%if 0%{?rhel} == 6 +cd barrier && scl enable devtoolset-3 ./clean_build.sh +%endif + +%if 0%{?rhel} == 7 +cd barrier && ./clean_build.sh +%endif +# maybe need a default if/else for non rhel target :P + +%install +# no make install, so manual install +%{__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} barrier/build/bin/{barrier,barrierc,barriers,barrierd,syntool} + %files %defattr(755,root,root,-) %{_bindir}/barrier From f7e72b4278c9277261b600ece2037c5973da4fd6 Mon Sep 17 00:00:00 2001 From: Tru Huynh Date: Fri, 23 Feb 2018 22:43:34 +0100 Subject: [PATCH 3/3] replace which centos:centos7 docker minimal image does not provide which (although centos:centos6 minimal image does) --- clean_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clean_build.sh b/clean_build.sh index 290d570e..b58f7ef2 100755 --- a/clean_build.sh +++ b/clean_build.sh @@ -5,7 +5,7 @@ mkdir build || exit 1 cd build || exit 1 # some environments have cmake v2 as 'cmake' and v3 as 'cmake3' # check for cmake3 first then fallback to just cmake -B_CMAKE=`which cmake3 2>/dev/null` +`type cmake3 >> /dev/null` && B_CMAKE=`type cmake3 | cut -d ' ' -f 3` [ $? -ne 0 -o "x$B_CMAKE" = "x" ] && B_CMAKE=cmake # default build configuration B_BUILD_TYPE=${B_BUILD_TYPE:-Debug}