HowTo Build a Package from Source the Smart Way

Share your own howto's etc. Not for support questions!

Re: HowTo Build a Package from Source the Smart Way

Postby Soul Singin' » 2010-02-06 21:15

milomak wrote:All the above being said, your HOW-TO is a good one. It put me on the right path and the rest I was able to research using google.

Glad it helped. I'll probably incorporate your suggestions (and the suggestions of others) at some point in the future. Right now, I'm short on time.

Thanks,
- Soul Singin'
.
User avatar
Soul Singin'
 
Posts: 1471
Joined: 2008-12-21 07:02

Re: HowTo Build a Package from Source the Smart Way

Postby badhat101 » 2010-08-23 01:10

I'm following the guide but I get stuck building a package with dh_make. The dpkg-buildpackage always exits with the error
Code: Select all
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2


I'm not certain what to do with the debian/rules file. I'm assuming this is why I have the exit error upon building...

Any help?
badhat101
 
Posts: 27
Joined: 2010-08-18 20:55

Re: HowTo Build a Package from Source the Smart Way

Postby Soul Singin' » 2010-08-23 01:44

badhat101 wrote:I'm following the guide but I get stuck building a package with dh_make.

First, you should not post support questions in a HowTo thread. You should create a new thread.

Second, when you create a new thread, please:

  • tell us what package you are trying to build
  • post your debian/rules file
  • tell us if you have installed fakeroot, devsripts, etc.

Looking forward to working with you,
- Soul Singin'
.
User avatar
Soul Singin'
 
Posts: 1471
Joined: 2008-12-21 07:02

Re: HowTo Build a Package from Source the Smart Way

Postby nadir » 2010-11-20 08:28

found this link:
http://meetbot.debian.net/debian-women/ ... 5.log.html
For me it is interesting. If not for this thread, let me know ( it is rather an intro).

