Remove build utilities, add install script

This commit is contained in:
2025-06-10 17:15:05 +02:00
parent bf244c7dab
commit af4b697e01
8 changed files with 126 additions and 68 deletions

View File

@@ -1,22 +0,0 @@
# Maintainer: Janis Hutz <development@janishutz.com>
pkgname=biogascontrollerapp
pkgver=3.0
pkgrel=1
pkgdesc="Utility Software to control the Biogas plant of ENATECH at KSWO"
arch=('x86_64')
url="https://github.com/janishutz/BiogasControllerApp"
license=('GPL-3.0-or-later')
depends=('python')
makedepends=('pyinstaller' 'python-setuptools')
source=("biogascontrollerapp/biogascontrollerapp.py")
sha256sums=('SKIP') # Replace with actual checksum for production use
# TODO: Update source to be from upstream so only PKGBUILD can be distributed
build() {
cd "$srcdir"
pyinstaller --onefile biogascontrollerapp.py
}
package() {
install -Dm755 "$srcdir/dist/myscript" "$pkgdir/usr/bin/myscript"
}

View File

@@ -36,10 +36,17 @@ If you are here to read the code, the files you are most likely looking for can
- Focus on code quality and readability as well as stability
- Tips to resolve errors directly in the app
- The app is still maintained and as such known issues will be resolved
- Installer for Windows, deb, rpm and arch package available
- Clean UI focusing on ease of use
- Documented code so you can more easily understand what is happening
# Installation
To install it, navigate to the releases tab on the right hand side. Click the current release, scroll down to assets and select the version appropriate for your operating system.
That means:
- on Windows, select BiogasControllerApp-Windows.zip
- on Linux, you may download the tarball or you may also download the `install-linux.sh` script to automatically install it for you. Just note: You need to enable execute permissions for the file!
Compared to older versions, the new BiogasControllerApp doesn't install itself as an app and only resides in a folder where you can launch it using the executable or the `launch.sh` script.
# Issues
If you encounter any bugs or other weird behaviour, please open an issue on this GitHub repository.
@@ -48,19 +55,19 @@ If you encounter any bugs or other weird behaviour, please open an issue on this
You may find documentation for this project in its wiki here on GitHub. The code is also documented with explanations what it does
# Officially Supported OS
- Microsoft Windows 10, 11 (through my installer, may though support older Versions but this is not verified. Open an issue if you have managed to run it on an older version of Windows)
- Microsoft Windows 10, 11 (through the provided compiled package, might work on older versions as well)
- Microsoft Windows XP, Vista, 7, 8, 10, 11 (through running the package with Python yourself)
- MacOS 10.9 (Mavericks) or later (required by Python)
- GNU/Linux: All distros that support Python 3.8 or later
- GNU/Linux: All distros that support Python 3.8 or later (use `install-linux.sh` to install and `launch.sh` to launch for convenience)
- FreeBSD: If you have Pyhton 3.8 or later installed
## Dependencies
Only needed if you run with python directly
- Python 3.10 - 3.12 (only tested on this version, but should work down to at least 3.8 and with the latest versions)
- kivy
- Python 3.10 - latest (only tested on this version, but should work down to at least 3.8)
- kivy[base]
- pyserial
To install them, run `pip install -r requirements.txt`
To install them, run `pip install -r requirements.txt` in the `biogascontrollerapp/` directory
# Contributing
If you wish to contribute to this project, please fork this repository, create a new branch in your fork, make your changes and open a pull request in this repo.

94
install-linux.sh Executable file
View File

@@ -0,0 +1,94 @@
#!/bin/sh
# Create virtual environment to not clutter up local python install
echo "
___ ___ _ _ _ _____
( _ \ _ ( _ \ ( )_ (_ )(_ ) ( _ )
| (_) )_) _ __ _ _ ___| ( (_) _ ___ | _)_ __ _ | | | | __ _ __| (_) |_ _ _ _
| _ (| |/ _ \ / _ \/ _ ) __) | _ / _ \/ _ \ | ( __)/ _ \ | | | | / __ \ __) _ ) _ \( _ \
| (_) ) | (_) ) (_) | (_| |__ \ (_( ) (_) ) ( ) | |_| | ( (_) )| | | |( ___/ | | | | | (_) ) (_) )
(____/(_)\___/ \__ |\__ _)____/____/ \___/(_) (_)\__)_) \___/(___)___)\____)_) (_) (_) __/| __/
( )_) | | | | |
\___/ (_) (_)
WELCOME! This script will automatically install BiogasControllerApp for you!
We first have to ask a few questions. If you are unsure what they mean,
simply press enter to use default options, which are designed to make
uninstalling much easier. The default option is highlighted using capital
letters.
Please ensure you have wget installed. The script will verify and tell you
if you do not have it installed
If this script is not inside a full copy of the BiogasControllerApp repo,
the repo will be automatically downloaded for you.
"
use_venv=""
read -p "Install dependencies in a virtual environment? (Y/n) " use_venv
use_venv=$(echo "$use_venv" | tr '[:upper:]' '[:lower:]')
echo "\n => Checking for repo..."
if [[ -f ./biogascontrollerapp/biogascontrollerapp.py ]]; then
echo "\n -> Data found, not downloading"
else
do_download=""
read -p " -> Data not found, okay to download? (Y/n) " do_download
do_download=$(echo "$do_download" | tr '[:upper:]' '[:lower:]')
if [[ "$do_download" == "y" || "$do_download" == "" ]]; then
# Check if wget is installed
if [[ !command -v wget >/dev/null 2>&1 ]]; then
echo "wget unavailable. Please install using your distribution's package manager or manually download the repo from GitHub releases"
echo 1
fi
# Download the latest release package
wget https://github.com/janishutz/BiogasControllerApp/releases/latest/download/biogascontrollerapp-linux.tar.gz
# Extract the tar (as tar is basically standard on all distros)
tar -xf ./biogascontrollerapp-linux.tar.gz
# Remove tarball (to keep it clean)
rm ./biogascontrollerapp.tar.gz
cd biogascontrollerapp/
else
echo "Please download the repo manually and execute the script inside the downloaded repo from GitHub releases"
exit 1
fi
fi
# We are now guaranteed to be in the base directory of the repo
# cd into biogascontrollerapp directory
cd ./biogascontrollerapp/
# Set up venv if selected
if [[ "$use_venv" == "y" || "$use_venv" == "" ]]; then
python -m venv .venv
if [[ "$SHELL" == "fish" ]]; then
source ./.venv/bin/activate.fish
elif [[ "$SHELL" == "csh" ]]; then
source ./.venv/bin/activate.csh
else
source ./.venv/bin/activate
fi
if [[ !command -v deactivate >/dev/null 2>&1 ]]; then
echo "Virtual environment could not be activated.
You may install the dependencies by changing to the biogascontrollerapp directory and running
pip install -r requirements.txt"
exit 1
fi
fi
pip install -r requirements.txt
echo "
==> Installation complete!
"

19
launch.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
use_venv="y"
if [[ -f ./biogascontrollerapp/.venv/bin/activate ]]; then
if [[ "$SHELL" == "fish" ]]; then
source ./.venv/bin/activate.fish
elif [[ "$SHELL" == "csh" ]]; then
source ./.venv/bin/activate.csh
else
source ./.venv/bin/activate
fi
if [[ !command -v deactivate >/dev/null 2>&1 ]]; then
echo "Virtual environment could not be activated. Trying to run anyway"
fi
fi
cd ./biogascontrollerapp/
python biogascontrollerapp.py

View File

@@ -1,8 +0,0 @@
#!/bin/sh
# Build deb
dpkg-deb --build deb
# Build rpm
rpmbuild -ba ./rpm-build/SPECS/biogascontrollerapp.spec

View File

@@ -1,7 +0,0 @@
Package: biogascontrollerapp
Version: 3.0
Section: education
Priority: optional
Architecture: amd64
Maintainer: Janis Hutz <development@janishutz.com>
Description: Utility Software to control the Biogas plant of ENATECH at KSWO

View File

@@ -1,25 +0,0 @@
Name: biogascontrollerapp
Version: 3.0
Release: 1%{?dist}
Summary: Utility Software to control the Biogas plant of ENATECH at KSWO
License: GPL
URL: http://github.com/janishutz/BiogasControllerApp
Source0: biogascontrollerapp-3.0.tar.gz
%description
Utility Software to control the Biogas plant of ENATECH at KSWO
%prep
%setup -q
%build
%install
mkdir -p %{buildroot}/usr/local/bin
cp biogascontrollerapp %{buildroot}/usr/local/bin/
%files
/usr/local/bin/biogascontrollerapp
%changelog