archrelease: copy trunk to community-any
[ArchLinux/community.git] / xrootd4 / trunk / PKGBUILD
blob63e20a3ba92958e9998d4e5a59af2ddbc1fca291
1 # Maintainer: Konstantin Gizdov < arch at kge dot pw >
2 # Contributor: Jan Kašpar < jan.kaspar at gmail dot com >
3 # Contributor: Alex Pearce < alex at alexpearce dot me >
4 _pkgname=xrootd
5 pkgname="${_pkgname}4"
6 pkgdesc="Software framework for fast, low latency, scalable and fault tolerant data access."
7 pkgver=4.12.6
8 pkgrel=3
9 arch=('x86_64')
10 url="https://xrootd.slac.stanford.edu/"
11 license=('LGPL3')
12 depends=('ceph' 'curl' 'libxml2' 'openssl' 'perl' 'python')
13 makedepends=('cmake' 'systemd')
14 checkdepends=('cppunit')
15 provides=('xrootd')
16 conflicts=('xrootd')
17 source=("${url}/download/v${pkgver}/${_pkgname}-${pkgver}.tar.gz"
18         'stat_ver.patch'
19         'cxx17.patch')
20 sha256sums=('1a9056ab7aeeaafa586ea77e442960c71d233c9ba60c7f9db9262c1410954ac4'
21             '9e8e17ea1a6a07a4d636d07c397fcfde5a6a398fea2fbb89a763044a481698af'
22             'ad423ea5c78c89e4f048da5c0ffd0fe263a3005e6de638077fbd770de89603eb')
24 get_pyver () {
25     python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
28 prepare () {
29     cd "${srcdir}/${_pkgname}-${pkgver}"
30     patch -Np1 -i "${srcdir}/cxx17.patch"
31     patch -Np1 -i "${srcdir}/stat_ver.patch"
34 build() {
35     cd "${srcdir}/${_pkgname}-${pkgver}"
37     # configure
38     mkdir -p "${srcdir}/build"
39     cd "${srcdir}/build"
41     CFLAGS="${CFLAGS}" \
42     CXXFLAGS="${CXXFLAGS}" \
43     LDFLAGS="${LDFLAGS}" \
44     cmake -DCMAKE_BUILD_TYPE:STRING=Release \
45           -DCMAKE_INSTALL_LIBDIR:PATH=lib \
46           -DCMAKE_INSTALL_PREFIX:PATH=/usr \
47           -DCMAKE_CXX_STANDARD="17" \
48           -DENABLE_TESTS=1 \
49           -DXRD_PYTHON_REQ_VERSION=$(get_pyver) \
50           "${srcdir}/${_pkgname}-${pkgver}"
52     # build
53     make
56 check() {
57     cd "${srcdir}/build/tests"
59     # Check has significantly changed, to-be-updated
60     # ./common/text-runner ./XrdCephTests/libXrdCephTests.so "All Tests"
62     ##
63     # This requires a running XRootD server with multiIP DNS forwarder and local disk servers
64     # only run this if you have configured the env correctly,
65     # examples in https://github.com/xrootd/xrootd-test-suite
66     # sample environment can be configured like so:
67     # export XRDTEST_MAINSERVERURL=metaman.xrd.test
68     # or export XRDTEST_MAINSERVERURL=http://xrootd.cern.ch/
69     # export XRDTEST_DISKSERVERURL=srv1.xrd.test
70     # or export XRDTEST_DISKSERVERURL=http://xrootd.cern.ch/
71     # export XRDTEST_DATAPATH=/tests/test-files/
72     # export XRDTEST_LOCALFILE=/data/a048e67f-4397-4bb8-85eb-8d7e40d90763.dat
73     # or export XRDTEST_LOCALFILE=/tmp/accwe.root
74     # export XRDTEST_REMOTEFILE=${XRDTEST_MAINSERVERURL}${XRDTEST_DATAPATH}/a048e67f-4397-4bb8-85eb-8d7e40d90763.dat
75     # or export XRDTEST_MULTIIPSERVERURL=multiip.xrd.test
76     # ./common/text-runner ./XrdClTests/libXrdClTests.so "All Tests"
79 package() {
80     cd "${srcdir}/build"
81     make DESTDIR="${pkgdir}" install
82     # drop unneeded test bin & lib
83     rm "${pkgdir}/usr/bin/text-runner"
84     rm "${pkgdir}/usr/lib/libXrdClTests.so"
85     install -d "${pkgdir}/usr/lib/cmake/XRootD"
86     mv "${pkgdir}/usr/share/xrootd/cmake/XRootDConfig.cmake" "${pkgdir}/usr/lib/cmake/XRootD"/
87     rm -rf "${pkgdir}/usr/share/xrootd/cmake"
88     ln -s "/usr/lib/cmake" "${pkgdir}/usr/share/xrootd/cmake"