You are not logged in.
I'm using PKGBUILD to grab a .deb package and convert to pkg.tar.xz
This is the beggining of the PKGBUILD
# NordVPN script
pkgname=nordvpn-bin
pkgver=3.2.0_2
pkgrel=1
pkgdesc="NordVPN CLI tool for Linux"
arch=('x86_64')
url="https://nordvpn.com/download/linux/"
license=('custom')
depends=('net-tools' 'libxslt' 'iptables' 'procps' 'iproute2')
provides=('nordvpn')
conflicts=('openvpn-nordvpn')
install=nordvpn-bin.install
source_x86_64=("https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn_${pkgver//_/-}_amd64.deb")
sha256sums_x86_64=('508722c2bb4943dad260ebbecd0af8d4d115330f55dbf2bc32f3b74a47f125a7')
package() {
bsdtar -O -xf *.deb data.tar.xz | bsdtar -C "${pkgdir}" -xJf -
mv "${pkgdir}/usr/sbin/nordvpnd" "${pkgdir}/usr/bin"
rm -r "${pkgdir}/etc/init.d"
rm -r "${pkgdir}/usr/sbin"
}
What my issue is it possible to point pkgver to download the latest package version instead of entering the package version manually? For example version in PKGBUILD pkgver=3.2.0_2 but 3.4.0 is available now in pool if I run makepkg it will grab 3.2.0_2 as it mentioned in PKGBUILD.
I'm trying to read through this https://wiki.archlinux.org/index.php/PKGBUILD#pkgver but obviously don't understand it.
Last edited by archifer (2019-12-12 11:44:15)
Offline
Please post the full PKGBUILD, nothing can be done with this excerpt. You are referring to 3.2.0 and 3.4.0, but the url you provided only has a link for 1.0.0.
EDIT: I found it in the AUR. The pool doesn't have any symlink for the latest version. So what is it you want to download? The PKGBUILD looks fine as it is. Is there a problem?
Last edited by Trilby (2019-08-07 13:01:58)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
looks like someone else already created that package, https://aur.archlinux.org/packages/nordvpn-bin
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
Please post the full PKGBUILD, nothing can be done with this excerpt. You are referring to 3.2.0 and 3.4.0, but the url you provided only has a link for 1.0.0.
EDIT: I found it in the AUR. The pool doesn't have any symlink for the latest version. So what is it you want to download? The PKGBUILD looks fine as it is. Is there a problem?
Added complete script
Offline
looks like someone else already created that package, https://aur.archlinux.org/packages/nordvpn-bin
Yes but I maintain it manually on my system because I receive in terminal notification that new version of NordVPN is availbale but it takes time in AUR to update it.
Offline
Please post the full PKGBUILD, nothing can be done with this excerpt. You are referring to 3.2.0 and 3.4.0, but the url you provided only has a link for 1.0.0.
EDIT: I found it in the AUR. The pool doesn't have any symlink for the latest version. So what is it you want to download? The PKGBUILD looks fine as it is. Is there a problem?
I download it with the script from here https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/
Offline
What my issue is it possible to point pkgver to download the latest package version instead of entering the package version manually?
Is there any algorithmic process by which the latest package version can be determined? If not, makepkg is not magic.
It seems the only way to do this would be to download the pool index page, and parse/filter it to get the largest version number. This would be completely inappropriate in a PKGBUILD. Even if you did this, you'd then have to change the package name to end in -latest or similar and you'd have to get rid of checksums.
Why do you want to do this? I suspect there is an X-Y question behind this.
EDIT: please use the edit button rather than posting several times in a row.
I maintain it manually on my system because I receive in terminal notification that new version of NordVPN is availbale but it takes time in AUR to update it.
And there is no magic pill to avoid this. But it is trivial to update, you could even script the updates:
cd /path/to/wherever/package/is/
newver=$(curl -s https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/ | sed -n '/href.*amd64/{s/[^_]*_\([^_]*\).*/\1/;x;};${x;p;}')
sed -i "s/pkgver=.*/pkgver=${newver}/" PKGBUILD
makepkg --printsrcinfo >| .SRCINFO
git commit -m "update to pkgver=${newver}"
git push
Last edited by Trilby (2019-08-07 13:15:06)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
archifer wrote:What my issue is it possible to point pkgver to download the latest package version instead of entering the package version manually?
Is there any algorithmic process by which the latest package version can be determined? If not, makepkg is not magic.
It seems the only way to do this would be to download the pool index page, and parse/filter it to get the largest version number. This would be completely inappropriate in a PKGBUILD. Even if you did this, you'd then have to change the package name to end in -latest or similar and you'd have to get rid of checksums.
Why do you want to do this? I suspect there is an X-Y question behind this.
I just would like it to download the latest version automatically without pointing the exact package version in PKGBUILD
Offline
This is just for your personal usage, not for the AUR, right?
Just script it.
Offline
This is just for your personal usage, not for the AUR, right?
Just script it.
Yes I download it and compile it myself with this script on my system
Last edited by archifer (2019-08-07 13:18:47)
Offline
In that case, go ahead and put the parsing in the PKGBUILD:
pkgver=$(curl -s https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/ | sed -n '/href.*amd64/{s/[^_]*_\([^_]*\).*/\1/;x;};${x;p;}')
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
In that case, go ahead and put the parsing in the PKGBUILD:
pkgver=$(curl -s https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/ | sed -n '/href.*amd64/{s/[^_]*_\([^_]*\).*/\1/;x;};${x;p;}')
Could you point me out where should I place it? Because I receive
==> ERROR: pkgver is not allowed to contain colons, forward slashes, hyphens or whitespace.
Offline
Ah, right, that sed script gets both the version and release number - you'd need to split it into two in the PKGBUILD. I can do that later if needed.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Ah, right, that sed script gets both the version and release number - you'd need to split it into two in the PKGBUILD. I can do that later if needed.
Yes please. I would like to try it once you be able to provide it.
Offline
My first thought would be to split these into pkgver and pkgrel, but that'd be wrong: all of it goes into pkgver. So just convert the hyphen into something else, e.g. 'r' for the upstream release number:
pkgver=$(curl -s https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/ | sed -n '/href.*amd64/h;${g;s/[^_]*_\([^-]*\)-\([^_]*\).*/\1r\2/p;}')
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
My first thought would be to split these into pkgver and pkgrel, but that'd be wrong: all of it goes into pkgver. So just convert the hyphen into something else, e.g. 'r' for the upstream release number:
pkgver=$(curl -s https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/ | sed -n '/href.*amd64/h;${g;s/[^_]*_\([^-]*\)-\([^_]*\).*/\1r\2/p;}')
Thank you. Will try.
Offline