Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37539543
en ru br
ALT Linux repos
S:0.18.1-alt1
5.0: 0.0.0-alt2.20081031git

Group :: Development/Other
RPM: thrift

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

# Work around this for now by disabling LTO:
%define optflags_lto %nil

Name:    thrift
Version: 0.14.0
Release: alt2
Summary: Software framework for cross-language services development
Group: Development/Other
ExcludeArch: armh

# Parts of the source are used under the BSD and zlib licenses, but

# these are OK for inclusion in an Apache 2.0-licensed whole:
# https://www.apache.org/legal/3party.html

# Here's the breakdown:

# ./lib/py/compat/win32/stdint.h is 2-clause BSD
# ./compiler/cpp/src/md5.[ch] are zlib
License: ASL 2.0 and BSD and zlib
URL:     https://thrift.apache.org/

Source0: %name-%version.tar

Source1: https://repo1.maven.org/maven2/org/apache/thrift/lib%name/%version/lib%name-%version.pom
Source2: https://raw.github.com/apache/%name/%version/bootstrap.sh

# Fix char warning

# https://issues.apache.org/jira/browse/THRIFT-5350
Patch0: thrift-char.patch

BuildRequires(pre): rpm-build-perl rpm-build-python3
BuildRequires: boost-devel boost-filesystem-devel boost-program_options-devel perl(CPAN/Meta.pm) perl(Encode.pm) perl(HTTP/Request.pm) perl(IO/Socket/SSL.pm) perl(IO/String.pm) perl(LWP/UserAgent.pm) perl(Test/Exception.pm) perl(parent.pm) perl-podlators
BuildRequires: chrpath
BuildRequires: boost-complete
#BuildRequires: boost-devel-static
BuildRequires: gcc-c++
BuildRequires: glib2-devel libgio libgio-devel
#BuildRequires: libevent-devel # for libthriftnb.so
BuildRequires: libssl-devel
BuildRequires: qt5-base-devel
BuildRequires: texlive-texmf
BuildRequires: zlib-devel

%description
The Apache Thrift software framework for cross-language services
development combines a software stack with a code generation engine to
build services that work efficiently and seamlessly between C++, Java,
Python, %{?php_langname}and other languages.

%package devel
Group: Development/C++
Summary: Development files for %name
Requires: %name = %EVR
Requires: boost-complete

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package qt5
Group: Development/Other
Summary: Qt5 support for %{name}
Requires: %name = %EVR

%description qt5
The %{name}-qt package contains Qt bindings for %name.

%package glib
Group: Development/Other
Summary: GLib support for %name
Requires: %name = %EVR

%description glib
The %name-qt package contains GLib bindings for %name.

%package -n python3-module-%name
Group: Development/Python3
Summary: Python 3 support for %name
BuildRequires: python3-devel
BuildRequires: python3-module-pkg_resources python3-module-setuptools
Requires: %name = %EVR

%description -n python3-module-thrift
The python3-%name package contains Python bindings for %name.

%package -n perl-%name
Group: Development/Perl
Summary: Perl support for %{name}
BuildArch: noarch
BuildRequires: perl(Bit/Vector.pm)
BuildRequires: perl(Class/Accessor.pm)
BuildRequires: perl(ExtUtils/MakeMaker.pm)
BuildRequires: rpm-build-perl
Requires: perl(Bit/Vector.pm)
Requires: perl(Encode.pm)
Requires: perl(HTTP/Request.pm)
Requires: perl(IO/Select.pm)
Requires: perl(IO/Socket/INET.pm)
Requires: perl(IO/String.pm)
Requires: perl(LWP/UserAgent.pm)
Requires: perl(POSIX.pm)
Requires: perl(base.pm)
Requires: perl(constant.pm)
Requires: perl(strict.pm)
Requires: perl(utf8.pm)
Requires: perl(warnings.pm)
# thrift improperly packages some components in files with names different
# than the package they contain
Provides: perl(Thrift/Exception.pm)
Provides: perl(Thrift/MessageType.pm)
Provides: perl(Thrift/Type.pm)

%description -n perl-%name
The perl-%name package contains Perl bindings for %name.

%prep
%setup
%patch0 -p1

# avoid spurious executable permissions in debuginfo package

