Commit ae66d03e authored by Victor Yacovlev's avatar Victor Yacovlev

SDK: Flexible out-of-project customization for launchers/plugins

parent 32158392
......@@ -62,6 +62,7 @@ install(
WORLD_EXECUTE WORLD_READ
)
install(DIRECTORY cmake/ DESTINATION "${KUMIR2_SDK_CMAKE_DIR}")
install(FILES src/app/kumir2-launcher.cpp DESTINATION ${KUMIR2_SDK_SRC_DIR})
# Generate and install CMake file describing current build configuration
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/distribution_build_config.cmake" "# Installed build configuration\n")
......@@ -76,23 +77,14 @@ install(
DESTINATION "${KUMIR2_SDK_CMAKE_DIR}/kumir2"
)
# Platform-specific global resources handling
if(WIN32)
# Do nothing
elseif(APPLE)
# TODO Make package-related stuff
else()
# Create XDG-compliant filesystem structure for applciations and icons
# Application icons
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${KUMIR2_XDG_ICONS_DIR}")
file(GLOB_RECURSE icons RELATIVE ${CMAKE_SOURCE_DIR}/app_icons/linux ${CMAKE_SOURCE_DIR}/app_icons/linux/*)
# XDG mime types handling
if(NOT WIN32 AND NOT APPLE)
set(ICONS_DIR "${CMAKE_SOURCE_DIR}/app_icons/linux/hicolor")
message(STATUS "icons dir : ${ICONS_DIR}")
file(GLOB_RECURSE icons RELATIVE ${ICONS_DIR} "${ICONS_DIR}/*/mimetypes/*.*")
foreach(icon IN ITEMS ${icons})
get_filename_component(subdir ${icon} PATH)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${KUMIR2_XDG_ICONS_DIR}/${subdir}")
file(COPY "${CMAKE_SOURCE_DIR}/app_icons/linux/${icon}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${KUMIR2_XDG_ICONS_DIR}/${subdir}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${KUMIR2_XDG_ICONS_DIR}/${icon}" DESTINATION "${KUMIR2_XDG_ICONS_DIR}/${subdir}")
install(FILES "${ICONS_DIR}/${icon}" DESTINATION "${KUMIR2_XDG_ICONS_DIR}/${subdir}")
endforeach(icon)
endif()
install(FILES "${CMAKE_SOURCE_DIR}/share/mime/packages/kumir2-mimetypes.xml" DESTINATION ${KUMIR2_XDG_MIME_PACKAGES_DIR})
endif(NOT WIN32 AND NOT APPLE)
......@@ -288,19 +288,61 @@ function(kumir2_add_actor)
endfunction(kumir2_add_actor)
function(kumir2_add_launcher)
cmake_parse_arguments(PARSED_ARGS "" "NAME;SPLASHSCREEN;CONFIGURATION" "" ${ARGN})
set(LAUNCHER_SOURCES "${CMAKE_SOURCE_DIR}/src/app/main.cpp")
cmake_parse_arguments(PARSED_ARGS "" "NAME;SPLASHSCREEN;CONFIGURATION;WINDOW_ICON;APP_ICON_NAME;X_ICONS_DIR;WIN_ICONS_DIR;X_NAME;X_NAME_ru;X_CATEGORIES" "" ${ARGN})
if(EXISTS "${CMAKE_SOURCE_DIR}/src/app/kumir2-launcher.cpp")
set(LAUNCHER_SOURCES "${CMAKE_SOURCE_DIR}/src/app/kumir2-launcher.cpp")
else()
set(LAUNCHER_SOURCES "${KUMIR2_SDK_SRC_DIR}/kumir2-launcher.cpp")
endif()
if(PARSED_ARGS_APP_ICON_NAME)
if(WIN32)
if(PARSED_ARGS_WIN_ICONS_DIR)
set(ICONS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${PARSED_ARGS_WIN_ICONS_DIR}/")
else()
set(ICONS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/")
endif()
elseif(NOT APPLE)
if(PARSED_ARGS_X_ICONS_DIR)
set(ICONS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${PARSED_ARGS_X_ICONS_DIR}/")
else()
set(ICONS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/")
endif()
endif()
endif(PARSED_ARGS_APP_ICON_NAME)
kumir2_use_qt(Core Gui)
if(WIN32 AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${PARSED_ARGS_NAME}.rc")
list(APPEND LAUNCHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${PARSED_ARGS_NAME}.rc")
add_executable(${PARSED_ARGS_NAME} WIN32 ${LAUNCHER_SOURCES})
set(QRC_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PARSED_ARGS_NAME}.qrc")
file(WRITE ${QRC_FILE} "<RCC>\n")
file(APPEND ${QRC_FILE} "<qresource prefix=\"/kumir2-launcher\">\n")
if(PARSED_ARGS_SPLASHSCREEN)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/${PARSED_ARGS_SPLASHSCREEN}" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(APPEND ${QRC_FILE} "<file>")
file(APPEND ${QRC_FILE} "${PARSED_ARGS_SPLASHSCREEN}")
file(APPEND ${QRC_FILE} "</file>\n")
endif()
if(PARSED_ARGS_WINDOW_ICON)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/${PARSED_ARGS_WINDOW_ICON}" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(APPEND ${QRC_FILE} "<file>")
file(APPEND ${QRC_FILE} "${PARSED_ARGS_WINDOW_ICON}")
file(APPEND ${QRC_FILE} "</file>\n")
endif()
file(APPEND ${QRC_FILE} "</qresource>\n</RCC>\n")
set_source_files_properties(${QRC_FILE} PROPERTIES GENERATED ON)
kumir2_add_resources(QRC_SRC ${QRC_FILE})
if(WIN32 AND EXISTS "${ICONS_DIR}/${PARSED_APP_ICON_NAME}.ico")
set(WIN_RC_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PARSED_ARGS_NAME}.rc")
set_source_files_properties(${WIN_RC_FILE} PROPERTIES GENERATED ON)
set(ICON_PATH "${ICONS_DIR}/${PARSED_APP_ICON_NAME}.ico")
string(REPLACE "/" "\\\\" ICON_NATIVE_PATH ${ICON_PATH})
file(WRITE ${WIN_RC_FILE} "IDI_ICON1 ICON DISCARDABLE \"${ICON_NATIVE_PATH}\"\r\n")
list(APPEND LAUNCHER_SOURCES ${WIN_RC_FILE})
add_executable(${PARSED_ARGS_NAME} WIN32 ${LAUNCHER_SOURCES} ${QRC_SRC})
if(${USE_QT} GREATER 4)
list(APPEND QT_LIBRARIES ${Qt5Core_QTMAIN_LIBRARIES})
else()
list(APPEND QT_LIBRARIES ${QT_QTMAIN_LIBRARY})
endif()
else()
add_executable(${PARSED_ARGS_NAME} ${LAUNCHER_SOURCES})
add_executable(${PARSED_ARGS_NAME} ${LAUNCHER_SOURCES} ${QRC_SRC})
endif()
target_link_libraries(${PARSED_ARGS_NAME} ${QT_LIBRARIES} ExtensionSystem)
set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY COMPILE_FLAGS "${KUMIR2_CXXFLAGS} ${KUMIR2_CXXFLAGS_${CMAKE_BUILD_TYPE}}")
......@@ -309,6 +351,9 @@ function(kumir2_add_launcher)
if(PARSED_ARGS_SPLASHSCREEN)
set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY COMPILE_DEFINITIONS SPLASHSCREEN="${PARSED_ARGS_SPLASHSCREEN}")
endif(PARSED_ARGS_SPLASHSCREEN)
if(PARSED_ARGS_WINDOW_ICON)
set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY COMPILE_DEFINITIONS WINDOW_ICON="${PARSED_ARGS_WINDOW_ICON}")
endif(PARSED_ARGS_WINDOW_ICON)
set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY COMPILE_DEFINITIONS KUMIR2_PLUGINS_DIR="${KUMIR2_PLUGINS_DIR}")
set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY COMPILE_DEFINITIONS KUMIR2_RESOURCES_DIR="${KUMIR2_RESOURCES_DIR}")
set_property(TARGET ${PARSED_ARGS_NAME} APPEND PROPERTY COMPILE_DEFINITIONS KUMIR2_EXEC_DIR="${KUMIR2_EXEC_DIR}")
......@@ -317,10 +362,40 @@ 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_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_APPLICATIONS_DIR})
endif()
if(KUMIR2_XDG_APPLICATIONS_DIR AND PARSED_ARGS_X_NAME)
set(DESKTOP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PARSED_ARGS_NAME}.desktop")
file(WRITE ${DESKTOP_FILE} "[Desktop Entry]\n")
file(APPEND ${DESKTOP_FILE} "Type=Application\n")
file(APPEND ${DESKTOP_FILE} "Exec=${PARSED_ARGS_NAME} %U\n")
if(PARSED_ARGS_APP_ICON_NAME)
file(APPEND ${DESKTOP_FILE} "Icon=${PARSED_ARGS_APP_ICON_NAME}\n")
endif(PARSED_ARGS_APP_ICON_NAME)
file(APPEND ${DESKTOP_FILE} "Name=${PARSED_ARGS_X_NAME}\n")
if(PARSED_ARGS_X_NAME_ru) # TODO make support for several languages
file(APPEND ${DESKTOP_FILE} "Name[ru]=${PARSED_ARGS_X_NAME_ru}\n")
endif(PARSED_ARGS_X_NAME_ru)
if(PARSED_ARGS_X_CATEGORIES)
string(REPLACE "," ";" X_CATS ${PARSED_ARGS_X_CATEGORIES})
file(APPEND ${DESKTOP_FILE} "Categories=${X_CATS};\n")
endif(PARSED_ARGS_X_CATEGORIES)
set_source_files_properties(${DESKTOP_FILE} PROPERTIES GENERATED ON)
install(FILES ${DESKTOP_FILE} DESTINATION ${KUMIR2_XDG_APPLICATIONS_DIR})
endif(KUMIR2_XDG_APPLICATIONS_DIR AND PARSED_ARGS_X_NAME)
if(PARSED_ARGS_APP_ICON_NAME AND NOT WIN32 AND NOT APPLE)
if(KUMIR2_XDG_ICONS_DIR)
file(GLOB_RECURSE icons RELATIVE ${ICONS_DIR} "${ICONS_DIR}/*/apps/${PARSED_ARGS_APP_ICON_NAME}.*")
foreach(icon IN ITEMS ${icons})
get_filename_component(subdir ${icon} PATH)
install(FILES "${ICONS_DIR}/${icon}" DESTINATION "${KUMIR2_XDG_ICONS_DIR}/${subdir}")
endforeach(icon)
endif(KUMIR2_XDG_ICONS_DIR)
if(KUMIR2_XDG_PIXMAPS_DIR AND EXISTS "${ICONS_DIR}/${PARSED_ARGS_APP_ICON_NAME}.png")
install(FILES "${ICONS_DIR}/${PARSED_ARGS_APP_ICON_NAME}.png" DESTINATION "${KUMIR2_XDG_PIXMAPS_DIR}")
endif()
if(KUMIR2_XDG_PIXMAPS_DIR AND EXISTS "${ICONS_DIR}/${PARSED_ARGS_APP_ICON_NAME}.svg")
install(FILES "${ICONS_DIR}/${PARSED_ARGS_APP_ICON_NAME}.svg" DESTINATION "${KUMIR2_XDG_PIXMAPS_DIR}")
endif()
endif(PARSED_ARGS_APP_ICON_NAME AND NOT WIN32 AND NOT APPLE)
endfunction(kumir2_add_launcher)
function(kumir2_add_tool)
......
......@@ -15,6 +15,7 @@ set(KUMIR2_PLUGINS_DIR "${LIB_BASENAME}/kumir2/plugins") # libraries to be lo
set(KUMIR2_RESOURCES_DIR "share/kumir2") # non-executable resources
set(KUMIR2_XDG_APPLICATIONS_DIR "share/applications") # X applications catalog
set(KUMIR2_XDG_ICONS_DIR "share/icons") # X icons catalog
set(KUMIR2_XDG_PIXMAPS_DIR "share/pixmaps") # X pixmaps directory
set(KUMIR2_XDG_MIME_PACKAGES_DIR "share/mime/packages") # X MIME packages catalog
if(NOT DEFINED KUMIR2_LIBEXECS_DIR)
......@@ -33,6 +34,10 @@ if(NOT DEFINED KUMIR2_SDK_CMAKE_DIR)
set(KUMIR2_SDK_CMAKE_DIR "${LIB_BASENAME}/cmake/Kumir2") # cmake files to use from others
endif(NOT DEFINED KUMIR2_SDK_CMAKE_DIR)
if(NOT DEFINED KUMIR2_SDK_SRC_DIR)
set(KUMIR2_SDK_SRC_DIR "${KUMIR2_RESOURCES_DIR}/src")
endif(NOT DEFINED KUMIR2_SDK_SRC_DIR) # sources required to build some components (launchers, etc.)
# clear default CMake RPATH values
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
......
[Desktop Entry]
Type=Application
Exec=kumir2-classic %U
Icon=kumir2-classic
Name=Kumir Standard Edition
Name[ru]=Кумир
Categories=Qt;KDE;Education;X-KDE-Edu-Misc;Math;
[Desktop Entry]
Type=Application
Exec=kumir2-highgrade %U
Icon=kumir2-highgrade
Name=Kumir High Grades School Edition
Name[ru]=Кумир для старших классов
Categories=Qt;KDE;Education;X-KDE-Edu-Misc;Math;
[Desktop Entry]
Type=Application
Exec=kumir2-ide %U
Icon=kumir2-ide
Name=Kumir Professional Edition
Name[ru]=Кумир-Про
Categories=Qt;KDE;Education;X-KDE-Edu-Misc;Math;
X-Kumir-MDI=true
# norootforbuild
# Required for version information in case of not in GIT repo
# define date 20150401
# define branch master
# define hash 255daa697c2cd10763def72c12141c41b51502b8
# define tag 2.1.0-beta7
# define timestamp 1427898729
%define name_suffix -nightly
# Build kumir2-llvm or not
%define with_llvm 1
# If target system has modern version of Boost,
# use it. Otherwise use bundled files
%define with_bundled_boost 0
# Build kumir2-python (experimental!!!) or not
%define with_python_ide 0
# Note:
# OBS service freezes on LaTeX pre-installation,
# required to build PDF documentation
%define with_pdf_documentation 0
Name: kumir2%name_suffix
Summary: Kumir education system (Nightly *unstable* builds)
License: GPL2+
BuildRequires: python
BuildRequires: cmake >= 2.8
BuildRequires: gcc-c++ >= 4.6
Group: Productivity/Scientific/Other
Version: %date
Release: 1
BuildRoot: %{_tmppath}/%{name}-%{version}
Vendor: NIISI RAS
Packager: Kumir Team <kumir@lpm.org.ru>
Source: kumir2-%branch.tar.gz
BuildRequires: pkgconfig(QtCore) >= 4.7.0
BuildRequires: pkgconfig(QtGui) >= 4.7.0
BuildRequires: pkgconfig(QtXml) >= 4.7.0
BuildRequires: pkgconfig(QtWebKit) >= 4.7.0
BuildRequires: pkgconfig(QtScript) >= 4.7.0
BuildRequires: pkgconfig(QtDeclarative) >= 4.7.0
%if %with_bundled_boost
%else
BuildRequires: boost-devel >= 1.49
%endif
%if %with_python_ide
BuildRequires: python3-devel >= 3.2
BuildRequires: pkgconfig(python3)
%endif
%if %with_llvm
BuildRequires: clang >= 3.2
BuildRequires: llvm-devel >= 3.2
%endif
%if %with_pdf_documentation
BuildRequires: texlive
BuildRequires: texlive-collection-langcyrillic
BuildRequires: texlive-collection-latex
BuildRequires: texlive-collection-latexextra
BuildRequires: texlive-collection-latexrecommended
# fixes fedora ambiguous dependency
BuildRequires: texlive-simplecv
%endif
URL: http://www.niisi.ru/kumir/
%if 0%{?opensuse_bs}
%if 0%{?suse_version}
BuildRequires: procps
BuildRequires: -post-build-checks -rpmlint-Factory
%endif
%endif
# meta-package requirements
Requires: %name-desktop-integration = %version
Requires: %name-libs = %version
Requires: %name-bc = %version
Requires: %name-run = %version
Requires: %name-xrun = %version
Requires: %name-ide = %version
Requires: %name-classic = %version
Requires: %name-highgrade = %version
Requires: %name-teacher = %version
%if %with_python_ide
Requires: %name-python = %version
%endif
%if %with_llvm
Requires: %name-llvmc = %version
%endif
%if %with_pdf_documentation
Requires: %name-doc = %version
%endif
%description
Meta-package to full kumir2 installation
%prep
%setup -q -n kumir2-%branch
%build
# debug messages for OBS
%if %{defined fedora}
echo "Build for Fedora"
%endif
%if %{defined suse_version}
echo "Build for openSUSE"
%endif
touch version_info.cmake
echo set\(GIT_TIMESTAMP %timestamp\) > version_info.cmake
echo set\(GIT_BRANCH %branch\) >> version_info.cmake
echo set\(GIT_TAG %tag\) >> version_info.cmake
echo set\(GIT_HASH %hash\) >> version_info.cmake
%if %with_bundled_boost
%else
rm -rf src/3rdparty/boost-*
%endif
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$RPM_BUILD_ROOT/%_prefix ../
make -j 5
cd ..
%if %with_pdf_documentation
mkdir pdf_userdoc
mkdir pdf_userdoc/pdf_a4
mkdir pdf_userdoc/pdf_tablet
export PATH=`pwd`/build/Release/bin:$PATH
export LD_LIBRARY_PATH=`pwd`/build/Release/lib/kumir2:`pwd`/build/Release/lib64/kumir2:$LD_LIBRARY_PATH
cd userdocs
docbook2latex --profile=a4 --configuration=classic --output=kumir2-classic.tex system/index-classic.xml
docbook2latex --profile=a4 --configuration=highgrade --output=kumir2-highgrade.tex system/index-highgrade.xml
docbook2latex --profile=a4 --configuration=ide --output=kumir2-ide.tex system/index-ide.xml
docbook2latex --profile=a4 --configuration=teacher --output=kumir2-teacher.tex system/index-teacher.xml
docbook2latex --profile=a4 --output=language.tex language/index.xml
for file in Actor*.xml
docbook2latex --profile=a4 $file
done
for file in *.tex
pdflatex $file
done
# Run pdflatex again to include TOC
for file in *.tex
pdflatex $file
done
mv *.pdf ../pdf_userdoc/pdf_a4/
rm *.tex
docbook2latex --profile=tablet --configuration=classic --output=kumir2-classic.tex system/index-classic.xml
docbook2latex --profile=tablet --configuration=highgrade --output=kumir2-highgrade.tex system/index-highgrade.xml
docbook2latex --profile=tablet --configuration=ide --output=kumir2-ide.tex system/index-ide.xml
docbook2latex --profile=tablet --configuration=teacher --output=kumir2-teacher.tex system/index-teacher.xml
docbook2latex --profile=tablet --output=language.tex language/index.xml
for file in Actor*.xml
docbook2latex --profile=tablet $file
done
for file in *.tex
pdflatex $file
done
# Run pdflatex again to include TOC
for file in *.tex
pdflatex $file
done
mv *.pdf ../pdf_userdoc/pdf_tablet/
cd ..
%else
echo "Skip build PDF documentation"
%endif
%install
cd build
make install
cd ..
%if %with_pdf_documentation
mkdir -p $RPM_BUILD_ROOT/%_docdir/%name/pdf_a4
mkdir -p $RPM_BUILD_ROOT/%_docdir/%name/pdf_tablet
cp pdf_userdoc/pdf_a4/*.pdf $RPM_BUILD_ROOT/%_docdir/%name/pdf_a4/
cp pdf_userdoc/pdf_tablet/*.pdf $RPM_BUILD_ROOT/%_docdir/%name/pdf_tablet/
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%dir %_libdir/kumir2
%dir %_datadir/kumir2
%package libs
Summary: Shared files used by various Kumir components
%if %{defined fedora}
Requires: qt4 >= 4.7.0
Requires: qt4-x11 >= 4.7.0
%endif
%if %{defined suse_version}
Requires: libqt4 >= 4.7.0
Requires: libqt4-x11 >= 4.7.0
Requires: libQtWebKit4 >= 4.7.0
%endif
%if %with_python_ide
Requires: python3 >= 3.2
Requires: libpython3.so
%endif
%description libs
Shared files used by various Kumir components
%files libs
%defattr(-,root,root)
%dir %_libdir/kumir2
%dir %_libdir/kumir2/plugins
%dir %_datadir/kumir2
%_libdir/kumir2/*.so
%_libdir/kumir2/plugins/libActor*.so
%_libdir/kumir2/plugins/Actor*.pluginspec
%_libdir/kumir2/plugins/libBrowser.so
%_libdir/kumir2/plugins/Browser.pluginspec
%_libdir/kumir2/plugins/libCoreGUI.so
%_libdir/kumir2/plugins/CoreGUI.pluginspec
%_libdir/kumir2/plugins/libCourseManager.so
%_libdir/kumir2/plugins/CourseManager.pluginspec
%_libdir/kumir2/plugins/libEditor.so
%_libdir/kumir2/plugins/Editor.pluginspec
%_libdir/kumir2/plugins/libKumirAnalizer.so
%_libdir/kumir2/plugins/KumirAnalizer.pluginspec
%_libdir/kumir2/plugins/libKumirCompilerTool.so
%_libdir/kumir2/plugins/KumirCompilerTool.pluginspec
%_libdir/kumir2/plugins/libKumirCodeGenerator.so
%_libdir/kumir2/plugins/KumirCodeGenerator.pluginspec
%_libdir/kumir2/plugins/libKumirCodeRun.so
%_libdir/kumir2/plugins/KumirCodeRun.pluginspec
%if %with_python_ide
%_libdir/kumir2/plugins/libPython3Language.so
%_libdir/kumir2/plugins/Python3Language.pluginspec
%endif
%if %with_llvm
%_libdir/kumir2/plugins/libLLVMCodeGenerator.so
%_libdir/kumir2/plugins/LLVMCodeGenerator.pluginspec
%endif
%_datadir/kumir2/actors/*
%_datadir/kumir2/coregui/*
%_datadir/kumir2/coursemanager/*
%_datadir/kumir2/editor/*
%_datadir/kumir2/icons/*
%_datadir/kumir2/kumiranalizer/*
%if %with_python_ide
%_datadir/kumir2/python3language/*
%endif
%if %with_llvm
%_datadir/kumir2/llvmcodegenerator/*
%endif
%_datadir/kumir2/translations/*
%_datadir/kumir2/userdocs/*
%_datadir/kumir2/widgets/*
%_datadir/kumir2/docbookviewer/*
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%package ide
Summary: Modern UI for Kumir
Requires: %name-libs = %version
Provides: %name-gui = %version
Requires: /usr/bin/gtk-update-icon-cache
%description ide
Modern UI for Kumir with tabs and session support
%files ide
%defattr(-,root,root)
%if %{defined suse_version}
%dir %_bindir
%dir %_datadir/icons/hicolor/*/apps
%dir %_datadir/applications
%endif
%_bindir/kumir2-ide
%_datadir/applications/kumir2-professional.desktop
%_datadir/icons/hicolor/*/apps/kumir2.*
%post ide
/bin/touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null || :
%postun ide
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor/ &>/dev/null || :
fi
%posttrans ide
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
%package classic
Summary: Classic UI for Kumir
Provides: %name-gui = %version
Requires: %name-libs = %version
Requires: /usr/bin/gtk-update-icon-cache
%description classic
Classic Kumir UI like 1.x
%files classic
%defattr(-,root,root)
%if %{defined suse_version}
%dir %_bindir
%dir %_datadir/icons/hicolor/*/apps
%dir %_datadir/applications
%endif
%_bindir/kumir2-classic
%_datadir/applications/kumir2-classic.desktop
%_datadir/icons/hicolor/*/apps/kumir2-classic.*
%post classic
/bin/touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null || :
%postun classic
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor/ &>/dev/null || :
fi
%posttrans classic
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
%package highgrade
Summary: Classic UI for Kumir + High grade features
Provides: %name-gui = %version
Requires: %name-libs = %version
Requires: /usr/bin/gtk-update-icon-cache
%description highgrade
Classic Kumir UI like 1.x with high grade packages
enabled by default
%files highgrade
%defattr(-,root,root)
%if %{defined suse_version}
%dir %_bindir
%dir %_datadir/icons/hicolor/*/apps
%dir %_datadir/applications
%endif
%_bindir/kumir2-highgrade
%_datadir/applications/kumir2-highgrade.desktop
%_datadir/icons/hicolor/*/apps/kumir2-highgrade.*
%post highgrade
/bin/touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null || :
%postun highgrade
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor/ &>/dev/null || :
fi
%posttrans highgrade
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
%package teacher
Summary: Teacher mode Kumir UI
Provides: %name-gui = %version
Requires: %name-libs = %version
Requires: /usr/bin/gtk-update-icon-cache
%description teacher
Kumir UI with teacher features
%files teacher
%defattr(-,root,root)
%if %{defined suse_version}
%dir %_bindir
%dir %_datadir/icons/hicolor/*/apps
%dir %_datadir/applications
%endif
%_bindir/kumir2-teacher
%_datadir/applications/kumir2-teacher.desktop
%_datadir/icons/hicolor/*/apps/kumir2-teacher.*
%post teacher
/bin/touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null || :
%postun teacher
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor/ &>/dev/null || :
fi
%posttrans teacher
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :