Python
使用 stdeb 建構 debian 包
我一直在嘗試從 Python 模組為 Debian 建構 .deb 包。在瀏覽了Debian 的 LibraryStyleGuide for Python、Pybuild和An Overview of Packaging for Python之後,我決定我最好用一些可以為我簡化流程的東西。我發現stdeb是一個受歡迎的選擇。我嘗試根據this自己建構 stdeb 。它給了我以下錯誤:
python3 setup.py --command-packages=stdeb.command bdist_deb running bdist_deb running sdist_dsc running sdist running check reading manifest template 'MANIFEST.in' writing manifest file 'MANIFEST' creating stdeb-0.10.0 creating stdeb-0.10.0/scripts creating stdeb-0.10.0/stdeb creating stdeb-0.10.0/stdeb/command creating stdeb-0.10.0/test_data creating stdeb-0.10.0/test_data/py2_only_pkg creating stdeb-0.10.0/test_data/py2_only_pkg/py2_only_pkg creating stdeb-0.10.0/test_data/py3_only_pkg creating stdeb-0.10.0/test_data/py3_only_pkg/py3_only_pkg creating stdeb-0.10.0/test_data/simple_pkg creating stdeb-0.10.0/test_data/simple_pkg/simple_pkg making hard links in stdeb-0.10.0... hard linking .gitignore -> stdeb-0.10.0 hard linking .travis.yml -> stdeb-0.10.0 hard linking CHANGELOG.txt -> stdeb-0.10.0 hard linking LICENSE.txt -> stdeb-0.10.0 hard linking MANIFEST.in -> stdeb-0.10.0 hard linking README.rst -> stdeb-0.10.0 hard linking RELEASE_NOTES.txt -> stdeb-0.10.0 hard linking Vagrantfile.debian-7-wheezy.rb -> stdeb-0.10.0 hard linking Vagrantfile.debian-8-jessie.rb -> stdeb-0.10.0 hard linking Vagrantfile.ubuntu-12.04-precise.rb -> stdeb-0.10.0 hard linking Vagrantfile.ubuntu-14.04-trusty.rb -> stdeb-0.10.0 hard linking error.txt -> stdeb-0.10.0 hard linking setup.py -> stdeb-0.10.0 hard linking stdeb.cfg -> stdeb-0.10.0 hard linking test-pypi-install.sh -> stdeb-0.10.0 hard linking test.sh -> stdeb-0.10.0 hard linking test2and3.sh -> stdeb-0.10.0 hard linking scripts/py2dsc -> stdeb-0.10.0/scripts hard linking scripts/py2dsc-deb -> stdeb-0.10.0/scripts hard linking scripts/pypi-download -> stdeb-0.10.0/scripts hard linking scripts/pypi-install -> stdeb-0.10.0/scripts hard linking stdeb/__init__.py -> stdeb-0.10.0/stdeb hard linking stdeb/cli_runner.py -> stdeb-0.10.0/stdeb hard linking stdeb/downloader.py -> stdeb-0.10.0/stdeb hard linking stdeb/transport.py -> stdeb-0.10.0/stdeb hard linking stdeb/util.py -> stdeb-0.10.0/stdeb hard linking stdeb/command/__init__.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/bdist_deb.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/common.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/debianize.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/install_deb.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/sdist_dsc.py -> stdeb-0.10.0/stdeb/command hard linking test_data/py2_only_pkg/setup.py -> stdeb-0.10.0/test_data/py2_only_pkg hard linking test_data/py2_only_pkg/py2_only_pkg/__init__.py -> stdeb-0.10.0/test_data/py2_only_pkg/py2_only_pkg hard linking test_data/py2_only_pkg/py2_only_pkg/py2_module.py -> stdeb-0.10.0/test_data/py2_only_pkg/py2_only_pkg hard linking test_data/py3_only_pkg/setup.py -> stdeb-0.10.0/test_data/py3_only_pkg hard linking test_data/py3_only_pkg/py3_only_pkg/py3_module.py -> stdeb-0.10.0/test_data/py3_only_pkg/py3_only_pkg hard linking test_data/simple_pkg/setup.py -> stdeb-0.10.0/test_data/simple_pkg hard linking test_data/simple_pkg/simple_pkg/__init__.py -> stdeb-0.10.0/test_data/simple_pkg/simple_pkg Creating tar archive removing 'stdeb-0.10.0' (and everything under it) dpkg-buildpackage: info: source package stdeb dpkg-buildpackage: info: source version 0.10.0-1 dpkg-buildpackage: info: source distribution unstable dpkg-buildpackage: info: source changed by Andrew Straw <strawman@astraw.com> dpkg-source --before-build . dpkg-source: info: using options from stdeb-0.10.0/debian/source/options: --extend-diff-ignore=\.egg-info$ fakeroot debian/rules clean dh clean --with python3 --buildsystem=python_distutils dh: warning: Compatibility levels before 10 are deprecated (level 9 in use) dh: error: unable to load addon python3: Cant locate Debian/Debhelper/Sequence/python3.pm in @INC (you may need to install the Debian::Debhelper::Sequence::python3 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at (eval 16) line 1. BEGIN failed--compilation aborted at (eval 16) line 1. make: *** [debian/rules:7: clean] Error 25 dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2 Traceback (most recent call last): File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/setup.py", line 8, in <module> setup( File "/usr/lib/python3.9/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/command/bdist_deb.py", line 34, in run self.run_command('sdist_dsc') File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/command/sdist_dsc.py", line 137, in run build_dsc(debinfo, File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 1569, in build_dsc dpkg_buildpackage(*args, cwd=fullpath_repackaged_dirname) File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 585, in dpkg_buildpackage process_command(args, cwd=cwd) File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 226, in process_command check_call(args, cwd=cwd) File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 59, in check_call raise CalledProcessError(retcode) stdeb.util.CalledProcessError: 2
我在這里和這裡發現了類似的錯誤報告,但它們似乎已經修復並且我的系統是最新的。
這是我的 /proc/version 它有幫助:
Linux version 5.8.0-1parrot1-amd64 (team@parrotsec.org) (gcc-10 (Debian 10.2.0-5) 10.2.0, GNU ld (GNU Binutils for Debian) 2.35) #1 SMP Debian 5.8.7-1parrot1 (2020-09-14)
有人可以告訴我問題到底是什麼並幫助我建構它嗎?
錯誤是
無法在 @INC 中找到 Debian/Debhelper/Sequence/python3.pm
要解決此問題,您需要安裝
dh-python
:sudo apt install dh-python