Created
August 29, 2017 18:40
-
-
Save cippaciong/bb7b4afbd2cd2b1cb99b3333b8b22cf2 to your computer and use it in GitHub Desktop.
Apache Flink 1.3.2 PKGBUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Apache Flink Standalone JobManager | |
After=network.target | |
[Service] | |
User=apache-flink | |
Group=apache-flink | |
Environment=FLINK_LOG_DIR=/var/log/apache-flink FLINK_PID_DIR=/run/apache-flink JAVA_HOME=/usr/lib/jvm/default-runtime FLINK_IDENT_STRING=systemd | |
PIDFile=/run/apache-flink/flink-systemd-jobmanager.pid | |
ExecStart=/opt/apache-flink/bin/start-local.sh | |
Type=forking | |
[Install] | |
WantedBy=multi-user.target | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post_install() { | |
getent group 'apache-flink' >/dev/null 2>&1 || groupadd -r -f 'apache-flink' >/dev/null | |
getent passwd 'apache-flink' /dev/null 2>&1 || useradd -r -g 'apache-flink' -d '/etc/apache-flink' 'apache-flink' >/dev/null | |
chown -R apache-flink:apache-flink /var/log/apache-flink | |
chown -R apache-flink:apache-flink /etc/apache-flink | |
chown -R apache-flink:apache-flink /run/apache-flink | |
chmod 777 /opt/apache-flink/log | |
if [ ! -e '/etc/apache-flink/.ssh/id_rsa' ] ; then | |
su -s '/usr/bin/bash' -c "ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa" - 'apache-flink' | |
su -s '/usr/bin/bash' -c "cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys" - 'apache-flink' | |
fi | |
} | |
post_remove() { | |
getent passwd apache-flink >/dev/null 2>&1 || userdel -f apache-flink | |
getent group apache-flink >/dev/null 2>&1 || groupdelf apache-flink | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Tao Meng ("mtunique") <oatgnem [at] gmail.com> | |
# Contributor: Tommaso Sardelli ("cippaciong") <lacapannadelloziotom [at] gmail [dot] com> | |
pkgname=apache-flink | |
pkgver=1.3.2 | |
pkgrel=1 | |
_hadoopver=27 | |
_scalaver=2.11 | |
pkgdesc="Apache Flink is an open source platform for distributed stream and batch data processing" | |
arch=("i686" "x86_64") | |
url="http://flink.apache.org" | |
license=("APACHE") | |
depends=('java-environment>=7' 'openssh') | |
optdepends=("python2: python2 support for python API" | |
"python: python3 support for python API" | |
"hadoop: support for running on YARN") | |
install=apache-flink.install | |
source=("https://www-us.apache.org/dist/flink/flink-${pkgver}/flink-${pkgver}-bin-hadoop${_hadoopver}-scala_${_scalaver}.tgz" | |
"apache-flink-jobmanager.service") | |
sha256sums=('378be2346990264eeff2ae012175523fc94ddbe59bead7e2a76e0d93c0c7c455' | |
'2af8fbb95cebc9caddf5079783b02659e2169c794fa2b973e18e8cb435b6d7ff') | |
backup=( | |
"etc/${pkgname}/flink-conf.yaml" | |
"etc/${pkgname}/log4j-cli.properties" | |
"etc/${pkgname}/log4j-yarn-session.properties" | |
"etc/${pkgname}/log4j.properties" | |
"etc/${pkgname}/logback-yarn.xml" | |
"etc/${pkgname}/logback.xml" | |
"etc/${pkgname}/masters" | |
"etc/${pkgname}/slaves" | |
"etc/${pkgname}/zoo.cfg" | |
) | |
package() { | |
cd "$srcdir/flink-${pkgver}" | |
install -d "$pkgdir/usr/bin" "$pkgdir/opt" "$pkgdir/var/log/apache-flink" "$pkgdir/run/apache-flink" | |
cp -r "$srcdir/flink-${pkgver}" "$pkgdir/opt/apache-flink/" | |
cd "$pkgdir/usr/bin" | |
binpath="/opt/apache-flink/bin/flink" | |
ln -s "$binpath" $binary | |
install -Dm644 "$srcdir/apache-flink-jobmanager.service" "$pkgdir/usr/lib/systemd/system/apache-flink-jobmanager.service" | |
mkdir -p "$pkgdir/etc/apache-flink" | |
install -Dm644 "$srcdir/flink-${pkgver}/conf"/* "$pkgdir/etc/apache-flink" | |
cd "$pkgdir/opt/apache-flink" | |
mv conf conf-templates | |
ln -sf "/etc/apache-flink" conf | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment