You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
3.2 KiB
96 lines
3.2 KiB
#!/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.
|
|
|
|
NAME="battery-status-led"
|
|
VERSION="0.1-1"
|
|
|
|
rm -rf build*
|
|
mkdir -p build/${NAME}_${VERSION}/DEBIAN
|
|
|
|
cat > build/${NAME}_${VERSION}/DEBIAN/control <<EOL
|
|
Package: ${NAME}
|
|
Version: ${VERSION}
|
|
Section: misc
|
|
Priority: optional
|
|
Architecture: amd64
|
|
Maintainer: Denes Matetelki <denes@matetelki.com>
|
|
Description: Blink a LED on low battery
|
|
Battery (low/critical) status indication by making a (the capslock) LED blink"
|
|
EOL
|
|
|
|
cat > build/copyright <<EOL
|
|
Copyright (c) 2018 Denes Matetelki
|
|
|
|
License: GPL-3+
|
|
This program 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.
|
|
.
|
|
This program 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 this package; if not, write to the Free
|
|
Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Boston, MA 02110-1301 USA
|
|
.
|
|
On Debian systems, the full text of the GNU General Public
|
|
License version 3 can be found in the file
|
|
'/usr/share/common-licenses/GPL-3'.
|
|
EOL
|
|
|
|
cat > build/changelog.Debian <<EOL
|
|
battery-status-led (0.1-1) misc; urgency=low
|
|
|
|
* Initial release
|
|
|
|
-- Denes Matetelki <denes@matetelki.com> Fri, 31 Aug 2018 12:00:00 +0100
|
|
EOL
|
|
|
|
mkdir -m 0755 -p build/${NAME}_${VERSION}/lib/systemd/system
|
|
cp ../${NAME}.service build/${NAME}_${VERSION}/lib/systemd/system/
|
|
|
|
mkdir -m 0755 -p build/${NAME}_${VERSION}/usr/bin
|
|
cp ../${NAME} build/${NAME}_${VERSION}/usr/bin/
|
|
|
|
mkdir -m 0755 -p build/${NAME}_${VERSION}/usr/share/doc/${NAME}
|
|
cp ../README.md build/${NAME}_${VERSION}/usr/share/doc/${NAME}/
|
|
mv build/copyright build/${NAME}_${VERSION}/usr/share/doc/${NAME}
|
|
chmod 0644 build/${NAME}_${VERSION}/usr/share/doc/${NAME}/copyright
|
|
mv build/changelog.Debian build/${NAME}_${VERSION}/usr/share/doc/${NAME}
|
|
gzip -9 -n build/${NAME}_${VERSION}/usr/share/doc/${NAME}/changelog.Debian
|
|
chmod 0644 build/${NAME}_${VERSION}/usr/share/doc/${NAME}/changelog.Debian.gz
|
|
|
|
mkdir -m 0755 -p build/${NAME}_${VERSION}/usr/share/man/man1
|
|
cp ../${NAME}.1 build/${NAME}_${VERSION}/usr/share/man/man1/
|
|
gzip -9 -n build/${NAME}_${VERSION}/usr/share/man/man1/${NAME}.1
|
|
|
|
cd build
|
|
dpkg-deb --root-owner-group --build ${NAME}_${VERSION}
|
|
|
|
cd ..
|
|
mv build/${NAME}_${VERSION}.deb .
|
|
rm -rf build
|
|
|