# -*- sh-shell: rpm -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

%define __python /usr/bin/python3

%define _amzn %{?amzn:%{amzn}}%{!?amzn:0}
%define is_amazon_linux (%{_amzn} != 0)

%define _rhel %{?rhel:%{rhel}}%{!?rhel:0}
%define is_rhel (%{_rhel} != 0)

%define is_centos_7 (%{_rhel} == 7 && !%{is_amazon_linux})

%define major_version %(echo @VERSION@ | cut -d. -f 1)
%define minor_version %(echo @VERSION@ | cut -d. -f 2)
%define so_version %(expr %{major_version} '*' 100 + %{minor_version})

%define boost_version %( \
  if [ %{_rhel} -eq 7 ]; then \
    echo 169; \
  fi)
%define cmake_version %( \
  if [ %{_rhel} -eq 7 ]; then \
    echo 3; \
  fi)

%define lz4_requirement %( \
  if [ %{_amzn} -eq 0 ]; then \
    echo ">= 1.8.0"; \
  fi)

%if %{_rhel} >= 9 || %{_amzn} >= 2023
%define arrow_cmake_builddir %{__cmake_builddir}
%define arrow_cmake %cmake
%define arrow_cmake_build make -C %{arrow_cmake_builddir} %{?_smp_mflags}
%define arrow_cmake_install %cmake_install
%else
%define arrow_cmake_builddir build
%define arrow_cmake %cmake3 -S . -B %{arrow_cmake_builddir}
%define arrow_cmake_build make -C %{arrow_cmake_builddir} %{?_smp_mflags}
%define arrow_cmake_install DESTDIR="%{buildroot}" make -C %{arrow_cmake_builddir} install
%endif

%if %{is_centos_7}
%define gcc_package devtoolset-11-gcc
%else
%define gcc_package gcc
%endif

%define use_azure (%{_rhel} >= 8 || %{_amzn} >= 2023)
%define use_bundled_nlohmann_json (%{_rhel} == 8)
%define use_flight (%{_rhel} >= 8 || %{_amzn} >= 2023)
%define use_gandiva (%{_rhel} >= 8 || %{_amzn} >= 2023)
%define use_gcs (%{_rhel} >= 8)
%define use_gflags (!%{is_amazon_linux})
## TODO: Enable this when glog stopped depending on gflags-devel.
# %%define use_glog (%%{_rhel} <= 8)
%define use_glog 0
%define use_mimalloc (%{_rhel} >= 8)
# TODO: Enable this. This works on local but is fragile on GitHub Actions and
# Travis CI.
# %%define use_s3 (%%{_rhel} >= 8)
%define use_s3 0
%define use_vala (%{_rhel} >= 8 || %{is_amazon_linux})

%define have_grpc (%{_amzn} >= 2023)
%define have_lz4_libs (%{_rhel} >= 8 || %{_amzn} >= 2023)
%define have_rapidjson (%{_rhel} != 8)
%define have_re2 (%{_rhel} >= 8 || %{_amzn} >= 2023)
%define have_thrift (%{_rhel} >= 8)
%define have_utf8proc (%{_rhel} >= 9 || %{_amzn} >= 2023)

%define enable_glib_doc (%{_rhel} >= 9 || %{is_amazon_linux})

Name:		@PACKAGE@
Version:	@VERSION@
Release:	@RELEASE@%{?dist}
Summary:	Apache Arrow is a data processing library for analysis

License:	Apache-2.0
URL:		https://arrow.apache.org/
Source0:	https://dist.apache.org/repos/dist/release/@PACKAGE@/@PACKAGE@-%{version}/apache-@PACKAGE@-%{version}.tar.gz

BuildRequires:	bison
BuildRequires:	boost%{boost_version}-devel
BuildRequires:	brotli-devel
BuildRequires:	bzip2-devel
%if %{use_flight}
BuildRequires:	c-ares-devel
%endif
BuildRequires:	cmake%{cmake_version}
BuildRequires:	curl-devel
BuildRequires:	flex
BuildRequires:	%{gcc_package}-c++
%if %{use_gflags}
BuildRequires:	gflags-devel
%endif
BuildRequires:	git
%if %{use_glog}
BuildRequires:	glog-devel
%endif
%if %{have_grpc}
BuildRequires:	grpc-devel
BuildRequires:	grpc-plugins
%endif
%if %{use_gcs} && !%{use_bundled_nlohmann_json}
BuildRequires:	json-devel
%endif
%if %{use_azure}
BuildRequires:	libxml2-devel
%endif
BuildRequires:	libzstd-devel
BuildRequires:	lz4-devel %{lz4_requirement}
BuildRequires:	ninja-build
BuildRequires:	openssl-devel
BuildRequires:	pkgconfig
%if %{have_rapidjson}
BuildRequires:	rapidjson-devel
%endif
%if %{have_re2}
BuildRequires:	re2-devel
%endif
BuildRequires:	snappy-devel
%if %{have_thrift}
BuildRequires:	thrift-devel
%endif
%if %{have_utf8proc}
BuildRequires:	utf8proc-devel
%endif
BuildRequires:	zlib-devel

%if %{use_gandiva}
BuildRequires:	llvm-devel
BuildRequires:	ncurses-devel
%endif

BuildRequires:	gobject-introspection-devel
%if %{use_vala}
BuildRequires:	vala
%endif

%description
Apache Arrow is a data processing library for analysis.

%prep
%setup -q -n apache-@PACKAGE@-%{version}

%build
cpp_build_type=release
cd cpp
%arrow_cmake \
%if %{use_azure}
  -DARROW_AZURE=ON \
%endif
  -DARROW_BUILD_UTILITIES=ON \
  -DARROW_CSV=ON \
  -DARROW_DATASET=ON \
%if %{use_flight}
  -DARROW_FLIGHT=ON \
  -DARROW_FLIGHT_SQL=ON \
%endif
%if %{use_gandiva}
  -DARROW_GANDIVA=ON \
%endif
%if %{use_gcs}
  -DARROW_GCS=ON \
%endif
  -DARROW_HDFS=ON \
  -DARROW_JSON=ON \
%if %{use_mimalloc}
  -DARROW_MIMALLOC=ON \
%endif
  -DARROW_ORC=ON \
  -DARROW_PACKAGE_KIND=rpm \
  -DARROW_PARQUET=ON \
%if %{use_s3}
  -DARROW_S3=ON \
%endif
  -DARROW_USE_CCACHE=OFF \
  -DARROW_WITH_BROTLI=ON \
  -DARROW_WITH_BZ2=ON \
  -DARROW_WITH_LZ4=ON \
  -DARROW_WITH_SNAPPY=ON \
  -DARROW_WITH_ZLIB=ON \
  -DARROW_WITH_ZSTD=ON \
  -DCMAKE_BUILD_TYPE=$cpp_build_type \
  -DPARQUET_BUILD_EXECUTABLES=ON \
  -DPARQUET_REQUIRE_ENCRYPTION=ON \
%if %{use_bundled_nlohmann_json}
  -Dnlohmann_json_SOURCE=BUNDLED \
%endif
  -G"Unix Makefiles"
%arrow_cmake_build
cd -

cd c_glib
%if %{_amzn} >= 2023
  # Do nothing
%else
  %if %{is_centos_7}
    # Meson 0.62.0 or later requires Python 3.7 or later.
    pip3 install 'meson<0.62.0'
  %else
    pip3 install meson
  %endif
%endif
%if %{enable_glib_doc}
  pip3 install gi-docgen
%endif
meson setup build \
  --default-library=both \
  --libdir=%{_libdir} \
  --prefix=%{_prefix} \
  -Darrow_cpp_build_dir=../cpp/%{arrow_cmake_builddir} \
  -Darrow_cpp_build_type=$cpp_build_type \
%if %{enable_glib_doc}
  -Ddoc=true \
%endif
%if %{use_vala}
  -Dvapi=true
%endif

LD_LIBRARY_PATH=$PWD/../cpp/%{arrow_cmake_builddir}/$cpp_build_type \
  meson compile -C build %{?_smp_mflags}
cd -

%install
cpp_build_type=release

cd c_glib
DESTDIR=%{buildroot} meson install -C build
cd -

cd cpp
%arrow_cmake_install
rm -rf %{buildroot}%{_docdir}/arrow/
cd -

