| 1 | #!/bin/bash |
| 2 | set -e |
| 3 | set -x |
| 4 | |
| 5 | pkg="htslib" |
| 6 | |
| 7 | if [ "$AUTOPKGTEST_TMP" = "" ] ; then |
| 8 | AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX) |
| 9 | trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM |
| 10 | fi |
| 11 | |
| 12 | cp -aL /usr/share/${pkg}-test/* "$AUTOPKGTEST_TMP" |
| 13 | cp -aL htslib.pc.in "$AUTOPKGTEST_TMP" |
| 14 | cp -aL htslib.map "$AUTOPKGTEST_TMP" |
| 15 | |
| 16 | cd "$AUTOPKGTEST_TMP" |
| 17 | |
| 18 | sed -i 's#\$(HTSPREFIX)#/usr/include/#g' htslib_vars.mk |
| 19 | sed -i 's#\$(HTSLIB)#/usr/include/#g' htslib.mk |
| 20 | |
| 21 | CFLAGS="-O2 -fno-strict-aliasing -fno-code-hoisting" |
| 22 | |
| 23 | if grep sse /proc/cpuinfo > /dev/null; then |
| 24 | CFLAGS="${CFLAGS} -msse -mfpmath=sse" |
| 25 | fi |
| 26 | export CFLAGS |
| 27 | |
| 28 | DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 29 | libdir="/usr/lib/${DEB_HOST_MULTIARCH}" |
| 30 | plugindir="${libdir}/htslib" |
| 31 | export ac_cv_func_mmap_fixed_mapped=yes |
| 32 | autoreconf -f -i |
| 33 | ./configure \ |
| 34 | "--build=${DEB_HOST_MULTIARCH}" \ |
| 35 | --prefix=/usr \ |
| 36 | --includedir="\${prefix}/include" \ |
| 37 | --mandir="\${prefix}/share/man" \ |
| 38 | --infodir="\${prefix}/share/info" \ |
| 39 | --sysconfdir=/etc \ |
| 40 | --localstatedir=/var \ |
| 41 | --disable-option-checking \ |
| 42 | --disable-silent-rules \ |
| 43 | --libdir="\${prefix}/lib/${DEB_HOST_MULTIARCH}" \ |
| 44 | --runstatedir=/run \ |
| 45 | --disable-maintainer-mode \ |
| 46 | --disable-dependency-tracking \ |
| 47 | --enable-libcurl \ |
| 48 | --enable-gcs \ |
| 49 | --enable-s3 \ |
| 50 | --enable-plugins \ |
| 51 | --with-plugin-dir="${libdir}/htslib" \ |
| 52 | --with-external-htscodecs \ |
| 53 | --with-plugin-path="/usr/local/lib/htslib:/usr/local/libexec/htslib:${plugindir}" |
| 54 | |
| 55 | |
| 56 | make -e check |
| 57 | |
| 58 | echo "PASS" |