Edit:
Someone is so nice to rewrite the tutorials for the debian-wiki
(i don't know the name at the moment):
http://wiki.debian.org/IntroDebianPackaging
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.
User avatar
nadir
 
Posts: 5964
Joined: 2009-10-05 22:06
Location: away

Re: HowTo Build a Package from Source the Smart Way

Postby csaba » 2010-12-24 11:22

I'm trying to make a deb out of apache thrift, so far with just a littlebit of success. I'm using the dh_make + dpkg-buildpackage approach. Also i'm running purely without X from the tty, on squeeze, under virtualbox, for full enjoyment purposes. although i'm not sure that this is relevant to the point but i'll mention it anyway.
I would like to give the configure script a few flags (mainly to switch off a few functionalities) and if my conclusions are correct this can be done by editing the file debian/rules. Probably yes, cause this howto also mentions this fact a few times.

You might then have to tweak the debian/rules file (e.g. to set configuration options) or set a shell variable.


Hopefully i'm not misunderstanding that this means that in this file i could pass to the configure script a few parameters, somehow. Probably the easiest solution would be to just set an env. variable and pass all the options i want to configure through it. Although i'm just thinking loudly, feel free to correct me anytime if i'm wrong.
At the moment my default rules file has only one line (i used dh_make --createorig for debianizing the upstream source), which is '<tab>dh $@', so i really dont comprehend where could i put my custom options and even how would those options be passed to configure. The next thing that i'll try to do will be to lok into a debian source package and it's rules file for some clues, but if there is a quick fix for this, feel free to enlighten me with the information.

thanx
Omnes homines natura scire desiderant.
User avatar
csaba
 
Posts: 127
Joined: 2007-08-02 05:30

Re: HowTo Build a Package from Source the Smart Way

Postby csaba » 2010-12-24 11:30

I have the following lines in debian/rules now which are relevant (a reminder to myself and everybody: don't forget the tabs because of make at the start of the line):

Code: Select all

...

%:
   dh $@
override_dh_auto_configure:
   dh_auto_configure -- --without-cpp --without-python


--without-cpp and --without-python were the options i wanted to pass to configure. It works now as expected.

http://wiki.debian.org/IntroDebianPackaging to the rescue :)

Oh, and by the way this is a really nice and helpful FAQ. Good work
Omnes homines natura scire desiderant.
User avatar
csaba
 
Posts: 127
Joined: 2007-08-02 05:30

Re: HowTo Build a Package from Source the Smart Way

Postby MarcusW » 2011-02-18 11:06

Awesome guide. :)
MarcusW
 
Posts: 183
Joined: 2009-12-04 14:52
Location: Sweden

Re: HowTo Build a Package from Source the Smart Way

Postby handheldCar » 2011-03-10 06:14

I went through this compiling source code, today, but I will probably use this tutorial and build a deb, next time.
handheldCar
 
Posts: 221
Joined: 2009-11-27 02:31
Location: North Cackalack

Re: HowTo Build a Package from Source the Smart Way

Postby handheldCar » 2011-03-11 04:18

Soul Singin' wrote:If you're going to build a package from source by carefully choosing the build options, etc. etc. etc. then you should install from source.

But if you're going to blindly accept every default and if you're not going to think about the build at all, then you'd be well advised to use alien instead of the make install routine.

As I mentioned in my response to Hadret ... If you're going to build a package from source by carefully choosing the build options, using the --prefix=/usr/local argument, etc. etc. etc., then you're not going to get yourself in trouble.
What are all these etc. etc. etc. etc.'s? What other options should I be concerned about? all the ones in ./configure --help?
budr wrote:try make -n uninstall. Redirect the output to a file and you've got an uninstall script ready made. Failing that, try make -n install and save that. That way at least you've got a pretty good idea where to look for things if you do have to back out of an install.
If you do that, do you need the source code directory anymore?
Soul Singin' wrote:
julian67 wrote:A useful addition to the first post would be on applying patches.
The trouble is that different packages use different patch maintenance systems (e.g. dpatch, quilt, cdbs and dbs). A proper discussion of patching would describe each method and is therefore outside the scope of the original post (which is to explain the various methods of building a package from source).
Did you or anyone else do a tutorial on patching?
handheldCar
 
Posts: 221
Joined: 2009-11-27 02:31
Location: North Cackalack

Re: HowTo Build a Package from Source the Smart Way

Postby stevepusser » 2011-03-11 06:50

Did you or anyone else do a tutorial on patching?


Both the new quilt source format (3.0) and the cdbs "/usr/share/cdbs/1/rules/simple-patchsys.mk"

are pretty simple to use. Just generate a .diff between your patched code and the original source file, put that in /debian/patches, and add it to "series" or "00list". CDBS requires that you include this line in the rules file:
Code: Select all
include /usr/share/cdbs/1/rules/simple-patchsys.mk


but the new quilt format, which dh_make generates by default, just works automagically.

The older way of using quilt lets you create and manage a stack of patches, but is a bit harder to learn:

https://mybravenewworld.wordpress.com/2 ... anagement/

I don't know that much about dpatch. though I have been able to modify a .diff patch to work in the dpatch system, by looking at the other patches.

If you are modifying a text file that will be installed, such as a configuration file, and it will not be compiled, you can get away with just installing the modified version from the /debian directory by adding it and its destination to the package.install file, for example, for package foo, foo.install would have

Code: Select all
debian/foo-config.conf /etc/foo-config.conf


though the install command can also be added to the rules file.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: AzPainter 2.1.0, Pale Moon 27.4.2, Liquorix kernel 4.12-8, mpv 0.27.0, Kodi 17.3, 0ad 0.0.22, Mesa 13.0.6
User avatar
stevepusser
 
Posts: 8724
Joined: 2009-10-06 05:53

Re: HowTo Build a Package from Source the Smart Way

Postby handheldCar » 2011-03-11 16:40

nadir wrote:the tutorials for the debian-wiki
http://wiki.debian.org/IntroDebianPackaging
This had some good information, too.

FYI, you can add the license and e-mail parameters to dh_make, or you can just edit the files afterward.
handheldCar
 
Posts: 221
Joined: 2009-11-27 02:31
Location: North Cackalack

Thanks For The How-To

Postby ChipOManiac » 2011-07-29 02:54

Thanks for posting this... I'm one of thoes guyst that does »make install«... Apparently this will change my ways, already happy about being here

:D YAY!
"Chew, if only you could see what I've seen with your eyes!"
- Roy Batty (Blade Runner)

Lenovo ThinkPad T440p (Ястреб "Yastreb")

You had me at "without systemd"
User avatar
ChipOManiac
 
Posts: 285
Joined: 2011-07-29 02:42
Location: Talpittiya, Sri Lanka

A Small Question

Postby ChipOManiac » 2011-09-03 02:14

I was compiling »QtCurve« yesterday. Got the source off »SourceForge«, and was preparing it for the neccessary work. I noticed that the, KWin part was also included in the source package. On the Debian package repository, there's a kde-style and kwin-style, which probably means that the KWin and KDE styles are packaged differently.

In this case, what should I do tho get a separate KDE style package, and KWin style package?
"Chew, if only you could see what I've seen with your eyes!"
- Roy Batty (Blade Runner)

Lenovo ThinkPad T440p (Ястреб "Yastreb")

You had me at "without systemd"
User avatar
ChipOManiac
 
Posts: 285
Joined: 2011-07-29 02:42
Location: Talpittiya, Sri Lanka

Re: HowTo Build a Package from Source the Smart Way

Postby stevepusser » 2011-09-03 03:02

The kwin package is probably the window decorations (titlebar, bar buttons, and borders) while the style is the rest of the window, such as buttons, scrollbars, backgrounds, etc.

Take a look inside the /debian folder of the Debian package (easy to do if there's a debian.tar.gz file to download and extract).

For multipart packages, there should be a list of files to install in different <packagename>.install files in there.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: AzPainter 2.1.0, Pale Moon 27.4.2, Liquorix kernel 4.12-8, mpv 0.27.0, Kodi 17.3, 0ad 0.0.22, Mesa 13.0.6
User avatar
stevepusser
 
Posts: 8724
Joined: 2009-10-06 05:53

Re: HowTo Build a Package from Source the Smart Way

Postby ChipOManiac » 2011-09-03 03:29

stevepusser wrote:The kwin package is probably the window decorations (titlebar, bar buttons, and borders) while the style is the rest of the window, such as buttons, scrollbars, backgrounds, etc.

Correct :)

stevepusser wrote:Take a look inside the /debian folder of the Debian package (easy to do if there's a debian.tar.gz file to download and extract).

For multipart packages, there should be a list of files to install in different <packagename>.install files in there.

Is that in the package from the repos or the one I compiled from source?

Thanks however :D
"Chew, if only you could see what I've seen with your eyes!"
- Roy Batty (Blade Runner)

Lenovo ThinkPad T440p (Ястреб "Yastreb")

You had me at "without systemd"
User avatar
ChipOManiac
 
Posts: 285
Joined: 2011-07-29 02:42
Location: Talpittiya, Sri Lanka

PreviousNext

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable