From cfe8924b48f4059ea2bca1a9ecd19b3479874669 Mon Sep 17 00:00:00 2001 From: "Tru Huynh (pasteur.fr)" Date: Mon, 19 Mar 2018 22:17:22 +0100 Subject: [PATCH] cmake nows builds tarball that can be used to rpmbuild --- barrier.spec | 19 ++++++++++++++----- build_rpm.sh | 5 ++--- cmake/Package.cmake | 2 +- dist/rpm/barrier.spec.in | 12 +++++++++--- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/barrier.spec b/barrier.spec index 55db5f16..b3c438f1 100644 --- a/barrier.spec +++ b/barrier.spec @@ -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 diff --git a/build_rpm.sh b/build_rpm.sh index c58549af..d754e970 100755 --- a/build_rpm.sh +++ b/build_rpm.sh @@ -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 ) + diff --git a/cmake/Package.cmake b/cmake/Package.cmake index da65de71..5aedadfe 100644 --- a/cmake/Package.cmake +++ b/cmake/Package.cmake @@ -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() diff --git a/dist/rpm/barrier.spec.in b/dist/rpm/barrier.spec.in index 2b358692..d170023f 100644 --- a/dist/rpm/barrier.spec.in +++ b/dist/rpm/barrier.spec.in @@ -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