You are not logged in.

#1 2017-03-04 16:27:36

Eskdale
Member
Registered: 2017-03-04
Posts: 3

[Solved] Creating Package From Binary?

The Wiki pages for Creating Packages, PKGBUILD and Makepkg all provide information for making packages from the source code.  I've already built the binary for my application and wish to create the package from that, but I'm having trouble.

I've created a PKGBUILD file which contains the mandatory variables (I'll add more optional variables later):

pkgname=eskdale
pkgver=1.0
pkgrel=1
arch=('x86_64')

In the same directory as the PKGBUILD file I've created a directory called pkg.  The pkg directory is a fakeroot with all the application files in the relevant directories.  When I run makepkg I get this output:

==> Making package: eskdale 1.0-1 (Sat  4 Mar 16:02:01 GMT 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
==> Extracting sources...
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issue...
==> Creating package "eskdale"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: eskdale 1.0-1 (Sat  4 Mar 16:02:01 GMT 2017)

Unfortunately, the package that is created doesn't contain the application files.  The reason appears to be barbecue of the line "==> Removing existing $pkgdir/ directory..." which deletes all the application files before it builds the package.

I can't find any information in the wiki as to how to build a package from the binaries, so I'm at a loss as to what to do.

How can I get this working?

Last edited by Eskdale (2017-03-04 22:15:45)

Offline

#2 2017-03-04 17:39:25

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,784
Website

Re: [Solved] Creating Package From Binary?

You shouldn't be pre-populating the pkg directory before running makepkg. Your PKGBUILD should take the files declared in the source array, and do whatever is needed (e.g. compiling binaries, moving files, etc) to populate the pkg directory. You don't have to compile from source (although since you have the source, I'm unsure why you don't want to do this), just take a look at the existing -bin packages on the AUR, such as atom-editor-bin


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#3 2017-03-04 18:44:27

Eskdale
Member
Registered: 2017-03-04
Posts: 3

Re: [Solved] Creating Package From Binary?

Forcing you to combine the building and packaging process seems inconvenient and unnatural to me.

Surely there must be a way to make the package from the binaries, like you do with .deb?

Offline

#4 2017-03-04 18:54:22

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: [Solved] Creating Package From Binary?

Eskdale wrote:

Forcing you to combine the building and packaging process seems inconvenient and unnatural to me.

Surely there must be a way to make the package from the binaries, like you do with .deb?

He told you how... you aren't building anything by definition, so go directly to packaging.  Another example: https://aur.archlinux.org/cgit/aur.git/ … mprime-bin


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2017-03-04 22:15:29

Eskdale
Member
Registered: 2017-03-04
Posts: 3

Re: [Solved] Creating Package From Binary?

graysky wrote:

He told you how... you aren't building anything by definition, so go directly to packaging.  Another example: https://aur.archlinux.org/cgit/aur.git/ … mprime-bin

Sorry, I completely misunderstood.  I understand now after seeing that example.

Thanks a lot for the assistance.

Offline

Board footer

Powered by FluxBB