You are not logged in.

#1 2013-04-10 22:40:37

bugfix
Member
Registered: 2012-07-18
Posts: 11

[SOLVED] First PKGBUILD, did I miss anything?

Hi there,

the following PKGBUILD works for me and I can use my scanner after installing it. Still, is there anything I missed in order to make this valid for the AUR?

pkgname=iscan-plugin-gt-1500
pkgver=2.2.0_1
pkgrel=1
pkgdesc="iscan plugin for the Epson GT-1500 scanner."
arch=('i686' 'x86_64')
url="http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"
license=('custom')
depends=('iscan' 'iscan-data')
makedepends=('rpmextract')
install=gt-1500.install
source=(http://download.ebz.epson.net/dsc/f/01/00/02/09/21/79a6200fed4b7bd1c0ce04909e1a4f64e854b9fb/iscan-plugin-gt-1500-2.2.0-1.i386.rpm)
[[ $CARCH == "x86_64" ]] && \
  source=(http://download.ebz.epson.net/dsc/f/01/00/02/09/21/89f74a7055d4c0fd8c7842a212e80f534b957bfa/iscan-plugin-gt-1500-2.2.0-1.x86_64.rpm)
md5sums=('7732026cc89dd7cf5502ce752d8d6930')
[[ $CARCH == "x86_64" ]] && md5sums=('8eb6899ce77a173c9c7366c1b6af7a04')
package() {
  cd "$startdir"
  rpmextract.sh $(basename ${source[0]})
  cp -R $startdir/usr $pkgdir
  mkdir $pkgdir/usr/share/licences
  mv $pkgdir/usr/share/doc/iscan-plugin-gt-1500-2.2.0 $pkgdir/usr/share/licences/
  rmdir $pkgdir/usr/share/doc
}

Thanks!

Last edited by bugfix (2013-04-11 13:28:56)

Offline

#2 2013-04-10 22:50:05

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

First of all, it looks like the way you're declaring your source and md5sum arrays doesn't make much sense. The easier way would be to have

if [[ "$CARCH" == "i686" ]]; then
   source=('Source URL here')
   md5sums=('mmm, checksums')
elif [[ "$CARCH" == "x86_64" ]]; then
   source=('x64 source')
   md5sums=('x64 checksums')
fi

On a related note, I'd recommend that you use one of the sha2 algorithms for hashing, not md5. Though md5 is still widely used, it really shouldn't be. Further more, you should have the rpmextract bit in the build() function, not the package function. Next, it may be worth your while, if you're going to extract things manually, to include that source-file in the noextract array. Next to last, avoid using "startdir", there are much better options to make things cleaner. And finally (after the quick glance that I had), always quote your variables (including "${pkgdir}" and "${srcdir}"), it's good form and will make things less likely to break.

[Edit]: A further suggestion: If you're going to use `cp`, in that case, I'd recommend you use `cp -dpr --no-preserve=ownership [directories you want to copy]`

All the best,

-HG

Last edited by HalosGhost (2013-04-10 23:26:23)


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#3 2013-04-10 23:00:50

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,957
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

It's a good idea to include your .install in the source array and include a *sum for it. That way, if you ever change it, users that just download the updated PKGBUILD will get an integrity check fail because their .install is out of date.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Making lemonade from lemons since 2015.

Offline

#4 2013-04-11 09:27:35

bugfix
Member
Registered: 2012-07-18
Posts: 11

Re: [SOLVED] First PKGBUILD, did I miss anything?

Thank you very much for your input! I have only just adopted this package and wanted to change as little as possible (mainly replacing deb2targz with rpmextract) but your changes really make a lot of sense.

This is how it looks now, still works perfectly.

pkgname=iscan-plugin-gt-1500
pkgver=2.2.0_1
pkgrel=1
pkgdesc="iscan plugin for the Epson GT-1500 scanner."
arch=('i686' 'x86_64')
url="http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"
license=('custom')
depends=('iscan' 'iscan-data')
makedepends=('rpmextract')
install=gt-1500.install
noextract=('iscan-plugin-gt-1500-2.2.0-1.i386.rpm' 'iscan-plugin-gt-1500-2.2.0-1.x86_64.rpm')

if [[ "$CARCH" == "i686" ]]; then
   source=('http://download.ebz.epson.net/dsc/f/01/00/02/09/21/79a6200fed4b7bd1c0ce04909e1a4f64e854b9fb/iscan-plugin-gt-1500-2.2.0-1.i386.rpm' 'gt-1500.install')
   sha256sums=('cbb3e7855b9d119aca3070777076d461125de9b907822a1d3fa4669b10cb6514' 'bcaa2139106cc7f3049008925de32e5f2c91f41dbdeba6bc5c9f65ae424efe26')
elif [[ "$CARCH" == "x86_64" ]]; then
   source=('http://download.ebz.epson.net/dsc/f/01/00/02/09/21/89f74a7055d4c0fd8c7842a212e80f534b957bfa/iscan-plugin-gt-1500-2.2.0-1.x86_64.rpm' 'gt-1500.install
')
   sha256sums=('f5e3efa4e739b80e87443b1b1124c79036ef7ed684d8d5f58f5ce4e5754516db' 'bcaa2139106cc7f3049008925de32e5f2c91f41dbdeba6bc5c9f65ae424efe26')
fi

build() {
  cd "$srcdir"
  rpmextract.sh "$(basename ${source[0]})"
}



package() {
  cp -dpr --no-preserve=ownership usr "$pkgdir"
  mkdir "$pkgdir"/usr/share/licences
  mv "$pkgdir"/usr/share/doc/iscan-plugin-gt-1500-2.2.0 "$pkgdir"/usr/share/licences/
  rmdir "$pkgdir"/usr/share/doc
}
HalosGhost wrote:

First of all, it looks like the way you're declaring your source and md5sum arrays doesn't make much sense.

Your version indeed seems way more logical.

Further more, you should have the rpmextract bit in the build() function, not the package function.

I don't even know why I didn't put it there in the first place hmm

Next to last, avoid using "startdir", there are much better options to make things cleaner.

It says so in the wiki as well, must have overread that.

always quote your variables (including "${pkgdir}" and "${srcdir}")

Will do!

WorMzy wrote:

It's a good idea to include your .install in the source array and include a *sum for it.

Smart!


Thank you again! Anything else that I missed?

Offline

#5 2013-04-11 10:00:19

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,357

Re: [SOLVED] First PKGBUILD, did I miss anything?

bugfix wrote:

Thank you very much for your input! I have only just adopted this package and wanted to change as little as possible (mainly replacing deb2targz with rpmextract) but your changes really make a lot of sense.

deb2targz isn't needed anyway. makepkg extracts with bsdtar, which extracts .deb files just fine. Cleaner solution, IMO, than requiring a makedep.

Offline

#6 2013-04-11 10:15:53

bugfix
Member
Registered: 2012-07-18
Posts: 11

Re: [SOLVED] First PKGBUILD, did I miss anything?

Scimmia wrote:
bugfix wrote:

Thank you very much for your input! I have only just adopted this package and wanted to change as little as possible (mainly replacing deb2targz with rpmextract) but your changes really make a lot of sense.

deb2targz isn't needed anyway. makepkg extracts with bsdtar, which extracts .deb files just fine. Cleaner solution, IMO, than requiring a makedep.

Your're right, this works just as well and doesn't require any makedepends...

pkgname=iscan-plugin-gt-1500
pkgver=2.2.0_1
pkgrel=1
pkgdesc="iscan plugin for the Epson GT-1500 scanner."
arch=('i686' 'x86_64')
url="http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"
license=('custom')
depends=('iscan' 'iscan-data')
install=gt-1500.install

if [[ "$CARCH" == "i686" ]]; then
   source=('http://download.ebz.epson.net/dsc/f/01/00/02/09/21/79a6200fed4b7bd1c0ce04909e1a4f64e854b9fb/iscan-plugin-gt-1500-2.2.0-1.i386.rpm' 'gt-1500.install')
   sha256sums=('cbb3e7855b9d119aca3070777076d461125de9b907822a1d3fa4669b10cb6514' 'bcaa2139106cc7f3049008925de32e5f2c91f41dbdeba6bc5c9f65ae424efe26')
elif [[ "$CARCH" == "x86_64" ]]; then
   source=('http://download.ebz.epson.net/dsc/f/01/00/02/09/21/89f74a7055d4c0fd8c7842a212e80f534b957bfa/iscan-plugin-gt-1500-2.2.0-1.x86_64.rpm' 'gt-1500.install
')
   sha256sums=('f5e3efa4e739b80e87443b1b1124c79036ef7ed684d8d5f58f5ce4e5754516db' 'bcaa2139106cc7f3049008925de32e5f2c91f41dbdeba6bc5c9f65ae424efe26')
fi

build() {
  cd "$srcdir"
}



package() {
  cp -dpr --no-preserve=ownership usr "$pkgdir"
  mkdir "$pkgdir"/usr/share/licences
  mv "$pkgdir"/usr/share/doc/iscan-plugin-gt-1500-2.2.0 "$pkgdir"/usr/share/licences/
  rmdir "$pkgdir"/usr/share/doc
}

Last edited by bugfix (2013-04-11 10:16:11)

Offline

#7 2013-04-11 10:16:49

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

bugfix wrote:

Thank you again! Anything else that I missed?

First off, this looks far cleaner, so you're definitely on the right track. Here are a couple suggestions to clean it up a bit more. Instead of the `mv` command, it's considered better form (at least, from what I've seen) to use the `install` builtin. Next, wherever you can, try and make it so that things can be updated by just changing one of the variable/array declarations at the top rather than editing the whole PKGBUILD.

For instance, rather than having noextract declare the names of the source files verbosely, have them be declared using the variables:

noextract=("${pkgname}-${pkgver//_/-}.$CARCH.rpm")

Doing this means that on the release of a new version, you won't have to touch that array at all, and you only need to declare it for one item, not both explicitly as you have now. You can apply this logic throughout your PKGBUILD. At a glance, using this type of logic will allow you to clean up the `mv`/`install` command in the package() function, and your source arrays.

However, the source arrays, specifically, I think can be cleaned up quite a bit using this logic and refining the if/elif statement. Here's how I would do it:

if [[ "$CARCH" == "i686" ]]; then
   _srcurl="http://download.ebz.epson.net/dsc/f/01/00/02/09/21/79a6200fed4b7bd1c0ce04909e1a4f64e854b9fb"
   sha256sums=('cbb3e7855b9d119aca3070777076d461125de9b907822a1d3fa4669b10cb6514')
elif [[ "$CARCH" == "x86_64" ]]; then
   _srcurl="http://download.ebz.epson.net/dsc/f/01/00/02/09/21/89f74a7055d4c0fd8c7842a212e80f534b957bfa"
   sha256sums=('f5e3efa4e739b80e87443b1b1124c79036ef7ed684d8d5f58f5ce4e5754516db')
fi
source=("$_srcurl/${pkgname}-${pkgver//_/-}.$CARCH.rpm"
        "gt-1500.install")
sha256sums+=('bcaa2139106cc7f3049008925de32e5f2c91f41dbdeba6bc5c9f65ae424efe26')

Also, because the source array is referenced by the noextract array, it is good form to have the noextract array follow the source array in the PKGBUILD.

And, if you follow Scimmia's advice and drop rpmextract from the makedepends, and just have it extract using the standard bsdtar (which is a good idea), there's no reason to have the build() at all. Just have the `cd "${srcdir}"` at the beginning of the package() function.

A last note, while all these things clean up the PKGBUILD so that it looks nicer and can be updated more simply in the future (by using variables to their fullest extent rather than hard-coded declarations), the beautiful thing about PKGBUILD is that it's essentially just bash scripting. If it builds correctly, installs correctly and works, then there's nothing wrong with putting it on the AUR.

[Edit]: I decided I liked this way of doing the if/elif statement better tongue

All the best,

-HG

Last edited by HalosGhost (2013-04-11 10:39:26)


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#8 2013-04-11 10:23:50

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,357

Re: [SOLVED] First PKGBUILD, did I miss anything?

bugfix wrote:
build() {
  cd "$srcdir"
}



package() {
  cp -dpr --no-preserve=ownership usr "$pkgdir"
  mkdir "$pkgdir"/usr/share/licences
  mv "$pkgdir"/usr/share/doc/iscan-plugin-gt-1500-2.2.0 "$pkgdir"/usr/share/licences/
  rmdir "$pkgdir"/usr/share/doc
}

It won't work quite like that, you probably didn't have a clean src dir. Once makepkg extracts the deb file, you end up with three files: control.tar.gz, data.tar.gz, and debian-binary. The program is in data.tar.gz, so you just have to extract that yourself. I do "bsdtar -xf data.tar.gz -C "$pkgdir"" in the package function to extract everything directly to $pkgdir.

And you don't need the build if it's not doing anything.

Last edited by Scimmia (2013-04-11 10:25:23)

Offline

#9 2013-04-11 10:24:53

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

Scimmia wrote:

It won't work quite like that, you probably didn't have a clean src dir. Once makepkg extracts the deb file, you end up with three files: control.tar.gz, data.tar.gz, and debian-binary. The program is in data.tar.gz, so you just have to extract that yourself. I do "bsdtar -xf data.tar.gz -C "$pkgdir" in the package function to extract everything directly to $pkgdir.

And you don't need the build if it's not doing anything.

bugfix is using a .rpm now though smile

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#10 2013-04-11 10:25:51

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,357

Re: [SOLVED] First PKGBUILD, did I miss anything?

HalosGhost wrote:
Scimmia wrote:

It won't work quite like that, you probably didn't have a clean src dir. Once makepkg extracts the deb file, you end up with three files: control.tar.gz, data.tar.gz, and debian-binary. The program is in data.tar.gz, so you just have to extract that yourself. I do "bsdtar -xf data.tar.gz -C "$pkgdir" in the package function to extract everything directly to $pkgdir.

And you don't need the build if it's not doing anything.

bugfix is using a .rpm now though smile

All the best,

-HG

I think you missed his last post...

Offline

#11 2013-04-11 10:30:33

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

Scimmia wrote:

I think you missed his last post...

I don't think so. He applied what you said, that bsdtar could extract .debs to his current setup, still using a .rpm. Feel free to look at the code he posted again.

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#12 2013-04-11 10:37:19

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,357

Re: [SOLVED] First PKGBUILD, did I miss anything?

wow, you're right. He kept the RPMs and just got rid of all of the extraction. That makes no sense at all.

Offline

#13 2013-04-11 10:37:27

SidK
Member
Registered: 2011-03-03
Posts: 116

Re: [SOLVED] First PKGBUILD, did I miss anything?

The license file should be named the same thing as the package. You don't need the version number appended.

Also, I find it more readable how the sha256sums work in a PKGBUILD like this one: https://aur.archlinux.org/packages/su/s … y/PKGBUILD; First it creates the arrays (assuming x86_86), then checks for i686 and overwrites the relevant key.

Means you only need the hash for the .install file once.

Offline

#14 2013-04-11 10:40:13

bugfix
Member
Registered: 2012-07-18
Posts: 11

Re: [SOLVED] First PKGBUILD, did I miss anything?

This is how it looks right now.

#Created with lots of help from HalosGhost, Scimmia and WorMzy
pkgname=iscan-plugin-gt-1500
pkgver=2.2.0_1
pkgrel=1
pkgdesc="iscan plugin for the Epson GT-1500 scanner."
arch=('i686' 'x86_64')
url="http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"
license=('custom')
depends=('iscan' 'iscan-data')
install=gt-1500.install

if [[ "$CARCH" == "i686" ]]; then
   _pkgurlid="79a6200fed4b7bd1c0ce04909e1a4f64e854b9fb"
   sha256sums=('cbb3e7855b9d119aca3070777076d461125de9b907822a1d3fa4669b10cb6514')
elif [[ "$CARCH" == "x86_64" ]]; then
   _pkgurlid="89f74a7055d4c0fd8c7842a212e80f534b957bfa"
   sha256sums=('f5e3efa4e739b80e87443b1b1124c79036ef7ed684d8d5f58f5ce4e5754516db')
fi
source=("http://download.ebz.epson.net/dsc/f/01/00/02/09/21/$_pkgurlid/${pkgname}-${pkgver//_/-}.$CARCH.rpm"
        "gt-1500.install")
sha256sums[1]='bcaa2139106cc7f3049008925de32e5f2c91f41dbdeba6bc5c9f65ae424efe26'

package() {
  cd "$srcdir"
  cp -dpr --no-preserve=ownership usr "$pkgdir"
  mkdir "$pkgdir"/usr/share/licences
  install -Dm644 "${pkgdir}/usr/share/doc/iscan-plugin-gt-1500-2.2.0/AVASYSPL.en.txt" "${pkgdir}/usr/share/licences/"
  rm -r "$pkgdir"/usr/share/doc
}

Offline

#15 2013-04-11 10:42:29

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,357

Re: [SOLVED] First PKGBUILD, did I miss anything?

SidK wrote:

The license file should be named the same thing as the package. You don't need the version number appended.

Also, I find it more readable how the sha256sums work in a PKGBUILD like this one: https://aur.archlinux.org/packages/su/s … y/PKGBUILD; First it creates the arrays (assuming x86_86), then checks for i686 and overwrites the relevant key.

Means you only need the hash for the .install file once.

Personally, I find that less readable, but to each their own.

You can still include the .install file and it's hash once by using things like "source+=" and "sha256sums+=" to append them to the arrays as HalosGhost already pointed out.

And I didn't realize that libarchive/bsdtar would extract rpms as well. It didn't the last time I tried it, but that was a long time ago. Makes rpm PKGBUILDs easier.

Last edited by Scimmia (2013-04-11 10:47:11)

Offline

#16 2013-04-11 10:49:08

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

Scimmia wrote:

Personally, I find that less readable, but to each their own.

You can still include the .install file and it's hash once by using things like "source+=" and "sha256sums+=" to append them to the arrays as HalosGhost already pointed out.

I'm with Scimmia on this one, I really prefer the explicit if/elif statement and using the ARRAY+= setup. bugfix, I cleaned up the code I recommended earlier so it should play a bit nicer.

The last bit before you upload it is the maintainer tag. It should be a single line at the top of the form like this:

# Maintainer: your name (or handle) <your email at provider dot com>

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#17 2013-04-11 10:54:36

bugfix
Member
Registered: 2012-07-18
Posts: 11

Re: [SOLVED] First PKGBUILD, did I miss anything?

I really appreciate that you guys take the time to make sure it all works out.

# Maintainer: 
#Created with lots of help from HalosGhost, Scimmia and WorMzy
pkgname=iscan-plugin-gt-1500
pkgver=2.2.0_1
pkgrel=1
pkgdesc="iscan plugin for the Epson GT-1500 scanner."
arch=('i686' 'x86_64')
url="http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"
license=('custom')
depends=('iscan' 'iscan-data')
install=gt-1500.install

if [[ "$CARCH" == "i686" ]]; then
   _srcurl="http://download.ebz.epson.net/dsc/f/01/00/02/09/21/79a6200fed4b7bd1c0ce04909e1a4f64e854b9fb"
   sha256sums=('cbb3e7855b9d119aca3070777076d461125de9b907822a1d3fa4669b10cb6514')
elif [[ "$CARCH" == "x86_64" ]]; then
   _srcurl="http://download.ebz.epson.net/dsc/f/01/00/02/09/21/89f74a7055d4c0fd8c7842a212e80f534b957bfa"
   sha256sums=('f5e3efa4e739b80e87443b1b1124c79036ef7ed684d8d5f58f5ce4e5754516db')
fi
source=("$_srcurl/${pkgname}-${pkgver//_/-}.$CARCH.rpm"
        "gt-1500.install")
sha256sums+=('bcaa2139106cc7f3049008925de32e5f2c91f41dbdeba6bc5c9f65ae424efe26')

package() {
  cd "$srcdir"
  cp -dpr --no-preserve=ownership usr "$pkgdir"
  mkdir "$pkgdir"/usr/share/licences
  install -Dm644 "${pkgdir}/usr/share/doc/iscan-plugin-gt-1500-2.2.0/AVASYSPL.en.txt" "${pkgdir}/usr/share/licences/"
  rm -r "$pkgdir"/usr/share/doc
}

Good to go? If I want to update the package, I just resubmit my new tarball, right?

Last edited by bugfix (2013-04-12 15:20:30)

Offline

#18 2013-04-11 11:01:07

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

bugfix wrote:

I really appreciate that you guys take the time to make sure it all works out.
Good to go? If I want to update the package, I just resubmit my new tarball, right?

Well, I'd follow SidK's advice about having the license named the name of the package where you install it. And, you can't just submit the pkg.tar.xz. You need to build the source package using `makepkg -S`, and then upload the resulting src.tar.gz.

Also, if you really want to reference other people who helped with the PKGBUILD, you can add Contributor lines. They look exactly the same as maintainer lines, but with "Contributor" instead of "Maintainer." If you honestly want to reference me in that list, you can grab the information from one of the PKGBUILDs I have up on the AUR, but you really don't need to.

Also, you can still clean up that `install` command using the variable logic I mentioned. I imagine it would look something like this:

install -Dm644 "${pkgdir}/usr/share/doc/${pkgname}-${pkgver//_1/}/AVASYSPL.en.txt" "${pkgdir}"/usr/share/licences/"${pkgname}"/

And Scimmia is correct, with the -D option on install, you shouldn't have the mkdir command.

All the best,

-HG

Last edited by HalosGhost (2013-04-11 11:04:32)


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#19 2013-04-11 11:01:43

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,357

Re: [SOLVED] First PKGBUILD, did I miss anything?

Not quite, your license installation still isn't right. If you do install with the -D option, you don't need the preceding mkdir, you need to put the file name in the destination, and it needs to be in a subdir with the pkgname. something like "$pkgdir/usr/share/licences/$pkgname/AVASYSPL.en.txt"

Offline

#20 2013-04-11 11:15:02

bugfix
Member
Registered: 2012-07-18
Posts: 11

Re: [SOLVED] First PKGBUILD, did I miss anything?

I think we're getting there...

# Maintainer: 
# Contributor: Sam Stuewe <halosghost at archlinux dot info>; Scimmia; WorMzy
pkgname=iscan-plugin-gt-1500
pkgver=2.2.0_1
pkgrel=1
pkgdesc="iscan plugin for the Epson GT-1500 scanner."
arch=('i686' 'x86_64')
url="http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"
license=('custom')
depends=('iscan' 'iscan-data')
install=gt-1500.install

if [[ "$CARCH" == "i686" ]]; then
   _srcurl="http://download.ebz.epson.net/dsc/f/01/00/02/09/21/79a6200fed4b7bd1c0ce04909e1a4f64e854b9fb"
   sha256sums=('cbb3e7855b9d119aca3070777076d461125de9b907822a1d3fa4669b10cb6514')
elif [[ "$CARCH" == "x86_64" ]]; then
   _srcurl="http://download.ebz.epson.net/dsc/f/01/00/02/09/21/89f74a7055d4c0fd8c7842a212e80f534b957bfa"
   sha256sums=('f5e3efa4e739b80e87443b1b1124c79036ef7ed684d8d5f58f5ce4e5754516db')
fi
source=("$_srcurl/${pkgname}-${pkgver//_/-}.$CARCH.rpm"
        "gt-1500.install")
sha256sums+=('bcaa2139106cc7f3049008925de32e5f2c91f41dbdeba6bc5c9f65ae424efe26')

package() {
  cd "$srcdir"
  cp -dpr --no-preserve=ownership usr "$pkgdir"
  install -Dm644 "${pkgdir}/usr/share/doc/${pkgname}-${pkgver//_1/}/AVASYSPL.en.txt" "${pkgdir}/usr/share/licenses/${pkgname}/AVASYSPL.en.txt"
  rm -r "$pkgdir"/usr/share/doc
}

Last edited by bugfix (2013-04-12 15:20:17)

Offline

#21 2013-04-11 11:18:03

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

If Scimmia and WorMzy don't mind being referenced, you should give them their own contributor lines. Other than that, it looks fine to me.

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#22 2013-04-11 11:22:10

bugfix
Member
Registered: 2012-07-18
Posts: 11

Re: [SOLVED] First PKGBUILD, did I miss anything?

HalosGhost wrote:

If Scimmia and WorMzy don't mind being referenced, you should give them their own contributor lines. Other than that, it looks fine to me.

I'll give them their own lines if they're okay with that. I think credit should be given where credit is due.

Offline

#23 2013-04-11 12:18:19

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

Oh wait, it just dawned on me that you were writing i386 when referencing the ix86 source file. If it is i3 and not i6, then that source array won't work for x86 machines.
Okay, I think if you change the source=() array to the following, it should work fine, but I don't have an i686 install on me, so I do not have a simple way to test.

source=("$_srcurl/${pkgname}-${pkgver//_/-}.${CARCH//i686/i386}.rpm"

I genuinely don't know if that will work, but I think it might. smile

[Edit]: Alright, I actually do think that will work fine. Now that you've got the package up on the AUR, you should add [Solved] to the beginning of your thread title.

All the best,

-HG

Last edited by HalosGhost (2013-04-11 13:26:49)


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#24 2013-04-11 13:28:23

bugfix
Member
Registered: 2012-07-18
Posts: 11

Re: [SOLVED] First PKGBUILD, did I miss anything?

HalosGhost wrote:

Oh wait, it just dawned on me that you were writing i386 when referencing the ix86 source file. If it is i3 and not i6, then that source array won't work for x86 machines.
Okay, I think if you change the source=() array to the following, it should work fine, but I don't have an i686 install on me, so I do not have a simple way to test.

source=("$_srcurl/${pkgname}-${pkgver//_/-}.${CARCH//i686/i386}.rpm"

I genuinely don't know if that will work, but I think it might. smile

[Edit]: Alright, I actually do think that will work fine. Now that you've got the package up on the AUR, you should add [Solved] to the beginning of your thread title.

All the best,

-HG

Good catch, I already thought that i686 superseded i386 or something...

Offline

#25 2013-04-11 13:31:27

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] First PKGBUILD, did I miss anything?

bugfix wrote:

Good catch, I already thought that i686 superseded i386 or something...

i386 and i686 are different architectures, but many companies release packages under the moniker "i386" when they often mean "ix86". Either way, the only reason the PKGBUILD would have failed for i686 platforms without that edit was because the name of the source file is "i386" even though it will likely function for i686 just fine so the download of the file itself would fail.

All the best,

-HG

Last edited by HalosGhost (2013-04-11 13:33:22)


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

Board footer

Powered by FluxBB