# Conditionals to help breaking presto-spi <-> presto-maven-plugin dependency cycle
%if 0%{?fedora}
%bcond_with presto_plugin
%endif
Name: presto
Version: 0.144
Release: 1%{?dist}
Summary: Distributed SQL query engine for big data
License: ASL 2.0
URL: https://prestodb.io/
Source0: https://github.com/prestodb/presto/archive/%{version}.tar.gz
BuildRequires: maven-local
BuildRequires: mvn(com.fasterxml.jackson.core:jackson-annotations)
BuildRequires: mvn(com.fasterxml.jackson.core:jackson-core)
BuildRequires: mvn(com.fasterxml.jackson.core:jackson-databind)
BuildRequires: mvn(com.google.code.findbugs:annotations)
BuildRequires: mvn(com.google.code.findbugs:jsr305)
BuildRequires: mvn(com.google.guava:guava)
BuildRequires: mvn(com.google.inject:guice)
BuildRequires: mvn(com.google.inject.extensions:guice-multibindings)
BuildRequires: mvn(com.h2database:h2)
# https://bugzilla.redhat.com/show_bug.cgi?id=1327888
BuildRequires: mvn(io.airlift:bootstrap)
BuildRequires: mvn(io.airlift:concurrent)
BuildRequires: mvn(io.airlift:configuration)
BuildRequires: mvn(io.airlift:log)
BuildRequires: mvn(io.airlift:log-manager)
BuildRequires: mvn(io.airlift:discovery)
BuildRequires: mvn(io.airlift:event)
BuildRequires: mvn(io.airlift:http-client)
BuildRequires: mvn(io.airlift:http-server)
BuildRequires: mvn(io.airlift:jaxrs)
BuildRequires: mvn(io.airlift:jmx)
BuildRequires: mvn(io.airlift:jmx-http)
BuildRequires: mvn(io.airlift:json)
BuildRequires: mvn(io.airlift:node)
BuildRequires: mvn(io.airlift:stats)
BuildRequires: mvn(io.airlift:testing)
BuildRequires: mvn(io.airlift:trace-token)
BuildRequires: mvn(io.airlift:units)
# https://bugzilla.redhat.com/show_bug.cgi?id=1325690
BuildRequires: mvn(io.airlift:slice)
# tpch:0.4 https://bugzilla.redhat.com/show_bug.cgi?id=1327892
BuildRequires: mvn(io.airlift.tpch:tpch)
%if %{with presto_plugin}
# for test only BuildRequires: mvn(com.orange.redis-embedded:embedded-redis:0.6) https://github.com/gbrd/embedded-redis
# https://bugzilla.redhat.com/show_bug.cgi?id=1327890
BuildRequires: mvn(io.airlift.discovery:discovery-server)
BuildRequires: mvn(io.takari.maven.plugins:presto-maven-plugin)
BuildRequires: mvn(io.takari.maven.plugins:provisio-maven-plugin)
BuildRequires: mvn(it.unimi.dsi:fastutil)
BuildRequires: mvn(javax.annotation:javax.annotation-api)
BuildRequires: mvn(javax.servlet:javax.servlet-api)
BuildRequires: mvn(javax.ws.rs:javax.ws.rs-api)
# jgrapht-core:0.9.0 https://gil.fedorapeople.org/jgrapht-core-0.9.2-1.fc23.src.rpm
# https://bugzilla.redhat.com/show_bug.cgi?id=1282074
BuildRequires: mvn(org.jgrapht:jgrapht-core)
BuildRequires: mvn(mysql:mysql-connector-java)
# https://bugzilla.redhat.com/show_bug.cgi?id=1217395
# BuildRequires: mvn(org.postgresql:postgresql)
BuildRequires: mvn(postgresql:postgresql)
BuildRequires: mvn(redis.clients:jedis)
# https://bugzilla.redhat.com/show_bug.cgi?id=1277450
# BuildRequires: mvn(com.facebook.thirdparty:libsvm:3.18.1) for ml module
BuildRequires: mvn(tw.edu.ntu.csie:libsvm)
%endif
BuildRequires: mvn(javax.inject:javax.inject)
BuildRequires: mvn(javax.validation:validation-api)
BuildRequires: mvn(jline:jline)
BuildRequires: mvn(joda-time:joda-time)
BuildRequires: mvn(net.sf.opencsv:opencsv)
BuildRequires: mvn(org.antlr:antlr4-maven-plugin)
BuildRequires: mvn(org.antlr:antlr4-runtime)
BuildRequires: mvn(org.apache.commons:commons-math3)
BuildRequires: mvn(org.eclipse.jetty:jetty-util)
BuildRequires: mvn(org.fusesource.jansi:jansi)
BuildRequires: mvn(org.jdbi:jdbi)
# https://bugzilla.redhat.com/show_bug.cgi?id=1328062
BuildRequires: mvn(org.jetbrains:annotations)
BuildRequires: mvn(org.openjdk.jmh:jmh-core)
BuildRequires: mvn(org.openjdk.jmh:jmh-generator-annprocess)
# https://bugzilla.redhat.com/show_bug.cgi?id=1325671
BuildRequires: mvn(org.openjdk.jol:jol-core)
BuildRequires: mvn(org.ow2.asm:asm-all)
BuildRequires: mvn(org.testng:testng)
# https://bugzilla.redhat.com/show_bug.cgi?id=1325672
BuildRequires: mvn(org.weakref:jmxutils)
BuildRequires: %{_bindir}/sphinx-build
BuildArch: noarch
%description
Presto is an open source distributed SQL query engine
for running interactive analytic queries against data
sources of all sizes ranging from gigabytes to petabytes.
Presto was designed and written from the ground up for
interactive analytics and approaches the speed of
commercial data warehouses while scaling to the size of
organizations like Facebook.
%package base-jdbc
Summary: Presto - Base JDBC Connector
%description base-jdbc
Presto - Base JDBC Connector.
%package benchmark-driver
Summary: Presto - Benchmark Driver
%description benchmark-driver
The benchmark driver can be used to measure the
performance of queries in a Presto cluster.
%package bytecode
Summary: Presto - Bytecode
%description bytecode
Presto - Bytecode.
%package cli
Summary: Presto - CLI
%description cli
Presto - CLI.
%package client
Summary: Presto - Client
%description client
Presto - Client.
%package jdbc
Summary: Presto - JDBC Driver
%description jdbc
Presto can be accessed from Java using the JDBC driver.
%package parser
Summary: Presto - Parser
%description parser
Presto - Parser.
%package record-decoder
Summary: Presto - Record Decoder
%description record-decoder
Presto - Record Decoder.
%package root
Summary: Presto - Parent POM
%description root
Presto - Parent POM.
%package spi
Summary: Presto - SPI
%description spi
Presto - SPI.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%package docs
Summary: Documentation for %{name}
Requires: %{name}-javadoc = %{version}-%{release}
%description docs
Documentation for the %{name} library.
%prep
%setup -q -n presto-%{version}
rm -rf .mvn
find -name '*.class' -print -delete
find -name '*.jar' -print -delete
# io.airlift:airbase:pom:51
%pom_remove_parent
%pom_add_plugin org.apache.maven.plugins:maven-compiler-plugin:3.0 . '
1.8
'
# Not available dependencies
%pom_disable_module presto-cassandra
%pom_disable_module presto-hive
%pom_disable_module presto-hive-cdh4
%pom_disable_module presto-hive-cdh5
%pom_disable_module presto-hive-hadoop1
%pom_disable_module presto-hive-hadoop2
# org.apache.kafka:kafka_2.10:0.8.1.1
%pom_disable_module presto-kafka
# com.facebook.hive:hive-dwrf,hive-dwrf-shims:0.8
%pom_disable_module presto-orc
# com.teradata.tempto:tempto-runner:1.4 com.facebook.presto.hive:hive-apache-jdbc:0.13.1-1
%pom_disable_module presto-product-tests
# org.sonatype.aether:aether-api:1.13.1 io.airlift.resolver:resolver:1.3
# io.airlift:joni:2.1.5.1 (replace with "system" joni library)
%pom_disable_module presto-main
%pom_disable_module presto-verifier
%pom_disable_module presto-testing-server-launcher
# Unknown packaging: presto-plugin
%if %{without presto_plugin}
# io.takari.maven.plugins:presto-maven-plugin:0.1.5
%pom_remove_plugin -r :presto-maven-plugin
# io.takari.maven.plugins:provisio-maven-plugin:0.1.11
%pom_remove_plugin -r :provisio-maven-plugin
%pom_disable_module presto-server
%pom_disable_module presto-blackhole
%pom_disable_module presto-example-http
%pom_disable_module presto-jmx
%pom_disable_module presto-ml
%pom_disable_module presto-mysql
%pom_disable_module presto-postgresql
%pom_disable_module presto-raptor
%pom_disable_module presto-redis
%pom_disable_module presto-teradata-functions
%pom_disable_module presto-tpch
%pom_disable_module presto-benchmark
%pom_disable_module presto-tests
%endif
# uk.co.codezen:redlinerpm-maven-plugin:2.0
#%% pom_remove_plugin :redlinerpm-maven-plugin presto-server-rpm
%pom_disable_module presto-server-rpm
# org.gaul:modernizer-maven-plugin:1.2.2
%pom_remove_plugin -r :modernizer-maven-plugin
%pom_remove_plugin -r :license-maven-plugin
%pom_remove_plugin -r :maven-shade-plugin
%pom_remove_plugin -r org.skife.maven:really-executable-jar-maven-plugin
%pom_disable_module presto-docs
%pom_remove_plugin -r org.tomdz.maven:sphinx-maven-plugin
# package org.fusesource.jansi.internal does not exist
#%% pom_add_dep org.fusesource.jansi:jansi-native:1.5 presto-cli
# package org.fusesource.jansi does not exist
%pom_add_dep org.fusesource.jansi:jansi:1.11 presto-cli
%pom_add_dep com.google.code.findbugs:jsr305:2.0.3 presto-bytecode
%pom_remove_plugin -r :maven-checkstyle-plugin
%build
# No test deps: com.facebook.presto:presto-main com.facebook.presto:presto-tpch
%mvn_build -s -f -- -Dproject.build.sourceEncoding=UTF-8
%{__make} %{?_smp_mflags} -C presto-docs clean html
rm presto-docs/target/html/.buildinfo
rm presto-docs/target/html/_static/jquery.js
rm presto-docs/target/html/_static/underscore.js
%install
%mvn_install
%files base-jdbc -f .mfiles-%{name}-base-jdbc
%license LICENSE
%files benchmark-driver -f .mfiles-%{name}-benchmark-driver
%files bytecode -f .mfiles-%{name}-bytecode
%license LICENSE
%files cli -f .mfiles-%{name}-cli
%files client -f .mfiles-%{name}-client
%files jdbc -f .mfiles-%{name}-jdbc
%files parser -f .mfiles-%{name}-parser
%license LICENSE
%files record-decoder -f .mfiles-%{name}-record-decoder
%license LICENSE
%files root -f .mfiles-%{name}-root
%license LICENSE
%files spi -f .mfiles-%{name}-spi
%doc README.md
%license LICENSE
%files javadoc -f .mfiles-javadoc
%license LICENSE
%files docs
%doc presto-docs/target/html/*
%license LICENSE
%changelog
* Sun Apr 10 2016 gil cattaneo 0.144-1
- initial rpm