You are not logged in.

#1 2008-07-21 11:15:07

meandean
Member
Registered: 2008-06-24
Posts: 67

build package

Hello!
I often hear something along the lines of

compiling source and building a package is easier in Arch then in debian

That is something I hear a lot of but do not quite understand. How is it easier than apt-get source --compile packagename in debian?

Thanks for any clarification about this.

Last edited by meandean (2008-07-21 11:15:56)


Even a chicken can install Debian, when you put enough grain on the enter key.

Offline

#2 2008-07-21 11:24:48

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: build package

This is probably referring to the Arch Build System: http://wiki.archlinux.org/index.php/ABS


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#3 2008-07-21 11:29:19

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,604

Re: build package

I think the opinion being expressed is "it's easier to create an Arch *.pkg.tar.gz than it is to create a Debian *.deb" - perhaps the wording could be better. smile

I won't venture an opinion myself, as I've only created Arch packages.

Offline

#4 2008-07-21 11:29:55

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 9,939
Website

Re: build package

meandean wrote:

How is it easier than apt-get source --compile packagename in debian?

Well "makepkg" is only 7 letters... That is much easier to type!  big_smile 

There are two points to cover here.  Firstly, what if you want to change some of the build options.  PKGBUILDs are simple to interpret (just straight bash) so adjusting one is simple.  I only used Debian for six or so months so there may be a simple way to do that which I don't know.

The other point is making a package from scratch.  Writing your own PKGBUILD is fairly easy, if you can get the package to compile by hand, you can write a PKGBUILD.  I can remember making a .deb being a bit more involved.

Offline

#5 2008-07-21 11:57:09

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 3,528

Re: build package

meandean wrote:

Hello!
I often hear something along the lines of

compiling source and building a package is easier in Arch then in debian

That is something I hear a lot of but do not quite understand. How is it easier than apt-get source --compile packagename in debian?

Thanks for any clarification about this.

There are some differences here that you have to be aware of:
`apt-get source --compile packagename` dosn't realy create a package. It downloads a .deb containing the build scripts and source code, and then builds the pkg. We don't realy have anything exactly like that, since we don't distribute packages with the source included. Abs is somewhat the same, exept that all the build scripts are stored localy, and the source code is fetched directly from upstream. But from a users standpoint e.g. yaourt -S --abs packagename would be the same as the apt command.

Anyway, the real difference apears when you want to create your own pkg, or edit the build files of an existing one, and maby share it too. The three main points being:
* PKGBUILDS and .install are easier to write and understand than the debian conterparts.
* Arch's package guidelines are easier to grasp
* We got a realy nice system for sharing build files, namly AUR. Debian don't realy have anything like it afaik. (been a while since I used debian)


Evil #archlinux@freenode channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#6 2008-07-21 11:58:41

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: build package

alias m="sudo makepkg -c"

Thats 1 letter!

Last edited by dolby (2008-07-21 11:58:50)


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#7 2008-07-21 12:01:29

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 3,528

Re: build package

dolby wrote:

alias m="sudo makepkg -c"

Thats 1 letter!

Building as root is bad and not needed.
1. `makepkg -c`  don't need root at all (if you got fakeroot installed)
2. makepkg runs sudo as needed. If your user got access to pacman in sudoers, and do a `makepkg -sic`, then makepkg will prompt you for the password when needed.


Evil #archlinux@freenode channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#8 2008-07-21 12:11:46

meandean
Member
Registered: 2008-06-24
Posts: 67

Re: build package

Allan wrote:

Well "makepkg" is only 7 letters... That is much easier to type!  big_smile

big_smile  alias agsc='apt-get source --compile'

The last time I heard this about arch it went something like:

If I want the sources for "bash" package, for example, all I have to do in Arch is run "abs" as root to sync the ABS tree, copy /var/abs/core/bash folder somewhere, navigate to the copied folder and issue "makepkg -o". This will download and extract sources of bash for me. I can easily make a package out of these sources

Which had me rolling on the floor since that sounds anything except simple/easy although I am sure it really is easier than it sounds since describing something is often more complex than it is to actually do.

 

