You are not logged in.

#1 2019-02-06 21:28:52

iyanmv
Member
Registered: 2016-11-08
Posts: 39
Website

Compressed deb/rpm as source in PKGBUILD?

Hello!

I understand that makepkg extracts automatically (unless specify in the noextract array) compress and package files (deb, rpm, tar.gz files).
But what is the right approach when, for example, the source is a deb.zip or a rpm.zip? In the srcdir I find the rpm/deb file, but I would to get directly what is inside those packages without having to use other tools (e.g. rpmextract). Is it possible to indicate to extract to a second level?

I try in the wiki, man PKGBUILD, etc. but I couldn't find anything. Thanks!

Offline

#2 2019-02-06 21:49:23

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: Compressed deb/rpm as source in PKGBUILD?

Welcome to the arch linux forums iyanmv.  Use bsdtar in prepare() to extract the rpm/deb.tgz after makepkg has extracted the .zip?

Offline

#3 2019-02-06 21:57:19

jsoy9pQbYVNu5nfU
Member
Registered: 2013-04-19
Posts: 108

Re: Compressed deb/rpm as source in PKGBUILD?

As loqs is saying. You may look at this PKGBUILD for a full example.

Offline

#4 2019-02-06 22:02:08

iyanmv
Member
Registered: 2016-11-08
Posts: 39
Website

Re: Compressed deb/rpm as source in PKGBUILD?

loqs wrote:

Welcome to the arch linux forums iyanmv.  Use bsdtar in prepare() to extract the rpm/deb.tgz after makepkg has extracted the .zip?

Ok, perfect! I'll do that. Thanks for the quick answer.

Offline

#5 2019-02-06 22:09:12

iyanmv
Member
Registered: 2016-11-08
Posts: 39
Website

Re: Compressed deb/rpm as source in PKGBUILD?

Do you think that this is ok? Instead of extracting in prepare() to later having to copy, can I just extract directly in the pkgdir like the example @2ion mentioned?

pkgname=linux-intel-undervolt-gui
pkgver=1.0.1
pkgrel=1
pkgdesc="GUI frontend for undervolting intel CPUs on Linux"
arch=('x86_64')
url="https://github.com/lukechadwick/linux-intel-undervolt-gui"
license=('MIT')
depends=('python-undervolt')
source=("${url}/releases/download/${pkgver}/${pkgname}-${pkgver}.x86_64.rpm.zip")
sha512sums=('397e46e5cbd05d0a0c20e1c4542d2575b595e497d520842bece5acea2ca4eed09d90812c1f768bd64310ffff6f1eac142ec1493d49e80b7c43525abe32700f3d')

package() {
    cd ${srcdir}/
    bsdtar -xf ${pkgname}-${pkgver}.x86_64.rpm -C ${pkgdir}
}

Last edited by iyanmv (2019-02-06 22:17:16)

Offline

#6 2019-02-06 22:43:13

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: Compressed deb/rpm as source in PKGBUILD?

Have you tried building the electron app from source?

Offline

#7 2019-02-06 22:47:50

iyanmv
Member
Registered: 2016-11-08
Posts: 39
Website

Re: Compressed deb/rpm as source in PKGBUILD?

Yes, but it failed. I guess I can give it a second try during the weekend with more time. Is it preferable to use the source instead of the package from the release?

Offline

#8 2019-02-06 22:55:05

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: Compressed deb/rpm as source in PKGBUILD?

It is preferred to build from source.  Alternately you can add the -bin suffix to the package to indicate it is a repacked binary (not sure this applies to electron).
I have no experience with electron but if you provide the makepkg output from the build failure others who do may be able to resolve the issue.

Last edited by loqs (2019-02-06 22:55:20)

Offline

#9 2019-02-07 19:51:36

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Compressed deb/rpm as source in PKGBUILD?

iyanmv wrote:

I understand that makepkg extracts automatically (unless specify in the noextract array) compress and package files (deb, rpm, tar.gz files).
But what is the right approach when, for example, the source is a deb.zip or a rpm.zip?

makepkg does not *recursively* extract sources. Recommended plan of action:

Step one: do it yourself using bsdtar.

Step two: Start a dialog with upstream, asking why they did something so bizarre as to take a compressed .deb or .rpm, and stick it inside a zipfile. It's not like zipfiles are even good at compressing things to begin with, but it is pretty silly to even try when .deb natively supports much better compression by internally using e.g. data.tar.xz

iyanmv wrote:

Do you think that this is ok? Instead of extracting in prepare() to later having to copy, can I just extract directly in the pkgdir like the example @2ion mentioned?

You can do that for rpm, but .deb will extract to the three files debian-binary control.tar.gz and data.tar.xz which makes no sense to extract directly to "${pkgdir}".

loqs wrote:

It is preferred to build from source.  Alternately you can add the -bin suffix to the package to indicate it is a repacked binary (not sure this applies to electron).
I have no experience with electron but if you provide the makepkg output from the build failure others who do may be able to resolve the issue.

It's not about whether it applies to electron or not. It applies to all packages, and the only arguable exception is when the binary is closed-source and thus there is no source to build.

Electron apps are simply the most frequent sort of package to violate the -bin guidelines. That doesn't make it okay.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#10 2019-02-07 20:19:41

iyanmv
Member
Registered: 2016-11-08
Posts: 39
Website

Re: Compressed deb/rpm as source in PKGBUILD?

Ok, thanks for the detailed answer @eschwartz. Then, I will give it a try to do a proper PKGBUILD from the sources.

Offline

Board footer

Powered by FluxBB