You are not logged in.

#1 2019-08-19 05:04:15

dawnofman
Member
Registered: 2019-07-26
Posts: 140

[solved] zfs-linux package building issues

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

#2 2019-08-19 05:28:02

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: [solved] zfs-linux package building issues

dawnofman wrote:

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)

Offline

#3 2019-08-19 05:38:38

dawnofman
Member
Registered: 2019-07-26
Posts: 140

Re: [solved] zfs-linux package building issues

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 sad

And thanks for your fast reply !

Offline

#4 2019-08-19 05:40:42

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: [solved] zfs-linux package building issues

No worries. I'll reserve commenting on the sanity of such a command in packaging.

Offline

#5 2019-08-19 22:34:28

dawnofman
Member
Registered: 2019-07-26
Posts: 140

Re: [solved] zfs-linux package building issues

fukawi2 wrote:

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

Board footer

Powered by FluxBB