Added more instructions to INSTALL.md, rearranges the steps and added warning for ubuntu 20 & greater

This commit is contained in:
kuldeep.k@cisinlabs.com 2021-11-15 20:41:57 +05:30
parent 971c79b3f5
commit 8d779f3760
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A
3 changed files with 98 additions and 94 deletions

View File

@ -1,108 +1,87 @@
# PyBitmessage Installation Instructions # PyBitmessage Installation Instructions
- Binary (no separate installation of dependencies required)
- windows (32bit only): https://download.bitmessage.org/snapshots/
- linux (64bit): https://appimage.bitmessage.org/releases/
- mac (64bit, not up to date): https://github.com/Bitmessage/PyBitmessage/releases/tag/v0.6.3
- Source
git clone git://github.com/Bitmessage/PyBitmessage.git
For an up-to-date version of these instructions, please visit the ## Helper Script for building from source
[Bitmessage Wiki](https://bitmessage.org/wiki/Compiling_instructions). Go to the directory with PyBitmessage source code and run:
```
python checkdeps.py
```
If there are missing dependencies, it will explain you what is missing and for many Unix-like systems also what you have to do to resolve it. You need to repeat calling the script until you get nothing mandatory missing. How you then run setuptools depends on whether you want to install it to user's directory or system.
PyBitmessage can be run in either one of two ways: ### If checkdeps fails, then verify manually which dependencies are missing from below
- straight from source
or
- from an installed
package.
## Dependencies
Before running PyBitmessage, make sure you have all the necessary dependencies Before running PyBitmessage, make sure you have all the necessary dependencies
installed on your system. installed on your system.
Here's a list of dependencies needed for PyBitmessage These dependencies may not be available on a recent OS and PyBitmessage may not build on such systems.
- python2.7 Here's a list of dependencies needed for PyBitmessage based on operating system
- python2-qt4 (python-qt4 on Debian/Ubuntu)
- openssl
- (Fedora & Redhat only) openssl-compat-bitcoin-libs
## Running PyBitmessage For Debian-based (Ubuntu, Raspbian, PiBang, others)
PyBitmessage can be run in two ways:
- straight from source
or
- via a package which is installed on your system. Since PyBitmessage is Beta, it is best to run
PyBitmessage from source, so that you may update as needed.
#### Updating
To update PyBitmessage from source (Linux/OS X), you can do these easy steps:
``` ```
cd PyBitmessage/src/ python2.7 openssl libssl-dev git python-msgpack python-qt4 python-six
git fetch --all ```
git reset --hard origin/master For Arch Linux
python bitmessagemain.py ```
python2 openssl git python2-pyqt4 python-six
```
For Fedora
```
python python-qt4 git openssl-compat-bitcoin-libs python-six
```
For Red Hat Enterprise Linux (RHEL)
```
python python-qt4 git openssl-compat-bitcoin-libs python-six
```
For GNU Guix
```
python2-msgpack python2-pyqt@4.11.4 python2-sip openssl python-six
``` ```
Voilà! Bitmessage is updated!
#### Linux ## setuptools
To run PyBitmessage from the command-line, you must download the source, then This is now the recommended and in most cases the easiest procedure for installing PyBitmessage.
There are 3 options for running setuptools: root, user, venv
### as root:
```
python setup.py install
pybitmessage
```
### as user:
```
python setup.py install --user
~/.local/bin/pybitmessage
```
### as venv:
Create virtualenv with Python 2.x version
```
virtualenv -p python2 env
```
Activate env
```
source env/bin/activate
```
Install requirements.txt
```
pip install -r requirements.txt
```
Build & run pybitmessage
```
python setup.py install
pybitmessage
```
## Alternative way to run PyBitmessage, without setuptools (this isn't recommended)
run `src/bitmessagemain.py`. run `src/bitmessagemain.py`.
``` ```
git clone git://github.com/Bitmessage/PyBitmessage.git
cd PyBitmessage/ && python src/bitmessagemain.py cd PyBitmessage/ && python src/bitmessagemain.py
``` ```
That's it! *Honestly*!
#### Windows
On Windows you can download an executable for Bitmessage
[here](https://github.com/Bitmessage/PyBitmessage/releases/download/0.6.3.2/Bitmessage_x86_0.6.3.2.exe).
However, if you would like to run PyBitmessage via Python in Windows, you can
go [here](https://bitmessage.org/wiki/Compiling_instructions#Windows) for
information on how to do so.
#### OS X
First off, install Homebrew.
```
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
Now, install the required dependencies
```
brew install git python openssl cartr/qt4/pyqt@4
```
Download and run PyBitmessage:
```
git clone git://github.com/Bitmessage/PyBitmessage.git
cd PyBitmessage && python src/bitmessagemain.py
```
## Creating a package for installation
If you really want, you can make a package for PyBitmessage, which you may
install yourself or distribute to friends. This isn't recommended, since
PyBitmessage is in Beta, and subject to frequent change.
#### Linux
First off, since PyBitmessage uses something nifty called
[packagemonkey](https://github.com/fuzzgun/packagemonkey), go ahead and get
that installed. You may have to build it from source.
Next, edit the generate.sh script to your liking.
Now, run the appropriate script for the type of package you'd like to make
```
arch.sh - create a package for Arch Linux
debian.sh - create a package for Debian/Ubuntu
ebuild.sh - create a package for Gentoo
osx.sh - create a package for OS X
puppy.sh - create a package for Puppy Linux
rpm.sh - create a RPM package
slack.sh - create a package for Slackware
```
#### OS X
Please refer to
[this page](https://bitmessage.org/forum/index.php/topic,2761.0.html) on the
forums for instructions on how to create a package on OS X.
Please note that some versions of OS X don't work.
#### Windows
## TODO: Create Windows package creation instructions

View File

@ -47,6 +47,7 @@ EXTRAS_REQUIRE_DEPS = {
"Debian": ["libcap-dev python-prctl"], "Debian": ["libcap-dev python-prctl"],
"Ubuntu": ["libcap-dev python-prctl"], "Ubuntu": ["libcap-dev python-prctl"],
"Ubuntu 12": ["libcap-dev python-prctl"], "Ubuntu 12": ["libcap-dev python-prctl"],
"Ubuntu 20": [""],
"openSUSE": [""], "openSUSE": [""],
"Fedora": ["prctl"], "Fedora": ["prctl"],
"Guix": [""], "Guix": [""],
@ -162,6 +163,10 @@ for lhs, rhs in EXTRAS_REQUIRE.items():
"Optional dependency `pip install .[{}]` would require `{}`" "Optional dependency `pip install .[{}]` would require `{}`"
" to be run as root".format(lhs, rhs_cmd)) " to be run as root".format(lhs, rhs_cmd))
if detectOS.result == "Ubuntu 20":
print(
"Qt interface isn't supported in %s" % detectOS.result)
if (not compiler or prereqs) and OPSYS in PACKAGE_MANAGER: if (not compiler or prereqs) and OPSYS in PACKAGE_MANAGER:
print("You can install the missing dependencies by running, as root:") print("You can install the missing dependencies by running, as root:")
if not compiler: if not compiler:

View File

@ -45,6 +45,7 @@ PACKAGE_MANAGER = {
"Debian": "apt-get install", "Debian": "apt-get install",
"Ubuntu": "apt-get install", "Ubuntu": "apt-get install",
"Ubuntu 12": "apt-get install", "Ubuntu 12": "apt-get install",
"Ubuntu 20": "apt-get install",
"openSUSE": "zypper install", "openSUSE": "zypper install",
"Fedora": "dnf install", "Fedora": "dnf install",
"Guix": "guix package -i", "Guix": "guix package -i",
@ -58,6 +59,7 @@ PACKAGES = {
"Debian": "python-qt4", "Debian": "python-qt4",
"Ubuntu": "python-qt4", "Ubuntu": "python-qt4",
"Ubuntu 12": "python-qt4", "Ubuntu 12": "python-qt4",
"Ubuntu 20": "",
"openSUSE": "python-qt", "openSUSE": "python-qt",
"Fedora": "PyQt4", "Fedora": "PyQt4",
"Guix": "python2-pyqt@4.11.4", "Guix": "python2-pyqt@4.11.4",
@ -75,6 +77,7 @@ PACKAGES = {
"Debian": "python-msgpack", "Debian": "python-msgpack",
"Ubuntu": "python-msgpack", "Ubuntu": "python-msgpack",
"Ubuntu 12": "msgpack-python", "Ubuntu 12": "msgpack-python",
"Ubuntu 20": "",
"openSUSE": "python-msgpack-python", "openSUSE": "python-msgpack-python",
"Fedora": "python2-msgpack", "Fedora": "python2-msgpack",
"Guix": "python2-msgpack", "Guix": "python2-msgpack",
@ -89,6 +92,7 @@ PACKAGES = {
"Debian": "python-pyopencl", "Debian": "python-pyopencl",
"Ubuntu": "python-pyopencl", "Ubuntu": "python-pyopencl",
"Ubuntu 12": "python-pyopencl", "Ubuntu 12": "python-pyopencl",
"Ubuntu 20": "",
"Fedora": "python2-pyopencl", "Fedora": "python2-pyopencl",
"openSUSE": "", "openSUSE": "",
"OpenBSD": "", "OpenBSD": "",
@ -106,11 +110,25 @@ PACKAGES = {
"Debian": "python-setuptools", "Debian": "python-setuptools",
"Ubuntu": "python-setuptools", "Ubuntu": "python-setuptools",
"Ubuntu 12": "python-setuptools", "Ubuntu 12": "python-setuptools",
"Ubuntu 20": "python-setuptools",
"Fedora": "python2-setuptools", "Fedora": "python2-setuptools",
"openSUSE": "python-setuptools", "openSUSE": "python-setuptools",
"Guix": "python2-setuptools", "Guix": "python2-setuptools",
"Gentoo": "dev-python/setuptools", "Gentoo": "dev-python/setuptools",
"optional": False, "optional": False,
},
"six": {
"OpenBSD": "py-six",
"FreeBSD": "py27-six",
"Debian": "python-six",
"Ubuntu": "python-six",
"Ubuntu 12": "python-six",
"Ubuntu 20": "python-six",
"Fedora": "python-six",
"openSUSE": "python-six",
"Guix": "python-six",
"Gentoo": "dev-python/six",
"optional": False,
} }
} }
@ -150,6 +168,8 @@ def detectOSRelease():
pass pass
if detectOS.result == "Ubuntu" and version < 14: if detectOS.result == "Ubuntu" and version < 14:
detectOS.result = "Ubuntu 12" detectOS.result = "Ubuntu 12"
elif detectOS.result == "Ubuntu" and version >= 20:
detectOS.result = "Ubuntu 20"
def try_import(module, log_extra=False): def try_import(module, log_extra=False):