Python 模块到 deb 包

Python 模块到 deb 包

我正在尝试打包numpy 1.12.1成 deb 包。为了做到这一点,我首先运行

dh_make -f ../numpy1.12.1.tar.gz

它生成一个debian目录,在control生成的文件中显示numpyBROKEN,我将其更改为 numpy1.12.1 并编辑debian/rules以告诉该包有一个setup.py文件并且必须使用python3.这是我的debian/rules文件:

#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1

# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


# main packaging script based on dh7 syntax
%:
        dh $@ --with python3 --buildsystem=pybuild

# debmake generated override targets
# This is example for Cmake (See http://bugs.debian.org/641051 )
#override_dh_auto_configure:
#       dh_auto_configure -- \
#       -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

然后我运行:

dpkg-buildpackage -us -uc

它会生成一个包。但是如果我解压 deb 包或者查看生成的结构文件夹,dpkg-buildpackage我只能看到以下内容

$ ls debian/numpy1.12.1
DEBIAN  usr
$ ls debian/numpy1.12.1/DEBIAN/
control  md5sums
$ ls debian/numpy1.12.1/usr/
share
$ ls debian/numpy1.12.1/usr/share/doc/numpy1.12.1/
changelog.Debian.gz  copyright

只有DEBIAN文件和usr文件夹中只出现share文件夹,没有关于 numpy 编译文件的信息......

如何从 python 模块生成 debian 包?

答案1

为什么要重新发明轮子?

dget http://httpredir.debian.org/debian/pool/main/p/python-numpy/python-numpy_1.12.0-2.dsc
cd python-numpy-1.12.0

检查 PY3VERSdebian/rules然后重建:

dch -n "Rebuild with Python 3.6."
dch -r ignored
dpkg-buildpackage -us -uc

相关内容