I am creating a binary package for local usage by reading http://chat.stackexchange.com/transcript/message/1313226#1313226 chat session. I followed the steps mentioned in the list.
My environment:
ubuntu 12.04
Project: MakeFile based C++ project which contains several sub directories and creating several shared libraries.
Below are the steps followed.
- create a gpg key using gpg –gen-key
- create necessary directories for packaging (folder for package with name-version, debian sub folder) and run
dh_make --createorig
in console. This step generated required files for packaging inside debian folder - edit necessary files in ./debian folder
list of files in ./debian folder
source //folder
compat
rules
copyright
changelog
control
install
Below are the contents of important files.
$ cat control
Source: cscore
Section: misc
Priority: extra
Maintainer: dwft78 <aaaa@bbbb.com>
Build-Depends: debhelper (>= 8.0.0), autotools-dev
Standards-Version: 3.9.2
Homepage: <insert the upstream URL, if relevant>
Package: cscore
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: CoreScanner
CoreScanner for Ubuntu-12.04
$ cat install
/opt/installation-dir/bin/
this is where the binary files should be installed.
cat changelog
cscore (1.0-1) precise; urgency=low
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
-- name <name@xxx.com> Wed, 28 May 2014 14:16:29 +0530
$ cat rules
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@
finally I run debuild
command but I got bellow error.
find /home/dwft78/project/cscore/cscore-1.0/lib -name "libcs*" -type f -exec cp -f {} /home/dwft78/project/cscore/cscore-1.0/debian/cscore/opt/motorola-scanner//bin \;
find /home/dwft78/project/cscore/cscore-1.0/lib -name "libcs*" -type l -exec cp -Rf {} /home/dwft78/project/cscore/cscore-1.0/debian/cscore/opt/motorola-scanner//bin \;
make[1]: Leaving directory `/home/dwft78/project/cscore/cscore-1.0'
dh_install
cp: cannot stat `debian/tmp//opt/motorola-scanner/bin/': No such file or directory
dh_install: cp -a debian/tmp//opt/motorola-scanner/bin/ debian/cscore///opt/motorola-scanner/ returned exit code 1
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
actually there is no folder created called tmp inside debian folder.
debhelper noted the status of debuild command execution it has continued till dh_install level. output files also created excepting above set of files.
$ cat cscore.debhelper.log
dh_auto_configure
dh_auto_build
dh_auto_test
dh_prep
dh_installdirs
dh_auto_install
Please somebody help to go forward.
-Thanks.
Best Answer
As the man page for dh_install says, the purpose of
dh_install
and the files that it reads are typically used for one of two purposes:If you have a build system that can already build and install all the files needed for the binary package in the right directories, and you are only building one binary package from your source, then you don't need a
debian/install
file at all.You mentioned that you are working with a
Makefile
-based project. As long as it supports standard targets likemake all
andmake install
and respects the$DESTDIR
variable for installing, there's no need for adebian/install
at all.In fact, in the output you posted you can see a couple lines starting with
find
executing immediately beforedh_install
. I assume that is your project'smake install
target executing, and it looks to me like it is already installing files in the correct path, namelydebian/cscore/opt/motorola-scanner/bin
. So I think your build might work without adebian/install
.