diff --git a/PKGBUILD b/PKGBUILD index 70c670a..6b61cfd 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,45 +4,43 @@ pkgname=kdeplasma-applets-pytextmonitor _pkgname=py-text-monitor pkgver=1.3.4 -pkgrel=5 +pkgrel=6 _dtengine=ext-sysmon _dtver=1.2 pkgdesc="Minimalistic Plasmoid script written on Python2. It looks like widgets in awesome-wm" arch=(any) url="https://github.com/arcan1s/pytextmonitor" license=('GPL') -depends=('kdebindings-python2' 'lm_sensors' 'net-tools') -optdepends=('hddtemp: for HDD temperature monitor' - 'catalyst: for GPU monitor' - 'nvidia-utils: for GPU monitor') -makedepends=('unzip' 'cmake' 'automoc4') +depends=('kdebase-workspace' 'kdebindings-python2' 'lm_sensors' 'net-tools') +optdepends=("hddtemp: for HDD temperature monitor" + "catalyst: for GPU monitor" + "nvidia-utils: for GPU monitor") +makedepends=('cmake' 'automoc4') source=(https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_pkgname}-${pkgver}.plasmoid https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_dtengine}-${_dtver}.zip) install=${pkgname}.install -md5sums=('cdc55960177a07b52ab0a2713f5df212' - '9dfc23f75d330fcb3b8a9cfa20b7717a') +md5sums=('7cca5fd76735add215f35d406c020dea' + '9b547781732ab19ad103710b7bd07d8d') build () { # build dataengine - unzip -o -q ${srcdir}/${_dtengine}-${_dtver}.zip -d ${srcdir}/${_dtengine} if [ -d ${srcdir}/${_dtengine}/build ]; then rm -r ${srcdir}/${_dtengine}/build fi mkdir ${srcdir}/${_dtengine}/build && cd ${srcdir}/${_dtengine}/build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ../ - make + cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=Release ../ + make || return 1 } -package() +package() { # install dataengine cd ${srcdir}/${_dtengine}/build - make DESTDIR=${pkgdir} install + make DESTDIR=${pkgdir} install || return 1 # install plasmoid - unzip -o -q ${srcdir}/${_pkgname}-${pkgver}.plasmoid -d ${srcdir}/${_pkgname} - install -D ${srcdir}/${_pkgname}/metadata.desktop ${pkgdir}/`kde4-config --prefix`/share/kde4/services/${_pkgname}.desktop - mkdir -p ${pkgdir}/`kde4-config --prefix`/share/apps/plasma/plasmoids/${_pkgname} - cp -r ${srcdir}/${_pkgname}/* ${pkgdir}/`kde4-config --prefix`/share/apps/plasma/plasmoids/${_pkgname}/ + install -D ${srcdir}/metadata.desktop ${pkgdir}/`kde4-config --prefix`/share/kde4/services/${_pkgname}.desktop || return 1 + install -D ${srcdir}/metadata.desktop ${pkgdir}/`kde4-config --prefix`/share/apps/plasma/plasmoids/${_pkgname}/metadata.desktop || return 1 + cp -r ${srcdir}/contents ${pkgdir}/`kde4-config --prefix`/share/apps/plasma/plasmoids/${_pkgname}/ || return 1 } diff --git a/create_archive.sh b/create_archive.sh new file mode 100755 index 0000000..f3c1450 --- /dev/null +++ b/create_archive.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# build dataengine +ARCHIVE="ext-sysmon" +VERSION=`grep Version ext-sysmon/plasma-engine-extsysmon.desktop | awk -F "=" '{print $2}'` +# create archive +if [ -e ${ARCHIVE}-${VERSION}.zip ]; then + rm -f ${ARCHIVE}-${VERSION}.zip +fi +zip -9 -y -r -q ${ARCHIVE}-${VERSION}.zip ${ARCHIVE} +# update md5sum +MD5SUMS=`md5sum ${ARCHIVE}-${VERSION}.zip | awk '{print $1}'` +sed -i "/ '[0-9A-Fa-f]*/s/[^'][^)]*/ '${MD5SUMS}'/" PKGBUILD +sed -i "s/_dtver=[0-9.]*/_dtver=${VERSION}/" PKGBUILD + +# build widget +cd sources +FILES="contents metadata.desktop" +ARCHIVE="py-text-monitor" +VERSION=`grep Version metadata.desktop | awk -F "=" '{print $2}'` +# create archive +if [ -e ${ARCHIVE}-${VERSION}.plasmoid ]; then + rm -f ${ARCHIVE}-${VERSION}.plasmoid +fi +zip -9 -y -r -q ../${ARCHIVE}-${VERSION}.plasmoid ${FILES} +cd .. +# update md5sum +MD5SUMS=`md5sum ${ARCHIVE}-${VERSION}.plasmoid | awk '{print $1}'` +sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" PKGBUILD +sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" PKGBUILD diff --git a/ext-sysmon-1.2.zip b/ext-sysmon-1.2.zip index 25c9496..6ea64cd 100644 Binary files a/ext-sysmon-1.2.zip and b/ext-sysmon-1.2.zip differ diff --git a/ext-sysmon/CMakeLists.txt b/ext-sysmon/CMakeLists.txt index d598657..2aaef1f 100644 --- a/ext-sysmon/CMakeLists.txt +++ b/ext-sysmon/CMakeLists.txt @@ -1,24 +1,24 @@ -project (extsysmon) - -# Find the required Libaries +# set project name +project (plasma_engine_extsysmon) + +# find required libaries find_package (KDE4 REQUIRED) include (KDE4Defaults) - -add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories (${CMAKE_SOURCE_DIR} - ${CMAKE_BINARY_DIR} + +add_definitions (${QT_DEFINITIONS} + ${KDE4_DEFINITIONS}) +include_directories (${CMAKE_SOURCE_DIR} + ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES}) -set (extsysmon_engine_SRCS extsysmon.cpp) - -# Now make sure all files get to the right place -kde4_add_plugin (plasma_engine_extsysmon ${extsysmon_engine_SRCS}) -target_link_libraries(plasma_engine_extsysmon - ${KDE4_KDECORE_LIBS} - ${KDE4_PLASMA_LIBS}) - -install(TARGETS plasma_engine_extsysmon - DESTINATION ${PLUGIN_INSTALL_DIR}) - -install(FILES plasma-engine-extsysmon.desktop - DESTINATION ${SERVICES_INSTALL_DIR}) +set (PLUGIN_NAME ${PROJECT_NAME}) +file (GLOB PROJECT_DESKTOP *.desktop) +file (GLOB PROJECT_SRCS *.cpp) + +# make +kde4_add_plugin (${PLUGIN_NAME} ${PROJECT_SRCS}) +target_link_libraries (${PLUGIN_NAME} ${KDE4_KDECORE_LIBS} ${KDE4_PLASMA_LIBS}) + +# install +install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}) +install(FILES ${PROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/ext-sysmon/plasma-engine-extsysmon.desktop b/ext-sysmon/plasma-engine-extsysmon.desktop index 31f1d64..693a027 100644 --- a/ext-sysmon/plasma-engine-extsysmon.desktop +++ b/ext-sysmon/plasma-engine-extsysmon.desktop @@ -9,7 +9,8 @@ Icon=utilities-system-monitor X-KDE-ServiceTypes=Plasma/DataEngine X-KDE-Library=plasma_engine_extsysmon X-Plasma-EngineName=ext-sysmon -X-KDE-PluginInfo-Author=Evgeniy Alexeev aka arcanis + +X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis X-KDE-PluginInfo-Email=esalexeev@gmail.com X-KDE-PluginInfo-Name=ext-sysmon X-KDE-PluginInfo-Version=1.2 diff --git a/kdeplasma-applets-pytextmonitor.install b/kdeplasma-applets-pytextmonitor.install index d7ee1f1..a74b64f 100644 --- a/kdeplasma-applets-pytextmonitor.install +++ b/kdeplasma-applets-pytextmonitor.install @@ -4,6 +4,9 @@ post_install() Update plasmoids... EOF kbuildsycoca4 > /dev/null 2>&1 + cat << EOF +Make sure that `hddtemp` can be run as non-root +EOF } post_upgrade() diff --git a/py-text-monitor-1.3.4.plasmoid b/py-text-monitor-1.3.4.plasmoid index f7100d6..c9f2503 100644 Binary files a/py-text-monitor-1.3.4.plasmoid and b/py-text-monitor-1.3.4.plasmoid differ diff --git a/src/contents/code/config.py b/sources/contents/code/config.py similarity index 100% rename from src/contents/code/config.py rename to sources/contents/code/config.py diff --git a/src/contents/code/configdef.py b/sources/contents/code/configdef.py similarity index 100% rename from src/contents/code/configdef.py rename to sources/contents/code/configdef.py diff --git a/src/contents/code/configwindow.py b/sources/contents/code/configwindow.py similarity index 100% rename from src/contents/code/configwindow.py rename to sources/contents/code/configwindow.py diff --git a/src/contents/code/dataengine.py b/sources/contents/code/dataengine.py similarity index 100% rename from src/contents/code/dataengine.py rename to sources/contents/code/dataengine.py diff --git a/src/contents/code/main.py b/sources/contents/code/main.py similarity index 100% rename from src/contents/code/main.py rename to sources/contents/code/main.py diff --git a/src/contents/code/reinit.py b/sources/contents/code/reinit.py similarity index 100% rename from src/contents/code/reinit.py rename to sources/contents/code/reinit.py diff --git a/src/contents/code/util.py b/sources/contents/code/util.py similarity index 100% rename from src/contents/code/util.py rename to sources/contents/code/util.py diff --git a/src/contents/ui/configwindow.ui b/sources/contents/ui/configwindow.ui similarity index 100% rename from src/contents/ui/configwindow.ui rename to sources/contents/ui/configwindow.ui diff --git a/src/metadata.desktop b/sources/metadata.desktop similarity index 90% rename from src/metadata.desktop rename to sources/metadata.desktop index f2180cb..8034900 100644 --- a/src/metadata.desktop +++ b/sources/metadata.desktop @@ -9,7 +9,7 @@ X-Plasma-API=python X-Plasma-MainScript=code/main.py X-Plasma-RequiredExtensions=LaunchApp,LocalIO,FileDialog -X-KDE-PluginInfo-Author=Evgeniy Alexeev aka arcanis +X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis X-KDE-PluginInfo-Email=esalexeev@gmail.com X-KDE-PluginInfo-Name=py-text-monitor X-KDE-PluginInfo-Version=1.3.4