diff --git a/Makefile b/Makefile index 3e1b1b6..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,27 +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/ ${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/source/ublexec.cc b/source/ublexec.cc index 006ed41..5a4a1ff 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -183,7 +183,6 @@ void MainWindow::localization() { lblSystem->set_text(_("System")); btnListApp->set_tooltip_text(_("Application Overview")); btnFilemaneg->set_tooltip_text(_("File Overview")); - } void MainWindow::event() {