%package -n %{name}%{so_version}-libs
Summary:	Runtime libraries for Apache Arrow C++
License:	Apache-2.0
%if %{have_lz4_libs}
Requires:	lz4-libs %{lz4_requirement}
%else
Requires:	lz4 %{lz4_requirement}
%endif

%description -n %{name}%{so_version}-libs
This package contains the libraries for Apache Arrow C++.

%files -n %{name}%{so_version}-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/libarrow.so.*

%package tools
Summary:	Tools for Apache Arrow C++
License:	Apache-2.0
Requires:	%{name}%{so_version}-libs = %{version}-%{release}

%description tools
Tools for Apache Arrow C++.

%files tools
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_bindir}/arrow-*

%package devel
Summary:	Libraries and header files for Apache Arrow C++
License:	Apache-2.0
Requires:	%{name}%{so_version}-libs = %{version}-%{release}
Requires:	brotli-devel
Requires:	bzip2-devel
Requires:	curl-devel
%if %{use_gcs} && !%{use_bundled_nlohmann_json}
Requires:	json-devel
%endif
Requires:	libzstd-devel
Requires:	lz4-devel %{lz4_requirement}
Requires:	openssl-devel
%if %{have_rapidjson}
Requires:	rapidjson-devel
%endif
%if %{have_re2}
Requires:	re2-devel
%endif
Requires:	snappy-devel
%if %{have_utf8proc}
Requires:	utf8proc-devel
%endif
Requires:	zlib-devel

%description devel
Libraries and header files for Apache Arrow C++.

%files devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_datadir}/arrow/gdb/
%{_datadir}/gdb/auto-load/
%{_includedir}/arrow/
%exclude %{_includedir}/arrow/acero/
%exclude %{_includedir}/arrow/dataset/
%if %{use_flight}
%exclude %{_includedir}/arrow/flight/
%endif
%{_libdir}/cmake/Arrow/
%{_libdir}/libarrow.a
%{_libdir}/libarrow.so
%{_libdir}/libarrow_bundled_dependencies.a
%{_libdir}/pkgconfig/arrow-compute.pc
%{_libdir}/pkgconfig/arrow-csv.pc
%{_libdir}/pkgconfig/arrow-filesystem.pc
%{_libdir}/pkgconfig/arrow-json.pc
%{_libdir}/pkgconfig/arrow-orc.pc
%{_libdir}/pkgconfig/arrow.pc

%package -n %{name}%{so_version}-acero-libs
Summary:	C++ library to execute a query in streaming
License:	Apache-2.0
Requires:	%{name}%{so_version}-libs = %{version}-%{release}

%description -n %{name}%{so_version}-acero-libs
This package contains the libraries for Apache Arrow Acero.

%files -n %{name}%{so_version}-acero-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/libarrow_acero.so.*

%package acero-devel
Summary:	Libraries and header files for Apache Arrow Acero
License:	Apache-2.0
Requires:	%{name}%{so_version}-acero-libs = %{version}-%{release}
Requires:	%{name}-devel = %{version}-%{release}

%description acero-devel
Libraries and header files for Apache Arrow Acero

%files acero-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_includedir}/arrow/acero/
%{_libdir}/cmake/ArrowAcero/
%{_libdir}/libarrow_acero.a
%{_libdir}/libarrow_acero.so
%{_libdir}/pkgconfig/arrow-acero.pc

%package -n %{name}%{so_version}-dataset-libs
Summary:	C++ library to read and write semantic datasets stored in different locations and formats
License:	Apache-2.0
Requires:	%{name}%{so_version}-acero-libs = %{version}-%{release}
Requires:	parquet%{so_version}-libs = %{version}-%{release}

%description -n %{name}%{so_version}-dataset-libs
This package contains the libraries for Apache Arrow dataset.

%files -n %{name}%{so_version}-dataset-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/libarrow_dataset.so.*

%package dataset-devel
Summary:	Libraries and header files for Apache Arrow dataset.
License:	Apache-2.0
Requires:	%{name}%{so_version}-dataset-libs = %{version}-%{release}
Requires:	%{name}-acero-devel = %{version}-%{release}
Requires:	parquet-devel = %{version}-%{release}

