You are not logged in.

#1 2016-07-13 06:39:08

pattyo
Member
Registered: 2016-07-13
Posts: 8

Help with PKGBUILD for package with non redistributable source

Hi,

I'm trying to repackage a small part of a binary installer provided by NXP. The source is freely available but you need to sign up to their website in order to download it.

The guidelines (https://wiki.archlinux.org/index.php/Ar … the_AUR.3F) for this say: "For other cases, where it is mentioned that "you may not link" to downloads, i.e. contents that are not redistributable, you may only use the file name itself as the source. This means and requires that users already have the restricted source in the build directory prior to building the package."

So I have put together a PKGBUILD which looks like this:

# Maintainer: Patrick Oppenlander <patrick.oppenlander at gmail.com>
#
# Note: to build this package you need to download S32_Power_Linux_v1.1.bin from
# http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/s32-arm-processors-microcontrollers/s32-design-studio-ide:S32DS?code=S32DS&nodeId=0150522FC830D4&fpsp=1&tab=Design_Tools_Tab
# and place it in the same location as this PKGBUILD file.
#
pkgname=pegdbserver_power
pkgver=1.3.3.201605241936
pkgrel=1
pkgdesc="GDB server for Power devices using P&E JTAG hardware"
arch=('i386' 'x86_64')
url="http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/s32-arm-processors-microcontrollers/s32-design-studio-ide:S32DS?code=S32DS&nodeId=0150522FC830D4&fpsp=1&tab=Design_Tools_Tab"
license=('custom')
depends=('libusb-compat')
install=pegdbserver_power.install
source=('S32_Power_Linux_v1.1.bin' 'license_gdb.pdf')
md5sums=('b37cf6d2d4699cc3350c5d74b530eede'
         'd291bf2583f067357118abd114f40090')

build() {
	unzip C_/MakingInstalers/Layout/eclipse_zg_ia_sf.jar plugins/com.pemicro.debug.gdbjtag.ppc_$pkgver/lin/*
	unzip C_/MakingInstalers/Layout/Drivers_zg_ia_sf.jar libusb_64_32/*
}

package() {
	mkdir -p $pkgdir/opt/$pkgname
	cp -r plugins/com.pemicro.debug.gdbjtag.ppc_$pkgver/lin/* $pkgdir/opt/$pkgname
	chmod +x $pkgdir/opt/$pkgname/pegdbserver_power_console

	mkdir -p $pkgdir/etc/udev/rules.d
	cp libusb_64_32/55-pemicro.rules $pkgdir/etc/udev/rules.d

	mkdir -p $pkgdir/usr/bin
	ln -s /opt/$pkgname/pegdbserver_power_console $pkgdir/usr/bin/pegdbserver_power_console

	mkdir -p $pkgdir/usr/share/licenses/$pkgname
	cp license_gdb.pdf $pkgdir/usr/share/licenses/$pkgname
}

But I run into a problem when I try to push it to the AUR:

remote: error: The following error occurred when parsing commit
remote: error: 3b9b0b040531ed85ee49bea62c210657df5f0408:
remote: error: missing source file: S32_Power_Linux_v1.1.bin
remote: error: hook declined to update refs/heads/master

So what is the right PKGBUILD source line for this sutiation?

Thanks,

Patrick

Offline

#2 2016-07-13 06:42:31

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

Re: Help with PKGBUILD for package with non redistributable source

You need to specify an url protocol, the usual one used for sources that need to be manually downloaded is file://


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

Offline

#3 2016-07-13 06:50:01

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

Re: Help with PKGBUILD for package with non redistributable source

Also, please quote $pkgdir whenever you use it. You don't control the contents of that variable, and it may contain spaces.
unzip is not in base or base-devel, so please add it as a makedepends.
Instead of using "mkdir -p"; "cp" you can use "install -D" (a single command).

And while you are at it, md5sums is quite old, why not use sha256sums?

Last edited by eschwartz (2016-07-13 06:53:48)


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

Offline

#4 2016-07-13 06:55:40

pattyo
Member
Registered: 2016-07-13
Posts: 8

Re: Help with PKGBUILD for package with non redistributable source

file:// is still rejected by the commit hook with the same error message.

I will quote $pkgdir, didn't realise this could contain spaces.

I'm using md5sums because that's what's in the PKGBUILD prototype (https://wiki.archlinux.org/index.php/Ar … _prototype)

Patrick

Offline

#5 2016-07-13 06:57:05

pattyo
Member
Registered: 2016-07-13
Posts: 8

Re: Help with PKGBUILD for package with non redistributable source

Forgot to mention -- will update it to sha256sums as suggested.

Last edited by pattyo (2016-07-13 06:57:22)

Offline

#6 2016-07-13 07:01:53

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

Re: Help with PKGBUILD for package with non redistributable source

Did you add a commit fixing the source array, or did you rebase? Because the update hook used by the AUR checks all commits for problems, not just the latest commit.


The prototype files haven't been updated since md5sums were in style. wink

And $srcdir and $pkgdir are the full path the "src" and "pkg" directories... which means it includes the path to $(pwd) which can contain spaces depending on the user.

Last edited by eschwartz (2016-07-13 07:06:11)


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

Offline

#7 2016-07-13 07:04:20

pattyo
Member
Registered: 2016-07-13
Posts: 8

Re: Help with PKGBUILD for package with non redistributable source

I did a commit --amend so rewrote the commit with the new source array.

Offline

#8 2016-07-13 07:08:09

pattyo
Member
Registered: 2016-07-13
Posts: 8

Re: Help with PKGBUILD for package with non redistributable source

Just to clarify -- the repository has a single commit I'm trying to push.

Offline

#9 2016-07-13 07:11:46

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

Re: Help with PKGBUILD for package with non redistributable source

Did you remember to regenerate your .SRCINFO? The AUR update hook actually checks the .SRCINFO, not the PKGBUILD which is much harder to parse safely. wink

(Follow the link in my signature to see how I automatically keep the .SRCINFO up to date with all changes no matter what.)

Last edited by eschwartz (2016-07-13 07:13:13)


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

Offline

#10 2016-07-13 09:15:47

pattyo
Member
Registered: 2016-07-13
Posts: 8

Re: Help with PKGBUILD for package with non redistributable source

Thanks. That fixed it.

I always forget about .SRCINFO. Doesn't help that it's a dotfile.

I'll take a look at your pkgbuilds repository tomorrow. I've got 3 PKGBUILDS now and that certainly looks like it would make life easier.

Thank you for your help!

Offline

Board footer

Powered by FluxBB