2011-05-17 89 views
8

我有一个非常简单的命令行程序,它实际上由一个python脚本和一些辅助shell脚本组成。我想了解打包这个程序,尽管它是微不足道的。checkinstall创建无用的deb?

从我收集的内容中,我找到了configure/make/install路径。由于我没有有什么配置,或任何做,我简单的创建一个Makefile与只不过是安装部分:

install: 
     cp ./myProgram /usr/bin/my-program 
     chown root:root /usr/bin/my-program 
     chmod 777 /usr/bin/my-program 
     cp -r ./ProgramResources /usr/lib/my-program 
     chown -hR root:root /usr/lib/my-program 
     chmod -R 777 /usr/lib/my-program 

在这一点上,我的程序安装并运行正常使用sudo make install的。

然后,我试图让使用checkinstall一个deb文件,如下所示:

sudo checkinstall sudo make install 

这似乎让过去的安装部分,因为它报告它成功,但随后失败:

======================== Installation successful ========================== 
cp: cannot stat `//var/tmp/tmp.jKCmESc0v7/newfiles.tmp': No such file or directory 

Copying files to the temporary directory...OK 

Stripping ELF binaries and libraries...OK 

Compressing man pages...OK 

Building file list... FAILED! 

Building Debian package...OK 

Installing Debian package...OK 

Erasing temporary files...OK 

Deleting temp dir...OK 


********************************************************************** 

Done. The new package has been installed and saved to 

... 

该程序已安装,但据我所知,这个新创建的.deb文件什么都不做。的dpkg -L我的计划产量仅

/. 

,并手动删除它,然后在DEB文件安装不出现做任何事情 - 它实际上并没有放任何文件的任何地方。

所以,(1)我的方法有什么问题吗? (2)如何解决checkinstall问题?

非常感谢您的回答,尽管我很擅长使用代码,但我从来不知道有关打包/分发的任何信息。

回答

3

我不知道这是否正是回答了这个问题,但这里是我到目前为止(在Ubuntu清晰,检查安装1.6.1):

我试图建立一个开源项目,其中建成正好。然后我试图将其打包为Debian:

checkinstall -D --install=no --pkgname=$PKGNAME --pkgversion=0.0.1 --pkgrelease="svn-001" [email protected] --strip=no --stripso=no --addso=yes

这基本上未能在同一Building file list... FAILED!;并报告了类似的grep: /var/tmp/tmp.NaoiwTHT6F/newfile: No such file or directory

我也试过在上面的checkinstall命令末尾加上make--那也没什么效果。

最后,我尝试这样做:

make clean
checkinstall -D --install=no --pkgname=$PKGNAME --pkgversion=0.0.1 --pkgrelease="svn-001" [email protected] --strip=no --stripso=no --addso=yes -d2 make

开关-d2是启用调试;并且... make将再次运行一次。

-d2将打印出的临时目录:

debug: The temporary directory is: [ /var/tmp/tmp.NaoiwTHT6F ]
,因此它可以通过上市来检查......的确,我可以证实,一个 newfile是不是在我的情况下产生的有(但是,有 newfilesnewfiles.installwatchnewfiles-tarnewfiles.tmp)。事实上,原来 checkinstallbash脚本,因此可以确认 newfile只有在它出现一次:

$ grep 'newfile ' `which checkinstall` 
    grep '^/home' ${TMP_DIR}/newfile > /${TMP_DIR}/unwanted 

此外,调试会指出这些文件/目录:

debug: INSTW_EXCLUDE=/dev,/path/to/myproject-build,/proc,/tmp,/var/tmp, 
debug: INSTW_ROOTPATH=/var/tmp/tmp.NaoiwTHT6F 
debug: INSTW_LOGFILE=/var/tmp/tmp.NaoiwTHT6F/newfiles.tmp 
debug: INSTW_DBGFILE=/var/tmp/tmp.NaoiwTHT6F/dbgfile 

请注意,默认情况下,排除我的构建文件夹/path/to/myproject-build的路径 - 这也是该项目还存储构建的可执行文件的位置!

 

显然,当内checkinstallmake推移建设的第一次,它可以捕捉新生成的可执行文件 - 他们将在${TMP_DIR}/newfiles上市;然而,就我而言,问题在于可执行文件最终在调用checkinstall的同一目录下;因此,在该对话框:

Some of the files created by the installation are inside the build 
directory: /path/to/myproject-build 

You probably don't want them to be included in the package, 
especially if they are inside your home directory. 
Do you want me to list them? [n]: y 
Should I exclude them from the package? (Saying yes is a good idea) [y]: n 

...我必须,其实,回答n - 否则我会得到包括什么!然后我可以检查内容:

dpkg --contents mytest.deb | less 

但是,那么问题是,checkinstall

  • 包括.o文件,以及.svn目录
  • 计数的绝对路径相对(不会自动“发送”可执行文件说,/usr/bin.so s到/usr/lib

 

简单 - 一些方法上面可以得到一个有.deb这不完全是空的;但这并不意味着只有需要的文件那里,或者他们将被路由到通常的安装目的地...

那么,希望这可以帮助至少一点,
干杯!

1

我有类似的问题。到最后我跟着this很简单,但还是比较手动的做法。

例如,将要打包的文件放在debian/usr/bin中。没有必要完成通常的步骤configure, make, make install

5

sudo的双重使用是问题所在。

随着文件的安装。SH等

#! /bin/bash 
set -x 
touch useless 
cp useless /usr/share/useless 

命令

sudo checkinstall --pkgname useless -y ./install.sh 

作品而

sudo checkinstall --pkgname useless -y sudo ./install.sh 
             ^^^^ 

显示

cp: cannot stat ‘//var/tmp/tmp.Au4ympTNlT/newfiles.tmp’: No such file or directory 

并产生一个空的包装。