%description dataset-devel
Libraries and header files for Apache Arrow dataset.

%files dataset-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_includedir}/arrow/dataset/
%{_libdir}/cmake/ArrowDataset/
%{_libdir}/libarrow_dataset.a
%{_libdir}/libarrow_dataset.so
%{_libdir}/pkgconfig/arrow-dataset.pc

%if %{use_flight}
%package -n %{name}%{so_version}-flight-libs
Summary:	C++ library for fast data transport.
License:	Apache-2.0
Requires:	%{name}%{so_version}-libs = %{version}-%{release}

%description -n %{name}%{so_version}-flight-libs
This package contains the libraries for Apache Arrow Flight.

%files -n %{name}%{so_version}-flight-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/libarrow_flight.so.*

%package flight-devel
Summary:	Libraries and header files for Apache Arrow Flight.
License:	Apache-2.0
Requires:	%{name}%{so_version}-flight-libs = %{version}-%{release}
Requires:	%{name}-devel = %{version}-%{release}
Requires:	c-ares-devel
%if %{have_grpc}
Requires:	grpc-devel
Requires:	grpc-plugins
%endif

%description flight-devel
Libraries and header files for Apache Arrow Flight.

%files flight-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_includedir}/arrow/flight/
%exclude %{_includedir}/arrow/flight/sql/
%{_libdir}/cmake/ArrowFlight/
%{_libdir}/libarrow_flight.a
%{_libdir}/libarrow_flight.so
%{_libdir}/pkgconfig/arrow-flight.pc

%package -n %{name}%{so_version}-flight-sql-libs
Summary:	C++ library for interacting with SQL databases.
License:	Apache-2.0
Requires:	%{name}%{so_version}-flight-libs = %{version}-%{release}

%description -n %{name}%{so_version}-flight-sql-libs
This package contains the libraries for Apache Arrow Flight SQL.

%files -n %{name}%{so_version}-flight-sql-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/libarrow_flight_sql.so.*

%package flight-sql-devel
Summary:	Libraries and header files for Apache Arrow Flight SQL.
License:	Apache-2.0
Requires:	%{name}%{so_version}-flight-sql-libs = %{version}-%{release}
Requires:	%{name}-devel = %{version}-%{release}

%description flight-sql-devel
Libraries and header files for Apache Arrow Flight SQL.

%files flight-sql-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_includedir}/arrow/flight/sql/
%{_libdir}/cmake/ArrowFlightSql/
%{_libdir}/libarrow_flight_sql.a
%{_libdir}/libarrow_flight_sql.so
%{_libdir}/pkgconfig/arrow-flight-sql.pc
%endif

%if %{use_gandiva}
%package -n gandiva%{so_version}-libs
Summary:	C++ library for compiling and evaluating expressions on Apache Arrow data.
License:	Apache-2.0
Requires:	%{name}%{so_version}-libs = %{version}-%{release}

%description -n gandiva%{so_version}-libs
This package contains the libraries for Gandiva.

%files -n gandiva%{so_version}-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/libgandiva.so.*

%package -n gandiva-devel
Summary:	Libraries and header files for Gandiva.
License:	Apache-2.0
Requires:	%{name}-devel = %{version}-%{release}
Requires:	gandiva%{so_version}-libs = %{version}-%{release}
Requires:	llvm-devel

%description -n gandiva-devel
Libraries and header files for Gandiva.

%files -n gandiva-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_includedir}/gandiva/
%{_libdir}/cmake/Gandiva/
%{_libdir}/libgandiva.a
%{_libdir}/libgandiva.so
%{_libdir}/pkgconfig/gandiva.pc
%endif

%package -n parquet%{so_version}-libs
Summary:	Runtime libraries for Apache Parquet C++
License:	Apache-2.0
Requires:	%{name}%{so_version}-libs = %{version}-%{release}

%description -n parquet%{so_version}-libs
This package contains the libraries for Apache Parquet C++.

%files -n parquet%{so_version}-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/libparquet.so.*

%package -n parquet-tools
Summary:	Tools for Apache Parquet C++
License:	Apache-2.0
Requires:	parquet%{so_version}-libs = %{version}-%{release}

