initial spec file that actually build

This commit is contained in:
Tru Huynh (pasteur.fr) 2018-03-09 12:45:18 +01:00
parent 97d891639b
commit d2272824df
2 changed files with 45 additions and 12 deletions

View File

@ -1,13 +1,16 @@
Name: barrier 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 Summary: Keyboard and mouse sharing solution
Group: Applications/Productivity Group: Applications/Productivity
URL: https://github.com/debauchee/barrier/ URL: https://github.com/debauchee/barrier/
Source: https://github.com/debauchee/barrier/ Source: https://github.com/debauchee/barrier/archive/v@BARRIER_VERSION@.tar.gz
Vendor: Debauchee # workaround the git versionning and set to Release instead of the default Debug
Packager: Debauchee <todo@mail.com> Source1: build_env.sh
Vendor: Debauchee ### FIXME ###
Packager: Tru Huynh <tru@pasteur.fr>
License: GPLv2 License: GPLv2
Release: @BARRIER_BUILD_NUMBER@@BARRIER_SNAPSHOT_INFO@%{?dist} Release: @BARRIER_BUILD_NUMBER@%{?dist}
# 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: 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. Work seamlessly across Windows, macOS and Linux.
%prep %prep
# TO BE DONE need a Source tarball and not git.. %setup -n %{name}-@BARRIER_VERSION@
%build %build
git clone https://github.com/debauchee/barrier/ cp %{SOURCE1} .
%if 0%{?rhel} == 6 %if 0%{?rhel} == 6
cd barrier && scl enable devtoolset-3 ./clean_build.sh scl enable devtoolset-3 ./clean_build.sh
%endif %endif
%if 0%{?rhel} == 7 %if 0%{?rhel} == 7
cd barrier && ./clean_build.sh ./clean_build.sh
%endif %endif
# maybe need a default if/else for non rhel target :P # 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 %{__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}/applications res/barrier.desktop
%{__install} -t %{buildroot}%{_datarootdir}/icons/hicolor/scalable/apps res/barrier.svg %{__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 %files
%defattr(755,root,root,-) %defattr(755,root,root,-)
%{_bindir}/barrier %{_bindir}/barrier
%{_bindir}/barrierc %{_bindir}/barrierc
%{_bindir}/barriers %{_bindir}/barriers
%{_bindir}/barrierd
%{_bindir}/syntool %{_bindir}/syntool
%attr(644,-,-) %{_datarootdir}/applications/barrier.desktop %attr(644,-,-) %{_datarootdir}/applications/barrier.desktop
%attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/barrier.svg %attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/barrier.svg
%changelog %changelog
* Sat Jan 27 2018 Debauchee <todo@mail.com> * Fri Mar 9 2018 Tru Huynh <tru@pasteur.fr> - barrier 2.0.0-1
- Initial version of the package - Initial rpm package for barrier

29
prepare_spec_file.sh Executable file
View File

@ -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