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)
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}")
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}")
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()
endfunction(kumir2_add_launcher)
......
{
"unstablePackageSuffix": "-unstable",
"installPrefix": "%_prefix",
"cmakeCommand": "cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$rpmBuildRoot/%_prefix",
"makeCommand": "make -j",
"makeInstallCommand": "make install",
"cmakeCommand": "%cmake",
"makeCommand": "%make_jobs",
"makeInstallCommand": "%cmake_install",
"rpmBuildRoot": "$RPM_BUILD_ROOT",
"binDir": "%_bindir",
"libDir": "%_libdir",
"dataDir": "%_datadir",
"includesDir": "%_incdir",
"includesDir": "%_includedir",
"defAttr": "%defattr(-,root,root)",
"dirsOwnership": true,
"useBundledBoost": false,
"skipCleanSection": true,
"buildRequires": [
"python3",
"python3 >= 3.2",
"cmake >= 3.0",
"gcc-c++ >= 4.8",
"boost-devel >= 1.54",
......
......@@ -32,14 +32,11 @@ $unstableNotice
%build
$removeBundledBoostIfNeed
mkdir build
pushd build
$cmakeCommand \
-DUSE_QT=5 \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DKUMIR2_REAL_PREFIX=$installPrefix \
-DKUMIR2_SDK_CMAKE_DIR=$rpmBuildRoot/$cmakeFilesLocation \
-DKUMIR2_SDK_SCRIPTS_DIR=$RPM_BUILD_ROOT/$develScriptsLocation \
-DKUMIR2_SDK_CMAKE_DIR=$cmakeFilesLocation \
-DKUMIR2_SDK_SCRIPTS_DIR=$develScriptsLocation \
-DPROVIDED_VERSION_INFO:BOOL=ON \
-DGIT_TAG="$gitTag" \
-DGIT_BRANCH="$gitBranch" \
......@@ -47,15 +44,12 @@ $cmakeCommand \
-DGIT_TIMESTAMP="$gitTimestamp" \
../
$makeCommand
popd
%install
pushd build
$makeInstallCommand
popd
%clean
rm -rf $rpmBuildRoot
$cleanSection
%files
$mainFilesPrefs
......@@ -72,9 +66,9 @@ $dataDir/icons/hicolor/*/apps/kumir2-classic.*
$dataDir/applications/kumir2-highgrade.desktop
$dataDir/icons/hicolor/*/apps/kumir2-highgrade.*
$dataDir/applications/kumir2-teacher.desktop
$dataDir/icons/hicolor/*/apps/teacher-highgrade.*
$datadir/icons/hicolor/*/mimetypes/*
$datadir/mime/packages/kumir2-mimetypes.xml
$dataDir/icons/hicolor/*/apps/kumir2-teacher.*
$dataDir/icons/hicolor/*/mimetypes/*
$dataDir/mime/packages/kumir2-mimetypes.xml
%post -p /sbin/ldconfig
......@@ -247,6 +241,11 @@ def generate_rpm_spec_contents(dist: str, release: int, packager: str):
else:
subst["removeBundledBoostIfNeed"] = ""
if not conventions["skipCleanSection"]:
subst["cleanSection"] = "%clean\nrm -rf $rpmBuildRoot\n"
else:
subst["cleanSection"] = ""
if conventions["dirsOwnership"]:
subst["mainFilesPrefs"] += "\n%dir $binDir"
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