Commit 54b5931b authored by Victor Yacovlev's avatar Victor Yacovlev

Small fixed related to RPM generation

parent 32691def
...@@ -305,9 +305,9 @@ function(kumir2_add_launcher) ...@@ -305,9 +305,9 @@ function(kumir2_add_launcher)
set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${KUMIR2_EXEC_DIR}") set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${KUMIR2_EXEC_DIR}")
set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${KUMIR2_EXEC_DIR}") set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${KUMIR2_EXEC_DIR}")
install(TARGETS ${PARSED_ARGS_NAME} DESTINATION ${KUMIR2_EXEC_DIR}) install(TARGETS ${PARSED_ARGS_NAME} DESTINATION ${KUMIR2_EXEC_DIR})
if(KUMIR2_XDG_APPLICATION_DIR AND EXISTS "${CMAKE_SOURCE_DIR}/${PARSED_ARGS_NAME}.desktop") if(KUMIR2_XDG_APPLICATIONS_DIR AND EXISTS "${CMAKE_SOURCE_DIR}/${PARSED_ARGS_NAME}.desktop")
file(COPY "${CMAKE_SOURCE_DIR}/${PARSED_ARGS_NAME}.desktop" DESTINATION "${CMAKE_BINARY_DIR}/${KUMIR2_XDG_APPLICATION_DIR}") file(COPY "${CMAKE_SOURCE_DIR}/${PARSED_ARGS_NAME}.desktop" DESTINATION "${CMAKE_BINARY_DIR}/${KUMIR2_XDG_APPLICATION_DIR}")
install(FILES "${CMAKE_BINARY_DIR}/${KUMIR2_XDG_APPLICATION_DIR}/${PARSED_ARGS_NAME}.desktop" DESTINATION ${KUMIR2_XDG_APPLICATION_DIR}) install(FILES "${CMAKE_BINARY_DIR}/${KUMIR2_XDG_APPLICATION_DIR}/${PARSED_ARGS_NAME}.desktop" DESTINATION ${KUMIR2_XDG_APPLICATIONS_DIR})
endif() endif()
endfunction(kumir2_add_launcher) endfunction(kumir2_add_launcher)
......
{ {
"unstablePackageSuffix": "-unstable", "unstablePackageSuffix": "-unstable",
"installPrefix": "%_prefix", "installPrefix": "%_prefix",
"cmakeCommand": "cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$rpmBuildRoot/%_prefix", "cmakeCommand": "%cmake",
"makeCommand": "make -j", "makeCommand": "%make_jobs",
"makeInstallCommand": "make install", "makeInstallCommand": "%cmake_install",
"rpmBuildRoot": "$RPM_BUILD_ROOT", "rpmBuildRoot": "$RPM_BUILD_ROOT",
"binDir": "%_bindir", "binDir": "%_bindir",
"libDir": "%_libdir", "libDir": "%_libdir",
"dataDir": "%_datadir", "dataDir": "%_datadir",
"includesDir": "%_incdir", "includesDir": "%_includedir",
"defAttr": "%defattr(-,root,root)", "defAttr": "%defattr(-,root,root)",
"dirsOwnership": true, "dirsOwnership": true,
"useBundledBoost": false, "useBundledBoost": false,
"skipCleanSection": true,
"buildRequires": [ "buildRequires": [
"python3", "python3 >= 3.2",
"cmake >= 3.0", "cmake >= 3.0",
"gcc-c++ >= 4.8", "gcc-c++ >= 4.8",
"boost-devel >= 1.54", "boost-devel >= 1.54",
......
...@@ -32,14 +32,11 @@ $unstableNotice ...@@ -32,14 +32,11 @@ $unstableNotice
%build %build
$removeBundledBoostIfNeed $removeBundledBoostIfNeed
mkdir build
pushd build
$cmakeCommand \ $cmakeCommand \
-DUSE_QT=5 \ -DUSE_QT=5 \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DKUMIR2_REAL_PREFIX=$installPrefix \ -DKUMIR2_SDK_CMAKE_DIR=$cmakeFilesLocation \
-DKUMIR2_SDK_CMAKE_DIR=$rpmBuildRoot/$cmakeFilesLocation \ -DKUMIR2_SDK_SCRIPTS_DIR=$develScriptsLocation \
-DKUMIR2_SDK_SCRIPTS_DIR=$RPM_BUILD_ROOT/$develScriptsLocation \
-DPROVIDED_VERSION_INFO:BOOL=ON \ -DPROVIDED_VERSION_INFO:BOOL=ON \
-DGIT_TAG="$gitTag" \ -DGIT_TAG="$gitTag" \
-DGIT_BRANCH="$gitBranch" \ -DGIT_BRANCH="$gitBranch" \
...@@ -47,15 +44,12 @@ $cmakeCommand \ ...@@ -47,15 +44,12 @@ $cmakeCommand \
-DGIT_TIMESTAMP="$gitTimestamp" \ -DGIT_TIMESTAMP="$gitTimestamp" \
../ ../
$makeCommand $makeCommand
popd
%install %install
pushd build
$makeInstallCommand $makeInstallCommand
popd
%clean
rm -rf $rpmBuildRoot $cleanSection
%files %files
$mainFilesPrefs $mainFilesPrefs
...@@ -72,9 +66,9 @@ $dataDir/icons/hicolor/*/apps/kumir2-classic.* ...@@ -72,9 +66,9 @@ $dataDir/icons/hicolor/*/apps/kumir2-classic.*
$dataDir/applications/kumir2-highgrade.desktop $dataDir/applications/kumir2-highgrade.desktop
$dataDir/icons/hicolor/*/apps/kumir2-highgrade.* $dataDir/icons/hicolor/*/apps/kumir2-highgrade.*
$dataDir/applications/kumir2-teacher.desktop $dataDir/applications/kumir2-teacher.desktop
$dataDir/icons/hicolor/*/apps/teacher-highgrade.* $dataDir/icons/hicolor/*/apps/kumir2-teacher.*
$datadir/icons/hicolor/*/mimetypes/* $dataDir/icons/hicolor/*/mimetypes/*
$datadir/mime/packages/kumir2-mimetypes.xml $dataDir/mime/packages/kumir2-mimetypes.xml
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
...@@ -247,6 +241,11 @@ def generate_rpm_spec_contents(dist: str, release: int, packager: str): ...@@ -247,6 +241,11 @@ def generate_rpm_spec_contents(dist: str, release: int, packager: str):
else: else:
subst["removeBundledBoostIfNeed"] = "" subst["removeBundledBoostIfNeed"] = ""
if not conventions["skipCleanSection"]:
subst["cleanSection"] = "%clean\nrm -rf $rpmBuildRoot\n"
else:
subst["cleanSection"] = ""
if conventions["dirsOwnership"]: if conventions["dirsOwnership"]:
subst["mainFilesPrefs"] += "\n%dir $binDir" subst["mainFilesPrefs"] += "\n%dir $binDir"
subst["mainFilesPrefs"] += "\n%dir $dataDir/applications" subst["mainFilesPrefs"] += "\n%dir $dataDir/applications"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment