From 2a2feb290f7cefef5f2412120d2ea7a77d965869 Mon Sep 17 00:00:00 2001 From: "Tru Huynh (pasteur.fr)" Date: Fri, 9 Mar 2018 12:53:03 +0100 Subject: [PATCH] barrier.spec in place: rpmbuild -ta should work --- barrier.spec | 67 ++++++++++++++++++++++++++ docker/CentOS-7-git-builder/Dockerfile | 11 +++++ 2 files changed, 78 insertions(+) create mode 100644 barrier.spec create mode 100644 docker/CentOS-7-git-builder/Dockerfile diff --git a/barrier.spec b/barrier.spec new file mode 100644 index 00000000..ffdab907 --- /dev/null +++ b/barrier.spec @@ -0,0 +1,67 @@ +Name: barrier +Version: 2.0.0 +#Version: 2.0.0-RC2 ###FIXME can't have a dash - in the version string +Summary: Keyboard and mouse sharing solution +Group: Applications/Productivity +URL: https://github.com/debauchee/barrier/ +Source: https://github.com/debauchee/barrier/archive/v2.0.0-RC2.tar.gz +# workaround the git versionning and set to Release instead of the default Debug +Source1: build_env.sh +Vendor: Debauchee ### FIXME ### +Packager: Tru Huynh +License: GPLv2 +Release: 1%{?dist} + +# 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 + +# CXX14 +%if 0%{?rhel} == 6 +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 +%setup -n %{name}-2.0.0-RC2 + +%build +cp %{SOURCE1} . + +%if 0%{?rhel} == 6 +scl enable devtoolset-3 ./clean_build.sh +%endif + +%if 0%{?rhel} == 7 +./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} build/bin/{barrier,barrierc,barriers,barrierd,syntool} + +%files +%defattr(755,root,root,-) +%{_bindir}/barrier +%{_bindir}/barrierc +%{_bindir}/barriers +%{_bindir}/barrierd +%{_bindir}/syntool +%attr(644,-,-) %{_datarootdir}/applications/barrier.desktop +%attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/barrier.svg + +%changelog +* Fri Mar 9 2018 Tru Huynh - barrier 2.0.0-1 +- Initial rpm package for barrier diff --git a/docker/CentOS-7-git-builder/Dockerfile b/docker/CentOS-7-git-builder/Dockerfile new file mode 100644 index 00000000..f916030d --- /dev/null +++ b/docker/CentOS-7-git-builder/Dockerfile @@ -0,0 +1,11 @@ +FROM centos:centos7 + +RUN yum -y update && yum -y upgrade +RUN yum -y install epel-release +RUN yum -y install git cmake3 make qt5-qtbase-devel gcc \ + avahi-compat-libdns_sd-devel gcc-c++ curl-devel \ + openssl-devel \ + libXtst-devel libXinerama-devel libICE-devel libXrandr-devel + +RUN git clone https://github.com/debauchee/barrier/ +RUN cd barrier && ./clean_build.sh | tee clean_build.log && tar czvf build.tgz build clean_build.log