# Need easy help to "port" my Bible app to Freebsd



## hotlittlewhitedog (Apr 15, 2022)

Hi guys  

I'm new to FreeBSD and need a quick help (no coding, just info and maybe easy testing) to "port" my app to FreeBSD. 

The topo: 
My app exists on several packages: PyPI, Snap, Flatpak. 
It's a python app using ncurses and sqlite3. 
The app is of course free and under GPL3. 








						hotlittlewhitedog / BibleMultiTheSonOfMan · GitLab
					

Bible multi languages for Terminal. Easy to use with quick searches, parables, articles, cross references.




					gitlab.com
				




I installed a virtualbox with FreeBSD with python38, sqlite3, pip (as root).
When starting the app as a user, I need your help because I have a R/W error. 
In fact the app needs to copy the INI file and the DB in a user folder for read/write accesses.
I solved the problem of sandbox on Linux, Mac. 
As Python supports FreeBSD and the app seems working, I could support your OS without too much work.

Actually, the app was installed in /usr/home/<user> on FreeBSD. 
i don't know if it's correct, can someone help me? 

You can install the app via: https://pypi.org/project/sonofman/

Some videos: https://asciinema.org/~hlwd

The keys in the app: 
Q) to quit
B) for the books
A) for the articles and check the keys
P) for the parables
M) Menu
Arrow keys) to change page

Thanks a lot


----------



## hotlittlewhitedog (Apr 15, 2022)

Hi Alain De Vos, 
Maybe you can help me, I saw you spoke about Fortune-Bible-KJV and are active on the forum. 
I also live in Belgium XD


----------



## Alexander88207 (Apr 15, 2022)

Here is some initial work:


```
PORTNAME=       sonofman
DISTVERSION=    2.3.0
CATEGORIES=     misc
MASTER_SITES=   CHEESESHOP

MAINTAINER=     Alexander88207@protonmail.com
COMMENT=        Bible for the terminal

LICENSE=        GPLv3

RUN_DEPENDS=    ${PYTHON_PKGNAMEPREFIX}pyperclip>0:devel/py-pyperclip@${PY_FLAVOR}
                ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR}

USES=           python
USE_PYTHON=     autoplist distutils

NO_ARCH=        yes

.include <bsd.port.mk>
```

The files that should be in $HOME are in /usr/local/lib/python3.8/site-packages/

So i think its wrong? Because i needed root to load the text on the first launch.

So you have to write it like that the files that should gets written by $USER are being created in the $HOME directory.


----------



## Alain De Vos (Apr 16, 2022)

You could first try to make it run using pip as regular user.
Then write a freebsd port for it.
The normal install location for python packages was given by Alexander.
Offcourse to start the installed python application one should not need root, that is obvious from security point.
This link might help a bit as it explains the freebsd "pkg" framework used for ports,


			https://docs.freebsd.org/en/books/porters-handbook/book/


----------



## hotlittlewhitedog (Apr 16, 2022)

Thanks for your replies.

I removed what was installed with the root (except python3.8, sqlite) and installed the pypi package as a normal user:

```
pip install sonofman
```

The INI file, DB and the codes were installed in:

```
/usr/home/<user>/.local/lib/python3.8/site-packages/sonofman/*
```

if I go in:

```
/usr/home/<user>/.local/bin/
```
and run 
	
	



```
./som
```
 it works


----------



## Alexander88207 (Apr 16, 2022)

Yeah but the problem is, when you trying it to install as a port/package it fails because your $USER stuff gets installed in the same place as the program which is in situation like this not good.

The DB and the settings file for example should get created/moved/read to $HOME or something like that on the run.

This is not an problem here, its basically a problem everywhere where someone try's to package that app.


----------

