[pacman-dev] PKGBUILD.proto - Take2
Hi, Edit: Take2, changed the install line Dan suggested I send this to the pacman-dev list. After completing some research and asking alot of questions I present some minor changes to PKGBUILD.proto supplied as a .diff to be merged after your approval. I believe it helps the intended audience create a better PKGBUILD in less time according to the latest Arch Packaging Standards. Cheers Jud Inline: --- PKGBUILD.proto 2008-12-05 23:32:33.000005000 +1000 +++ PKGBUILD.proto.new 2008-12-07 13:49:43.889569135 +1000 @@ -3,13 +3,15 @@ # NOTE: Please fill out the license field for your package! If it is unknown, # then please put 'unknown'. + # Contributor: Your Name <youremail@domain.com> + pkgname=NAME -pkgver=VERSION +pkgver=VERSION # Note: if pkgver is '0.99-10' then use an underscore, i.e. '0.99_10' pkgrel=1 pkgdesc="" -arch=() -url="" +url="http://ADDRESS/" +arch=('i686' 'x86_64') license=('GPL') groups=() depends=() @@ -20,17 +22,13 @@ replaces=() backup=() options=() -install= -source=($pkgname-$pkgver.tar.gz) -noextract=() -md5sums=() #generate with 'makepkg -g' +install=${pkgname}.install +source=(http://ADDRESS/TO/FILE/${pkgname}-${pkgver}.tar.gz) +md5sums=() # Generate with 'makepkg -g' build() { - cd "$srcdir/$pkgname-$pkgver" - - ./configure --prefix=/usr + cd ${srcdir}${pkgname}-${pkgver} + ./configure --prefix=usr make || return 1 - make DESTDIR="$pkgdir/" install + make DESTDIR=${pkgdir} install || return 1 } - -# vim:set ts=2 sw=2 et:
On Sun, 7 Dec 2008, Jud wrote:
Hi,
Edit: Take2, changed the install line
Dan suggested I send this to the pacman-dev list.
After completing some research and asking alot of questions I present some minor changes to PKGBUILD.proto supplied as a .diff to be merged after your approval. I believe it helps the intended audience create a better PKGBUILD in less time according to the latest Arch Packaging Standards.
Cheers Jud
Inline: --- PKGBUILD.proto 2008-12-05 23:32:33.000005000 +1000 +++ PKGBUILD.proto.new 2008-12-07 13:49:43.889569135 +1000 @@ -3,13 +3,15 @@ # NOTE: Please fill out the license field for your package! If it is unknown, # then please put 'unknown'.
+ # Contributor: Your Name <youremail@domain.com> + pkgname=NAME -pkgver=VERSION +pkgver=VERSION # Note: if pkgver is '0.99-10' then use an underscore, i.e. '0.99_10' pkgrel=1 pkgdesc="" -arch=() -url="" +url="http://ADDRESS/" +arch=('i686' 'x86_64') license=('GPL') groups=() depends=() @@ -20,17 +22,13 @@ replaces=() backup=() options=() -install= -source=($pkgname-$pkgver.tar.gz) -noextract=() -md5sums=() #generate with 'makepkg -g' +install=${pkgname}.install +source=(http://ADDRESS/TO/FILE/${pkgname}-${pkgver}.tar.gz) +md5sums=() # Generate with 'makepkg -g'
build() { - cd "$srcdir/$pkgname-$pkgver" - - ./configure --prefix=/usr + cd ${srcdir}${pkgname}-${pkgver} + ./configure --prefix=usr make || return 1 - make DESTDIR="$pkgdir/" install + make DESTDIR=${pkgdir} install || return 1 } - -# vim:set ts=2 sw=2 et:
Please do the fixes I mentionned here: http://archlinux.org/pipermail/pacman-dev/2008-December/007740.html -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Jud wrote:
Hi,
Edit: Take2, changed the install line
Dan suggested I send this to the pacman-dev list.
After completing some research and asking alot of questions I present some minor changes to PKGBUILD.proto supplied as a .diff to be merged after your approval. I believe it helps the intended audience create a better PKGBUILD in less time according to the latest Arch Packaging Standards.
Cheers Jud
Inline: --- PKGBUILD.proto 2008-12-05 23:32:33.000005000 +1000 +++ PKGBUILD.proto.new 2008-12-07 13:49:43.889569135 +1000 @@ -3,13 +3,15 @@ # NOTE: Please fill out the license field for your package! If it is unknown, # then please put 'unknown'.
+ # Contributor: Your Name <youremail@domain.com> + pkgname=NAME -pkgver=VERSION +pkgver=VERSION # Note: if pkgver is '0.99-10' then use an underscore, i.e. '0.99_10' pkgrel=1
Can we make this shorter. I.e "# Note: Cannot contain hyphens." This really should get documented in the man page.
pkgdesc="" -arch=() -url="" +url="http://ADDRESS/" +arch=('i686' 'x86_64')
Re-ordering why? Also, adding Arch's standard arch values is distro specific. We try and avoid that in the pacman code.
license=('GPL') groups=() depends=() @@ -20,17 +22,13 @@ replaces=() backup=() options=() -install= -source=($pkgname-$pkgver.tar.gz) -noextract=() -md5sums=() #generate with 'makepkg -g' +install=${pkgname}.install +source=(http://ADDRESS/TO/FILE/${pkgname}-${pkgver}.tar.gz) +md5sums=() # Generate with 'makepkg -g'
Why remove noextract? The prototype should have every field.
build() { - cd "$srcdir/$pkgname-$pkgver" - - ./configure --prefix=/usr + cd ${srcdir}${pkgname}-${pkgver}
Still missing a / in the middle of this line and the quotes are needed for people who build in directories with spaces.
+ ./configure --prefix=usr make || return 1 - make DESTDIR="$pkgdir/" install + make DESTDIR=${pkgdir} install || return 1
The trailing slash was added here deliberately as some makefiles suck. Also, quotes are needed.
} - -# vim:set ts=2 sw=2 et:
Allan
I agree with Allan on pretty much everything he said below. I'll add a few things too. On Sat, Dec 6, 2008 at 10:07 PM, Allan McRae <allan@archlinux.org> wrote:
Jud wrote:
--- PKGBUILD.proto 2008-12-05 23:32:33.000005000 +1000 +++ PKGBUILD.proto.new 2008-12-07 13:49:43.889569135 +1000 @@ -3,13 +3,15 @@ # NOTE: Please fill out the license field for your package! If it is unknown, # then please put 'unknown'. + # Contributor: Your Name <youremail@domain.com> + pkgname=NAME -pkgver=VERSION +pkgver=VERSION # Note: if pkgver is '0.99-10' then use an underscore, i.e. '0.99_10' pkgrel=1
Can we make this shorter. I.e "# Note: Cannot contain hyphens." This really should get documented in the man page. Agreed on both counts. Patches welcome. :P
pkgdesc="" -arch=() -url="" +url="http://ADDRESS/" +arch=('i686' 'x86_64')
Re-ordering why? Also, adding Arch's standard arch values is distro specific. We try and avoid that in the pacman code. Mostly agreed. This is a shell script so order really doesn't matter. I feel like default arch values might be nice to show what we are going for, however. I'm really impartial on this though, and I'd defer to Allan on this decision as I've made him Mr. Makepkg. :)
license=('GPL') groups=() depends=() @@ -20,17 +22,13 @@ replaces=() backup=() options=() -install= -source=($pkgname-$pkgver.tar.gz) -noextract=() -md5sums=() #generate with 'makepkg -g' +install=${pkgname}.install +source=(http://ADDRESS/TO/FILE/${pkgname}-${pkgver}.tar.gz) +md5sums=() # Generate with 'makepkg -g'
Why remove noextract? The prototype should have every field. Agreed.
build() { - cd "$srcdir/$pkgname-$pkgver" - - ./configure --prefix=/usr + cd ${srcdir}${pkgname}-${pkgver}
Still missing a / in the middle of this line and the quotes are needed for people who build in directories with spaces. And why the 6 unnecessary characters? {}{}{} is a waste IMO as you didn't really give a good reason to change what is already there. Please leave this line as-is.
+ ./configure --prefix=usr make || return 1 - make DESTDIR="$pkgdir/" install + make DESTDIR=${pkgdir} install || return 1
The trailing slash was added here deliberately as some makefiles suck. Also, quotes are needed. Yep.
We may sound harsh but we try to do reviews of every patch- don't get discouraged, but please try and incorporate our feedback. -Dan
On Sat, 6 Dec 2008 22:47:38 -0600 "Dan McGee" <dpmcgee@gmail.com> wrote:
I agree with Allan on pretty much everything he said below. I'll add a few things too.
On Sat, Dec 6, 2008 at 10:07 PM, Allan McRae <allan@archlinux.org> wrote:
Jud wrote:
--- PKGBUILD.proto 2008-12-05 23:32:33.000005000 +1000 +++ PKGBUILD.proto.new 2008-12-07 13:49:43.889569135 +1000 @@ -3,13 +3,15 @@ # NOTE: Please fill out the license field for your package! If it is unknown, # then please put 'unknown'. + # Contributor: Your Name <youremail@domain.com> + pkgname=NAME -pkgver=VERSION +pkgver=VERSION # Note: if pkgver is '0.99-10' then use an underscore, i.e. '0.99_10' pkgrel=1
Can we make this shorter. I.e "# Note: Cannot contain hyphens." This really should get documented in the man page. Agreed on both counts. Patches welcome. :P
pkgdesc="" -arch=() -url="" +url="http://ADDRESS/" +arch=('i686' 'x86_64')
Re-ordering why? Also, adding Arch's standard arch values is distro specific. We try and avoid that in the pacman code. Mostly agreed. This is a shell script so order really doesn't matter. I feel like default arch values might be nice to show what we are going for, however. I'm really impartial on this though, and I'd defer to Allan on this decision as I've made him Mr. Makepkg. :)
license=('GPL') groups=() depends=() @@ -20,17 +22,13 @@ replaces=() backup=() options=() -install= -source=($pkgname-$pkgver.tar.gz) -noextract=() -md5sums=() #generate with 'makepkg -g' +install=${pkgname}.install +source=(http://ADDRESS/TO/FILE/${pkgname}-${pkgver}.tar.gz) +md5sums=() # Generate with 'makepkg -g'
Why remove noextract? The prototype should have every field. Agreed.
build() { - cd "$srcdir/$pkgname-$pkgver" - - ./configure --prefix=/usr + cd ${srcdir}${pkgname}-${pkgver}
Still missing a / in the middle of this line and the quotes are needed for people who build in directories with spaces. And why the 6 unnecessary characters? {}{}{} is a waste IMO as you didn't really give a good reason to change what is already there. Please leave this line as-is.
+ ./configure --prefix=usr make || return 1 - make DESTDIR="$pkgdir/" install + make DESTDIR=${pkgdir} install || return 1
The trailing slash was added here deliberately as some makefiles suck. Also, quotes are needed. Yep.
We may sound harsh but we try to do reviews of every patch- don't get discouraged, but please try and incorporate our feedback.
-Dan _______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
Thanks everyone for the quick replies. My only intention is to make Arch and pacman better. Everything added in is from other PKGBUILDs and what others have said to do over the past few weeks, as you could guess it has become very confusing. So I am glad to get this all straightened out and everyone can learn and make Arch and Pacman better. Personally, I couldn't give a c#%p what is in the PKGBUILD as long as everyone (Devs included) are on the same page. arch=() # For Arch Linux: arch=('i686' 'x86_64') Would this line be ok since I'd say the over whelming usage would be Arch (and derivatives) based? url line Only following the "Options and Directives" from the "PKGBUILD(5) Manual Page" Which I believe makes sense if you consider the old "Who? What? Where? When?" [1]. Also I think it reads and looks much better. If pacman is trying to be Distro independent wouldn't it be better to change line 9 from PKGBUILD.5.txt "PKGBUILD - Arch Linux package build description file"? I would be happy to help re-write the whole file. Do these following lines have the same result? cd "$srcdir/$pkgname-$pkgver" cd ${srcdir}/${pkgname}-${pkgver} From the PKGBUILDs I have studied (over 500 in the past few weeks) I would say it would be about 50/50 split (some only have 'cd $srcdir/$pkgname-$pkgver') Anyways I'm not phased which way the knife falls and I hope we can sort this all out quickly. Cheers Jud [1] http://en.wikipedia.org/wiki/5_Ws
Jud wrote:
Thanks everyone for the quick replies. My only intention is to make Arch and pacman better.
Everything added in is from other PKGBUILDs and what others have said to do over the past few weeks, as you could guess it has become very confusing. So I am glad to get this all straightened out and everyone can learn and make Arch and Pacman better. Personally, I couldn't give a c#%p what is in the PKGBUILD as long as everyone (Devs included) are on the same page.
Stylistic guidelines are almost never agreed on by anyone and are not particularly enforceable. As an example, search for C code formating guidelines on the web...
arch=() # For Arch Linux: arch=('i686' 'x86_64') Would this line be ok since I'd say the over whelming usage would be Arch (and derivatives) based?
I would like it left as just "arch=()". There is an example in the PKGBUILD man page.
url line Only following the "Options and Directives" from the "PKGBUILD(5) Manual Page" Which I believe makes sense if you consider the old "Who? What? Where? When?" [1]. Also I think it reads and looks much better.
If pacman is trying to be Distro independent wouldn't it be better to change line 9 from PKGBUILD.5.txt "PKGBUILD - Arch Linux package build description file"? I would be happy to help re-write the whole file.
Yes, that should be fixed. I do not think it needs that much of a rewrite though.
Do these following lines have the same result? cd "$srcdir/$pkgname-$pkgver" cd ${srcdir}/${pkgname}-${pkgver}
Well, the quotes in the top line allow $srcdir to have spaces. Otherwise they are the some thing. The {}'s are redundant in this case.
From the PKGBUILDs I have studied (over 500 in the past few weeks) I would say it would be about 50/50 split (some only have 'cd $srcdir/$pkgname-$pkgver')
I have to admit that I do not use quotes because I don't care about people who use spaces in directory names... But the prototype probably should keep the quotes in.
Anyways I'm not phased which way the knife falls and I hope we can sort this all out quickly.
Cheers Jud
Allan
On Sun, Dec 7, 2008 at 08:11, Allan McRae <allan@archlinux.org> wrote:
I would like it left as just "arch=()". There is an example in the PKGBUILD man page. Generic concern: I often like to start from the PKGBUILD.proto. For now it only has comments on the first lines, which can be destroyed with V4jd in vim, and in the md5sums line, which I destroy entirely too (and generate with makepkg -g >> PKGBUILD). PLEASE, PLEASE don't add documentation that will take time to remove and provide indications that will only be useful on the first uses. I'd rather see them in a HOWTO.
-- Geoffroy Carrier
participants (5)
-
Allan McRae
-
Dan McGee
-
Eric Bélanger
-
Geoffroy Carrier
-
Jud