Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HowTo Build a Package from Source the Smart Way

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Message
Author
User avatar
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: HowTo Build a Package from Source the Smart Way

#61 Post by Soul Singin' »

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'
.

badhat101
Posts: 27
Joined: 2010-08-18 20:55

Re: HowTo Build a Package from Source the Smart Way

#62 Post by badhat101 »

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?

User avatar
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: HowTo Build a Package from Source the Smart Way

#63 Post by Soul Singin' »

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
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: HowTo Build a Package from Source the Smart Way

#64 Post by nadir »

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
csaba
Posts: 127
Joined: 2007-08-02 05:30

Re: HowTo Build a Package from Source the Smart Way

#65 Post by csaba »

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

#66 Post by csaba »

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.

MarcusW
Posts: 183
Joined: 2009-12-04 14:52
Location: Sweden

Re: HowTo Build a Package from Source the Smart Way

#67 Post by MarcusW »

Awesome guide. :)

handheldCar
Posts: 221
Joined: 2009-11-27 02:31
Location: North Cackalack

Re: HowTo Build a Package from Source the Smart Way

#68 Post by handheldCar »

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

#69 Post by handheldCar »

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?

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: HowTo Build a Package from Source the Smart Way

#70 Post by stevepusser »

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.
MX Linux packager and developer

handheldCar
Posts: 221
Joined: 2009-11-27 02:31
Location: North Cackalack

Re: HowTo Build a Package from Source the Smart Way

#71 Post by handheldCar »

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.

User avatar
ChipOManiac
Posts: 285
Joined: 2011-07-29 02:42
Location: Talpittiya, Sri Lanka
Contact:

Thanks For The How-To

#72 Post by ChipOManiac »

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
Contact:

A Small Question

#73 Post by ChipOManiac »

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
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: HowTo Build a Package from Source the Smart Way

#74 Post by stevepusser »

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.
MX Linux packager and developer

User avatar
ChipOManiac
Posts: 285
Joined: 2011-07-29 02:42
Location: Talpittiya, Sri Lanka
Contact:

Re: HowTo Build a Package from Source the Smart Way

#75 Post by ChipOManiac »

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
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: HowTo Build a Package from Source the Smart Way

#76 Post by stevepusser »

Just to look at the latest Debian version as an example here: http://packages.debian.org/sid/kwin-style-qtcurve

and over on the right will be the source packages. Download the debian.tar.gz file over there, extract it, and take a look inside.
MX Linux packager and developer

User avatar
ChipOManiac
Posts: 285
Joined: 2011-07-29 02:42
Location: Talpittiya, Sri Lanka
Contact:

Re: HowTo Build a Package from Source the Smart Way

#77 Post by ChipOManiac »

stevepusser wrote:Just to look at the latest Debian version as an example here: http://packages.debian.org/sid/kwin-style-qtcurve

and over on the right will be the source packages. Download the debian.tar.gz file over there, extract it, and take a look inside.
OK. Thank You :)
"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
dbbolton
Posts: 2129
Joined: 2007-06-20 08:17
Location: Iapetus

Re: HowTo Build a Package from Source the Smart Way

#78 Post by dbbolton »

Next, enter the <packagename>_<version>/ directory and run dh_make.

Code: Select all

cd <packagename>_<version>/ 
dh_make
It should be name-version

Code: Select all

For dh_make to find the package name and version, the current directory 
needs to be in the format of <package>-<version>.  Alternatively use the
-p flag using the format <name>_<version> to override it.
I cannot understand the directory name or you have an invalid directory name!

Your current directory is /home/dbb/src/emerald/emerald_0.8.8, perhaps you could try going to
directory where the sources are?

Please note that this change is necessary ONLY during the initial
Debianization with dh_make.  When building the package, dpkg-source
will gracefully handle almost any upstream tarball.
GitHub | zsh docs in Letter PDF
Telemachus wrote:Put down the CGI.

User avatar
friarath
Posts: 82
Joined: 2010-06-16 18:52
Location: Mount Morris, MI

Re: HowTo Build a Package from Source the Smart Way

#79 Post by friarath »

I am using stable and trying to build AWN and the problem I have run in to is that it says:

Code: Select all

Build-Depends dependency for avant-window-navigator cannot be satisfied because no available versions of package libdesktop-agnostic-dev can satisfy version requirements
I have run into this problem trying to build Transmission and some other package. What can I do?
The Lord give you peace.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: HowTo Build a Package from Source the Smart Way

#80 Post by stevepusser »

You need then to backport a suitable version of the missing package, if possible.
MX Linux packager and developer

Post Reply