cmake nows builds tarball that can be used to rpmbuild

This commit is contained in:
Tru Huynh (pasteur.fr) 2018-03-19 22:17:22 +01:00
parent 8800c0654a
commit cfe8924b48
4 changed files with 26 additions and 12 deletions

View File

@ -4,7 +4,8 @@ Version: 2.0.0
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
Source: barrier-2.0.0-Source.tar.gz
#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 ###
@ -31,10 +32,17 @@ 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
%setup -n %{name}-2.0.0-Source
#%setup -n %{name}-2.0.0-RC2
%build
cp dist/rpm/build_env.sh .
echo "export B_BUILD_TYPE=Release" > build_env.sh
echo "export BARRIER_VERSION_MAJOR=2" >> build_env.sh
echo "export BARRIER_VERSION_MINOR=0" >> build_env.sh
echo "export BARRIER_VERSION_PATCH=0" >> build_env.sh
echo "export BARRIER_REVISION=12345678" >> build_env.sh
echo 'export B_CMAKE_FLAGS=" -D BARRIER_VERSION_MAJOR=${BARRIER_VERSION_MAJOR} -D BARRIER_VERSION_MINOR=${BARRIER_VERSION_MINOR} -D BARRIER_VERSION_PATCH=${BARRIER_VERSION_PATCH} -D BARRIER_VERSION_STAGE=${BARRIER_VERSION_STAGE} -D BARRIER_REVISION=${BARRIER_REVISION}"' >> build_env.sh
%if 0%{?rhel} == 6
scl enable devtoolset-3 ./clean_build.sh
@ -50,14 +58,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

View File

@ -24,6 +24,5 @@ rm -rf build
cd build || exit 1
echo Starting Barrier $B_BUILD_TYPE build...
$B_CMAKE $B_CMAKE_FLAGS .. || exit 1
[ -f rpm/barrier.spec ] && [ -f rpm/build_installer.sh ] ) && \
build/rpm/build_installer.sh &&
rpmbuild -ta ../Barrier*.tar.gz
[ -f rpm/barrier.spec ] && cp rpm/barrier.spec .. && make package_source && rpmbuild -ta barrier-*-Source.tar.gz )

View File

@ -3,7 +3,7 @@ if (UNIX)
set (CPACK_PACKAGE_VERSION_MINOR ${BARRIER_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${BARRIER_VERSION_PATCH})
set (CPACK_GENERATOR "TBZ2")
set (CPACK_SOURCE_GENERATOR "TXZ")
set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_SOURCE_IGNORE_FILES "/build/;\.gitignore$;/\.git/;/.github/;\.swp$;build_env\.*")
include (CPack)
endif()

View File

@ -4,7 +4,7 @@ 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: Barrier-@BARRIER_VERSION@.tar.gz
Source: barrier-@BARRIER_VERSION_MAJOR@.@BARRIER_VERSION_MINOR@.@BARRIER_VERSION_PATCH@-Source.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
@ -32,11 +32,17 @@ Barrier allows you to share one mouse and keyboard between multiple computers.
Work seamlessly across Windows, macOS and Linux.
%prep
%setup -n %{name}
%setup -n %{name}-@BARRIER_VERSION_MAJOR@.@BARRIER_VERSION_MINOR@.@BARRIER_VERSION_PATCH@-Source
#%setup -n %{name}-@BARRIER_VERSION@
%build
cp dist/rpm/build_env.sh .
echo "export B_BUILD_TYPE=Release" > build_env.sh
echo "export BARRIER_VERSION_MAJOR=@BARRIER_VERSION_MAJOR@" >> build_env.sh
echo "export BARRIER_VERSION_MINOR=@BARRIER_VERSION_MINOR@" >> build_env.sh
echo "export BARRIER_VERSION_PATCH=@BARRIER_VERSION_PATCH@" >> build_env.sh
echo "export BARRIER_REVISION=12345678" >> build_env.sh
echo 'export B_CMAKE_FLAGS=" -D BARRIER_VERSION_MAJOR=${BARRIER_VERSION_MAJOR} -D BARRIER_VERSION_MINOR=${BARRIER_VERSION_MINOR} -D BARRIER_VERSION_PATCH=${BARRIER_VERSION_PATCH} -D BARRIER_VERSION_STAGE=${BARRIER_VERSION_STAGE} -D BARRIER_REVISION=${BARRIER_REVISION}"' >> build_env.sh
%if 0%{?rhel} == 6
scl enable devtoolset-3 ./clean_build.sh