2022-09-19 17:29:28 +02:00
|
|
|
PORTNAME= spark
|
|
|
|
PORTVERSION= 3.3.0
|
|
|
|
CATEGORIES= devel java
|
2022-09-29 15:06:06 +02:00
|
|
|
MASTER_SITES= https://archive.apache.org/dist/${PORTNAME}/${PORTNAME}-${PORTVERSION}/ \
|
|
|
|
LOCAL/se/distfiles/:deps \
|
|
|
|
https://people.freebsd.org/~se/distfiles/:deps
|
2022-09-19 17:29:28 +02:00
|
|
|
PKGNAMEPREFIX= apache-
|
2022-09-29 15:06:06 +02:00
|
|
|
DISTFILES= ${PORTNAME}-${PORTVERSION}.tgz \
|
|
|
|
${PORTNAME}-${PORTVERSION}-deps.tgz:deps
|
2022-09-19 17:29:28 +02:00
|
|
|
|
|
|
|
MAINTAINER= freebsd@sysctl.cz
|
|
|
|
COMMENT= Fast big data processing engine
|
2022-09-29 15:06:06 +02:00
|
|
|
WWW= http://spark.apache.org/
|
2022-09-19 17:29:28 +02:00
|
|
|
|
|
|
|
LICENSE= APACHE20
|
|
|
|
|
|
|
|
BUILD_DEPENDS= ${LOCALBASE}/lib/libsnappyjava.so:archivers/snappy-java \
|
|
|
|
bash:shells/bash \
|
|
|
|
mvn:devel/maven
|
|
|
|
RUN_DEPENDS= bash:shells/bash
|
|
|
|
|
|
|
|
USES= cpe python shebangfix
|
|
|
|
CPE_VENDOR= apache
|
|
|
|
USE_JAVA= yes
|
|
|
|
|
2022-09-29 15:06:06 +02:00
|
|
|
USE_RC_SUBR= spark_master spark_worker
|
2022-09-19 17:29:28 +02:00
|
|
|
SHEBANG_FILES= bin/sparkR
|
|
|
|
|
2022-09-29 15:06:06 +02:00
|
|
|
MAKE_ENV+= JAVA_HOME=${JAVA_HOME} \
|
|
|
|
MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=2g"
|
|
|
|
|
|
|
|
NO_ARCH= yes
|
|
|
|
|
|
|
|
SUB_LIST= SPARK_GROUP=spark \
|
|
|
|
SPARK_USER=spark
|
|
|
|
|
2022-09-19 17:29:28 +02:00
|
|
|
USERS= spark
|
|
|
|
GROUPS= spark
|
|
|
|
|
2022-09-29 15:06:06 +02:00
|
|
|
PLIST_SUB= VER=${PORTVERSION}
|
2022-09-19 17:29:28 +02:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
.if ${ARCH} == "amd64"
|
|
|
|
JAVA_ARCH= x86_64
|
|
|
|
.elif ${ARCH} == "i386"
|
|
|
|
JAVA_ARCH= x86
|
|
|
|
.else
|
|
|
|
JAVA_ARCH= ${ARCH}
|
|
|
|
.endif
|
|
|
|
|
2022-09-29 15:06:06 +02:00
|
|
|
# Update spark-*-dist.tgz if the hadoop version is changed!
|
|
|
|
HADOOP_VERSION= 3.3.4
|
|
|
|
OFFLINE= -o
|
|
|
|
|
2022-09-19 17:29:28 +02:00
|
|
|
do-build:
|
|
|
|
${MKDIR} ${WRKDIR}/snappy/org/xerial/snappy/native/${OPSYS}/${JAVA_ARCH}
|
|
|
|
${CP} ${LOCALBASE}/lib/libsnappyjava.so \
|
|
|
|
${WRKDIR}/snappy/org/xerial/snappy/native/${OPSYS}/${JAVA_ARCH}
|
|
|
|
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
|
2022-09-29 15:06:06 +02:00
|
|
|
${LOCALBASE}/bin/mvn ${OFFLINE} \
|
|
|
|
-Duser.home=${WRKDIR} \
|
|
|
|
-Dmaven.repo.local=${WRKDIR}/m2 \
|
|
|
|
-Dhadoop.version=${HADOOP_VERSION} \
|
|
|
|
-Pyarn -Phive -Phive-thriftserver -DskipTests \
|
|
|
|
clean package
|
2022-09-19 17:29:28 +02:00
|
|
|
${JAR} uvf ${WRKSRC}/assembly/target/scala*/jars/snappy-java-*.jar \
|
|
|
|
-C ${WRKDIR}/snappy org
|
|
|
|
|
|
|
|
post-build:
|
|
|
|
${RM} ${WRKSRC}/bin/*.cmd ${WRKSRC}/sbin/spark-daemon.sh.orig
|
|
|
|
|
|
|
|
do-install:
|
|
|
|
${MKDIR} ${STAGEDIR}${DATADIR}/lib ${STAGEDIR}${DATADIR}/examples/jars ${STAGEDIR}${DATADIR}/bin ${STAGEDIR}${DATADIR}/sbin ${STAGEDIR}${DATADIR}/conf
|
2022-09-29 15:06:06 +02:00
|
|
|
${ECHO_CMD} "Spark ${PORTVERSION} built for Hadoop ${HADOOP_VERSION}" > ${STAGEDIR}${DATADIR}/RELEASE
|
2022-09-19 17:29:28 +02:00
|
|
|
(cd ${WRKSRC}/assembly/target/scala* && ${COPYTREE_SHARE} jars ${STAGEDIR}${DATADIR})
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/examples/target/spark-examples*.jar ${STAGEDIR}${DATADIR}/examples/jars
|
|
|
|
cd ${WRKSRC}/examples && ${COPYTREE_SHARE} src ${STAGEDIR}${DATADIR}/examples
|
|
|
|
cd ${WRKSRC}/bin && ${INSTALL_SCRIPT} * ${STAGEDIR}${DATADIR}/bin/
|
|
|
|
cd ${WRKSRC}/sbin && ${INSTALL_SCRIPT} * ${STAGEDIR}${DATADIR}/sbin/
|
2022-09-29 15:06:06 +02:00
|
|
|
cd ${WRKSRC} && ${COPYTREE_SHARE} "python" ${STAGEDIR}${DATADIR}/
|
2022-09-19 17:29:28 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/conf/*.template ${STAGEDIR}${DATADIR}/conf/
|
|
|
|
${MKDIR} ${STAGEDIR}/var/run/spark
|
|
|
|
${MKDIR} ${STAGEDIR}/var/log/spark
|
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|