[aur-general] PKGBUILD: build() vs package() function
Hello, hope I don't get this missplaced, as a quick search didn'd get me any results. When I have a package, which does actually build nothing -- say wine_gecko (a file only needs to be placed to a correct directory) -- I should only have package() function in the PKGBUILD, is that a correct interpretation? Now the makepkg is happy but the AUR complaints. I can workaround that with an empty build() function in that case the AUR is happy but the makepkg complains. So I just put in there a harmless echo and both are happy now. Actually my question is not that much about the correct workarounding, as it is about if I really get the meaning of the build() and package() functions correctly, that is for building build(), for installing package()? Thanx, Nicky. -- Don't it always seem to go That you don't know what you've got Till it's gone (Joni Mitchell)
On 08/28/2010 10:32 PM, Nicky726 wrote:
Hello,
hope I don't get this missplaced, as a quick search didn'd get me any results.
When I have a package, which does actually build nothing -- say wine_gecko (a file only needs to be placed to a correct directory) -- I should only have package() function in the PKGBUILD, is that a correct interpretation?
Now the makepkg is happy but the AUR complaints. I can workaround that with an empty build() function in that case the AUR is happy but the makepkg complains. So I just put in there a harmless echo and both are happy now. Actually my question is not that much about the correct workarounding, as it is about if I really get the meaning of the build() and package() functions correctly, that is for building build(), for installing package()?
Thanx, Nicky.
Hi Nicky, your interpretation sounds very sensible to me. The related AUR-bugreport is here: http://bugs.archlinux.org/task/19914 The bug is fixed in the git-repository, but the software on aur.archlinux.org was not updated after that patch was applied. An update of the AUR is not scheduled yet. Regards, PyroPeter -- freenode/pyropeter "12:50 - Ich drücke Return."
On 28 August 2010 22:32, Nicky726 <nicky726@gmail.com> wrote:
Hello,
hope I don't get this missplaced, as a quick search didn'd get me any results.
When I have a package, which does actually build nothing -- say wine_gecko (a file only needs to be placed to a correct directory) -- I should only have package() function in the PKGBUILD, is that a correct interpretation?
Now the makepkg is happy but the AUR complaints. I can workaround that with an empty build() function in that case the AUR is happy but the makepkg complains. So I just put in there a harmless echo and both are happy now. Actually my question is not that much about the correct workarounding, as it is about if I really get the meaning of the build() and package() functions correctly, that is for building build(), for installing package()?
Thanx, Nicky.
Personally I'd use /bin/true instead of echo. However I think in this case having everything in build() is justifiable. Lukas
On 29/08/10 06:32, Nicky726 wrote:
Hello,
hope I don't get this missplaced, as a quick search didn'd get me any results.
When I have a package, which does actually build nothing -- say wine_gecko (a file only needs to be placed to a correct directory) -- I should only have package() function in the PKGBUILD, is that a correct interpretation?
Now the makepkg is happy but the AUR complaints. I can workaround that with an empty build() function in that case the AUR is happy but the makepkg complains. So I just put in there a harmless echo and both are happy now. Actually my question is not that much about the correct workarounding, as it is about if I really get the meaning of the build() and package() functions correctly, that is for building build(), for installing package()?
It actually makes no difference. Makepkg treats packages with only a build() function the same as packages with only a package() function in that everything is run under fakeroot. When both a build() and package() function are present, the build() function is run as the user calling makepkg and the package() function is run under fakeroot. So it should be clear that an empty build() function is a waste of time... Allan
On Sun, Aug 29, 2010 at 9:29 AM, Allan McRae <allan@archlinux.org> wrote:
On 29/08/10 06:32, Nicky726 wrote:
Hello,
hope I don't get this missplaced, as a quick search didn'd get me any results.
When I have a package, which does actually build nothing -- say wine_gecko (a file only needs to be placed to a correct directory) -- I should only have package() function in the PKGBUILD, is that a correct interpretation?
Now the makepkg is happy but the AUR complaints. I can workaround that with an empty build() function in that case the AUR is happy but the makepkg complains. So I just put in there a harmless echo and both are happy now. Actually my question is not that much about the correct workarounding, as it is about if I really get the meaning of the build() and package() functions correctly, that is for building build(), for installing package()?
It actually makes no difference. Makepkg treats packages with only a build() function the same as packages with only a package() function in that everything is run under fakeroot.
When both a build() and package() function are present, the build() function is run as the user calling makepkg and the package() function is run under fakeroot.
So it should be clear that an empty build() function is a waste of time...
Allan
On one of my packages, where I copied the new PKGBUILD from /usr/share/pacman, under build(){ I did install -d ${pkgdir}/usr/bin } since it didn't actually have a build option like ./configure make or anything like that. While under package(){ install -Dm755 BINARY ${pkgdir}/usr/bin/BINARY Could maybe do it this way?
On 30/08/10 03:06, Nathan O wrote:
On Sun, Aug 29, 2010 at 9:29 AM, Allan McRae<allan@archlinux.org> wrote:
On 29/08/10 06:32, Nicky726 wrote:
Hello,
hope I don't get this missplaced, as a quick search didn'd get me any results.
When I have a package, which does actually build nothing -- say wine_gecko (a file only needs to be placed to a correct directory) -- I should only have package() function in the PKGBUILD, is that a correct interpretation?
Now the makepkg is happy but the AUR complaints. I can workaround that with an empty build() function in that case the AUR is happy but the makepkg complains. So I just put in there a harmless echo and both are happy now. Actually my question is not that much about the correct workarounding, as it is about if I really get the meaning of the build() and package() functions correctly, that is for building build(), for installing package()?
It actually makes no difference. Makepkg treats packages with only a build() function the same as packages with only a package() function in that everything is run under fakeroot.
When both a build() and package() function are present, the build() function is run as the user calling makepkg and the package() function is run under fakeroot.
So it should be clear that an empty build() function is a waste of time...
Allan
On one of my packages, where I copied the new PKGBUILD from /usr/share/pacman, under build(){ I did install -d ${pkgdir}/usr/bin } since it didn't actually have a build option like ./configure make or anything like that.
While under package(){ install -Dm755 BINARY ${pkgdir}/usr/bin/BINARY
Could maybe do it this way?
No... if there is a package() function then the build() function should never touch $pkgdir. Allan
On Sun, Aug 29, 2010 at 12:28 PM, Allan McRae <allan@archlinux.org> wrote:
On 30/08/10 03:06, Nathan O wrote:
On Sun, Aug 29, 2010 at 9:29 AM, Allan McRae<allan@archlinux.org> wrote:
On 29/08/10 06:32, Nicky726 wrote:
Hello,
hope I don't get this missplaced, as a quick search didn'd get me any results.
When I have a package, which does actually build nothing -- say wine_gecko (a file only needs to be placed to a correct directory) -- I should only have package() function in the PKGBUILD, is that a correct interpretation?
Now the makepkg is happy but the AUR complaints. I can workaround that with an empty build() function in that case the AUR is happy but the makepkg complains. So I just put in there a harmless echo and both are happy now. Actually my question is not that much about the correct workarounding, as it is about if I really get the meaning of the build() and package() functions correctly, that is for building build(), for installing package()?
It actually makes no difference. Makepkg treats packages with only a
build() function the same as packages with only a package() function in that everything is run under fakeroot.
When both a build() and package() function are present, the build() function is run as the user calling makepkg and the package() function is run under fakeroot.
So it should be clear that an empty build() function is a waste of time...
Allan
On one of my packages, where I copied the new PKGBUILD from
/usr/share/pacman, under build(){ I did install -d ${pkgdir}/usr/bin } since it didn't actually have a build option like ./configure make or anything like that.
While under package(){ install -Dm755 BINARY ${pkgdir}/usr/bin/BINARY
Could maybe do it this way?
No... if there is a package() function then the build() function should never touch $pkgdir.
Allan
Alright I understand. Will fix the one I did. I thought the build area would be the area for how I described above.
participants (5)
-
Allan McRae
-
Lukáš Jirkovský
-
Nathan O
-
Nicky726
-
PyroPeter