From 4c5dd9349a331da7e5c98b53ea199402621e64dd Mon Sep 17 00:00:00 2001 From: asmeron Date: Thu, 16 Mar 2023 09:06:15 +0300 Subject: [PATCH 1/6] [package] update --- Makefile | 65 ++++++++---------- VERSION.md | 2 +- ... => com.ublinux.pkexec.ublexec.exec.policy | 0 devel/update-version | 18 +++++ bg_top.png => logo-background.png | Bin source/main.cc | 0 source/ublexec.h | 0 style.css | 2 +- 8 files changed, 50 insertions(+), 37 deletions(-) rename org.ublinux.pkexec.ublexec.exec.policy => com.ublinux.pkexec.ublexec.exec.policy (100%) create mode 100755 devel/update-version rename bg_top.png => logo-background.png (100%) mode change 100755 => 100644 source/main.cc mode change 100755 => 100644 source/ublexec.h diff --git a/Makefile b/Makefile index 6492333..26e4b34 100644 --- a/Makefile +++ b/Makefile @@ -12,21 +12,18 @@ CMAKE_COMMAND = cmake CMAKE_SOURCE_DIR = ./source CMAKE_BUILD_DIR = ./compile DEPENDS = cmake -#PKGNAME = $(MAKEFILE_DIR) -PKGNAME = ublexec +pkgname = $(MAKEFILE_DIR) +#pkgname = ublexec +pkgdir = default_target: all all: init build init: @echo "Initialize ..."; \ - version="$$(cat VERSION.md)"; \ - version=$${version:8}; \ - search="s/string version_application.*$&"; \ - replace="string version_application = \"$${version}\";"; \ - sed -i -e "$$search/$$replace/gi" source/ublexec.h; \ + sed -r "s/(version_application = ).*/\1\"$$(grep 'VERSION' VERSION.md | cut -d" " -f2)\";/" -i source/ublexec.h; \ echo "-- Build path: ${CMAKE_BUILD_DIR}" - + depend: @echo "Check depends ..."; \ if [ ! -f /bin/${DEPENDS} ]; then \ @@ -52,10 +49,10 @@ prepare: 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 fount !"; \ exit 1; \ fi @@ -72,19 +69,19 @@ uninstall: PATH_FILE_MO="/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \ $(RM) "/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \ done -# @for SIZE in 16x16 32x32 48x48 scalable; do \ - $(RM) "/usr/share/icons/hicolor/$${SIZE}/apps/${PKGNAME}.svg"; \ - $(RM) "/usr/share/icons/hicolor/$${SIZE}/apps/${PKGNAME}.png"; \ - done -# @for FILE_SVG in $(wildcard *.svg); do \ + @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"; \ + 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}; \ 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}" + @$(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 @update-desktop-database --quiet 2>/dev/null @touch /usr/share/applications @@ -94,28 +91,26 @@ install: check uninstall @echo "Install ..." @for FILE_PO in $(wildcard *.po); do \ LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \ - install -dm755 /usr/share/locale/$${LANG}/LC_MESSAGES; \ + install -dm755 "${pkgdir}/usr/share/locale/$${LANG}/LC_MESSAGES"; \ FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \ - PATH_FILE_MO="/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \ + PATH_FILE_MO="${pkgdir}/usr/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 /usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps; \ - rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data "ru.ublinux.${PKGNAME}.svg" -o "/usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/ru.ublinux.${PKGNAME}.svg"; \ + 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"; \ done - @install -dm755 /usr/share/icons/hicolor/scalable/apps - @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ "ru.ublinux.${PKGNAME}.svg" - @install -Dm755 -t /usr/bin/ ${CMAKE_BUILD_DIR}/${PKGNAME} - @install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop - @install -Dm644 -t /usr/share/polkit-1/actions/ org.ublinux.pkexec.${PKGNAME}.exec.policy - @install -dm755 /usr/share/${PKGNAME}/{ui,css,images} - @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.glade - @install -Dm644 -t /usr/share/${PKGNAME}/css/ style.css - @install -Dm644 -t /usr/share/${PKGNAME}/images/ bg_top.png - @install -Dm644 -t /usr/share/${PKGNAME}/images/ "ru.ublinux.${PKGNAME}.svg" -# @install -Dm644 -t /usr/share/${PKGNAME}/images/ ${PKGNAME}.png - @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ + @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 @update-desktop-database --quiet 2>/dev/null @touch /usr/share/applications @echo "Install: OK" diff --git a/VERSION.md b/VERSION.md index 12ebd01..31c5941 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -VERSION 1.0 +VERSION 1.2 diff --git a/org.ublinux.pkexec.ublexec.exec.policy b/com.ublinux.pkexec.ublexec.exec.policy similarity index 100% rename from org.ublinux.pkexec.ublexec.exec.policy rename to com.ublinux.pkexec.ublexec.exec.policy diff --git a/devel/update-version b/devel/update-version new file mode 100755 index 0000000..e86b1b4 --- /dev/null +++ b/devel/update-version @@ -0,0 +1,18 @@ +#!/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 {} \; \ No newline at end of file diff --git a/bg_top.png b/logo-background.png similarity index 100% rename from bg_top.png rename to logo-background.png diff --git a/source/main.cc b/source/main.cc old mode 100755 new mode 100644 diff --git a/source/ublexec.h b/source/ublexec.h old mode 100755 new mode 100644 diff --git a/style.css b/style.css index 169a838..dea0dd6 100644 --- a/style.css +++ b/style.css @@ -1,5 +1,5 @@ .cssboxColor1{ - background: url("/usr/share/ublexec/images/bg_top.png") no-repeat; + background: url("/usr/share/ublexec/images/logo-background.png") no-repeat; } .textHead{ text-shadow: 1px 1px #ffffff; From 74a33740e20dc6d4455642fab3d665300da3c772 Mon Sep 17 00:00:00 2001 From: amid Date: Fri, 17 Mar 2023 18:31:08 +0600 Subject: [PATCH 2/6] [package] update --- VERSION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.md b/VERSION.md index 31c5941..17eb6c2 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -VERSION 1.2 +VERSION 2.23 From 318db08552d0417b475049f6c057b07217d4294c Mon Sep 17 00:00:00 2001 From: asmeron Date: Fri, 17 Mar 2023 19:07:14 +0600 Subject: [PATCH 3/6] [package] update --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 26e4b34..df58510 100644 --- a/Makefile +++ b/Makefile @@ -82,9 +82,9 @@ uninstall: @$(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 - @update-desktop-database --quiet 2>/dev/null - @touch /usr/share/applications + @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null || true + @update-desktop-database --quiet &>/dev/null || true + @touch /usr/share/applications &>/dev/null || true @echo "Uninstall: OK" install: check uninstall From d2429da39f01253a299df6948c6f4dd3f363cd20 Mon Sep 17 00:00:00 2001 From: amid Date: Fri, 17 Mar 2023 19:11:16 +0600 Subject: [PATCH 4/6] [package] update --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index df58510..e118ed6 100644 --- a/Makefile +++ b/Makefile @@ -110,9 +110,9 @@ install: check uninstall @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 - @update-desktop-database --quiet 2>/dev/null - @touch /usr/share/applications + @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null || true + @update-desktop-database --quiet &>/dev/null || true + @touch /usr/share/applications &>/dev/null || true @echo "Install: OK" clean: From 186527277795820df377b9f04c1601bfa61b94e1 Mon Sep 17 00:00:00 2001 From: amid Date: Fri, 17 Mar 2023 20:44:09 +0600 Subject: [PATCH 5/6] [package] update --- Makefile | 2 +- com.ublinux.pkexec.ublexec.exec.policy | 6 +++--- ublexec.desktop | 6 +++--- ublexec_ru.po | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index e118ed6..7bb882f 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ CMAKE_BUILD_DIR = ./compile DEPENDS = cmake pkgname = $(MAKEFILE_DIR) #pkgname = ublexec -pkgdir = +pkgdir = ${DESTDIR} default_target: all all: init build diff --git a/com.ublinux.pkexec.ublexec.exec.policy b/com.ublinux.pkexec.ublexec.exec.policy index 3664113..f2208d6 100644 --- a/com.ublinux.pkexec.ublexec.exec.policy +++ b/com.ublinux.pkexec.ublexec.exec.policy @@ -9,9 +9,9 @@ Run "ublexec" as root - Запус "Выполнить" с правами root - Authentication is required to run ublexec - Требуется авторизация для запуска "Выполнить" с правами root + Запус "Выполнить как..." с правами root + Authentication is required to run "Run as..." + Требуется авторизация для запуска "Выполнить как..." с правами root auth_admin auth_admin diff --git a/ublexec.desktop b/ublexec.desktop index 5e83001..32baff5 100644 --- a/ublexec.desktop +++ b/ublexec.desktop @@ -2,10 +2,10 @@ Encoding=UTF-8 Name=ublexec Name[ru]=Выполнить как... -GenericName=Execution from user rights +GenericName=Run as... GenericName[ru]=Выполнить как... -Comment=Execution from user rights -Comment[ru]=Выполнить как... +Comment=Run as another user +Comment[ru]=Выполнить от другого пользователя Type=Application Exec=ublexec Icon=ru.ublinux.ublexec diff --git a/ublexec_ru.po b/ublexec_ru.po index 2b26faa..a427543 100644 --- a/ublexec_ru.po +++ b/ublexec_ru.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: ubconfig 1.0\n" +"Project-Id-Version: ublexec 1.0\n" "Report-Msgid-Bugs-To: info@ublinux.ru\n" -"POT-Creation-Date: 2020-02-22 23:22+0600\n" -"PO-Revision-Date: 2020-02-22 23:28+0600\n" +"POT-Creation-Date: 2023-03-01 23:22+0600\n" +"PO-Revision-Date: 2023-03-01 23:28+0600\n" "Last-Translator: ublinux \n" "Language-Team: Russian - UBLinux Team \n" "Language: Russian\n" From 77d290e8efa1a3b783f4ece8bffea6bf6daf3577 Mon Sep 17 00:00:00 2001 From: asmeron Date: Sun, 19 Mar 2023 20:40:45 +0600 Subject: [PATCH 6/6] [package] updtae --- Makefile | 107 ++++++++++-------- ...nux.ublexec.svg => com.ublinux.ublexec.svg | 0 devel/update-version | 18 --- source/CMakeLists.txt | 10 +- source/ublexec.cc | 4 +- source/ublexec.h | 2 +- style.css => ublexec.css | 0 ublexec.desktop | 2 +- ublexec.glade | 18 +-- ublexec.pot | 29 +++-- ublexec_ru.po | 30 +++-- 11 files changed, 114 insertions(+), 106 deletions(-) rename ru.ublinux.ublexec.svg => com.ublinux.ublexec.svg (100%) delete mode 100755 devel/update-version rename style.css => ublexec.css (100%) diff --git a/Makefile b/Makefile index 7bb882f..f0e33cd 100644 --- a/Makefile +++ b/Makefile @@ -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)" diff --git a/ru.ublinux.ublexec.svg b/com.ublinux.ublexec.svg similarity index 100% rename from ru.ublinux.ublexec.svg rename to com.ublinux.ublexec.svg diff --git a/devel/update-version b/devel/update-version deleted file mode 100755 index e86b1b4..0000000 --- a/devel/update-version +++ /dev/null @@ -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 {} \; \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 543d234..ab85d20 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -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) diff --git a/source/ublexec.cc b/source/ublexec.cc index 2639d41..402fc4c 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -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")); diff --git a/source/ublexec.h b/source/ublexec.h index b14107b..f236971 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -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 = ""; diff --git a/style.css b/ublexec.css similarity index 100% rename from style.css rename to ublexec.css diff --git a/ublexec.desktop b/ublexec.desktop index 32baff5..846ac40 100644 --- a/ublexec.desktop +++ b/ublexec.desktop @@ -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 diff --git a/ublexec.glade b/ublexec.glade index c7e888b..b52d4cd 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -28,7 +28,7 @@ Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. UBGroup UBGroup - ru.ublinux.ublexec + com.ublinux.ublexec True gpl-2-0 @@ -66,7 +66,7 @@ 410 240 False - ru.ublinux.ublexec + com.ublinux.ublexec True @@ -1019,7 +1019,7 @@ False - ru.ublinux.ublexec + com.ublinux.ublexec True @@ -1040,7 +1040,7 @@ 6 6 69 - ru.ublinux.ublexec + com.ublinux.ublexec False @@ -1059,8 +1059,8 @@ 5 6 6 - Running applications as a user with a -specified priority + Run applications as another user +with the specified priority @@ -1862,7 +1862,7 @@ specified priority True False 32 - ru.ublinux.ublexec + com.ublinux.ublexec @@ -1904,7 +1904,7 @@ specified priority False Внимание! - ru.ublinux.ublexec + com.ublinux.ublexec dialog @@ -1965,7 +1965,7 @@ specified priority 500 400 True - ru.ublinux.ublexec + com.ublinux.ublexec dialog True True diff --git a/ublexec.pot b/ublexec.pot index efdccec..78e8b67 100644 --- a/ublexec.pot +++ b/ublexec.pot @@ -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 , 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 \n" +"Language-Team: UBLinux Team \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 "" \ No newline at end of file diff --git a/ublexec_ru.po b/ublexec_ru.po index a427543..84f982c 100644 --- a/ublexec_ru.po +++ b/ublexec_ru.po @@ -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 , 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 \n" -"Language-Team: Russian - UBLinux Team \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 \n" +"Language-Team: Russian - UBLinux Team \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 - " \ No newline at end of file