Changeset: 24c431eb2619 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=24c431eb2619 Modified Files: MonetDB.spec NT/rules.msc clients/examples/C/Makefile.ag clients/mapiclient/Makefile.ag common/stream/Makefile.ag common/stream/monetdb-stream.pc.in configure.ag tools/merovingian/client/Makefile.ag tools/merovingian/daemon/Makefile.ag tools/mserver/Makefile.ag Branch: Aug2018 Log Message:
Per the guidelines, use pkgconfig(XXX) in BuildRequires in spec file. On RHEL 6, there is no pkgconfig(bzip2), so provide old code for that. There is also no pkgconfig(atomic_ops) on RHEL 6, but in that case we just don't use atomic_ops. diffs (275 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -144,9 +144,9 @@ BuildRequires: selinux-policy-devel BuildRequires: hardlink %endif BuildRequires: bison -BuildRequires: bzip2-devel +BuildRequires: pkgconfig(bzip2) %if %{?with_fits:1}%{!?with_fits:0} -BuildRequires: cfitsio-devel +BuildRequires: pkgconfig(cfitsio) %endif BuildRequires: gcc %if %{?with_geos:1}%{!?with_geos:0} @@ -154,25 +154,25 @@ BuildRequires: geos-devel >= 3.4.0 %endif %if %{?with_lidar:1}%{!?with_lidar:0} BuildRequires: liblas-devel >= 1.8.0 -BuildRequires: gdal-devel -BuildRequires: libgeotiff-devel -# Fedora 22 liblas-devel does not depend on liblas: -BuildRequires: liblas >= 1.8.0 +BuildRequires: pkgconfig(gdal) %endif -BuildRequires: libatomic_ops-devel -BuildRequires: libcurl-devel -BuildRequires: xz-devel +%if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7 +# RHEL >= 7, and all current Fedora +BuildRequires: pkgconfig(atomic_ops) +%endif +BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(liblzma) # BuildRequires: libmicrohttpd-devel BuildRequires: libuuid-devel -BuildRequires: libxml2-devel -BuildRequires: openssl-devel +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(openssl) %if %{?with_pcre:1}%{!?with_pcre:0} -BuildRequires: pcre-devel >= 4.5 +BuildRequires: pkgconfig(libpcre) >= 4.5 %endif BuildRequires: readline-devel BuildRequires: unixODBC-devel # BuildRequires: uriparser-devel -BuildRequires: zlib-devel +BuildRequires: pkgconfig(zlib) %if %{?with_samtools:1}%{!?with_samtools:0} BuildRequires: samtools-devel %endif diff --git a/NT/rules.msc b/NT/rules.msc --- a/NT/rules.msc +++ b/NT/rules.msc @@ -138,8 +138,8 @@ zlib_CFLAGS = -DHAVE_LIBZ "-I$(LIBZLIB)\ !IFNDEF LIBBZIP2 LIBBZIP2 = C:\bzip2-1.0.5.win$(bits) !ENDIF -BZ_LIBS = "$(LIBBZIP2)\lib\libbz2.lib" -BZ_CFLAGS = -DHAVE_LIBBZ2 "-I$(LIBBZIP2)\include" +bzip2_LIBS = "$(LIBBZIP2)\lib\libbz2.lib" +bzip2_CFLAGS = -DHAVE_LIBBZ2 "-I$(LIBBZIP2)\include" !ENDIF !IFDEF HAVE_LIBXML diff --git a/clients/examples/C/Makefile.ag b/clients/examples/C/Makefile.ag --- a/clients/examples/C/Makefile.ag +++ b/clients/examples/C/Makefile.ag @@ -14,5 +14,5 @@ BINS = { smack00.c smack01.c LIBS = ../../mapilib/libmapi \ ../../../common/stream/libstream \ - $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) + $(SOCKET_LIBS) $(zlib_LIBS) $(bzip2_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) } diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag --- a/clients/mapiclient/Makefile.ag +++ b/clients/mapiclient/Makefile.ag @@ -19,7 +19,7 @@ bin_mclient = { ../mapilib/libmapi \ ../../common/stream/libstream \ $(READLINE_LIBS) \ - $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) + $(SOCKET_LIBS) $(zlib_LIBS) $(bzip2_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) } bin_msqldump = { @@ -27,7 +27,7 @@ bin_msqldump = { LIBS = libmcutil ../../common/utils/libmutils \ ../mapilib/libmapi \ ../../common/stream/libstream \ - $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) + $(SOCKET_LIBS) $(zlib_LIBS) $(bzip2_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) } bin_stethoscope = { @@ -35,7 +35,7 @@ bin_stethoscope = { LIBS = libmcutil ../../common/utils/libmutils \ ../mapilib/libmapi \ ../../common/stream/libstream \ - $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) + $(SOCKET_LIBS) $(zlib_LIBS) $(bzip2_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) } bin_tachograph = { @@ -43,7 +43,7 @@ bin_tachograph = { LIBS = libmcutil ../../common/utils/libmutils \ ../mapilib/libmapi \ ../../common/stream/libstream \ - $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) + $(SOCKET_LIBS) $(zlib_LIBS) $(bzip2_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) } bin_tomograph = { @@ -51,7 +51,7 @@ bin_tomograph = { LIBS = libmcutil ../../common/utils/libmutils \ ../mapilib/libmapi \ ../../common/stream/libstream \ - $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) + $(SOCKET_LIBS) $(zlib_LIBS) $(bzip2_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) $(openssl_LIBS) } # disabled: it's not really a tool for users, more to debug mapi diff --git a/common/stream/Makefile.ag b/common/stream/Makefile.ag --- a/common/stream/Makefile.ag +++ b/common/stream/Makefile.ag @@ -9,7 +9,7 @@ MTSAFE INCLUDES = $(zlib_CFLAGS) \ - $(BZ_CFLAGS) \ + $(bzip2_CFLAGS) \ $(snappy_CFLAGS) \ $(lz4_CFLAGS) \ $(liblzma_CFLAGS) \ @@ -20,7 +20,7 @@ lib_stream = { VERSION = $(STREAM_VERSION) LIBS = WIN32?$(SOCKET_LIBS) \ WIN32?$(zlib_LIBS) \ - WIN32?$(BZ_LIBS) \ + WIN32?$(bzip2_LIBS) \ WIN32?$(snappy_LIBS) \ WIN32?$(lz4_LIBS) \ WIN32?$(liblzma_LIBS) \ diff --git a/common/stream/monetdb-stream.pc.in b/common/stream/monetdb-stream.pc.in --- a/common/stream/monetdb-stream.pc.in +++ b/common/stream/monetdb-stream.pc.in @@ -12,7 +12,7 @@ includedir=@includedir@ Name: monetdb-stream Description: MonetDB streams libary Version: @PACKAGE_VERSION@ -Requires: @PKG_CURL@ @PKG_ZLIB@ @PKG_LIBLZMA@ @PKG_LZ4@ +Requires: @PKG_CURL@ @PKG_ZLIB@ @PKG_LIBLZMA@ @PKG_LZ4@ @PKG_BZIP2@ -Libs: -L${libdir} -lstream @SOCKET_LIBS@ @BZ_LIBS@ @snappy_LIBS@ @LIBICONV@ +Libs: -L${libdir} -lstream @SOCKET_LIBS@ @snappy_LIBS@ @LIBICONV@ Cflags: -I${includedir}/monetdb diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -1340,37 +1340,41 @@ AS_CASE([$host_os], # check for bz2 (de)compression library org_have_bz2=auto have_bz2=$org_have_bz2 -BZ_CFLAGS="" -BZ_LIBS="-lbz2" AC_ARG_WITH([bz2], - [AS_HELP_STRING([--with-bz2=DIR], - [bz2 library is installed in DIR])], - [have_bz2="$withval"]) - -AS_CASE([$have_bz2], - [yes|no|auto], [], - [ - BZ_CFLAGS="-I$withval/include" - BZ_LIBS="-L$withval/lib -lbz2"]) - + [AS_HELP_STRING([--with-bz2], + [include bz2 support (default=auto)])], + [have_bz2=$withval]) AS_VAR_IF([have_bz2], [no], [], [ - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BZ_CFLAGS" - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $BZ_LIBS" - AC_CHECK_HEADER([bzlib.h], - [AC_CHECK_LIB([bz2], [BZ2_bzopen], - [AC_DEFINE([HAVE_LIBBZ2], 1, [Define if you have the bz2 library])], - [AS_VAR_IF([have_bz2], [auto], [], [AC_MSG_ERROR([-lbz2 library not found])]) - have_bz2=no; why_not_bz2="(bz2 library not found)"])], - [AS_VAR_IF([have_bz2], [auto], [], [AC_MSG_ERROR([bzlib.h header not found])]) - have_bz2=no; why_not_bz2="(bzlib.h header not found)"]) - LDFLAGS="$save_LDFLAGS" - CPPFLAGS="$save_CPPFLAGS"]) -AS_VAR_IF([have_bz2], [no], [BZ_CFLAGS=""; BZ_LIBS=""]) -AC_SUBST([BZ_CFLAGS]) -AC_SUBST([BZ_LIBS]) -AM_CONDITIONAL([HAVE_LIBBZ2], [test x$have_bz2 != xno]) + PKG_CHECK_MODULES([bzip2], [bzip2], [have_bz2=yes], [ + dnl RHEL 6 doesn't have a pkgconfig file for bzip2, + dnl so we also do it the old-fashioned way. + dnl When we drop support for RHEL 6, this whole "not found" + dnl section can be replace with + dnl [have_bz2=no; why_not_bz2="(bzip2 not found)"] + bzip2_CFLAGS="" + bzip2_LIBS="-lbz2" + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $bzip2_CFLAGS" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $bzip2_LIBS" + AC_CHECK_HEADER([bzlib.h], + [AC_CHECK_LIB([bz2], [BZ2_bzopen], + [have_bz2=yes], + [AS_VAR_IF([have_bz2], [auto], [], + [AC_MSG_ERROR([-lbz2 library not found])]) + have_bz2=no + why_not_bz2="(bz2 library not found)"])], + [AS_VAR_IF([have_bz2], [auto], [], + [AC_MSG_ERROR([bzlib.h header not found])]) + have_bz2=no + why_not_bz2="(bzlib.h header not found)"]) + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS"]) + AS_VAR_IF([have_bz2], [yes], + [AC_SUBST([PKG_BZIP2], [bzip2])]) + AS_VAR_IF([have_bz2], [yes], + [AC_DEFINE([HAVE_LIBBZ2], 1, [Define if you have the bz2 library])])]) +AM_CONDITIONAL([HAVE_LIBBZ2], [test x"$have_libbz2" != xno]) diff --git a/tools/merovingian/client/Makefile.ag b/tools/merovingian/client/Makefile.ag --- a/tools/merovingian/client/Makefile.ag +++ b/tools/merovingian/client/Makefile.ag @@ -22,5 +22,5 @@ bin_monetdb = { ../../../common/stream/libstream \ $(UUID_LIBS) \ $(openssl_LIBS) \ - $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) + $(SOCKET_LIBS) $(zlib_LIBS) $(bzip2_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) } diff --git a/tools/merovingian/daemon/Makefile.ag b/tools/merovingian/daemon/Makefile.ag --- a/tools/merovingian/daemon/Makefile.ag +++ b/tools/merovingian/daemon/Makefile.ag @@ -49,7 +49,7 @@ bin_monetdbd = { ../../../gdk/libbat \ $(UUID_LIBS) \ $(openssl_LIBS) \ - $(SOCKET_LIBS) $(zlib_LIBS) $(BZ_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) \ + $(SOCKET_LIBS) $(zlib_LIBS) $(bzip2_LIBS) $(snappy_LIBS) $(lz4_LIBS) $(liblzma_LIBS) $(curl_LIBS) $(LTLIBICONV) \ $(MATH_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS) $(DL_LIBS) $(PSAPILIB) $(KVM_LIBS) \ $(pcre_LIBS) $(libxml2_LIBS) } diff --git a/tools/mserver/Makefile.ag b/tools/mserver/Makefile.ag --- a/tools/mserver/Makefile.ag +++ b/tools/mserver/Makefile.ag @@ -62,7 +62,7 @@ bin_mserver5 = { $(PSAPILIB) \ $(KVM_LIBS) \ $(zlib_LIBS) \ - $(BZ_LIBS) \ + $(bzip2_LIBS) \ $(snappy_LIBS) \ $(lz4_LIBS) \ $(liblzma_LIBS) \ @@ -89,7 +89,7 @@ bin_shutdowntest = { $(PSAPILIB) \ $(KVM_LIBS) \ $(zlib_LIBS) \ - $(BZ_LIBS) \ + $(bzip2_LIBS) \ $(snappy_LIBS) \ $(lz4_LIBS) \ $(liblzma_LIBS) \ _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list