This is a simple python script that calls setup.py bdist_rpm
.
This tool builds RPM SPEC files for PIP package and its dependencies.
pip install git+https://github.com/pavelpatrin/packetizer.git
This tool works in few steps:
- Installs required package (and all dependencies) into
~/rpmbuild/PYTHON/venv
. - Downloads installed package version sources into
~/rpmbuild/PYTHON/temp
. - Builds RPM SPEC file via standard
setup.py bdist_rpm
. - Calls
pipdeptree
to detect installed package dependencies. - Injects
Requires
andConflicts
metadata to built SPEC. - Repeat steps for all detected dependencies.
(Search for keyword "prepared".)
[root@ffee3cc41437 ~]# python3.7 -m packetizer --prefix 'myproject-python37-' --recursive 'WeasyPrint'
Creating temporary: /root/rpmbuild/PYTHON/temp
Creating virtualenv: /root/rpmbuild/PYTHON/venv
Activating virtualenv: /root/rpmbuild/PYTHON/venv
Installing pipdeptree: pipdeptree==0.13.2
Building RPM spec for WeasyPrint
Installing package: WeasyPrint...
Querying version: WeasyPrint...
Querying version: WeasyPrint==48 installed
Querying dependencies: WeasyPrint==48...
Querying dependencies: own: CairoSVG >=2.4.0
Querying dependencies: own: Pyphen >=0.8
Querying dependencies: own: cairocffi >=0.9.0
Querying dependencies: own: cffi >=0.6
Querying dependencies: own: cssselect2 >=0.1
Querying dependencies: own: html5lib >=0.999999999
Querying dependencies: own: setuptools >=39.2.0
Querying dependencies: own: tinycss2 >=1.0.0
Querying dependencies: all: CairoSVG >=2.4.0
Querying dependencies: all: Pyphen >=0.8
Querying dependencies: all: cairocffi
Querying dependencies: all: cairocffi >=0.9.0
Querying dependencies: all: cffi >=0.6
Querying dependencies: all: cffi >=1.1.0
Querying dependencies: all: cssselect2
Querying dependencies: all: cssselect2 >=0.1
Querying dependencies: all: defusedxml
Querying dependencies: all: html5lib >=0.999999999
Querying dependencies: all: pillow
Querying dependencies: all: pycparser
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: six >=1.9
Querying dependencies: all: tinycss2
Querying dependencies: all: tinycss2 >=1.0.0
Querying dependencies: all: webencodings
Querying dependencies: all: webencodings >=0.4
Downloading sources: WeasyPrint==48...
Downloading sources: /root/rpmbuild/SOURCES/WeasyPrint-48.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/WeasyPrint-48.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/WeasyPrint-48 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/WeasyPrint-48...
Building SPEC file: /root/rpmbuild/PYTHON/temp/WeasyPrint-48/dist/WeasyPrint.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/WeasyPrint-48/dist/WeasyPrint.spec...
Querying version: CairoSVG...
Querying version: CairoSVG==2.4.0 installed
Querying dependencies: CairoSVG==2.4.0...
Querying dependencies: own: cairocffi
Querying dependencies: own: cssselect2
Querying dependencies: own: defusedxml
Querying dependencies: own: pillow
Querying dependencies: own: tinycss2
Querying dependencies: all: cairocffi
Querying dependencies: all: cffi >=1.1.0
Querying dependencies: all: cssselect2
Querying dependencies: all: defusedxml
Querying dependencies: all: pillow
Querying dependencies: all: pycparser
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: tinycss2
Querying dependencies: all: webencodings >=0.4
Querying version: Pyphen...
Querying version: Pyphen==0.9.5 installed
Querying dependencies: Pyphen==0.9.5...
Querying version: cairocffi...
Querying version: cairocffi==1.0.2 installed
Querying dependencies: cairocffi==1.0.2...
Querying dependencies: own: cffi >=1.1.0
Querying dependencies: own: setuptools >=39.2.0
Querying dependencies: all: cffi >=1.1.0
Querying dependencies: all: pycparser
Querying dependencies: all: setuptools >=39.2.0
Querying version: cffi...
Querying version: cffi==1.12.3 installed
Querying dependencies: cffi==1.12.3...
Querying dependencies: own: pycparser
Querying dependencies: all: pycparser
Querying version: cssselect2...
Querying version: cssselect2==0.2.1 installed
Querying dependencies: cssselect2==0.2.1...
Querying dependencies: own: tinycss2
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: tinycss2
Querying dependencies: all: webencodings >=0.4
Querying version: html5lib...
Querying version: html5lib==1.0.1 installed
Querying dependencies: html5lib==1.0.1...
Querying dependencies: own: six >=1.9
Querying dependencies: own: webencodings
Querying dependencies: all: six >=1.9
Querying dependencies: all: webencodings
Querying version: setuptools...
Querying version: setuptools==40.8.0 installed
Querying dependencies: setuptools==40.8.0...
Querying version: tinycss2...
Querying version: tinycss2==1.0.2 installed
Querying dependencies: tinycss2==1.0.2...
Querying dependencies: own: setuptools >=39.2.0
Querying dependencies: own: webencodings >=0.4
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: webencodings >=0.4
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-WeasyPrint.spec prepared
Building RPMs for CairoSVG==2.4.0
Querying version: CairoSVG...
Querying version: CairoSVG==2.4.0 installed
Querying dependencies: CairoSVG==2.4.0...
Querying dependencies: own: cairocffi
Querying dependencies: own: cssselect2
Querying dependencies: own: defusedxml
Querying dependencies: own: pillow
Querying dependencies: own: tinycss2
Querying dependencies: all: cairocffi
Querying dependencies: all: cffi >=1.1.0
Querying dependencies: all: cssselect2
Querying dependencies: all: defusedxml
Querying dependencies: all: pillow
Querying dependencies: all: pycparser
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: tinycss2
Querying dependencies: all: webencodings >=0.4
Downloading sources: CairoSVG==2.4.0...
Downloading sources: /root/rpmbuild/SOURCES/CairoSVG-2.4.0.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/CairoSVG-2.4.0.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/CairoSVG-2.4.0 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/CairoSVG-2.4.0...
Building SPEC file: /root/rpmbuild/PYTHON/temp/CairoSVG-2.4.0/dist/CairoSVG.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/CairoSVG-2.4.0/dist/CairoSVG.spec...
Querying version: cairocffi...
Querying version: cairocffi==1.0.2 installed
Querying dependencies: cairocffi==1.0.2...
Querying dependencies: own: cffi >=1.1.0
Querying dependencies: own: setuptools >=39.2.0
Querying dependencies: all: cffi >=1.1.0
Querying dependencies: all: pycparser
Querying dependencies: all: setuptools >=39.2.0
Querying version: cssselect2...
Querying version: cssselect2==0.2.1 installed
Querying dependencies: cssselect2==0.2.1...
Querying dependencies: own: tinycss2
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: tinycss2
Querying dependencies: all: webencodings >=0.4
Querying version: defusedxml...
Querying version: defusedxml==0.6.0 installed
Querying dependencies: defusedxml==0.6.0...
Querying version: pillow...
Querying version: Pillow==6.1.0 installed
Querying dependencies: Pillow==6.1.0...
Querying version: tinycss2...
Querying version: tinycss2==1.0.2 installed
Querying dependencies: tinycss2==1.0.2...
Querying dependencies: own: setuptools >=39.2.0
Querying dependencies: own: webencodings >=0.4
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: webencodings >=0.4
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-CairoSVG.spec prepared
Building RPMs for Pyphen==0.9.5
Querying version: Pyphen...
Querying version: Pyphen==0.9.5 installed
Querying dependencies: Pyphen==0.9.5...
Downloading sources: Pyphen==0.9.5...
Downloading sources: /root/rpmbuild/SOURCES/Pyphen-0.9.5.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/Pyphen-0.9.5.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/Pyphen-0.9.5 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/Pyphen-0.9.5...
Building SPEC file: /root/rpmbuild/PYTHON/temp/Pyphen-0.9.5/dist/Pyphen.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/Pyphen-0.9.5/dist/Pyphen.spec...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-Pyphen.spec prepared
Building RPMs for cairocffi==1.0.2
Querying version: cairocffi...
Querying version: cairocffi==1.0.2 installed
Querying dependencies: cairocffi==1.0.2...
Querying dependencies: own: cffi >=1.1.0
Querying dependencies: own: setuptools >=39.2.0
Querying dependencies: all: cffi >=1.1.0
Querying dependencies: all: pycparser
Querying dependencies: all: setuptools >=39.2.0
Downloading sources: cairocffi==1.0.2...
Downloading sources: /root/rpmbuild/SOURCES/cairocffi-1.0.2.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/cairocffi-1.0.2.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/cairocffi-1.0.2 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/cairocffi-1.0.2...
Building SPEC file: /root/rpmbuild/PYTHON/temp/cairocffi-1.0.2/dist/cairocffi.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/cairocffi-1.0.2/dist/cairocffi.spec...
Querying version: cffi...
Querying version: cffi==1.12.3 installed
Querying dependencies: cffi==1.12.3...
Querying dependencies: own: pycparser
Querying dependencies: all: pycparser
Querying version: setuptools...
Querying version: setuptools==40.8.0 installed
Querying dependencies: setuptools==40.8.0...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-cairocffi.spec prepared
Building RPMs for cffi==1.12.3
Querying version: cffi...
Querying version: cffi==1.12.3 installed
Querying dependencies: cffi==1.12.3...
Querying dependencies: own: pycparser
Querying dependencies: all: pycparser
Downloading sources: cffi==1.12.3...
Downloading sources: /root/rpmbuild/SOURCES/cffi-1.12.3.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/cffi-1.12.3.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/cffi-1.12.3 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/cffi-1.12.3...
Building SPEC file: /root/rpmbuild/PYTHON/temp/cffi-1.12.3/dist/cffi.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/cffi-1.12.3/dist/cffi.spec...
Querying version: pycparser...
Querying version: pycparser==2.19 installed
Querying dependencies: pycparser==2.19...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-cffi.spec prepared
Building RPMs for cssselect2==0.2.1
Querying version: cssselect2...
Querying version: cssselect2==0.2.1 installed
Querying dependencies: cssselect2==0.2.1...
Querying dependencies: own: tinycss2
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: tinycss2
Querying dependencies: all: webencodings >=0.4
Downloading sources: cssselect2==0.2.1...
Downloading sources: /root/rpmbuild/SOURCES/cssselect2-0.2.1.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/cssselect2-0.2.1.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/cssselect2-0.2.1 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/cssselect2-0.2.1...
Building SPEC file: /root/rpmbuild/PYTHON/temp/cssselect2-0.2.1/dist/cssselect2.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/cssselect2-0.2.1/dist/cssselect2.spec...
Querying version: tinycss2...
Querying version: tinycss2==1.0.2 installed
Querying dependencies: tinycss2==1.0.2...
Querying dependencies: own: setuptools >=39.2.0
Querying dependencies: own: webencodings >=0.4
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: webencodings >=0.4
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-cssselect2.spec prepared
Building RPMs for defusedxml==0.6.0
Querying version: defusedxml...
Querying version: defusedxml==0.6.0 installed
Querying dependencies: defusedxml==0.6.0...
Downloading sources: defusedxml==0.6.0...
Downloading sources: /root/rpmbuild/SOURCES/defusedxml-0.6.0.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/defusedxml-0.6.0.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/defusedxml-0.6.0 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/defusedxml-0.6.0...
Building SPEC file: /root/rpmbuild/PYTHON/temp/defusedxml-0.6.0/dist/defusedxml.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/defusedxml-0.6.0/dist/defusedxml.spec...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-defusedxml.spec prepared
Building RPMs for html5lib==1.0.1
Querying version: html5lib...
Querying version: html5lib==1.0.1 installed
Querying dependencies: html5lib==1.0.1...
Querying dependencies: own: six >=1.9
Querying dependencies: own: webencodings
Querying dependencies: all: six >=1.9
Querying dependencies: all: webencodings
Downloading sources: html5lib==1.0.1...
Downloading sources: /root/rpmbuild/SOURCES/html5lib-1.0.1.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/html5lib-1.0.1.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/html5lib-1.0.1 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/html5lib-1.0.1...
Building SPEC file: /root/rpmbuild/PYTHON/temp/html5lib-1.0.1/dist/html5lib.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/html5lib-1.0.1/dist/html5lib.spec...
Querying version: six...
Querying version: six==1.12.0 installed
Querying dependencies: six==1.12.0...
Querying version: webencodings...
Querying version: webencodings==0.5.1 installed
Querying dependencies: webencodings==0.5.1...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-html5lib.spec prepared
Building RPMs for pillow==6.1.0
Querying version: pillow...
Querying version: Pillow==6.1.0 installed
Querying dependencies: Pillow==6.1.0...
Downloading sources: Pillow==6.1.0...
Downloading sources: /root/rpmbuild/SOURCES/Pillow-6.1.0.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/Pillow-6.1.0.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/Pillow-6.1.0 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/Pillow-6.1.0...
Building SPEC file: /root/rpmbuild/PYTHON/temp/Pillow-6.1.0/dist/Pillow.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/Pillow-6.1.0/dist/Pillow.spec...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-Pillow.spec prepared
Building RPMs for pycparser==2.19
Querying version: pycparser...
Querying version: pycparser==2.19 installed
Querying dependencies: pycparser==2.19...
Downloading sources: pycparser==2.19...
Downloading sources: /root/rpmbuild/SOURCES/pycparser-2.19.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/pycparser-2.19.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/pycparser-2.19 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/pycparser-2.19...
Building SPEC file: /root/rpmbuild/PYTHON/temp/pycparser-2.19/dist/pycparser.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/pycparser-2.19/dist/pycparser.spec...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-pycparser.spec prepared
Building RPMs for setuptools==40.8.0
Querying version: setuptools...
Querying version: setuptools==40.8.0 installed
Querying dependencies: setuptools==40.8.0...
Downloading sources: setuptools==40.8.0...
Downloading sources: /root/rpmbuild/SOURCES/setuptools-40.8.0.zip downloaded
Unpacking sources: /root/rpmbuild/SOURCES/setuptools-40.8.0.zip...
Unpacking sources: /root/rpmbuild/PYTHON/temp/setuptools-40.8.0 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/setuptools-40.8.0...
Building SPEC file: /root/rpmbuild/PYTHON/temp/setuptools-40.8.0/dist/setuptools.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/setuptools-40.8.0/dist/setuptools.spec...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-setuptools.spec prepared
Building RPMs for six==1.12.0
Querying version: six...
Querying version: six==1.12.0 installed
Querying dependencies: six==1.12.0...
Downloading sources: six==1.12.0...
Downloading sources: /root/rpmbuild/SOURCES/six-1.12.0.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/six-1.12.0.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/six-1.12.0 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/six-1.12.0...
Building SPEC file: /root/rpmbuild/PYTHON/temp/six-1.12.0/dist/six.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/six-1.12.0/dist/six.spec...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-six.spec prepared
Building RPMs for tinycss2==1.0.2
Querying version: tinycss2...
Querying version: tinycss2==1.0.2 installed
Querying dependencies: tinycss2==1.0.2...
Querying dependencies: own: setuptools >=39.2.0
Querying dependencies: own: webencodings >=0.4
Querying dependencies: all: setuptools >=39.2.0
Querying dependencies: all: webencodings >=0.4
Downloading sources: tinycss2==1.0.2...
Downloading sources: /root/rpmbuild/SOURCES/tinycss2-1.0.2.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/tinycss2-1.0.2.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/tinycss2-1.0.2 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/tinycss2-1.0.2...
Building SPEC file: /root/rpmbuild/PYTHON/temp/tinycss2-1.0.2/dist/tinycss2.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/tinycss2-1.0.2/dist/tinycss2.spec...
Querying version: setuptools...
Querying version: setuptools==40.8.0 installed
Querying dependencies: setuptools==40.8.0...
Querying version: webencodings...
Querying version: webencodings==0.5.1 installed
Querying dependencies: webencodings==0.5.1...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-tinycss2.spec prepared
Building RPMs for webencodings==0.5.1
Querying version: webencodings...
Querying version: webencodings==0.5.1 installed
Querying dependencies: webencodings==0.5.1...
Downloading sources: webencodings==0.5.1...
Downloading sources: /root/rpmbuild/SOURCES/webencodings-0.5.1.tar.gz downloaded
Unpacking sources: /root/rpmbuild/SOURCES/webencodings-0.5.1.tar.gz...
Unpacking sources: /root/rpmbuild/PYTHON/temp/webencodings-0.5.1 unpacked
Building SPEC file: /root/rpmbuild/PYTHON/temp/webencodings-0.5.1...
Building SPEC file: /root/rpmbuild/PYTHON/temp/webencodings-0.5.1/dist/webencodings.spec built
Preparing SPEC file: /root/rpmbuild/PYTHON/temp/webencodings-0.5.1/dist/webencodings.spec...
Preparing SPEC file: /root/rpmbuild/SPECS/myproject-python37-webencodings.spec prepared