find . -name \*.cpp -or -name \*.cc -or -name \*.h | xargs -r chmod 644

cp -p %SOURCE2 bootstrap.sh

# work around linking issues

echo 'libthrift_c_glib_la_LIBADD = $(GLIB_LIBS) $(GOBJECT_LIBS) -L../cpp/.libs ' >> lib/c_glib/Makefile.am
echo 'libthriftqt5_la_LIBADD = $(QT_LIBS) -lthrift -L.libs' >> lib/cpp/Makefile.am
echo 'libthriftz_la_LIBADD = $(ZLIB_LIBS) -lthrift -L.libs' >> lib/cpp/Makefile.am
echo 'EXTRA_libthriftqt5_la_DEPENDENCIES = libthrift.la' >> lib/cpp/Makefile.am
echo 'EXTRA_libthriftz_la_DEPENDENCIES = libthrift.la' >> lib/cpp/Makefile.am

# explicitly set python3

shopt -s globstar
sed -i -E 's at ^(#!.*/env) *python *$ at \1 python3 at ' **/*.py

%build
export PY_PREFIX=%prefix
export PERL_PREFIX=%prefix
export GLIB_LIBS=$(pkg-config --libs glib-2.0)
export GLIB_CFLAGS=$(pkg-config --cflags glib-2.0)
export GOBJECT_LIBS=$(pkg-config --libs gobject-2.0)
export GOBJECT_CFLAGS=$(pkg-config --cflags gobject-2.0)

find . -name rebar -exec rm -f '{}' \;
find . -name Makefile\* -exec sed -i -e 's/[.][/]rebar/rebar/g' {} \;

sh ./bootstrap.sh

# use unversioned doc dirs where appropriate (via _pkgdocdir macro)

export PYTHON=%{_bindir}/python3
%configure --disable-dependency-tracking --disable-static --with-boost=%prefix \
 --docdir=%_docdir/%name-%version

# eliminate unused direct shlib dependencies

sed -i -e 's/ -shared / -Wl,--as-needed\0/g' libtool

%make_build

%install
%makeinstall_std
find %buildroot -name '*.la' -exec rm -f {} ';'
find %buildroot -name fastbinary.so | xargs -r chmod 755
find %buildroot -name \*.erl -or -name \*.hrl -or -name \*.app | xargs -r chmod 644

# Move perl files into appropriate places

find %buildroot -name \*.pod -exec rm -f '{}' \;
find %buildroot -name .packlist -exec rm -f '{}' \;
find %buildroot/usr/lib/perl5 -type d -empty -delete
mkdir -p %buildroot/%perl_vendor_privlib/
mv %buildroot/usr/lib/perl5/* %buildroot/%perl_vendor_privlib

# Fix permissions on Thread.h

find %buildroot -name Thread.h -exec chmod a-x '{}' \;

# Ensure all python scripts are executable

find %buildroot -name \*.py -exec grep -q /usr/bin/env {} \; -print | xargs -r chmod 755
# kill rpath
for i in `find %buildroot{%_bindir,%_libdir,/usr/libexec,/usr/lib,/usr/sbin} -type f -perm -111 ! -name '*.la' `; do
chrpath -d $i ||:
done

%files
%doc LICENSE NOTICE
%_bindir/thrift
%_libdir/libthrift-%version.so
%_libdir/libthriftz-%version.so
#_libdir/libthriftnb-%version.so

%files glib
%_libdir/libthrift_c_glib.so.*

%files qt5
%_libdir/libthriftqt5-%version.so

%files devel
%_includedir/thrift
%_libdir/*.so
%exclude %_libdir/lib*-%version.so
%_libdir/pkgconfig/thrift-z.pc
%_libdir/pkgconfig/thrift-qt5.pc
#_libdir/pkgconfig/thrift-nb.pc
%_libdir/pkgconfig/thrift.pc
%_libdir/pkgconfig/thrift_c_glib.pc
%doc NOTICE

%files -n perl-%name
%perl_vendor_privlib/Thrift
%perl_vendor_privlib/Thrift.pm
%doc NOTICE

%files -n python3-module-%name
%python3_sitelibdir/%name
%python3_sitelibdir/%name-%version-py*.egg-info

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin