You are not logged in.

#1 2010-01-25 17:46:15

kaddy
Member
From: Perth, Western Australia
Registered: 2009-09-22
Posts: 192

how to create PKGBUILDS

Hi
ok... im probably going to sound like an idiot.... But i've been using arch for a few months now and love it... but 1 thing which
i want to learn is how to create packages for submission to the AUR.... I guess i'll just call it pkgbuilds....
i've read the Wiki but some things are not clear to me.... im new to compiling so forgive my stupidness.....

ok.... I see packages on sourceforge every now and then that i want that are not in the official repos or the AUR.... so i want to help contribute

So far this is a brief summary of how to do it............

   1. Download the source tarball of the software you want to package.
   2. Try compiling the package and installing it into an arbitrary directory.
   3. Copy over the prototype /usr/share/pacman/PKGBUILD.proto and rename it to PKGBUILD in a temporary working directory -- preferably ~/abs/.
   4. Edit the PKGBUILD according to the needs of your package.
   5. Run makepkg and see whether the resulting package is built correctly.
   6. If not, repeat the last two steps.


Ok... I understand what to do and am baffled at stage 4........  I know how to compile source packages.... But how the heck or where the heck do
I find the exact info to put into my pkgbuild? I know how to obtain a prototype that needs the blanks filled in... but where do i get the exact info to fill it in correctly?
is there a single location in the source package that will help me fill in all the info i need to create a Pkgbuild so that arch can use makepkg to install the newly created pkgbuild?

Can anybody explain it to me in idiot terms?

thanx

Offline

#2 2010-01-25 17:55:05

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: how to create PKGBUILDS

From your package's documentation? The PKGBUILD is a script that would more or less automate the building process. If you don't know where to start, look at PKGBUILDs for packages similar to the one you are working with. (The wiki lists sections required for any well functioning PKGBUILD, and since you said you read it, I assume you have.)


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2010-01-25 18:26:23

kaddy
Member
From: Perth, Western Australia
Registered: 2009-09-22
Posts: 192

Re: how to create PKGBUILDS

yeah.... but if that is the way it is done... im confused as to why you would need to compile a package on Arch using the tradition method "./configure, make, make install" from a source package if all your going to do is fill out a pkgbuild.....??? why would you need to compile it in the first place?? I hope somebody can clear up this misunderstanding I have on whats going on with building these pkgbuilds.... im confused.... lol

Offline

#4 2010-01-25 18:32:24

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: how to create PKGBUILDS

2. is redundant, it's for checking if the source compiles

Offline

#5 2010-01-25 18:55:54

kaddy
Member
From: Perth, Western Australia
Registered: 2009-09-22
Posts: 192

Re: how to create PKGBUILDS

ok thanx..... that answers 1 of my questions..... makes sense now....
But as for making pkgbuilds for a new program i might of downloaded... Im still a bit confused.... fsckd said the documentation??? is this information correct?
If so.. where is all the information kept? I havn't been able to find anything in a source package that tells me the info i need to fill in the gaps of a pkgbuild... unless im blind....
or am I missing something here?

appreciate any comments wink

Offline

#6 2010-01-25 19:03:01

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 858
Website

Re: how to create PKGBUILDS

The build() function should contain almost exactly the steps you would type yourself to compile a package.  Usually you can get away with this:

./configure --prefix=/usr || return 1
make || return 1
make DESTDIR="${pkgdir}" install || return 1

The "|| return 1"s are just there to make makepkg fail if the build fails, the --prefix=/usr is to make it install to the right place (/usr/{bin,lib,include} etc.), and DESTDIR="${pkgdir}" makes it install to the package directory ($startdir/pkg).

To know what to change or add, just look at the documentation for whatever you're compiling; specifically, whatever it tells you to do to compile it.  Most packages will tell you just to run "./configure && make", and in these cases this minimal build function will probably work.  Other packages have a more complicated build process.

You should familiarise yourself with bash scripting in order to get a good feel for how PKGBUILDs work.

Offline

#7 2010-01-25 19:03:51

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: how to create PKGBUILDS

kaddy wrote:

where is all the information kept? I havn't been able to find anything in a source package that tells me the info i need to fill in the gaps of a pkgbuild

What software do you want to create a PKGBUILD for? What information for the PKGBUILD are you missing?

In my experience, all software is a little bit different. The location of the information you want to find differs between software projects.

Offline

#8 2010-01-25 19:10:28

kaddy
Member
From: Perth, Western Australia
Registered: 2009-09-22
Posts: 192

Re: how to create PKGBUILDS

thanx for comments....
no package in particular from the top of my head.... but I do find the odd package i want that isn't in Arch....

hmmmm, i wonder how many packages Arch linux has including the official repos + AuR... would be interesting to know if our package total is
up there with ubuntu.... hehehehe.

Last edited by kaddy (2010-01-25 19:11:00)

Offline

Board footer

Powered by FluxBB