2020-01-13 07:59:37 +01:00
|
|
|
#!/bin/bash -x
|
|
|
|
|
|
|
|
TARBALL=$(rpmspec --parse rdma-core.spec | grep Source: | awk '{ print $NF}')
|
|
|
|
OUTDIR=$(tar tf $TARBALL | head -n 1)
|
|
|
|
PATCHES=$(rpmspec --parse rdma-core.spec | egrep '^Patch[0-9]+:' | awk '{ print $NF}')
|
2022-09-14 08:20:09 +02:00
|
|
|
BUILD_CMDS=$(python3 -c "
|
2020-01-13 07:59:37 +01:00
|
|
|
import rpm
|
|
|
|
|
|
|
|
spec = rpm.spec(\"rdma-core.spec\")
|
2022-09-14 08:20:09 +02:00
|
|
|
print('%s' % (getattr(spec, \"build\"),))
|
2020-01-13 07:59:37 +01:00
|
|
|
")
|
|
|
|
|
|
|
|
CMAKE_CMD=$(echo "$BUILD_CMDS" | sed -e :a -e '/\\$/N; s/\\\n//; ta' | grep /bin/cmake | sed -e 's/-GNinja//' -e 's/$OLDPWD\/./../')
|
|
|
|
|
|
|
|
|
|
|
|
rm -Rf $OUTDIR
|
|
|
|
tar xf $TARBALL
|
|
|
|
cd $OUTDIR
|
|
|
|
for patch in $PATCHES; do
|
|
|
|
patch -p0 < ../$patch || exit 1
|
|
|
|
done
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
eval $CMAKE_CMD || exit 1
|
|
|
|
make docs -j4 || exit 1
|
|
|
|
tar czf ../../prebuilt-pandoc.tgz pandoc-prebuilt
|
|
|
|
cd ../..
|