我想打包一个第三方应用程序,其中包含.so文件。当我用构建包时,.so文件被排除在生成的源包之外。
我没有.orig文件。因此,我在debian/source中使用了"3.0 (本机)“。
首先,我收到了这样的信息:
dpkg-shlibdeps: error: cannot find library...因此,我在debian/rules文件中包含了"override_dh_makeshlibs“和"override_dh_shlibdeps”。
man源建议在debian/source中使用"3.0 (棉被)“,但我没有.orig文件,只有一个带有文件的tar文件。
不过,我尝试过设置debian/include-二进制文件(其中包含"path_to.so“),但这并没有帮助。
debian/规则:
%:
dh $@
override_dh_strip:
@echo "Not running dh_strip"
override_dh_makeshlibs:
@echo "Not running dh_makeshlibs"
override_dh_shlibdeps:
@echo "Not running dh_shlibdeps"debian/来源/格式:
3.0 (native)构建命令:
dpkg-buildpackage -aamd64 -us -uc我希望源代码包包含所有文件,但它缺少.so文件。
deb文件构建正确。
编辑:部分解决方案
在构建deb之前,通过手动创建源文件,我成功地创建了一个带有上游源的deb。
在源目录中:
变化情况g:
make sure that the version number has a revision.资料来源/格式:
3.0 (quilt)源/包括-二进制文件:
path_to.so命令:
VERSION=$(dpkg-parsechangelog -S Version | sed -rne 's,([^-\+]+)+(\+dfsg)*.*,\1,p'i)
SOURCE=$(dpkg-parsechangelog -S Source)
UPSTREAM_PACKAGE=${SOURCE}_${VERSION}.orig.tar.gz
rm -f ../${UPSTREAM_PACKAGE}
tar czvf ../${UPSTREAM_PACKAGE} --exclude=debian --exclude=Makefile
dpkg-buildpackage -rfakeroot -aamd64 -us -uc有自动化的方法吗?
我不知道在debian/rules文件中或者在Makefile中这是否是可能的,或者是如何做到的。
发布于 2019-06-14 14:33:42
这就是我想出的解决办法。
创建您的项目,因为您希望它被打包。我假设您知道成功打包项目需要哪些debian文件。
创建或修改这些文件:
debian/来源/格式:
3.0 (quilt)debian/规则:
#!/usr/bin/make -f
# -*- makefile -*-
# https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules
# https://manpages.debian.org/stretch/debhelper/debhelper.7.en.html
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
version := $(shell dpkg-parsechangelog -S Version | sed -rne 's,([^-\+]+)+(\+dfsg)*.*,\1,p'i)
source := $(shell dpkg-parsechangelog -S Source)
upstreampck := $(source)_$(version).orig.tar.gz
clean:
@ echo CLEAN
rm -f ../$(upstreampck)
tar czf ../$(upstreampck) --exclude=debian --exclude=.pc .
dh_testdir
dh_auto_clean
dh_clean
build:
@ echo BUILD: nothing to do here
#dh_testdir
#dh_auto_configure
#dh_auto_build
#dh_auto_test
binary:
@ echo BINARY
dh_testroot
dh_prep
dh_install
dh_installdocs
dh_installchangelogs
dh_installexamples
dh_installman
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
.PHONY: build clean binary更新cangelog并确保向上游版本添加修订号:
dch -i -D stable -u low -M -p构建包:
dpkg-buildpackage -rfakeroot -us -uc -aamd64 --source-option=--include-binaries这将生成源文件和debian/source/include-二进制文件。
接下来的所有构建都可以通过以下方式完成:
dpkg-buildpackage -rfakeroot -us -uc -aamd64https://stackoverflow.com/questions/56581531
复制相似问题