Firstly, what if you want to change some of the build options.  PKGBUILDs are simple to interpret (just straight bash) so adjusting one is simple.  I only used Debian for six or so months so there may be a simple way to do that which I don't know.

apt-get source
then edit the makefile
then you could probably run apt-get source --compile package
or run dpkg-buildpackage

The other point is making a package from scratch.  Writing your own PKGBUILD is fairly easy, if you can get the package to compile by hand, you can write a PKGBUILD.  I can remember making a .deb being a bit more involved.

To be honest I am not sure about the finer points of these issues since I do not mess with source code unless I have no alternative. smile

I have played with the above and messed with the following as well:
srcinst - support to install Debian packages, and all their build-time and run-time dependencies, solely from source
sbuild - tool for building Debian binary packages from Debian sources
And I can usually manage to not screw anything up.

Thanks for the clarification!


Even a chicken can install Debian, when you put enough grain on the enter key.

Offline

#9 2008-07-21 12:18:28

meandean
Member
Registered: 2008-06-24
Posts: 67

Re: build package

Mr.Elendig wrote:

Anyway, the real difference apears when you want to create your own pkg, or edit the build files of an existing one, and maby share it too. The three main points being:
* PKGBUILDS and .install are easier to write and understand than the debian conterparts.
* Arch's package guidelines are easier to grasp
* We got a realy nice system for sharing build files, namly AUR. Debian don't realy have anything like it afaik. (been a while since I used debian)

What are the debian counterparts to PKGBUILDS and .install? I always ignore guidelines - much more fun that way. smile Yea, the community aspect of AUR is interesting....possibly a bit scary....but cool nevertheless... Debian does seem to be a bit closed to 'average' users or should I say not as open to participation IMO.

Thanks for the clarification....again...

Last edited by meandean (2008-07-21 12:18:55)


Even a chicken can install Debian, when you put enough grain on the enter key.

Offline

#10 2008-07-21 13:23:40

catwell
Member
From: Bretagne, France
Registered: 2008-02-20
Posts: 207
Website

Re: build package

.install ~ DEBIAN/postinst / DEBIAN/postrm
PKGBUILD ~ about everything else

I have created Debian packages, this is a lot more complicated than to create Arch packages. Just compare these and you'll know :

http://www.debian.org/doc/maint-guide/
http://wiki.archlinux.org/index.php/The … guidelines

Offline

#11 2008-07-21 13:53:08

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: build package

Mr.Elendig wrote:
dolby wrote:

alias m="sudo makepkg -c"

Thats 1 letter!

Building as root is bad and not needed.
1. `makepkg -c`  don't need root at all (if you got fakeroot installed)
2. makepkg runs sudo as needed. If your user got access to pacman in sudoers, and do a `makepkg -sic`, then makepkg will prompt you for the password when needed.

OMG i got owned.
PS. I dont use sudo.


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#12 2008-07-21 14:06:47

meandean
Member
Registered: 2008-06-24
Posts: 67

Re: build package

catwell wrote:

.install ~ DEBIAN/postinst / DEBIAN/postrm
PKGBUILD ~ about everything else

I have created Debian packages, this is a lot more complicated than to create Arch packages. Just compare these and you'll know :

http://www.debian.org/doc/maint-guide/
http://wiki.archlinux.org/index.php/The … guidelines

Well that actually seems to be debian maintainer packaging policy and a long description of the process, not sure that is a equal comparison with the arch document. You also have http://wiki.archlinux.org/index.php/Arc … _Standards and so forth.

It seems that the tools in debian automate the process and do a lot of the work for you. For example dh-make will 'debianize' source code and I already mentioned a lot of other tools.

That being said, arch does have a simple method and doesn't require a lot of tools. I took a look at a PKGBUILD and the .install and that is simple. So I would say it is more simple to build a arch package 'by hand' or without having to use tools to do some work for you. It does seem that debian policy is more complex but those are requirements to get a package into debian itself not a home-grown repo.

A debian community package warehouse may be a idea to think about. Then again, I can always try to get my package in thru mentors.debian.net as well. But it is something to think about...

Great info so far. Got me thinking about a community repo idea. Thanks.

Last edited by meandean (2008-07-21 14:07:37)


