Update, move and create some project files

This commit is contained in:
Matti Viljanen 2020-04-26 11:27:37 +03:00
parent 6beba35d0f
commit 4b6609f56b
No known key found for this signature in database
GPG key ID: CF32A1495158F888
7 changed files with 15 additions and 62 deletions

View file

@ -14,6 +14,7 @@ TARGET = harbour-batterybuddy
CONFIG += console sailfishapp sailfishapp_i18n
# Keep this in sync with "service.pro"
VER = 2.2
REL = 2
@ -42,9 +43,7 @@ DISTFILES += qml/harbour-batterybuddy.qml \
qml/pages\LicensePage.qml \
qml/cover/CoverPage.qml \
../rpm/harbour-batterybuddy.spec \
service/clear-write-permissions.sh \
service/harbour-batterybuddy.service \
service/set-write-permissions.sh \
translations/*.ts \
harbour-batterybuddy.desktop \
qml/pages/MainPage.qml \
@ -59,17 +58,14 @@ SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
TRANSLATIONS += translations/*.ts
OTHER_FILES += service/clear-write-permissions.sh \
service/harbour-batterybuddy.service \
service/set-write-permissions.sh
# Executable provided by "service.pro"
OTHER_FILES += service/harbour-batterybuddy.service
service.files = service
service.path = /usr/share/$${TARGET}
INSTALLS += service
SUBDIRS += service
# Begin: include sound files
#OTHER_FILES += sounds/upperLimit.ogg \

View file

@ -18,11 +18,7 @@
Description=Battery Buddy file permission daemon
[Service]
Type=oneshot
ExecStart=/usr/share/harbour-batterybuddy/service/set-write-permissions.sh
RemainAfterExit=true
ExecStop=/usr/share/harbour-batterybuddy/service/clear-write-permissions.sh
StandardOutput=journal
ExecStart=/usr/bin/harbour-batterybuddy-daemon
[Install]
WantedBy=multi-user.target

View file

@ -1,5 +1,5 @@
#!/bin/bash
SPEC=rpm/$1.spec
SPEC=../rpm/$1.spec
if [[ $(grep "^Version: $2$" $SPEC | wc -l) = 0 ]]
then
sed -i "/^Version: /c\Version: $2" $SPEC

View file

@ -71,7 +71,6 @@ desktop-file-install --delete-original \
%posttrans
systemctl disable --now harbour-batterybuddy.service
cp %{_datadir}/%{name}/service/harbour-batterybuddy.service /etc/systemd/system/
chmod 755 %{_datadir}/%{name}/service/*.sh
systemctl enable --now harbour-batterybuddy.service
%postun

View file

@ -1,22 +0,0 @@
#!/bin/bash
# Battery Buddy, a Sailfish application to prolong battery lifetime
#
# Copyright (C) 2019-2020 Matti Viljanen
#
# Battery Buddy is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Battery Buddy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU General Public License for more details. You should have received a copy of the GNU
# General Public License along with Battery Buddy. If not, see <http://www.gnu.org/licenses/>.
#
# Author: Matti Viljanen
chmod 644 /sys/class/power_supply/battery/input_suspend 2>/dev/null
chmod 644 /sys/class/power_supply/battery/charging_enabled 2>/dev/null
chmod 644 /sys/class/power_supply/usb/charger_disable 2>/dev/null
exit 0

View file

@ -1,8 +1,16 @@
TARGET = harbour-batterybuddy-daemon
CONFIG = qt c++11 sailfish_build
CONFIG = qt console c++11 sailfish_build
QT = dbus network xml
QT = core network
# Keep this in sync with "application.pro"
VER = 2.2
REL = 2
VERSION = $${VER}-$${REL}
DEFINES += APP_VERSION=\"\\\"$$VERSION\\\"\"
DEFINES += APP_NAME=\"\\\"$$TARGET\\\"\"
HEADERS += \
src/filewatcher.h
@ -13,8 +21,6 @@ SOURCES += \
OTHER_FILES += harbour-batterybuddy-daemon.service
#include($$PWD/../common/common.pri)
service.path = /usr/lib/systemd/user/
service.files += harbour-batterybuddy-daemon.service
target.path = /usr/bin/

View file

@ -1,22 +0,0 @@
#!/bin/bash
# Battery Buddy, a Sailfish application to prolong battery lifetime
#
# Copyright (C) 2019-2020 Matti Viljanen
#
# Battery Buddy is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Battery Buddy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU General Public License for more details. You should have received a copy of the GNU
# General Public License along with Battery Buddy. If not, see <http://www.gnu.org/licenses/>.
#
# Author: Matti Viljanen
chmod 666 /sys/class/power_supply/battery/input_suspend 2>/dev/null
chmod 666 /sys/class/power_supply/battery/charging_enabled 2>/dev/null
chmod 666 /sys/class/power_supply/usb/charger_disable 2>/dev/null
exit 0