python3: sync build rules with python's

This patch is a mess [to say the least].
I created a diff of the python and python3 folders and copied and updated the build rules from python to python3.

After some tests I validated that it works.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>