%description -n parquet-tools
Tools for Apache Parquet C++.

%files -n parquet-tools
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_bindir}/parquet-*

%package -n parquet-devel
Summary:	Libraries and header files for Apache Parquet C++
License:	Apache-2.0
Requires:	%{name}-devel = %{version}-%{release}
Requires:	parquet%{so_version}-libs = %{version}-%{release}
Requires:	zlib-devel

%description -n parquet-devel
Libraries and header files for Apache Parquet C++.

%files -n parquet-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_includedir}/parquet/
%{_libdir}/cmake/Parquet/
%{_libdir}/libparquet.a
%{_libdir}/libparquet.so
%{_libdir}/pkgconfig/parquet*.pc

%package -n %{name}%{so_version}-glib-libs
Summary:	Runtime libraries for Apache Arrow GLib
License:	Apache-2.0
Requires:	%{name}%{so_version}-libs = %{version}-%{release}

%description -n %{name}%{so_version}-glib-libs
This package contains the libraries for Apache Arrow GLib.

%files -n %{name}%{so_version}-glib-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/girepository-1.0/Arrow-*.typelib
%{_libdir}/libarrow-glib.so.*

%package glib-devel
Summary:	Libraries and header files for Apache Arrow GLib
License:	Apache-2.0
Requires:	%{name}-acero-devel = %{version}-%{release}
Requires:	%{name}%{so_version}-glib-libs = %{version}-%{release}
Requires:	glib2-devel
Requires:	gobject-introspection-devel

%description glib-devel
Libraries and header files for Apache Arrow GLib.

%files glib-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_datadir}/arrow-glib/example/
%{_datadir}/gir-1.0/Arrow-*.gir
%if %{use_vala}
%{_datadir}/vala/vapi/arrow-glib.*
%endif
%{_includedir}/arrow-glib/
%{_libdir}/libarrow-glib.a
%{_libdir}/libarrow-glib.so
%{_libdir}/pkgconfig/arrow-glib.pc
%{_libdir}/pkgconfig/arrow-orc-glib.pc

%package glib-doc
Summary:	Documentation for Apache Arrow GLib
License:	Apache-2.0

%description glib-doc
Documentation for Apache Arrow GLib.

