diff --git a/alibuild-recipe-tools.sh b/alibuild-recipe-tools.sh new file mode 100644 index 0000000000..42c2a526f7 --- /dev/null +++ b/alibuild-recipe-tools.sh @@ -0,0 +1,26 @@ +package: alibuild-recipe-tools +version: "0.2.3" +tag: "v0.2.3" +source: https://github.com/alisw/alibuild-recipe-tools +--- +mkdir -p $INSTALLROOT/bin +install $SOURCEDIR/alibuild-generate-module $INSTALLROOT/bin + +MODULEDIR="$INSTALLROOT/etc/modulefiles" +MODULEFILE="$MODULEDIR/$PKGNAME" +mkdir -p "$MODULEDIR" +cat > "$MODULEFILE" <' | c++ -x c++ - -I`brew --prefix openssl`/include -c -o /dev/null || exit 1; echo -e "#include \n#if OPENSSL_VERSION_NUMBER >= 0x10100000L\n#error \"System's GCC cannot be used: we need OpenSSL 1.0.x to build XrootD. We are going to compile our own version.\"\n#endif\nint main() { }" | cc -x c++ - -I`brew --prefix openssl`/include -c -o /dev/null || exit 1 + #!/bin/bash -e + case $(uname) in + Darwin) prefix=$(brew --prefix openssl@1.1); [ -d "$prefix" ] ;; + *) prefix= ;; + esac + cc -x c - ${prefix:+"-I$prefix/include"} -c -o /dev/null <<\EOF + #include + #include + #if OPENSSL_VERSION_NUMBER < 0x10101000L + #error "System's OpenSSL cannot be used: we need OpenSSL >= 1.1.1 for the Python ssl module. We are going to compile our own version." + #endif + int main() { } + EOF build_requires: - - zlib - - "GCC-Toolchain:(?!osx)" + - zlib + - alibuild-recipe-tools + - "GCC-Toolchain:(?!osx)" --- #!/bin/bash -e -rsync -av --delete --exclude="**/.git" $SOURCEDIR/ . +rsync -av --delete --exclude="**/.git" "$SOURCEDIR/" . +case ${PKG_VERSION} in + v1.1*) + OPTS="" + OPENSSLDIRPREFIX="" ;; + *) + OPTS="no-krb5" + OPENSSLDIRPREFIX="etc/ssl" + ;; +esac ./config --prefix="$INSTALLROOT" \ - --openssldir="$INSTALLROOT/etc/ssl" \ + --openssldir="$INSTALLROOT/$OPENSSLDIRPREFIX" \ --libdir=lib \ zlib \ no-idea \ no-mdc2 \ no-rc5 \ - no-ec \ - no-ecdh \ - no-ecdsa \ no-asm \ - no-krb5 \ + ${OPTS} \ shared \ -fno-strict-aliasing \ -L"$INSTALLROOT/lib" \ -Wa,--noexecstack make depend make # don't ever try to build in multicore -make install +make install_sw # no not install man pages # Remove static libraries and pkgconfig -rm -rf $INSTALLROOT/lib/pkgconfig \ - $INSTALLROOT/lib/*.a +rm -rf "$INSTALLROOT/lib/pkgconfig" \ + "$INSTALLROOT"/lib/*.a # Modulefile MODULEDIR="$INSTALLROOT/etc/modulefiles" MODULEFILE="$MODULEDIR/$PKGNAME" + mkdir -p "$MODULEDIR" -cat > "$MODULEFILE" < "$MODULEFILE" +cat << EOF >> "$MODULEFILE" +prepend-path ROOT_INCLUDE_PATH \$PKG_ROOT/include +EOF +mkdir -p "$INSTALLROOT/etc/modulefiles" +rsync -a --delete "$MODULEDIR/" "$INSTALLROOT/etc/modulefiles"