[package] updtae

pull/29/head
Dmitry Razumov 3 years ago
parent 1865272777
commit 77d290e8ef

@ -1,5 +1,4 @@
#!/usr/bin/make -f
#!/usr/bin/make -f
#SHELL := /bin/bash
MAKEFILE_FILEPATH := $(abspath $(lastword $(MAKEFILE_LIST)))
@ -7,52 +6,58 @@ MAKEFILE_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_FILEPATH))))
MAKEFILE_PATH := $(dir $(MAKEFILE_FILEPATH))
CMAKE_COMMAND = cmake
#CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source
#CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile
CMAKE_SOURCE_DIR = ./source
CMAKE_BUILD_DIR = ./compile
DEPENDS = cmake
pkgname = $(MAKEFILE_DIR)
#pkgname = ublexec
pkgdir = ${DESTDIR}
CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source
CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile
#CMAKE_SOURCE_DIR = ./source
#CMAKE_BUILD_DIR = ./compile
FILE_VERSION = VERSION.md
DEPENDS = /bin/cmake
PREFIX ?= /usr
PKGNAME = $(MAKEFILE_DIR)
#PKGNAME = ublexec
default_target: all
.PHONY: all init depend debug prepare check build uninstall install clean up_ver help
all: init build
init:
@echo "Initialize ..."; \
sed -r "s/(version_application = ).*/\1\"$$(grep 'VERSION' VERSION.md | cut -d" " -f2)\";/" -i source/ublexec.h; \
sed -r "s/(version_application = ).*/\1\"$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2)\";/" -i source/ublexec.h; \
echo "-- Build path: ${CMAKE_BUILD_DIR}"
depend:
@echo "Check depends ..."; \
if [ ! -f /bin/${DEPENDS} ]; then \
echo "-- Depend '${DEPENDS}' not fount !"; \
exit 1; \
fi; \
@echo "Check depends ..."
@for FILE_DEPEND in $(DEPENDS); do \
if [ ! -f $${FILE_DEPEND} ]; then \
echo "ERROR: Depend '$${FILE_DEPEND}' not found !"; \
exit 1; \
fi; \
done; \
echo "Check depends: OK"
# $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
debug:
@echo "Debug ..."
if [ ! -d ${CMAKE_BUILD_DIR} ]; then \
$(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="/usr"; \
$(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \
fi; \
echo "Debug: OK"
prepare:
@echo "Prepare ..."; \
if [ ! -d ${CMAKE_BUILD_DIR} ]; then \
$(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr"; \
$(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \
fi; \
echo "Prepare: OK"
check:
@echo "Check ..."; \
if [ -f ${CMAKE_BUILD_DIR}/${pkgname} ]; then \
if [ -f ${CMAKE_BUILD_DIR}/${PKGNAME} ]; then \
echo "Check: OK"; \
else \
echo "Check: ${CMAKE_BUILD_DIR}/${pkgname} not fount !"; \
echo "Check: ${CMAKE_BUILD_DIR}/${PKGNAME} not found !"; \
exit 1; \
fi
@ -66,53 +71,57 @@ uninstall:
@for FILE_PO in $(wildcard *.po); do \
LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \
FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \
PATH_FILE_MO="/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
$(RM) "/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
PATH_FILE_MO="${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
$(RM) "${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
done
@for SIZE in 16x16 32x32 48x48 scalable; do \
$(RM) "/usr/share/icons/hicolor/$${SIZE}/apps/ru.ublinux.${pkgname}.svg"; \
$(RM) "/usr/share/icons/hicolor/$${SIZE}/apps/ru.ublinux.${pkgname}.png"; \
$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \
$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/apps/com.ublinux.${PKGNAME}.png"; \
done
@for FILE_SVG in $(wildcard *.svg); do \
for SIZE in 16x16 32x32 48x48 scalable; do \
$(RM) "/usr/share/icons/hicolor/$${SIZE}/status/$${FILE_SVG%.*}".{svg,png,jpg}; \
$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/status/$${FILE_SVG%.*}".{svg,png,jpg}; \
done; \
done
@$(RM) "/usr/bin/${pkgname}"
@$(RM) "/usr/share/applications/${pkgname}.desktop"
@$(RM) "/usr/share/polkit-1/actions/ru.ublinux.pkexec.${pkgname}.exec.policy"
@$(RM) -rd "/usr/share/${pkgname}"
@gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null || true
@$(RM) "${DESTDIR}${PREFIX}/bin/${PKGNAME}"
@$(RM) "${DESTDIR}${PREFIX}/share/applications/${PKGNAME}.desktop"
@$(RM) "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/logo-background.png"
@$(RM) "${DESTDIR}${PREFIX}/share/polkit-1/actions/com.ublinux.pkexec.${PKGNAME}.exec.policy"
@$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/com.ublinux.${PKGNAME}.svg"
@$(RM) -rd "${DESTDIR}${PREFIX}/share/${PKGNAME}"
@[ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true
@update-desktop-database --quiet &>/dev/null || true
@touch /usr/share/applications &>/dev/null || true
@[ -d "${DESTDIR}${PREFIX}/share/applications" ] && touch "${DESTDIR}${PREFIX}/share/applications" &>/dev/null || true
@echo "Uninstall: OK"
install: check uninstall
@echo "Install ..."
@for FILE_PO in $(wildcard *.po); do \
LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \
install -dm755 "${pkgdir}/usr/share/locale/$${LANG}/LC_MESSAGES"; \
install -dm755 "${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES"; \
FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \
PATH_FILE_MO="${pkgdir}/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
PATH_FILE_MO="${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
echo $${FILE_PO}; \
msgfmt "$${FILE_PO}" -v -f -o "$${PATH_FILE_MO}"; \
done
@for SIZE in 16 32 48; do \
install -dm755 "${pkgdir}/usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \
rsvg-convert -w $${SIZE} -h $${SIZE} -f png --keep-image-data "ru.ublinux.${pkgname}.svg" -o "${pkgdir}/usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/ru.ublinux.${pkgname}.png"; \
install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \
rsvg-convert -w $${SIZE} -h $${SIZE} -f png --keep-image-data "com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.png"; \
done
@install -dm755 "${pkgdir}/usr/share/icons/hicolor/scalable/apps"
@install -Dm644 -t "${pkgdir}/usr/share/icons/hicolor/scalable/apps/" "ru.ublinux.${pkgname}.svg"
@install -Dm755 -t "${pkgdir}/usr/bin/" "${CMAKE_BUILD_DIR}/${pkgname}"
@install -Dm644 -t "${pkgdir}/usr/share/applications/" "${pkgname}.desktop"
@install -Dm644 -t "${pkgdir}/usr/share/polkit-1/actions/" "com.ublinux.pkexec.${pkgname}.exec.policy"
@install -dm755 "${pkgdir}/usr/share/${pkgname}"/{ui,css,images}
@install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/ui/" "${pkgname}.glade"
@install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/css/" style.css
@install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" "logo-background.png"
@gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null || true
@install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/" "com.ublinux.${PKGNAME}.svg"
@install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}"
@install -dm755 "${DESTDIR}${PREFIX}/share/applications"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop"
@install -dm755 "${DESTDIR}${PREFIX}/share/polkit-1/actions"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/polkit-1/actions/" "com.ublinux.pkexec.${PKGNAME}.exec.policy"
@install -dm755 "${DESTDIR}${PREFIX}/share/${PKGNAME}"/{ui,css,images}
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/ui/" "${PKGNAME}.glade"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/css/" "${PKGNAME}.css"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "logo-background.png"
@gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true
@update-desktop-database --quiet &>/dev/null || true
@touch /usr/share/applications &>/dev/null || true
@touch "${DESTDIR}${PREFIX}/share/applications" &>/dev/null || true
@echo "Install: OK"
clean:
@ -124,6 +133,14 @@ clean:
echo "Clean: OK"; \
fi
up_ver:
@CURRENT=$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2); \
MAJOR=$$(cut -d. -f1 <<< $${CURRENT}); \
MINOR=$$(cut -d. -f2 <<< $${CURRENT}); \
VER="$${MAJOR}.$$(($${MINOR}+1))"; \
sed "s/VERSION *[[:digit:]]*.*/VERSION $${VER}/" -i ${FILE_VERSION}; \
echo "Updated version to VERSION.md: $${CURRENT} to $${VER}"
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 212 KiB

@ -1,18 +0,0 @@
#!/bin/bash
##
## Update VERSION 1.4
## $1 - Version
## Default - current Version value plus one (in minor section)
##
FILE_VERSION="VERSION.md"
[[ $1 ]] && VER=$1
if [[ -z ${VER} ]] ; then
SOURCE_FILE_VERSION=$(find ../ -maxdepth 1 -type f -iname "${FILE_VERSION}" -print -quit)
CURRENT=$(cat ${SOURCE_FILE_VERSION} | grep 'VERSION' | cut -d" " -f2)
MAJOR=$(echo ${CURRENT} | cut -d. -f1)
MINOR=$(echo ${CURRENT} | cut -d. -f2)
VER="${MAJOR}.$(echo $((${MINOR} +1)))"
fi
echo ":: Updated VERSION ${CURRENT} to ${VER}"
find ../ -maxdepth 2 -type f -iname "${FILE_VERSION}" -exec echo ":: Insert version in file: {}" \; -exec sed "s/VERSION *[[:digit:]]*.*/VERSION ${VER}/" -i {} \;

@ -7,12 +7,12 @@ pkg_check_modules(GTK REQUIRED gtkmm-3.0)
include_directories(${GTK_INCLUDE_DIRS})
link_directories(${GTK_LIBRARY_DIRS})
add_definitions(${GTK_CFLAGS_OTHER})
find_package(Threads REQUIRED)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wmissing-declarations -fdiagnostics-color=always")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \
-O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection")
set(SOURCE_FILES
main.cc
@ -26,5 +26,5 @@ set(LIBRARIES
pthread)
add_executable(ublexec ${SOURCE_FILES})
target_link_libraries(ublexec ${LIBRARIES} Threads::Threads)
target_link_libraries(ublexec ${LIBRARIES})
install(TARGETS ublexec DESTINATION bin)

@ -3,7 +3,7 @@ using namespace std;
const string path_app = "/usr/bin/";
const string path_glade = "/usr/share/ublexec/ui/ublexec.glade";
const string path_css = "/usr/share/ublexec/css/style.css";
const string path_css = "/usr/share/ublexec/css/ublexec.css";
const string app_name = "ublexec";
int socket_ext_id_I = 0;
int socket_trd_id_I = 0;
@ -162,7 +162,7 @@ void MainWindow::localization() {
btnStart->set_label(_("Run"));
wndChooseFileWallpaper->set_title(_("Please select File"));
dialogStartMenu->set_title(_("Selecting Programs"));
lblInfoHead->set_text(_("Running applications as a user with a\nspecified priority"));
lblInfoHead->set_text(_("Run applications as another user\nwith the specified priority"));
lblinfoCmd->set_text(_("Command Line"));
lblInfoTime->set_text(_("Team:"));
labInfoExecutTerm->set_text(_("Run in the terminal emulator"));

@ -201,7 +201,7 @@ public:
Gtk::Widget *boxAbout;
public:
string termunal_cmd[3] = {"konsole -e ", "xfce4-terminal -x ", "xterm -e "};
string version_application = "1.2";
string version_application = "2.23";
string cmd_old = "";
string user_exec_app = "";
string user_cmd = "";

@ -8,7 +8,7 @@ Comment=Run as another user
Comment[ru]=Выполнить от другого пользователя
Type=Application
Exec=ublexec
Icon=ru.ublinux.ublexec
Icon=com.ublinux.ublexec
Terminal=false
X-XfcePluggable=true
X-UBLPluggable=true

@ -28,7 +28,7 @@
Подробнее в &lt;a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"&gt;GNU General Public License, версии 2 или позднее&lt;/a&gt;.</property>
<property name="authors">UBGroup</property>
<property name="artists">UBGroup</property>
<property name="logo-icon-name">ru.ublinux.ublexec</property>
<property name="logo-icon-name">com.ublinux.ublexec</property>
<property name="wrap-license">True</property>
<property name="license-type">gpl-2-0</property>
<child internal-child="vbox">
@ -66,7 +66,7 @@
<property name="width-request">410</property>
<property name="height-request">240</property>
<property name="can-focus">False</property>
<property name="icon-name">ru.ublinux.ublexec</property>
<property name="icon-name">com.ublinux.ublexec</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -1019,7 +1019,7 @@
</object>
<object class="GtkWindow" id="window">
<property name="can-focus">False</property>
<property name="icon-name">ru.ublinux.ublexec</property>
<property name="icon-name">com.ublinux.ublexec</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -1040,7 +1040,7 @@
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="pixel-size">69</property>
<property name="icon-name">ru.ublinux.ublexec</property>
<property name="icon-name">com.ublinux.ublexec</property>
</object>
<packing>
<property name="expand">False</property>
@ -1059,8 +1059,8 @@
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="label" translatable="yes">Running applications as a user with a
specified priority</property>
<property name="label" translatable="yes">Run applications as another user
with the specified priority</property>
<attributes>
<attribute name="font-desc" value="URW Gothic Semi-Bold 10"/>
<attribute name="foreground" value="#000023233232"/>
@ -1862,7 +1862,7 @@ specified priority</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">32</property>
<property name="icon-name">ru.ublinux.ublexec</property>
<property name="icon-name">com.ublinux.ublexec</property>
</object>
</child>
<child>
@ -1904,7 +1904,7 @@ specified priority</property>
<object class="GtkMessageDialog" id="messageError">
<property name="can-focus">False</property>
<property name="title" translatable="yes">Внимание!</property>
<property name="icon-name">ru.ublinux.ublexec</property>
<property name="icon-name">com.ublinux.ublexec</property>
<property name="type-hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox">
@ -1965,7 +1965,7 @@ specified priority</property>
<property name="default-width">500</property>
<property name="default-height">400</property>
<property name="destroy-with-parent">True</property>
<property name="icon-name">ru.ublinux.ublexec</property>
<property name="icon-name">com.ublinux.ublexec</property>
<property name="type-hint">dialog</property>
<property name="skip-taskbar-hint">True</property>
<property name="urgency-hint">True</property>

@ -1,8 +1,22 @@
# Russian translations for PACKAGE package.
# Copyright (C) 2023 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Automatically generated, 2023.
# Language translations for ublexec package.
# Copyright (C) 2022, UBTech LLC
# This file is distributed under the same license as the ublexec package.
# UBLinux Team <info@ublinux.com>, 2022
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: ublexec 1.0\n"
"Report-Msgid-Bugs-To: info@ublinux.com\n"
"POT-Creation-Date: 2023-01-01 00:00+0600\n"
"PO-Revision-Date: 2023-01-01 00:00+0600\n"
"Last-Translator: UBLinux Team <info@ublinux.com>\n"
"Language-Team: UBLinux Team <info@ublinux.com>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid ""
msgstr ""
@ -57,13 +71,13 @@ msgstr ""
msgid "ОК"
msgstr ""
msgid "Exit"
msgid "Cancel"
msgstr ""
msgid "Selecting Programs"
msgstr ""
msgid "Running applications as a user with a\nspecified priority"
msgid "Run applications as another user\nwith the specified priority"
msgstr ""
msgid "Team"
@ -126,8 +140,5 @@ msgstr ""
msgid "ublexec"
msgstr ""
msgid "ubl-exec"
msgstr ""
msgid "Copyright © UBSoft LLC, 2022 - "
msgstr ""

@ -1,16 +1,17 @@
# Russian translations for PACKAGE package.
# Copyright (C) 2023 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Automatically generated, 2023.
# Russian translations for ublexec package.
# Copyright (C) 2022, UBTech LLC
# This file is distributed under the same license as the ublexec package.
# UBLinux Team <info@ublinux.com>, 2022
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: ublexec 1.0\n"
"Report-Msgid-Bugs-To: info@ublinux.ru\n"
"POT-Creation-Date: 2023-03-01 23:22+0600\n"
"PO-Revision-Date: 2023-03-01 23:28+0600\n"
"Last-Translator: ublinux <info@ublinux.ru>\n"
"Language-Team: Russian - UBLinux Team <info@ublinux.ru>\n"
"Report-Msgid-Bugs-To: info@ublinux.com\n"
"POT-Creation-Date: 2023-01-01 00:00+0600\n"
"PO-Revision-Date: 2023-01-01 00:00+0600\n"
"Last-Translator: UBLinux Team <info@ublinux.com>\n"
"Language-Team: Russian - UBLinux Team <info@ublinux.com>\n"
"Language: Russian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -67,14 +68,14 @@ msgstr "Графика"
msgid "ОК"
msgstr "ОК"
msgid "Exit"
msgstr "Выход"
msgid "Cancel"
msgstr "Отмена"
msgid "Selecting Programs"
msgstr "Выбор программ"
msgid "Running applications as a user with a\nspecified priority"
msgstr "Запуск приложений от имени пользователя с\nуказанным приоритетом"
msgid "Run applications as another user\nwith the specified priority"
msgstr "Запускать приложения от имени другого пользователя\nс указанным приоритетом"
msgid "Team:"
msgstr "Команда:"
@ -139,8 +140,5 @@ msgstr "Внимание!"
msgid "ublexec"
msgstr "Выполнить как..."
msgid "ubl-exec"
msgstr "ubl-exec"
msgid "Copyright © UBSoft LLC, 2022 - "
msgstr "Авторские права © ООО \"Юбисофт\", 2022 - "
Loading…
Cancel
Save