[aur-general] Review request for a PKGBUILD

Leonid Bloch leonid.bloch at esrf.fr
Sun Jan 8 04:59:02 UTC 2017


Hi,

I'd like to push the following PKGBUILD to AUR. It is useful for those
who want to use HDF5 files with LZ4 compression.

There are two things that bother me about it:
1) The upstream repository contains 4 directories: LZ4, BLOSC, BZIP2,
and docs. Of which only LZ4 is used. I just "git rm -rf" the unneeded
directories, as you can see. But it doesn't seem very elegant.
2) The package will work properly only if the "HDF5_PLUGIN_PATH" env.
variable is set. Putting hdf5_env.sh into /etc/profile.d takes care of
that for any subsequent login. But is there a way to set this variable
in the same shell from which the installation is being performed? And
to unset it on removal? It's not critical at all - no problem to open
a new shell after installation, just for the sake of correctness.

Of course, if there are other problems - I'd like to hear as well.

Thanks!
Leonid.
___

PKGBUILD:
~~~~~~~~~~
# Package maintainer: Leonid B <leonid dot bloch at esrf dot fr>
pkgname=hdf5-lz4-filter-git
pkgver=r106.863db28
pkgrel=1
pkgdesc="LZ4 filter for the HDF5 data format"
arch=('i686' 'x86_64')
url="https://github.com/nexusformat/HDF5-External-Filter-Plugins/tree/master/LZ4"
license=('BSD')
depends=('hdf5' 'lz4')
makedepends=('git')
source=("${pkgname%-git}::git+https://github.com/nexusformat/HDF5-External-Filter-Plugins.git"
        "hdf5_env.sh")
sha1sums=('SKIP' 'c82f6a025138c3f9430ab930a7dd42ad0963918b')

pkgver() {
    cd "${srcdir}/${pkgname%-git}"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse
--short HEAD)"
}

prepare() {
    cd "${srcdir}/${pkgname%-git}"
    git rm -rf BLOSC BZIP2 docs
}

build() {
    cd "${srcdir}/${pkgname%-git}/LZ4"
    ./configure --prefix=/usr --with-hdf5=/usr --with-lz4lib=/usr
    make
}

package() {
    cd "${srcdir}/${pkgname%-git}/LZ4"
    make DESTDIR="${pkgdir}/" install
    install -D -m755 "${srcdir}/hdf5_env.sh"
"${pkgdir}/etc/profile.d/hdf5_env.sh"
    install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}


hdf5_env.sh:
~~~~~~~~~~~
export HDF5_PLUGIN_PATH=/usr/lib


More information about the aur-general mailing list