You are not logged in.
I have some experience so far building/customizing packages from core/extra/community (bind, bind-tools, nginx, etc) but this is my first attempt to build a package from AUR.
I am trying to build zfs-linux 0.8.1_5.2.9.arch1.1-1 maintained by minextu.
In the following function in PKGBUILD:
package_zfs-linux() {
pkgdesc="Kernel modules for the Zettabyte File System."
install=zfs.install
provides=("zfs" "spl")
groups=("archzfs-linux")
conflicts=("zfs-dkms" "zfs-dkms-git" "zfs-dkms-rc" "spl-dkms" "spl-dkms-git" 'zfs-linux-git' 'zfs-linux-rc' 'spl-linux')
replaces=("spl-linux")
cd "${srcdir}/zfs-${_zfsver}"
make DESTDIR="${pkgdir}" install
cp -r "${pkgdir}"/{lib,usr}
rm -r "${pkgdir}"/lib
# Remove src dir
rm -r "${pkgdir}"/usr/src
}
I encountered the following issue:
cp -r "${pkgdir}"/{lib,usr}
Which should be the same as:
cp -r "${pkgdir}/lib";
cp -r "${pkgdir}/usr";
... do a recursive copy to ... where ?
And also the following issue which I am not sure whether it is relevant or not:
--libexecdir=/usr/lib/zfs-${zfsver}
should be:
--libexecdir=/usr/lib/zfs-${_zfsver}
that is _zfsver is defined at the top of PKGBUILD instead of zfsver; this makes the package built as:
--libexecdir=/usr/lib/zfs-
without the ZFS version beign built
Last edited by dawnofman (2019-08-19 22:34:54)
Offline
Which should be the same as:
cp -r "${pkgdir}/lib"; cp -r "${pkgdir}/usr";
No, it's the same as:
cp -r "${pkgdir}/lib" "${pkgdir}/usr";
If you're ever unsure about a bash expansion, replace or prepend the command (cp -r in this case) with echo.
$ pkgdir=/tmp/whatever ; echo cp -r "${pkgdir}"/{lib,usr}
cp -r /tmp/whatever/lib /tmp/whatever/usr
Last edited by fukawi2 (2019-08-19 05:29:12)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
No, it's the same as:
cp -r "${pkgdir}/lib" "${pkgdir}/usr";
If you're ever unsure about a bash expansion, replace or prepend the command (cp -r in this case) with echo.
$ pkgdir=/tmp/whatever ; echo cp -r "${pkgdir}"/{lib,usr} cp -r /tmp/whatever/lib /tmp/whatever/usr
Yes, you're completely right !
I got BASH expansion totally wrong on this one.
My apologies
And thanks for your fast reply !
Offline
No worries. I'll reserve commenting on the sanity of such a command in packaging.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
No worries. I'll reserve commenting on the sanity of such a command in packaging.
Now that you mention it ... this is one of the many reasons that prompted me to start re-writing the package for myself.
Offline