1
我必須將我的RPM軟件包轉換爲DEB軟件包才能在Ubuntu上安裝它。由於我沒有任何構建DEB包的經驗,因此使用Google搜索建議從stdeb包中'bdist_rpm'使用python setuptools'bdist_deb'編譯C代碼
代碼主要是Python,配置文件等。但是有一個C代碼需要構建。該RPM安裝二進制文件在/ usr/bin中的setup.py
代碼創建二進制文件
if sys.argv and len(sys.argv) > 1 and sys.argv[1].strip().startswith('bdist'):
try:
compiler = UnixCCompiler(verbose=1)
compiler.compile(['cutility/chown_sudo.c'])
compiler.link_executable((['cutility/chown_sudo.o']), 'bin/sudoown')
except CompileError as compileError:
print "Failed to compile the binary file."
raise
bdist_rpm理解這些代碼,並創建了C.但是bdist_deb忽略它:(
在網上搜索,debuild實用程序建議爲這個和其他複雜的東西創建一些Makefile文件
這是複雜嗎?一些搜索還建議使用'外星人'工具而不是?
直到現在我的想法是,使用以下命令
python setup.py --command-packages=stdeb.command debianize
然後調整debian目錄postint,控制等 但我不知道如何建立的C代碼