Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I downloaded the files for Mercurial 1.5.2 from http://packages.debian.org/sid/mercurial (mercurial_1.5.2-1.debian.tar.gz, mercurial_1.5.2-1.dsc and mercurial_1.5.2.orig.tar.gz). How do I get a .deb package out of these? I tried to follow the instructions at http://www.debian.org/doc/maint-guide/ch-build.en.html but they don't work.

I tried to unpack the two archives and run dpkg-buildpackage or debian/rules build but that fails with:

dh --with quilt clean
   dh_testdir
   debian/rules override_dh_auto_clean
make[1]: Entering directory `/home/user/packages/mercurial-deb'
cp -a mercurial/__version__.py mercurial/__version__.py.save
cp: cannot stat `mercurial/__version__.py': No such file or directory
make[1]: *** [override_dh_auto_clean] Error 1
make[1]: Leaving directory `/home/user/packages/mercurial-deb'
make: *** [clean] Error 2

That's because the directory mercurial is inside mercurial_1.5.2/. Why doesn't the build script cd into the right place? If I try ../debian/rules build, I get

dh --with quilt build
dh: cannot read debian/control: No such file or directory

sigh

How do I compile a package for debian???

share|improve this question
    
Should be on SO? –  Fake Name May 21 '10 at 9:01
    
This isn't about programming but "how do I use software". But it's a grey area, I agree. –  Aaron Digulla May 21 '10 at 9:30

2 Answers 2

up vote 1 down vote accepted

Why would you want to recompile it? Well whatever.
First, grab them with: dget -u --insecure http://ftp.de.debian.org/debian/pool/main/m/mercurial/mercurial_1.5.2-1.dsc

Then run those commands. This will pack them into a deb like in the archive.

(I would just add a sid.list into my /etc/apt/sources.list.d/ and use apt-pinning since it grabs every needed dependencies, etc etc. You should check apt-pinning out if you just want a newer version.)

share|improve this answer
    
Thanks, that works. My reason is that I have a patch which I need and I really don't want to pollute my system with unknown packages at this time, so no "sid" for me (whatever that might be - it's my first contact with debian). –  Aaron Digulla May 21 '10 at 10:31

You need to get the mercurial_1.5.2-1.debian.tar.gz file as well. Extract this into the right place and you should be good to go.

The orig file is the source code that the Debian people have got hold of. The debian file contains the changes they have made to the package, including all the information on how the .deb file needs to be built.

share|improve this answer
    
The "right place" was what I was missing. I unpacked the debian directory along with the orig sources instead of inside of it. –  Aaron Digulla May 21 '10 at 11:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.