Even a chicken can install Debian, when you put enough grain on the enter key.

Offline

#13 2008-07-21 14:46:30

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: build package

meandean wrote:

If I want the sources for "bash" package, for example, all I have to do in Arch is run "abs" as root to sync the ABS tree, copy /var/abs/core/bash folder somewhere, navigate to the copied folder and issue "makepkg -o". This will download and extract sources of bash for me. I can easily make a package out of these sources

Which had me rolling on the floor since that sounds anything except simple/easy although I am sure it really is easier than it sounds since describing something is often more complex than it is to actually do.

You're quoting me out of context wink  That was an answer to "how to get the sources for a package in Arch?"  If all you want is to build a package from source, all you need is "yaourt -Sb [package]" (needs yaourt from git at the moment).

Offline

#14 2008-07-21 15:06:37

meandean
Member
Registered: 2008-06-24
Posts: 67

Re: build package

I wasn't quoting you...I left your name out. And I did not ask that question you have in quotes...must be misquoting someone... wink

That does bring up a good question - What about the binary packages in CORE? How do you get the source for those packages? Same methods or what?

btw (just a observation) for arch to be so simple there sure are a lot of things to figure out.....AUR, abs, pacman, yaourt, etc... smile

Just so everyone knows, I am not trolling or causing trouble....just in my nature to dig in deep and find out about things and want things explained. I like to understand and prove things to myself not just believe what others say.


Even a chicken can install Debian, when you put enough grain on the enter key.

Offline

#15 2008-07-21 15:58:40

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: build package

Your question about the CORE packages -- same method.

Arch is simple, which doesn't always mean easy -- it means that once you understand the principle the details become intuitive.  All you really need to build/customize packages in Arch is:

* ABS -- it basically syncs the local ABS tree (located in /var/abs) with the current snapshot on Arch server.
* makepkg -- for building packages.
* pacman -- for managing packages.

That's it -- you have 2 tools, which a clear division of labor between them, and file-system-organized collection of build scripts.

Yaourt is a wrapper for pacman/makepkg that automates some common tasks, so it's useful and convenient, but it doesn't really do anything that can't be done "manually" with makepkg/pacman.

AUR -- in essence a community maintained version of ABS, with a web interface, and without pre-built binary packages.

Maybe it does sound like a lot, but once you start using it you find that it's not that difficult to figure out.

Offline

#16 2008-07-21 16:21:08

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,167
Website

Re: build package

meandean wrote:

btw (just a observation) for arch to be so simple there sure are a lot of things to figure out.....AUR, abs, pacman, yaourt, etc... smile

" 'Simple' is defined from a technical standpoint, not a usability standpoint. It is better to be technically elegant with a higher learning curve, than to be easy to use and technically [inferior]." -Aaron Griffin

smile

Offline

#17 2008-07-21 16:23:13

catwell
Member
From: Bretagne, France
Registered: 2008-02-20
Posts: 207
Website

Re: build package

I think the use of yaourt to build source packages from AUR has even been considered harmful by some devs, including phrakture (because it encourages you not to read the PKGBUILDs). You really don't need yaourt to use Arch and make packages - I don't use it personally.

Offline

#18 2008-07-21 16:25:47

meandean
Member
Registered: 2008-06-24
Posts: 67

Re: build package

Misfit138 wrote:
meandean wrote:

btw (just a observation) for arch to be so simple there sure are a lot of things to figure out.....AUR, abs, pacman, yaourt, etc... smile

" 'Simple' is defined from a technical standpoint, not a usability standpoint. It is better to be technically elegant with a higher learning curve, than to be easy to use and technically [inferior]." -Aaron Griffin

smile

and 'easy'? lol


Even a chicken can install Debian, when you put enough grain on the enter key.

Offline

#19 2008-07-21 16:58:18

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: build package

meandean wrote:

Hello!
I often hear something along the lines of

compiling source and building a package is easier in Arch then in debian

That is something I hear a lot of but do not quite understand. How is it easier than apt-get source --compile packagename in debian?

Thanks for any clarification about this.

I think that quote is referring to packages not in the repositories.

