From e9f98dab4e74da204d0d90cea7b6df7470da8fe9 Mon Sep 17 00:00:00 2001 From: denes Date: Sun, 19 Aug 2018 11:00:43 +0200 Subject: [PATCH] Debian package creator script --- README.md | 15 ++++++++++--- debian/package-deb.sh | 51 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) create mode 100755 debian/package-deb.sh diff --git a/README.md b/README.md index 343d50c..ff543ac 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Battery Status LED Battery (low/critical) status indication by making a (the capslock) LED blink -## Prerequisites +## Prerequisites: Make sure you have your laptop's ACPI module compiled into your kernel: ``` Device Drivers > X86 Platform Specific Device Drivers @@ -9,7 +9,7 @@ Device Drivers > X86 Platform Specific Device Drivers For example: Asus laptop extras, ThinkPad ACPI Laptop Extras, etc. -## Usage +## Usage: Execute the script as a root user: ``` /usr/bin/battery_status_led.sh @@ -36,7 +36,16 @@ ebuild battery_status_led-0.1.ebuild digest emerge battery_status_led ``` -## Note +## Creating a debian package and installing it: +``` +cd DIR +git clone https://github.com/dmatetelki/battery_status_led +cd battery_status_led/debian +./package.deb +sudo dpkg -i ./batterystatusled_0.1-1.deb +``` + +## Note: Did you know that the CapsLock key can be turned into another Ctrl? Add the following lines to `~/.Xmodmap` : ``` diff --git a/debian/package-deb.sh b/debian/package-deb.sh new file mode 100755 index 0000000..da19852 --- /dev/null +++ b/debian/package-deb.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# Copyright 2018 Denes Matetelki + +# This file is part of battery_status_led. + +# battery_status_led is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License v3 as published by the Free +# Software Foundation. + +# battery_status_led 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 v3 for +# more details. + +# You should have received a copy of the GNU General Public License v3 along +# with battery_status_led. If not, see +# https://www.gnu.org/licenses/gpl-3.0.html. + +VERSION="0.1-1" +rm -rf build* + +mkdir -p build/batterystatusled_${VERSION}/DEBIAN +# cp control build/batterystatusled_${VERSION}/DEBIAN/control + +cat > build/batterystatusled_${VERSION}/DEBIAN/control < +Description: Battery Status LED + Battery (low/critical) status indication by making a (the capslock) LED blink" +EOL + +mkdir -p build/batterystatusled_${VERSION}/lib/systemd/system +cp ../battery_status_led.service build/batterystatusled_${VERSION}/lib/systemd/system + +mkdir -p build/batterystatusled_${VERSION}/usr/bin +cp ../battery_status_led.sh build/batterystatusled_${VERSION}/usr/bin + +mkdir -p build/batterystatusled_${VERSION}/usr/share/doc/ +cp ../README.md build/batterystatusled_${VERSION}/usr/share/doc/ + +cd build +dpkg-deb --build batterystatusled_${VERSION} + +cd .. +mv build/batterystatusled_${VERSION}.deb . +rm -rf build \ No newline at end of file