Fix RPM build

This commit is contained in:
Jonas Kvinge 2018-10-22 23:23:25 +02:00
parent ba8717f95a
commit 89a08d1d5e
3 changed files with 13 additions and 14 deletions

View File

@ -1,6 +1,7 @@
find_program(LSB_RELEASE_EXEC lsb_release)
find_program(RPMBUILD_EXEC rpmbuild)
if (LSB_RELEASE_EXEC)
if (LSB_RELEASE_EXEC AND RPMBUILD_EXEC)
execute_process(COMMAND /bin/sh "-c" "${LSB_RELEASE_EXEC} -is | tr '[:upper:]' '[:lower:]' | cut -d' ' -f1"
OUTPUT_VARIABLE DIST_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE
@ -42,8 +43,8 @@ if (LSB_RELEASE_EXEC)
add_custom_target(rpm
COMMAND ${CMAKE_SOURCE_DIR}/dist/scripts/maketarball.sh
COMMAND ${CMAKE_COMMAND} -E copy strawberry-${STRAWBERRY_VERSION_PACKAGE}.tar.xz ${RPMBUILD_DIR}/SOURCES/
COMMAND rpmbuild -bs ${CMAKE_SOURCE_DIR}/dist/opensuse/strawberry.spec
COMMAND rpmbuild -bb ${CMAKE_SOURCE_DIR}/dist/opensuse/strawberry.spec
COMMAND ${RPMBUILD_EXEC} -bs ${CMAKE_SOURCE_DIR}/dist/opensuse/strawberry.spec
COMMAND ${RPMBUILD_EXEC} -bb ${CMAKE_SOURCE_DIR}/dist/opensuse/strawberry.spec
)
elseif (${DIST_NAME} STREQUAL "fedora")
if (DIST_VERSION)

View File

@ -2,9 +2,8 @@ Name: strawberry
Version: @STRAWBERRY_VERSION_RPM_V@
Release: @STRAWBERRY_VERSION_RPM_R@.@RPM_DISTRO@
Summary: A audio player and music collection organiser
Group: Applications/Multimedia
License: GPL-3.0+
License: GPLv3+
URL: http://www.strawbs.org/
Source0: %{name}-@STRAWBERRY_VERSION_PACKAGE@.tar.xz
@ -82,7 +81,6 @@ export CXXFLAGS="%{optflags} -fpermissive"
mkdir %{_target_platform}
pushd %{_target_platform}
%{cmake} \
-DBUILD_WERROR:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING=Release \
@ -93,18 +91,15 @@ popd
%install
make install DESTDIR=%{buildroot} -C %{_target_platform}
rm -rf %{buildroot}%{_datadir}/man
rm -rf %{buildroot}%{_datadir}/metainfo
%check
desktop-file-validate %{buildroot}%{_datadir}/applications/strawberry.desktop
pushd %{_target_platform}
popd
%clean
%files
%defattr(-,root,root,-)
%doc
%doc README.md Changelog
%license COPYING
%{_bindir}/strawberry
%{_bindir}/strawberry-tagreader
%{_datadir}/applications/strawberry.desktop
@ -112,6 +107,8 @@ popd
%{_datadir}/icons/hicolor/64x64/apps/strawberry.png
%{_datadir}/icons/hicolor/128x128/apps/strawberry.png
%{_datadir}/icons/hicolor/scalable/apps/strawberry.svg
%{_mandir}/man1/strawberry.1.*
%{_mandir}/man1/strawberry-tagreader.1.*
%changelog
* @RPM_DATE@ Jonas Kvinge <jonas@strawbs.net> - @STRAWBERRY_VERSION_RPM_V@

View File

@ -2,7 +2,6 @@ Name: strawberry
Version: @STRAWBERRY_VERSION_RPM_V@
Release: @STRAWBERRY_VERSION_RPM_R@.@RPM_DISTRO@
Summary: A audio player and music collection organiser
Group: Applications/Multimedia
License: GPL-3.0+
URL: http://www.strawbs.org/
@ -89,6 +88,7 @@ make %{?_smp_mflags}
%install
cd build
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf %{buildroot}%{_datadir}/metainfo
%clean
cd build
@ -96,7 +96,8 @@ make clean
%files
%defattr(-,root,root,-)
%doc
%doc README.md Changelog
%license COPYING
%{_bindir}/strawberry
%{_bindir}/strawberry-tagreader
%{_datadir}/applications/strawberry.desktop