diff --git a/THRIFT-4177.patch b/THRIFT-4177.patch new file mode 100644 index 0000000..c0c331b --- /dev/null +++ b/THRIFT-4177.patch @@ -0,0 +1,27 @@ +diff --git a/compiler/cpp/src/thrift/generate/t_java_generator.cc b/compiler/cpp/src/thrift/generate/t_java_generator.cc +index fb581e4..90dfa06 100644 +--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc ++++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc +@@ -4657,8 +4657,9 @@ void t_java_generator::generate_deep_copy_non_container(ofstream& out, + std::string dest_name, + t_type* type) { + (void)dest_name; ++ type = get_true_type(type); + if (type->is_base_type() || type->is_enum() || type->is_typedef()) { +- if (((t_base_type*)type)->is_binary()) { ++ if (type->is_binary()) { + out << "org.apache.thrift.TBaseHelper.copyBinary(" << source_name << ")"; + } else { + // everything else can be copied directly +diff --git a/compiler/cpp/src/thrift/parse/t_type.h b/compiler/cpp/src/thrift/parse/t_type.h +index 30f8c1f7..3a6d1e04 100644 +--- a/compiler/cpp/src/thrift/parse/t_type.h ++++ b/compiler/cpp/src/thrift/parse/t_type.h +@@ -47,6 +47,7 @@ public: + virtual bool is_void() const { return false; } + virtual bool is_base_type() const { return false; } + virtual bool is_string() const { return false; } ++ virtual bool is_binary() const { return false; } + virtual bool is_bool() const { return false; } + virtual bool is_typedef() const { return false; } + virtual bool is_enum() const { return false; } diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100644 index 0000000..52ecda4 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +# +# 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. +# + +./cleanup.sh +if test -d lib/php/src/ext/thrift_protocol ; then + if phpize -v >/dev/null 2>/dev/null ; then + (cd lib/php/src/ext/thrift_protocol && phpize) + fi +fi + +set -e + +# libtoolize is called "glibtoolize" on OSX. +if libtoolize --version 1 >/dev/null 2>/dev/null; then + LIBTOOLIZE=libtoolize +elif glibtoolize --version 1 >/dev/null 2>/dev/null; then + LIBTOOLIZE=glibtoolize +else + echo >&2 "Couldn't find libtoolize!" + exit 1 +fi + +# we require automake 1.13 or later +# check must happen externally due to use of newer macro +AUTOMAKE_VERSION=`automake --version | grep automake | egrep -o '([0-9]{1,}\.)+[0-9]{1,}'` +if [ "$AUTOMAKE_VERSION" \< "1.13" ]; then + echo >&2 "automake version $AUTOMAKE_VERSION is too old (need 1.13 or later)" + exit 1 +fi + +autoscan +$LIBTOOLIZE --copy --automake +aclocal -I ./aclocal +autoheader +autoconf +automake --copy --add-missing --foreign diff --git a/configure-java-prefix.patch b/configure-java-prefix.patch new file mode 100644 index 0000000..ebd542f --- /dev/null +++ b/configure-java-prefix.patch @@ -0,0 +1,16 @@ +diff --git a/configure.ac b/configure.ac +index 0972abf..77107fc 100755 +--- a/configure.ac ++++ b/configure.ac +@@ -34,10 +34,7 @@ AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules. + AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"]) + + AC_ARG_VAR([JAVA_PREFIX], [Prefix for installing the Java lib jar. +- Default = "/usr/local/lib"]) +-AS_IF([test "x$JAVA_PREFIX" != x], [JAVA_PREFIX="$JAVA_PREFIX/usr/local/lib"], +- [test "x$PREFIX" != x], [JAVA_PREFIX="$PREFIX/usr/local/lib"], +- [JAVA_PREFIX="/usr/local/lib"]) ++ Default = "/usr/share/java"]) + + AC_ARG_VAR([RUBY_PREFIX], [Prefix for installing Ruby modules. + (Normal --prefix is ignored for Ruby because diff --git a/fb303-0.10.0-buildxml.patch b/fb303-0.10.0-buildxml.patch new file mode 100644 index 0000000..eb3825a --- /dev/null +++ b/fb303-0.10.0-buildxml.patch @@ -0,0 +1,158 @@ +diff --git a/contrib/fb303/java/build.xml b/contrib/fb303/java/build.xml +index 8f2fa51..d89f05e 100755 +--- a/contrib/fb303/java/build.xml ++++ b/contrib/fb303/java/build.xml +@@ -17,8 +17,7 @@ + specific language governing permissions and limitations + under the License. + --> +- ++ + + + +@@ -38,8 +37,8 @@ + + + +- +- ++ ++ + + + +@@ -50,7 +49,7 @@ + + + +- ++ + + + +@@ -72,13 +71,21 @@ + + + +- ++ + + +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + ++ + + + +@@ -99,97 +106,4 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + diff --git a/fix-ppc64le-builds.patch b/fix-ppc64le-builds.patch new file mode 100644 index 0000000..f56ad86 --- /dev/null +++ b/fix-ppc64le-builds.patch @@ -0,0 +1,13 @@ +diff --git a/aclocal/ax_boost_base.m4 b/aclocal/ax_boost_base.m4 +index b496020..30ee0df 100644 +--- a/aclocal/ax_boost_base.m4 ++++ b/aclocal/ax_boost_base.m4 +@@ -92,7 +92,7 @@ if test "x$want_boost" = "xyes"; then + libsubdirs="lib" + ax_arch=`uname -m` + case $ax_arch in +- x86_64|ppc64|s390x|sparc64|aarch64) ++ x86_64|ppc64|ppc64le|s390x|sparc64|aarch64) + libsubdirs="lib64 lib lib64" + ;; + esac diff --git a/libfb303-0.10.0.pom b/libfb303-0.10.0.pom new file mode 100644 index 0000000..c3fddde --- /dev/null +++ b/libfb303-0.10.0.pom @@ -0,0 +1,104 @@ + + + 4.0.0 + org.apache.thrift + libfb303 + 0.10.0 + pom + Apache Thrift + Thrift is a software framework for scalable cross-language services development. + http://thrift.apache.org + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + mcslee + Mark Slee + + + dreiss + David Reiss + + + aditya + Aditya Agarwal + + + marck + Marc Kwiatkowski + + + jwang + James Wang + + + cpiro + Chris Piro + + + bmaurer + Ben Maurer + + + kclark + Kevin Clark + + + jake + Jake Luciani + + + bryanduxbury + Bryan Duxbury + + + esteve + Esteve Fernandez + + + todd + Todd Lipcon + + + geechorama + Andrew McGeachie + + + molinaro + Anthony Molinaro + + + roger + Roger Meier + + + jfarrell + Jake Farrell + + + jensg + Jens Geyer + + + carl + Carl Yeksigian + + + + scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git + scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git + https://git-wip-us.apache.org/repos/asf?p=thrift.git + + + + org.apache.thrift + libthrift + 0.10.0 + + + diff --git a/libthrift-0.10.0.pom b/libthrift-0.10.0.pom new file mode 100644 index 0000000..7c5f61d --- /dev/null +++ b/libthrift-0.10.0.pom @@ -0,0 +1,120 @@ + + + 4.0.0 + org.apache.thrift + libthrift + 0.10.0 + pom + Apache Thrift + Thrift is a software framework for scalable cross-language services development. + http://thrift.apache.org + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + mcslee + Mark Slee + + + dreiss + David Reiss + + + aditya + Aditya Agarwal + + + marck + Marc Kwiatkowski + + + jwang + James Wang + + + cpiro + Chris Piro + + + bmaurer + Ben Maurer + + + kclark + Kevin Clark + + + jake + Jake Luciani + + + bryanduxbury + Bryan Duxbury + + + esteve + Esteve Fernandez + + + todd + Todd Lipcon + + + geechorama + Andrew McGeachie + + + molinaro + Anthony Molinaro + + + roger + Roger Meier + + + jfarrell + Jake Farrell + + + jensg + Jens Geyer + + + carl + Carl Yeksigian + + + + scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git + scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git + https://git-wip-us.apache.org/repos/asf?p=thrift.git + + + + org.slf4j + slf4j-api + 1.7.12 + + + javax.servlet + servlet-api + 2.5 + provided + + + org.apache.httpcomponents + httpclient + 4.4.1 + + + org.apache.httpcomponents + httpcore + 4.4.1 + + + diff --git a/python3.patch b/python3.patch new file mode 100644 index 0000000..c2908fd --- /dev/null +++ b/python3.patch @@ -0,0 +1,72 @@ +diff --git a/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py b/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py +index 4b1c257..df1c8cc 100644 +--- a/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py ++++ b/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py +@@ -57,24 +57,24 @@ def service_ctrl( + msg = fb_status_string(status) + if (len(status_details)): + msg += " - %s" % status_details +- print msg ++ print(msg) + + if (status == fb_status.ALIVE): + return 2 + else: + return 3 + except: +- print "Failed to get status" ++ print("Failed to get status") + return 3 + + # scalar commands + if command in ["version", "alive", "name"]: + try: + result = fb303_wrapper(command, port, trans_factory, prot_factory) +- print result ++ print(result) + return 0 + except: +- print "failed to get ", command ++ print("failed to get ", command) + return 3 + + # counters +@@ -82,10 +82,10 @@ def service_ctrl( + try: + counters = fb303_wrapper('counters', port, trans_factory, prot_factory) + for counter in counters: +- print "%s: %d" % (counter, counters[counter]) ++ print("%s: %d" % (counter, counters[counter])) + return 0 + except: +- print "failed to get counters" ++ print("failed to get counters") + return 3 + + # Only root should be able to run the following commands +@@ -96,19 +96,19 @@ def service_ctrl( + fb303_wrapper(command, port, trans_factory, prot_factory) + return 0 + except: +- print "failed to tell the service to ", command ++ print("failed to tell the service to ", command) + return 3 + else: + if command in ["stop", "reload"]: +- print "root privileges are required to stop or reload the service." ++ print("root privileges are required to stop or reload the service.") + return 4 + +- print "The following commands are available:" ++ print("The following commands are available:") + for command in ["counters", "name", "version", "alive", "status"]: +- print "\t%s" % command +- print "The following commands are available for users with root privileges:" ++ print("\t%s" % command) ++ print("The following commands are available for users with root privileges:") + for command in ["stop", "reload"]: +- print "\t%s" % command ++ print("\t%s" % command) + + return 0 + diff --git a/thrift-0.10.0-buildxml.patch b/thrift-0.10.0-buildxml.patch new file mode 100644 index 0000000..8931c03 --- /dev/null +++ b/thrift-0.10.0-buildxml.patch @@ -0,0 +1,235 @@ +diff --git a/lib/java/build.xml b/lib/java/build.xml +index 40e5284..db1ce54 100644 +--- a/lib/java/build.xml ++++ b/lib/java/build.xml +@@ -17,8 +17,7 @@ + specific language governing permissions and limitations + under the License. + --> +- ++ + + Thrift Build File + +@@ -67,8 +66,15 @@ + + + +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -78,11 +84,14 @@ + + + +- ++ ++ ++ ++ + + + +- ++ + + + +@@ -295,120 +304,12 @@ + + + +- + + + +- +- +- + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ++ + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + +diff --git a/tutorial/java/build.xml b/tutorial/java/build.xml +index 7638d5b..c5ca703 100644 +--- a/tutorial/java/build.xml ++++ b/tutorial/java/build.xml +@@ -29,13 +29,33 @@ + + + +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +- + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +diff --git a/tutorial/js/build.xml b/tutorial/js/build.xml +index a9a9ad4..2fddf0c 100644 +--- a/tutorial/js/build.xml ++++ b/tutorial/js/build.xml +@@ -35,8 +35,16 @@ + + + +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + diff --git a/thrift-0.10.0.tar.gz b/thrift-0.10.0.tar.gz new file mode 100644 index 0000000..e30c99f Binary files /dev/null and b/thrift-0.10.0.tar.gz differ diff --git a/thrift.spec b/thrift.spec new file mode 100644 index 0000000..30acae9 --- /dev/null +++ b/thrift.spec @@ -0,0 +1,365 @@ +%global php_extdir %(php-config --extension-dir 2>/dev/null || echo "undefined") +%{?perl_default_filter} +%global __provides_exclude_from ^(%{python3_sitearch}/.*\\.so|%{php_extdir}/.*\\.so)$ +%global have_mongrel 0 +%global have_jsx 0 +%global want_d 0 +%if 0%{?have_mongrel} == 0 +%global ruby_configure --without-ruby +%global with_ruby 0 +%else +%global ruby_configure --with-ruby +%global want_ruby 1 +%endif +%if 0%{?have_jsx} == 0 +%global erlang_configure --without-erlang +%global want_erlang 0 +%else +%global erlang_configure --with-erlang +%global want_erlang 1 +%endif +%global want_php 0 +%if 0%{?want_php} == 0 +%global php_langname %{nil} +%global php_configure --without-php +%else +%global php_langname PHP,\ +%global php_configure --with-php +%endif +%global want_golang 0 +%global golang_configure --without-go +Name: thrift +Version: 0.10.0 +Release: 1 +Summary: Software framework for cross-language services development +License: ASL 2.0 and BSD and zlib +URL: https://thrift.apache.org/ +Source0: https://archive.apache.org/dist/thrift/%{version}/thrift-%{version}.tar.gz +Source1: https://repo1.maven.org/maven2/org/apache/thrift/libthrift/%{version}/libthrift-%{version}.pom +Source2: https://raw.github.com/apache/thrift/%{version}/bootstrap.sh +Source3: https://repo1.maven.org/maven2/org/apache/thrift/libfb303/%{version}/libfb303-%{version}.pom +Patch0: thrift-%{version}-buildxml.patch +Patch1: fb303-%{version}-buildxml.patch +Patch2: configure-java-prefix.patch +Patch3: fix-ppc64le-builds.patch +Patch4: THRIFT-4177.patch +Patch5: python3.patch +BuildRequires: ant >= 1.7 autoconf automake bison boost-devel flex flex-devel gcc-c++ +BuildRequires: glib2-devel libevent-devel libstdc++-devel libtool openssl-devel qt-devel +BuildRequires: texlive zlib-devel +%if 0%{?want_golang} > 0 +BuildRequires: golang +Requires: golang +%endif +%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 +Summary: Development files for thrift +Requires: thrift%{?_isa} = %{version}-%{release} pkgconfig boost-devel +%description devel +The thrift-devel package contains libraries and header files for +developing applications that use thrift. + +%package qt +Summary: Qt support for thrift +Requires: thrift%{?_isa} = %{version}-%{release} +%description qt +The thrift-qt package contains Qt bindings for thrift. + +%package glib +Summary: GLib support for thrift +Requires: thrift%{?_isa} = %{version}-%{release} +%description glib +The thrift-qt package contains GLib bindings for thrift. + +%package -n python3-thrift +Summary: Python 3 support for thrift +BuildRequires: python3-devel +Requires: thrift%{?_isa} = %{version}-%{release} python3 +Obsoletes: python-thrift < 0.10.0-1%{?dist} +Obsoletes: python2-thrift < 0.10.0-14%{?dist} +%description -n python3-thrift +The python3-thrift package contains Python bindings for thrift. + +%package -n perl-thrift +Summary: Perl support for thrift +Provides: perl(Thrift) = %{version}-%{release} +BuildRequires: perl(Bit::Vector) perl(Class::Accessor) perl(ExtUtils::MakeMaker) +BuildRequires: perl-generators +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +Requires: perl(Bit::Vector) perl(Encode) perl(HTTP::Request) perl(IO::Select) +Requires: perl(IO::Socket::INET) perl(IO::String) perl(LWP::UserAgent) perl(POSIX) +Requires: perl(base) perl(constant) perl(strict) perl(utf8) perl(warnings) +BuildArch: noarch +%description -n perl-thrift +The perl-thrift package contains Perl bindings for thrift. +%if %{?want_d} + +%package -n d-thrift +Summary: D support for thrift +BuildRequires: ldc +%description -n d-thrift +The d-thrift package contains D bindings for thrift. +%endif +%if 0%{?want_php} != 0 + +%package -n php-thrift +Summary: PHP support for thrift +Requires: thrift%{?_isa} = %{version}-%{release} php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} php(language) >= 5.3.0 php-date php-json +BuildRequires: php-devel +%description -n php-thrift +The php-thrift package contains PHP bindings for thrift. +%endif + +%package -n libthrift-javadoc +Summary: API documentation for java-thrift +Requires: libthrift-java = %{version}-%{release} +BuildArch: noarch +%description -n libthrift-javadoc +The libthrift-javadoc package contains API documentation for the +Java bindings for thrift. + +%package -n libthrift-java +Summary: Java support for thrift +BuildRequires: apache-commons-codec apache-commons-lang apache-commons-logging +BuildRequires: httpcomponents-client httpcomponents-core java-devel javapackages-tools +BuildRequires: javapackages-local junit log4j slf4j +BuildRequires: mvn(javax.servlet:javax.servlet-api) = 3.1.0 +Requires: java-headless >= 1:1.6.0 javapackages-tools mvn(org.slf4j:slf4j-api) +Requires: mvn(commons-lang:commons-lang) mvn(org.apache.httpcomponents:httpclient) +Requires: mvn(org.apache.httpcomponents:httpcore) +BuildArch: noarch +%description -n libthrift-java +The libthrift-java package contains Java bindings for thrift. +%if 0%{?want_ruby} > 0 + +%package -n ruby-thrift +Summary: Ruby support for thrift +Requires: thrift%{?_isa} = %{version}-%{release} ruby(release) +BuildRequires: ruby-devel +%description -n ruby-thrift +The ruby-thrift package contains Ruby bindings for thrift. +%endif +%if 0%{?want_erlang} > 0 + +%package -n erlang-thrift +Summary: Erlang support for thrift +Requires: thrift%{?_isa} = %{version}-%{release} erlang erlang-jsx +BuildRequires: erlang erlang-rebar +%description -n erlang-thrift +The erlang-thrift package contains Erlang bindings for thrift. +%endif + +%package -n fb303 +Summary: Basic interface for Thrift services +Requires: thrift%{?_isa} = %{version}-%{release} +%description -n fb303 +fb303 is the shared root of all Thrift services; it provides a +standard interface to monitoring, dynamic options and configuration, +uptime reports, activity, etc. + +%package -n fb303-devel +Summary: Development files for fb303 +Requires: fb303%{?_isa} = %{version}-%{release} +%description -n fb303-devel +The fb303-devel package contains header files for fb303 + +%package -n python3-fb303 +Summary: Python 3 bindings for fb303 +Requires: fb303%{?_isa} = %{version}-%{release} +BuildRequires: python3-devel +Obsoletes: python-fb303 < 0.10.0-1%{?dist} +Obsoletes: python2-fb303 < 0.10.0-14%{?dist} +%description -n python3-fb303 +The python3-fb303 package contains Python bindings for fb303. + +%package -n fb303-java +Summary: Java bindings for fb303 +Requires: java-headless >= 1:1.6.0 javapackages-tools mvn(org.slf4j:slf4j-api) +Requires: mvn(commons-lang:commons-lang) mvn(org.apache.httpcomponents:httpclient) +Requires: mvn(org.apache.httpcomponents:httpcore) +BuildArch: noarch +%description -n fb303-java +The fb303-java package contains Java bindings for fb303. + +%prep +%autosetup -p1 +%{?!el5:sed -i -e 's/^AC_PROG_LIBTOOL/LT_INIT/g' configure.ac} +find . -name \*.cpp -or -name \*.cc -or -name \*.h | xargs -r chmod 644 +cp -p %{SOURCE2} bootstrap.sh +echo 'libthrift_c_glib_la_LIBADD = $(GLIB_LIBS) $(GOBJECT_LIBS) -L../cpp/.libs ' >> lib/c_glib/Makefile.am +echo 'libthriftqt_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_libthriftqt_la_DEPENDENCIES = libthrift.la' >> lib/cpp/Makefile.am +echo 'EXTRA_libthriftz_la_DEPENDENCIES = libthrift.la' >> lib/cpp/Makefile.am +sed -i 's|libfb303_so_LDFLAGS = $(SHARED_LDFLAGS)|libfb303_so_LDFLAGS = $(SHARED_LDFLAGS) -lthrift -L../../../lib/cpp/.libs -Wl,--as-needed|g' contrib/fb303/cpp/Makefile.am +sed -i 's|ANT_VALID=.*|ANT_VALID=1|' aclocal/ax_javac_and_java.m4 +sed -i 's|ANT_VALID=.*|ANT_VALID=1|' contrib/fb303/aclocal/ax_javac_and_java.m4 + +%build +export PY_PREFIX=%{_prefix} +export PERL_PREFIX=%{_prefix} +export PHP_PREFIX=%{php_extdir} +export JAVA_PREFIX=%{_javadir} +export RUBY_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 %{_builddir} -name rebar -exec rm -f '{}' \; +find . -name Makefile\* -exec sed -i -e 's/[.][/]rebar/rebar/g' {} \; +sed -i 's|-Dinstall.javadoc.path=$(DESTDIR)$(docdir)/java|-Dinstall.javadoc.path=$(DESTDIR)%{_javadocdir}/thrift|' lib/java/Makefile.* +sed -i 's|${thrift.artifactid}-${version}|${thrift.artifactid}|' lib/java/build.xml +sed -i 's|$(INSTALL) $$p|$(INSTALL) --mode 644 $$p|g' lib/erl/Makefile.am +sed -i 's|$(thrift_home)/bin/thrift|../../../compiler/cpp/thrift|g' \ + contrib/fb303/cpp/Makefile.am \ + contrib/fb303/py/Makefile.am +sed -i 's|$(prefix)/lib$|%{_libdir}|g' contrib/fb303/cpp/Makefile.am +sed -i 's|$(thrift_home)/include/thrift|../../../lib/cpp/src|g' \ + contrib/fb303/cpp/Makefile.am +echo "all: + ant +install: build/libfb303.jar + mkdir -p %{buildroot}%{_javadir} + /usr/bin/install -c -m 644 build/libfb303.jar %{buildroot}%{_javadir} +" > contrib/fb303/java/Makefile +sh ./bootstrap.sh +export PYTHON=%{_bindir}/python3 +%configure --disable-dependency-tracking --disable-static --with-boost=/usr %{ruby_configure} %{erlang_configure} %{golang_configure} %{php_configure} --with-py3 --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/thrift-%{version}} +sed -i -e 's/ -shared / -Wl,--as-needed\0/g' libtool +make %{?_smp_mflags} +( + cd contrib/fb303 + sed -i '/^[.][/]configure.*/d' bootstrap.sh + sh bootstrap.sh + %configure --disable-static --with-java --without-php --with-py3 --libdir=%{_libdir} + make %{?_smp_mflags} + ( + cd java + ant dist + ) +) + +%install +%make_install +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 +find %{buildroot}/%{_javadir} -name libthrift-javadoc.jar -exec rm -f '{}' \; +mkdir -p %{buildroot}%{_mavenpomdir} +install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-libthrift.pom +%add_maven_depmap JPP-libthrift.pom libthrift.jar +find %{buildroot} -name \*.jar -a \! -name \*thrift\* -exec rm -f '{}' \; +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_vendorlib}/ +mv %{buildroot}/usr/lib/perl5/* %{buildroot}/%{perl_vendorlib} +%if 0%{?want_php} != 0 +mkdir -p %{buildroot}/%{_datadir}/php/ +mv %{buildroot}/%{php_extdir}/Thrift %{buildroot}/%{_datadir}/php/ +%endif # want_php +find %{buildroot} -name Thread.h -exec chmod a-x '{}' \; +( + cd contrib/fb303 + make DESTDIR=%{buildroot} install + ( + cd java + ant -Dinstall.path=%{buildroot}%{_javadir} -Dinstall.javadoc.path=%{buildroot}%{_javadocdir}/fb303 install + ) +) +install -pm 644 %{SOURCE3} %{buildroot}%{_mavenpomdir}/JPP-libfb303.pom +%add_maven_depmap JPP-libfb303.pom libfb303.jar -f "fb303" +find %{buildroot} -name \*.py -exec grep -q /usr/bin/env {} \; -print | xargs -r chmod 755 + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%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 +%{_libdir}/libthrift_c_glib.so.* + +%files qt +%{_libdir}/libthriftqt.so +%{_libdir}/libthriftqt-%{version}.so + +%files devel +%{_includedir}/thrift +%exclude %{_includedir}/thrift/fb303 +%{_libdir}/*.so +%{_libdir}/*.so.0 +%{_libdir}/*.so.0.0.0 +%exclude %{_libdir}/lib*-%{version}.so +%exclude %{_libdir}/libfb303.so +%{_libdir}/pkgconfig/thrift-z.pc +%{_libdir}/pkgconfig/thrift-qt.pc +%{_libdir}/pkgconfig/thrift-nb.pc +%{_libdir}/pkgconfig/thrift.pc +%{_libdir}/pkgconfig/thrift_c_glib.pc +%doc LICENSE NOTICE + +%files -n perl-thrift +%{perl_vendorlib}/Thrift +%{perl_vendorlib}/Thrift.pm +%doc LICENSE NOTICE +%if 0%{?want_php} != 0 + +%files -n php-thrift +%config(noreplace) /etc/php.d/thrift_protocol.ini +%{_datadir}/php/Thrift/ +%{php_extdir}/thrift_protocol.so +%doc LICENSE NOTICE +%endif +%if %{?want_erlang} > 0 + +%files -n erlang-thrift +%{_libdir}/erlang/lib/thrift-%{version}/ +%doc LICENSE NOTICE +%endif + +%files -n python3-thrift +%{python3_sitearch}/thrift +%{python3_sitearch}/thrift-%{version}-py%{python3_version}.egg-info +%doc LICENSE NOTICE + +%files -n libthrift-javadoc +%{_javadocdir}/thrift +%doc LICENSE NOTICE + +%files -n libthrift-java -f .mfiles +%doc LICENSE NOTICE + +%files -n fb303 +%{_datarootdir}/fb303 +%doc LICENSE NOTICE + +%files -n fb303-devel +%{_libdir}/libfb303.so +%{_includedir}/thrift/fb303 +%doc LICENSE NOTICE + +%files -n python3-fb303 +%{python3_sitelib}/fb303 +%{python3_sitelib}/fb303_scripts +%{python3_sitelib}/thrift_fb303-%{version}-py%{python3_version}.egg-info +%doc LICENSE NOTICE + +%files -n fb303-java -f .mfiles-fb303 +%doc LICENSE NOTICE + +%changelog +* Tue Aug 18 2020 yaokai - 0.10.0-1 +- package init diff --git a/thrift.yaml b/thrift.yaml new file mode 100644 index 0000000..32d7f32 --- /dev/null +++ b/thrift.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/apache/thrift +version_control: github +src_repo: apache/thrift +tag_prefix: "^" +seperator: "."