how to compile

Asked by weihua zhang

I download the brach thru command:
  $ bzr branch lp:ubuntu/nautilus-open-terminal

I want make and build a debian package for this and debug it on my local machine, how to do that?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu nautilus-open-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Mark Rijckenberg
Solved:
Last query:
Last reply:
Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#1

The answer is here , the one with the green mark

http://askubuntu.com/questions/1345/what-is-the-simplest-debian-packaging-guide

Regards
 NikTh

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

Why not just run:

sudo apt-get install nautilus-open-terminal

It's in the repos:
https://launchpad.net/ubuntu/+source/nautilus-open-terminal

Revision history for this message
weihua zhang (whzhang-kylin) said :
#3

Thank for your answers! What I have done is:
1) $ bzr branch lp:ubuntu/nautilus-open-terminal, the output is:
------------------------------------------------------------------
Most recent Ubuntu version: 0.20-1
Packaging branch version: 0.18-2
Packaging branch status: OUT-OF-DATE
Branched 22 revisions.
------------------------------------------------------------------
   There is no debian directory in the source code

2) Then I download original tarball and debian tarball from https://launchpad.net/ubuntu/raring/+source/nautilus-open-terminal

3) I copy nautilus-open-terminal_0.20-1.dsc and nautilus-open-terminal_0.20.orig.tar.xz in the upper directory of the branch and extract nautilus-open-terminal_0.20-1.debian.tar.gz under the brach directory
    Now I have the debian/ directory

4) excute command: $ bzr-buildpackage, what I got is:
-----------------------------------------
...
dh clean --with autoreconf
   dh_testdir
   dh_auto_clean
   dh_autoreconf_clean
   dh_clean
 dpkg-source -b nautilus-open-terminal-0.20
dpkg-source: info: using source format `3.0 (quilt)'
dpkg-source: info: building nautilus-open-terminal using existing ./nautilus-open-terminal_0.20.orig.tar.xz
dpkg-source: info: fuzz is not allowed when applying patches
dpkg-source: info: if patch '001_fix-remote-shell.diff' is correctly applied by quilt, use 'quilt refresh' to update it
dpkg-source: error: cannot read nautilus-open-terminal-0.20.orig.vySzov/debian/patches/001_fix-remote-shell.diff: no such file or directory
dpkg-buildpackage: error: dpkg-source -b nautilus-open-terminal-0.20 提供错误退出状态 2
debuild: fatal error at line 1357:
dpkg-buildpackage -rfakeroot -D -us -uc failed
bzr: ERROR: The build failed.
------------------------------------------------------------------------------------------

Then I execute command $ debuilid -us -uc, what I got is:
----------
...
dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/nautilus-open-terminal_0.20-1.diff.nxAeL_
dpkg-source: info: you can integrate the local changes with dpkg-source --commit
dpkg-buildpackage: error: dpkg-source -b nautilus-open-terminal 提供错误退出状态 2
debuild: fatal error at line 1357:
dpkg-buildpackage -rfakeroot -D -us -uc failed

So what's the actual steps you are using to create the package? Do you use nautilus-open-terminal_0.20-1.debian.tar.gz? Once I can build the package, I'll be able to debug the code and write my own naulilus extention. Looking forward to your replies.

Revision history for this message
Best Mark Rijckenberg (markrijckenberg) said :
#4

I suggest using options 19 and 23 in the following link:

http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/

So please try these commands instead:

sudo apt-get update
sudo apt-get build-dep nautilus-open-terminal
sudo apt-get --compile source nautilus-open-terminal

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

What is your current Ubuntu release? (Execute the terminal command "lsb_relase -a".)
You might run into troubles when you try compiling a package that depends on other packages or package versions that you do not have on your system.

Revision history for this message
weihua zhang (whzhang-kylin) said :
#6

Thanks Mark Rijckenberg, that solved my question.

Revision history for this message
weihua zhang (whzhang-kylin) said :
#7

That's great! I have succeeded building nautilus-open-terminal following Mark Rijckenberg's guidance. One thing I want to know is that how could the command "sudo apt-get --compile source nautilus-open-terminal" know where to get the source code? I guess the souce code it got is not the newest souce code in the trunk branch on Launchpad.

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

"apt-get source" downloads the source from the repositories for your current release.
Look at https://launchpad.net/ubuntu/+source/nautilus-open-terminal to see the available versions of nautilus-open-terminal for the different Ubuntu releases.

I guess that you are running an older Ubuntu release, and not yet 13.04 raring (currently in development status, to be officially published next week), so you should verify the release that you are running, and should check which version of nautilus-open-terminal you have built.

When you want to compile the highest available version (0.20-1), you would have to manually download the original source and the debian.tar.gz files from https://launchpad.net/ubuntu/raring/+source/nautilus-open-terminal, unpack them and try compile the programs and build a package with one of the developer tools like debuild.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#9

If you read the lines in /etc/apt/sources.list you will see lines with deb-src instead of just deb on. These give source code instead of binaries. Your question is not dissimilar to "when I use sudo apt-get install gedit how does it know where to get the binaries"

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#10

Quick question too, why compile something so basic when the work is already done, or was it just for fun? You may want to pin the version of the package in apt so that updates don't overwrite your efforts