Removing installation script and updating README.md

This commit is contained in:
Vinicius Moreira
2019-06-18 15:13:00 -03:00
parent 4cb93fd535
commit 175d72d371
4 changed files with 6 additions and 98 deletions

2
.gitignore vendored
View File

@@ -3,3 +3,5 @@ env
.idea .idea
__pycache__ __pycache__
*.orig *.orig
dist
*.egg-info

View File

@@ -6,35 +6,22 @@ It has also a management window allowing the user to see all installed applicati
- Python3 and QT 5. - Python3 and QT 5.
### Requirements ### Requirements
#### Debian-based distros
- libappindicator3 (for GTK3 desktop environments) - libappindicator3 (for GTK3 desktop environments)
#### Debian-based distros
- python3-venv - python3-venv
#### Arch-based distros #### Arch-based distros
- python - python
- python-requests - python-requests
- python-virtualenv
- python-pip - python-pip
- python-pyqt5 - python-pyqt5
### Distribution ### 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: ### Manual installation:
The following script shows how to install the application in a separate python environment to not mess up with your If you prefer a manual and isolated installation, type the following commands within the cloned project folder:
system's python libraries. Inside the project directory type:
``` ```
python3 -m venv env python3 -m venv env
env/bin/pip install . env/bin/pip install .

View File

@@ -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)

View File

@@ -41,7 +41,6 @@ setup(
classifiers=[ classifiers=[
'Topic :: Utilities', 'Topic :: Utilities',
'Programming Language :: Python', 'Programming Language :: Python',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7' 'Programming Language :: Python :: 3.7'