I have a trivially simple command-line program that literally consists of a python script and some helper shell scripts. I'd like to learn about packaging this program, though it is trivial.
From what I gathered, I went the configure/make/install route. Since I didn't have anything to configure, or anything to make, I simple created a Makefile with nothing but an install section:
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
At this point, my program installs and runs fine with sudo make install.
Then, I attempt to make a deb file using checkinstall as follows:
sudo checkinstall sudo make install
It appears to get past the install part, as it reports it successful, but then fails:
======================== 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
...
The program is installed, but as far as I can tell, this newly made .deb file does nothing. dpkg -L my-program yields only
/.
and manually removing it and installing from the deb file doesn't appear to do anything - it doesn't actually put any files anywhere.
So, (1) Is there anything wrong with my approach? and (2) How can I fix the checkinstall problem?
Thank you very much for answers, even though I'm good with code, I've never known anything about packaging/distribution.
I'm not sure if this exactly answers the question, but here's what I got so far (on ubuntu lucid, checkinstall 1.6.1):
I tried to build an open-source project, which built just fine. Then I tried packaging it for debian:
checkinstall -D --install=no --pkgname=$PKGNAME --pkgversion=0.0.1 --pkgrelease="svn-001" [email protected] --strip=no --stripso=no --addso=yesThis basically failed at the same
Building file list... FAILED!; and a similargrep: /var/tmp/tmp.NaoiwTHT6F/newfile: No such file or directorywas reported.I also tried with adding
makeat end ofcheckinstallcommand above - that didn't do much either.Finally, I tried this:
make cleancheckinstall -D --install=no --pkgname=$PKGNAME --pkgversion=0.0.1 --pkgrelease="svn-001" [email protected] --strip=no --stripso=no --addso=yes -d2 make
The switch
-d2is to enable debug; and... makewill rerun make one more time.The
, so it can be checked by listing... And indeed, I can confirm that a-d2will print out the temporary directory:newfileis not generated there in my case (however, there isnewfiles,newfiles.installwatch,newfiles-tar, andnewfiles.tmp). In fact, turns outcheckinstallis abashscript, and so one can confirm thatnewfileonly appears once in it:Also, the debug will point out these files/directories:
Note that by default, the path to my build folder,
/path/to/myproject-buildis excluded - and that is where this project also stores the built executables!Apparently, when
makewithincheckinstallgoes on building for the first time, it can capture newly generated executable files - they will be listed in${TMP_DIR}/newfiles; however, in my case, the problem is that the executables end up under the same directory wherecheckinstallis called; thus, at this dialog:... I must, in fact, answer
n- otherwise I'd get nothing included! I can then check the contents with:However, then the problem is that
checkinstall:.ofiles, as well as.svndirectories/usr/bin, and.sos to/usr/libIn brief - some of the approaches above may get one to have a
.debwhich is not completely empty; but that doesn't mean one has only the needed files there, or that they would be routed to usual install destinations...Well, hope this helps at least a bit,
Cheers!