mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 20:34:16 +02:00
Removing installation script and updating README.md
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,3 +3,5 @@ env
|
||||
.idea
|
||||
__pycache__
|
||||
*.orig
|
||||
dist
|
||||
*.egg-info
|
||||
|
||||
21
README.md
21
README.md
@@ -6,35 +6,22 @@ It has also a management window allowing the user to see all installed applicati
|
||||
- Python3 and QT 5.
|
||||
|
||||
### Requirements
|
||||
#### Debian-based distros
|
||||
- libappindicator3 (for GTK3 desktop environments)
|
||||
#### Debian-based distros
|
||||
- python3-venv
|
||||
#### Arch-based distros
|
||||
- python
|
||||
- python-requests
|
||||
- python-virtualenv
|
||||
- python-pip
|
||||
- python-pyqt5
|
||||
|
||||
### Distribution
|
||||
Currently only available for Arch Linux users via **AUR**. Other distros can install it manually (described bellow).
|
||||
Currently available via **PyPi** (sudo pip3 install fpakman) or **AUR** (for Arch Linux users)
|
||||
|
||||
|
||||
### Installation script
|
||||
You can install the application without compromising your system via the provided installation script called 'install.py'.
|
||||
Type in the terminal:
|
||||
```
|
||||
sudo python3 install.py
|
||||
```
|
||||
If you want to uninstall the application, just call the script the same way.
|
||||
|
||||
To start the application, type in the terminal:
|
||||
```
|
||||
fpakman
|
||||
```
|
||||
|
||||
### Manual installation:
|
||||
The following script shows how to install the application in a separate python environment to not mess up with your
|
||||
system's python libraries. Inside the project directory type:
|
||||
If you prefer a manual and isolated installation, type the following commands within the cloned project folder:
|
||||
```
|
||||
python3 -m venv env
|
||||
env/bin/pip install .
|
||||
|
||||
80
install.py
80
install.py
@@ -1,80 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
################################################################
|
||||
# #
|
||||
# EXECUTE THIS SCRIPT INSIDE THE PROJECT FOLDER AS ROOT #
|
||||
# #
|
||||
################################################################
|
||||
import os
|
||||
import sys
|
||||
from shutil import rmtree
|
||||
|
||||
from fpakman.core import system, flatpak
|
||||
|
||||
if not os.geteuid() == 0:
|
||||
sys.exit("\nOnly root can run this script\n")
|
||||
|
||||
|
||||
runner_file = '/usr/local/bin/fpakman'
|
||||
env_name = 'env'
|
||||
|
||||
|
||||
def log(msg: str):
|
||||
print('[fpakman] {}'.format(msg))
|
||||
|
||||
|
||||
if os.path.exists(runner_file):
|
||||
log('already installed')
|
||||
log('Do you wish to uninstall it ? (y/N)')
|
||||
uninstall = input()
|
||||
|
||||
if uninstall.lower() == 'y':
|
||||
|
||||
if os.path.exists(runner_file):
|
||||
|
||||
try:
|
||||
os.remove(runner_file)
|
||||
except:
|
||||
log("Could not remove the runner file '{}'".format(runner_file))
|
||||
log("Aborting...")
|
||||
exit(1)
|
||||
|
||||
if os.path.exists('{}/{}'.format(os.getcwd(), env_name)):
|
||||
try:
|
||||
rmtree(env_name)
|
||||
except:
|
||||
log("Could not remove the virtualenv '{}'".format(env_name))
|
||||
log("Aborting")
|
||||
exit(1)
|
||||
|
||||
log("Successfully uninstalled")
|
||||
|
||||
else:
|
||||
log('Aborting...')
|
||||
else:
|
||||
if flatpak.get_version is None:
|
||||
print('flatpak seems not to be installed. Aborting...')
|
||||
exit(1)
|
||||
|
||||
if not os.path.exists('env'):
|
||||
log("Creating a new 'virtualenv' as '{}'...".format(env_name))
|
||||
res = system.run_cmd('python3 -m venv ' + env_name)
|
||||
|
||||
if res is None:
|
||||
log("Could create a virtualenv for installation. Check if 'virtualenv' is installed.")
|
||||
log('Aborting...')
|
||||
exit(1)
|
||||
|
||||
res = system.run_cmd('env/bin/pip install .')
|
||||
|
||||
if res:
|
||||
log("Creating runner as '{}'".format(runner_file))
|
||||
with open(runner_file, 'w+') as f:
|
||||
f.write('#!/bin/bash\n{d}/env/bin/fpakman'.format(d=os.getcwd()))
|
||||
|
||||
system.run_cmd('chmod +x ' + runner_file)
|
||||
|
||||
log('Successfully installed')
|
||||
else:
|
||||
log('Could not install python requirements to the virtualenv')
|
||||
log('Aborting...')
|
||||
exit(1)
|
||||
Reference in New Issue
Block a user