diff --git a/dist/rpm/barrier.spec.in b/dist/rpm/barrier.spec.in index 6f629602..79a288ae 100644 --- a/dist/rpm/barrier.spec.in +++ b/dist/rpm/barrier.spec.in @@ -1,13 +1,16 @@ Name: barrier -Version: @BARRIER_VERSION@ +Version: @BARRIER_VERSION_MAJOR@.@BARRIER_VERSION_MINOR@.@BARRIER_VERSION_PATCH@ +#Version: @BARRIER_VERSION@ ###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/ -Vendor: Debauchee -Packager: Debauchee +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 ### +Packager: Tru Huynh License: GPLv2 -Release: @BARRIER_BUILD_NUMBER@@BARRIER_SNAPSHOT_INFO@%{?dist} +Release: @BARRIER_BUILD_NUMBER@%{?dist} # at least for CentOS-7 and CentOS-6 BuildRequires: git cmake3 make gcc gcc-c++ curl-devel openssl-devel @@ -28,17 +31,17 @@ 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.. +%setup -n %{name}-@BARRIER_VERSION@ %build -git clone https://github.com/debauchee/barrier/ +cp %{SOURCE1} . %if 0%{?rhel} == 6 -cd barrier && scl enable devtoolset-3 ./clean_build.sh +scl enable devtoolset-3 ./clean_build.sh %endif %if 0%{?rhel} == 7 -cd barrier && ./clean_build.sh +./clean_build.sh %endif # maybe need a default if/else for non rhel target :P @@ -47,17 +50,18 @@ cd barrier && ./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} barrier/build/bin/{barrier,barrierc,barriers,barrierd,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}/syntool %attr(644,-,-) %{_datarootdir}/applications/barrier.desktop %attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/barrier.svg %changelog -* Sat Jan 27 2018 Debauchee -- Initial version of the package +* Fri Mar 9 2018 Tru Huynh - barrier 2.0.0-1 +- Initial rpm package for barrier diff --git a/prepare_spec_file.sh b/prepare_spec_file.sh new file mode 100755 index 00000000..f1937b9c --- /dev/null +++ b/prepare_spec_file.sh @@ -0,0 +1,29 @@ +#!/bin/sh +cd "$(dirname $0)" || exit 1 +# some environments have cmake v2 as 'cmake' and v3 as 'cmake3' +# check for cmake3 first then fallback to just cmake +B_CMAKE=`type cmake3 2>/dev/null` +if [ $? -eq 0 ]; then + B_CMAKE=`echo $B_CMAKE | cut -d' ' -f3` +else + B_CMAKE=cmake +fi +# default build configuration +B_BUILD_TYPE=${B_BUILD_TYPE:-Debug} +if [ "$(uname)" = "Darwin" ]; then + # OSX needs a lot of extra help, poor thing + # run the osx_environment.sh script to fix paths + . ./osx_environment.sh + B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS" +fi +# allow local customizations to build environment +[ -r ./build_env.sh ] && . ./build_env.sh +B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$B_BUILD_TYPE $B_CMAKE_FLAGS" +rm -rf build +mkdir build || exit 1 +cd build || exit 1 +echo Starting Barrier $B_BUILD_TYPE build... +$B_CMAKE $B_CMAKE_FLAGS .. || exit 1 +[ -f rpm/barrier.spec ] && cp rpm/barrier.spec .. && \ +echo "spec file written successfully" +# now one needs to make a tardist with the spec file at the top level