initial version for build_installer for rpm

This commit is contained in:
Tru Huynh 2018-03-14 21:03:53 +01:00
parent 8e65de070f
commit 85819ab959
2 changed files with 62 additions and 4 deletions

View File

@ -4,7 +4,8 @@ Version: @BARRIER_VERSION_MAJOR@.@BARRIER_VERSION_MINOR@.@BARRIER_VERSION_PATCH@
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/archive/v@BARRIER_VERSION@.tar.gz Source: Barrier-@BARRIER_VERSION@.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 # workaround the git versionning and set to Release instead of the default Debug
#Source1: build_env.sh #Source1: build_env.sh
Vendor: Debauchee ### FIXME ### Vendor: Debauchee ### FIXME ###
@ -31,7 +32,8 @@ 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
%setup -n %{name}-@BARRIER_VERSION@ %setup -n %{name}
#%setup -n %{name}-@BARRIER_VERSION@
%build %build
cp dist/rpm/build_env.sh . cp dist/rpm/build_env.sh .
@ -50,14 +52,15 @@ scl enable devtoolset-3 ./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} 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 %files
%defattr(755,root,root,-) %defattr(755,root,root,-)
%{_bindir}/barrier %{_bindir}/barrier
%{_bindir}/barrierc %{_bindir}/barrierc
%{_bindir}/barriers %{_bindir}/barriers
%{_bindir}/barrierd #%{_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

55
dist/rpm/build_installer.sh.in vendored Executable file
View File

@ -0,0 +1,55 @@
#!/bin/sh
# change this to rename the installer package
B_TARGZ="Barrier-@BARRIER_VERSION@.tar.gz"
# sanity check so we don't distribute packages full of debug symbols
if [ "@CMAKE_BUILD_TYPE@" != "Release" ]; then
echo Will only build installers for Release builds
exit 1
fi
cd @CMAKE_CURRENT_SOURCE_DIR@/build/rpm || exit 1
B_SPECFILE=@CMAKE_CURRENT_SOURCE_DIR@/barrier.spec
if [ ! -f $B_SPECFILE ]; then
echo Missing spec file: $B_SPECFILE
exit 1
fi
# remove any old copies so there's no confusion about whether this
# process completes successfully or not
[ -f $B_TARGZ ] && rm -f $B_TARGZ
cp build_env.sh $B_SPECFILE @CMAKE_CURRENT_SOURCE_DIR@ &&
(cd @CMAKE_CURRENT_SOURCE_DIR@/.. && tar -czvf @CMAKE_CURRENT_SOURCE_DIR@/../$B_TARGZ \
barrier/barrier.spec \
barrier/Build.properties \
barrier/CMakeLists.txt \
barrier/ChangeLog \
barrier/LICENSE \
barrier/README.md \
barrier/build_env.sh \
barrier/build_installer.bat \
barrier/clean_build.bat \
barrier/clean_build.sh \
barrier/cmake \
barrier/debian \
barrier/dist \
barrier/doc \
barrier/ext \
barrier/osx_environment.sh \
barrier/res \
barrier/src \
)
# copy all executables
#cp @CMAKE_RUNTIME_OUTPUT_DIRECTORY@/* . || exit 1
# copy the qt platform plugin
# TODO: this is hacky and will probably break if there is more than one qt
# version installed. need a better way to find this library
echo "Installer created successfully"