%files glib-doc
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_datadir}/arrow-glib/*.txt
%{_datadir}/arrow-glib/*.md
%if %{enable_glib_doc}
%{_docdir}/arrow-glib/
%endif

%package -n %{name}%{so_version}-dataset-glib-libs
Summary:	Runtime libraries for Apache Arrow Dataset GLib
License:	Apache-2.0
Requires:	%{name}%{so_version}-dataset-libs = %{version}-%{release}
Requires:	%{name}%{so_version}-glib-libs = %{version}-%{release}

%description -n %{name}%{so_version}-dataset-glib-libs
This package contains the libraries for Apache Arrow Dataset GLib.

%files -n %{name}%{so_version}-dataset-glib-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/girepository-1.0/ArrowDataset-*.typelib
%{_libdir}/libarrow-dataset-glib.so.*

%package dataset-glib-devel
Summary:	Libraries and header files for Apache Arrow Dataset GLib
License:	Apache-2.0
Requires:	%{name}%{so_version}-dataset-glib-libs = %{version}-%{release}
Requires:	%{name}-dataset-devel = %{version}-%{release}
Requires:	%{name}-glib-devel = %{version}-%{release}

%description dataset-glib-devel
Libraries and header files for Apache Arrow Dataset GLib.

%files dataset-glib-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_datadir}/gir-1.0/ArrowDataset-*.gir
%if %{use_vala}
%{_datadir}/vala/vapi/arrow-dataset-glib.*
%endif
%{_includedir}/arrow-dataset-glib/
%{_libdir}/libarrow-dataset-glib.a
%{_libdir}/libarrow-dataset-glib.so
%{_libdir}/pkgconfig/arrow-dataset-glib.pc

%package dataset-glib-doc
Summary:	Documentation for Apache Arrow Dataset GLib
License:	Apache-2.0

%description dataset-glib-doc
Documentation for Apache Arrow dataset GLib.

%files dataset-glib-doc
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%if %{enable_glib_doc}
%{_docdir}/arrow-dataset-glib/
%endif

%if %{use_flight}
%package -n %{name}%{so_version}-flight-glib-libs
Summary:	Runtime libraries for Apache Arrow Flight GLib
License:	Apache-2.0
Requires:	%{name}%{so_version}-flight-libs = %{version}-%{release}
Requires:	%{name}%{so_version}-glib-libs = %{version}-%{release}

%description -n %{name}%{so_version}-flight-glib-libs
This package contains the libraries for Apache Arrow Flight GLib.

%files -n %{name}%{so_version}-flight-glib-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/girepository-1.0/ArrowFlight-*.typelib
%{_libdir}/libarrow-flight-glib.so.*

%package flight-glib-devel
Summary:	Libraries and header files for Apache Arrow Flight GLib
License:	Apache-2.0
Requires:	%{name}%{so_version}-flight-glib-libs = %{version}-%{release}
Requires:	%{name}-flight-devel = %{version}-%{release}
Requires:	%{name}-glib-devel = %{version}-%{release}

%description flight-glib-devel
Libraries and header files for Apache Arrow Flight GLib.

%files flight-glib-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_datadir}/gir-1.0/ArrowFlight-*.gir
%if %{use_vala}
%{_datadir}/vala/vapi/arrow-flight-glib.*
%endif
%{_includedir}/arrow-flight-glib/
%{_libdir}/libarrow-flight-glib.a
%{_libdir}/libarrow-flight-glib.so
%{_libdir}/pkgconfig/arrow-flight-glib.pc

%package flight-glib-doc
Summary:	Documentation for Apache Arrow Flight GLib
License:	Apache-2.0

%description flight-glib-doc
Documentation for Apache Arrow Flight GLib.

%files flight-glib-doc
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%if %{enable_glib_doc}
%{_docdir}/arrow-flight-glib/
%endif

%package -n %{name}%{so_version}-flight-sql-glib-libs
Summary:	Runtime libraries for Apache Arrow Flight SQL GLib
License:	Apache-2.0
Requires:	%{name}%{so_version}-flight-sql-libs = %{version}-%{release}
Requires:	%{name}%{so_version}-flight-glib-libs = %{version}-%{release}

%description -n %{name}%{so_version}-flight-sql-glib-libs
This package contains the libraries for Apache Arrow Flight SQL GLib.

%files -n %{name}%{so_version}-flight-sql-glib-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/girepository-1.0/ArrowFlightSQL-*.typelib
%{_libdir}/libarrow-flight-sql-glib.so.*

%package flight-sql-glib-devel
Summary:	Libraries and header files for Apache Arrow Flight SQL GLib
License:	Apache-2.0
Requires:	%{name}%{so_version}-flight-sql-glib-libs = %{version}-%{release}
Requires:	%{name}-flight-sql-devel = %{version}-%{release}
Requires:	%{name}-flight-glib-devel = %{version}-%{release}

%description flight-sql-glib-devel
Libraries and header files for Apache Arrow Flight SQL GLib.

%files flight-sql-glib-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_datadir}/gir-1.0/ArrowFlightSQL-*.gir
%if %{use_vala}
%{_datadir}/vala/vapi/arrow-flight-sql-glib.*
%endif
%{_includedir}/arrow-flight-sql-glib/
%{_libdir}/libarrow-flight-sql-glib.a
%{_libdir}/libarrow-flight-sql-glib.so
%{_libdir}/pkgconfig/arrow-flight-sql-glib.pc

%package flight-sql-glib-doc
Summary:	Documentation for Apache Arrow Flight SQL GLib
License:	Apache-2.0

%description flight-sql-glib-doc
Documentation for Apache Arrow Flight SQL GLib.

%files flight-sql-glib-doc
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
  %if %{enable_glib_doc}
%{_docdir}/arrow-flight-sql-glib/
  %endif
%endif

%if %{use_gandiva}
%package -n gandiva%{so_version}-glib-libs
Summary:	Runtime libraries for Gandiva GLib
License:	Apache-2.0
Requires:	%{name}%{so_version}-glib-libs = %{version}-%{release}
Requires:	gandiva%{so_version}-libs = %{version}-%{release}

%description -n gandiva%{so_version}-glib-libs
This package contains the libraries for Gandiva GLib.

%files -n gandiva%{so_version}-glib-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/girepository-1.0/Gandiva-*.typelib
%{_libdir}/libgandiva-glib.so.*

%package -n gandiva-glib-devel
Summary:	Libraries and header files for Gandiva GLib
License:	Apache-2.0
Requires:	%{name}-glib-devel = %{version}-%{release}
Requires:	gandiva%{so_version}-glib-libs = %{version}-%{release}
Requires:	gandiva-devel = %{version}-%{release}

%description -n gandiva-glib-devel
Libraries and header files for Gandiva GLib.

%files -n gandiva-glib-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_datadir}/gir-1.0/Gandiva-*.gir
%if %{use_vala}
%{_datadir}/vala/vapi/gandiva-glib.*
%endif
%{_includedir}/gandiva-glib/
%{_libdir}/libgandiva-glib.a
%{_libdir}/libgandiva-glib.so
%{_libdir}/pkgconfig/gandiva-glib.pc

%package -n gandiva-glib-doc
Summary:	Documentation for Gandiva GLib
License:	Apache-2.0

%description -n gandiva-glib-doc
Documentation for Gandiva GLib.

%files -n gandiva-glib-doc
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
  %if %{enable_glib_doc}
%{_docdir}/gandiva-glib/
  %endif
%endif

%package -n parquet%{so_version}-glib-libs
Summary:	Runtime libraries for Apache Parquet GLib
License:	Apache-2.0
Requires:	%{name}%{so_version}-glib-libs = %{version}-%{release}
Requires:	parquet%{so_version}-libs = %{version}-%{release}

%description -n parquet%{so_version}-glib-libs
This package contains the libraries for Apache Parquet GLib.

%files -n parquet%{so_version}-glib-libs
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_libdir}/girepository-1.0/Parquet-*.typelib
%{_libdir}/libparquet-glib.so.*

%package -n parquet-glib-devel
Summary:	Libraries and header files for Apache Parquet GLib
License:	Apache-2.0
Requires:	%{name}-glib-devel = %{version}-%{release}
Requires:	parquet%{so_version}-glib-libs = %{version}-%{release}
Requires:	parquet-devel = %{version}-%{release}

%description -n parquet-glib-devel
Libraries and header files for Apache Parquet GLib.

%files -n parquet-glib-devel
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%{_datadir}/gir-1.0/Parquet-*.gir
%if %{use_vala}
%{_datadir}/vala/vapi/parquet-glib.*
%endif
%{_includedir}/parquet-glib/
%{_libdir}/libparquet-glib.a
%{_libdir}/libparquet-glib.so
%{_libdir}/pkgconfig/parquet-glib.pc

%package -n parquet-glib-doc
Summary:	Documentation for Apache Parquet GLib
License:	Apache-2.0

%description -n parquet-glib-doc
Documentation for Apache Parquet GLib.

%files -n parquet-glib-doc
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.txt NOTICE.txt
%if %{enable_glib_doc}
%{_docdir}/parquet-glib/
%endif

%changelog
* Tue Apr 22 2025 Jacob Wujciak-Jens <jacob@wujciak.de> - 20.0.0-1
- New upstream release.

* Tue Feb 11 2025 Bryce Mecum <petridish@gmail.com> - 19.0.1-1
- New upstream release.

* Tue Jan 07 2025 Bryce Mecum <petridish@gmail.com> - 19.0.0-1
- New upstream release.

* Wed Nov 13 2024 Bryce Mecum <petridish@gmail.com> - 18.1.0-1
- New upstream release.

* Wed Oct 16 2024 Sutou Kouhei <kou@clear-code.com> - 18.0.0-1
- New upstream release.

* Thu Jul 11 2024 Raúl Cumplido <raulcumplido@gmail.com> - 17.0.0-1
- New upstream release.

* Thu May 09 2024 Raúl Cumplido <raulcumplido@gmail.com> - 16.1.0-1
- New upstream release.

* Tue Apr 16 2024 Raúl Cumplido <raulcumplido@gmail.com> - 16.0.0-1
- New upstream release.

* Wed Mar 13 2024 Raúl Cumplido <raulcumplido@gmail.com> - 15.0.2-1
- New upstream release.

* Fri Feb 23 2024 Raúl Cumplido <raulcumplido@gmail.com> - 15.0.1-1
- New upstream release.

* Tue Jan 16 2024 Raúl Cumplido <raulcumplido@gmail.com> - 15.0.0-1
- New upstream release.

* Tue Dec 12 2023 Raúl Cumplido <raulcumplido@gmail.com> - 14.0.2-1
- New upstream release.

* Mon Nov 06 2023 Raúl Cumplido <raulcumplido@gmail.com> - 14.0.1-1
- New upstream release.

* Thu Oct 19 2023 Raúl Cumplido <raulcumplido@gmail.com> - 14.0.0-1
- New upstream release.

* Thu Aug 17 2023 Raúl Cumplido <raulcumplido@gmail.com> - 13.0.0-1
- New upstream release.

* Wed Jun 07 2023 Raúl Cumplido <raulcumplido@gmail.com> - 12.0.1-1
- New upstream release.

* Fri Apr 21 2023 Raúl Cumplido <raulcumplido@gmail.com> - 12.0.0-1
- New upstream release.

* Wed Jan 18 2023 Raúl Cumplido <raulcumplido@gmail.com> - 11.0.0-1
- New upstream release.

* Thu Oct 20 2022 Sutou Kouhei <kou@clear-code.com> - 10.0.0-1
- New upstream release.

* Fri Jul 29 2022 Krisztián Szűcs <szucs.krisztian@gmail.com> - 9.0.0-1
- New upstream release.

* Tue May 03 2022 Krisztián Szűcs <szucs.krisztian@gmail.com> - 8.0.0-1
- New upstream release.

* Sat Jan 29 2022 Krisztián Szűcs <szucs.krisztian@gmail.com> - 7.0.0-1
- New upstream release.

* Mon Jan 18 2021 Krisztián Szűcs <szucs.krisztian@gmail.com> - 3.0.0-1
- New upstream release.

* Mon Oct 12 2020 Krisztián Szűcs <szucs.krisztian@gmail.com> - 2.0.0-1
- New upstream release.

* Mon Jul 20 2020 Krisztián Szűcs <szucs.krisztian@gmail.com> - 1.0.0-1
- New upstream release.

* Thu Apr 16 2020 Krisztián Szűcs <szucs.krisztian@gmail.com> - 0.17.0-1
- New upstream release.

* Thu Jan 30 2020 Krisztián Szűcs <szucs.krisztian@gmail.com> - 0.16.0-1
- New upstream release.

* Mon Sep 30 2019 Krisztián Szűcs <szucs.krisztian@gmail.com> - 0.15.0-1
- New upstream release.

* Fri Jun 28 2019 Sutou Kouhei <kou@clear-code.com> - 0.14.0-1
- New upstream release.

* Thu Mar 28 2019 Kouhei Sutou <kou@clear-code.com> - 0.13.0-1
- New upstream release.

* Wed Jan 16 2019 Krisztián Szűcs <szucs.krisztian@gmail.com> - 0.12.0-1
- New upstream release.

* Thu Oct 04 2018 Kouhei Sutou <kou@clear-code.com> - 0.11.0-1
- New upstream release.

* Thu Aug 02 2018 Phillip Cloud <cpcloud@gmail.com> - 0.10.0-1
- New upstream release.

* Fri Mar 16 2018 Kouhei Sutou <kou@clear-code.com> - 0.9.0-1
- New upstream release.

* Sun Dec 17 2017 Uwe Korn <uwelk@xhochy.com> - 0.8.0-1
- New upstream release.

* Wed Sep 27 2017 Kouhei Sutou <kou@clear-code.com> - 0.7.1-1
- New upstream release.

* Tue Sep 12 2017 Wes McKinney <wes.mckinney@twosigma.com> - 0.7.0-1
- New upstream release.

* Fri Aug 11 2017 Kouhei Sutou <kou@clear-code.com> - 0.6.0-1
- New upstream release.

* Wed Aug 02 2017 Kouhei Sutou <kou@clear-code.com> - 0.6.0.20170802-1
- New upstream release.
