关于deb打包时source包中不能含有某些特殊二进制文件

问题是这样的,假如项目开发过程中使用了上游提供的闭源的*.so文件,现在想要对该项目打包,
但是debian的打包工具貌似不支持在source包中包含这种*.so的二进制文件,
那么在打成的source包里这类文件会被自动剔除,导致当想要将这个source包直接拿到其他地方重新编译就会出问题,
请问大家有没有什么好的解决方案呢?

ps. 对于debian使用的打包工具source包中不能包含*.so文件这个事情,
是我根据观察到的现象得出的结论,暂时还未在任何文档中看到确切的描述。
ps2. 对于以上的问题,目前想到的一种解决方案是在打包之前先对*.so文件重命名(比如改为~so文件),
然后在打包时脚本先将文件名改过来再继续常规打包流程,不知道还有什么好方法。

问题解决,原因是debian的打包工具底层调用的dpkg-source工具在使用 3.0 (quilt) 的格式进行打包时默认会排除一些常规下不应该存在于 debian source 软件包中的文件类型

执行 dpkg-source --help 可以看到默认被排除的所有文件类型,以下是该命令的完整输出:

[quote]Usage: dpkg-source …]

Commands:
-x, --extract .dsc ]
extract source package.
-b, --build build source package.
–print-format print the format to be used for the source package.
–commit ]]
store upstream changes in a new patch.

Build options:
-c get control info from this file.
-l get per-version info from this file.
-F force changelog format.
–format= set the format to be used for the source package.
-V= set a substitution variable.
-T read variables here.
-D= override or add a .dsc field and value.
-U remove a field.
-q quiet mode.
-i] filter out files to ignore diffs of
(defaults to: ‘(?:^|/).~$|(?:^|/).#.$|(?:^|/)….sw.$|(?:^|/),.(?:$|/.$)|(?:^|/)(?:DEADJOE|.arch-inventory|.(?:bzr|cvs|hg|git)ignore)$|(?:^|/)(?:CVS|RCS|.deps|{arch}|.arch-ids|.svn|.hg(?:tags|sigs)?|_darcs|.git(?:attributes|modules)?|.shelf|_MTN|.be|.bzr(?:.backup|tags)?)(?:$|/.$)’).
-I] filter out files when building tarballs
(defaults to: -I*.a -I*.la -I*.o -I*.so -I..sw? -I/~ -I, -I.#~]* -I.arch-ids -I.arch-inventory -I.be -I.bzr -I.bzr.backup -I.bzr.tags -I.bzrignore -I.cvsignore -I.deps -I.git -I.gitattributes -I.gitignore -I.gitmodules -I.hg -I.hgignore -I.hgsigs -I.hgtags -I.shelf -I.svn -ICVS -IDEADJOE -IRCS -I_MTN -I_darcs -I{arch}).
-Z select compression to use (defaults to ‘xz’,
supported are: bzip2 gzip lzma xz).
-z compression level to use (defaults to ‘6’,
supported are: ‘1’-‘9’, ‘best’, ‘fast’)

Extract options:
–no-copy don’t copy .orig tarballs
–no-check don’t check signature and checksums before unpacking
–require-valid-signature abort if the package doesn’t have a valid signature
–ignore-bad-version allow bad source package versions.

General options:
-?, --help show this help message.
–version show the version.

More options are available but they depend on the source package format.
See dpkg-source(1) for more info.
[/quote]

这个是通过 -I 选项来实现的,也就是说当在打包时不手动执行 -I 选项时, dpkg-source 命令会在打 source 包时默认排除这些文件,解决方法也很简单,手动用 -I 选项指定一些被排除的文件类型覆盖默认配置即可。