If you have a package that has never been packaged for debian, it is easier to figure out how to use a PKGBUILD than a debian.rules. I've done both for a program I created (pallavi.sf.net), and the Arch PKGBUILD is definitely fewer steps for each new release. In addition, it took me about two hours to figure out how to make my very first PKGBUILD four years ago when I didn't really know much about Linux, in comparison to three days to create my first Debian package after I was quite a bit more experienced.

Now that I've done both neither method is terribly difficult, but PKGBUILDs are definitely easier to read and understand, and that is simpler.

Dusty

Offline

#20 2008-07-21 17:12:25

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: build package

Misfit138 wrote:
meandean wrote:

btw (just a observation) for arch to be so simple there sure are a lot of things to figure out.....AUR, abs, pacman, yaourt, etc... smile

" 'Simple' is defined from a technical standpoint, not a usability standpoint. It is better to be technically elegant with a higher learning curve, than to be easy to use and technically [inferior]." -Aaron Griffin

smile

that's a pretty kick ass quote.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#21 2008-07-21 18:14:26

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,167
Website

Re: build package

meandean wrote:
Misfit138 wrote:
meandean wrote:

btw (just a observation) for arch to be so simple there sure are a lot of things to figure out.....AUR, abs, pacman, yaourt, etc... smile

" 'Simple' is defined from a technical standpoint, not a usability standpoint. It is better to be technically elegant with a higher learning curve, than to be easy to use and technically [inferior]." -Aaron Griffin

smile

and 'easy'? lol

Well, you said simple, not easy. wink

Offline

#22 2008-07-21 19:34:41

Asgaroth
Member
From: Hesse, Germany
Registered: 2008-03-26
Posts: 58

Re: build package

catwell wrote:

I think the use of yaourt to build source packages from AUR has even been considered harmful by some devs, including phrakture (because it encourages you not to read the PKGBUILDs). You really don't need yaourt to use Arch and make packages - I don't use it personally.

I don't really understand that point since the user is more encouraged by yaourt to read the PKGBUILD, since it prompts the user for every PKGBUILD and .install file, which the normal approach does not, since you could just download the PKGBUILD and type makepkg without any confirmation.
Furthermore, I don't think that it is the software that's the problem, it's the users, who don't consider it important and this attitude is not encouraged by yaourt, which doesn't make not reading the PKGBUILD more convenient than the manual process.

Last edited by Asgaroth (2008-07-21 19:36:06)

Offline

#23 2008-07-21 21:50:35

z0phi3l
Member
From: Waterbury CT
Registered: 2007-11-26
Posts: 276

Re: build package

Asgaroth wrote:
catwell wrote:

I think the use of yaourt to build source packages from AUR has even been considered harmful by some devs, including phrakture (because it encourages you not to read the PKGBUILDs). You really don't need yaourt to use Arch and make packages - I don't use it personally.

I don't really understand that point since the user is more encouraged by yaourt to read the PKGBUILD, since it prompts the user for every PKGBUILD and .install file, which the normal approach does not, since you could just download the PKGBUILD and type makepkg without any confirmation.
Furthermore, I don't think that it is the software that's the problem, it's the users, who don't consider it important and this attitude is not encouraged by yaourt, which doesn't make not reading the PKGBUILD more convenient than the manual process.

I personally like that yaourt asks you to check the files, because I don't always do check them out, plus it makes you think just for a bit to make sure you trust the source or not.
Because of yourt I have started checking pkgbuild and .install files, and I'm getting a grasp on them just from looking them over

Offline

#24 2008-07-22 07:25:34

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 960
Website

Re: build package

An Arch buildscript involves only one script, and an additional post-install script if needed. You could type up just a few lines and build a package for yourself anytime anywhere:

~ $ vim PKGBUILD
pkgname=foobar
pkgver=999
pkgrel=1
arch=(i686)
source=(foobar.tar.gz)

build() {
  cd $srdir/$pkgname-$pkgver
  
  mkdir -p $pkgdir/opt/$pkgname
  cp * $pkgdir/opt/$pkgname/
}
~ $ makepkg -ci

I need real, proper pen and paper for this.

Offline

Board footer

Powered by FluxBB