| #!/usr/bin/make -f |
| |
| # 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. |
| |
| # -*- makefile -*- |
| |
| # Uncomment this to turn on verbose mode. |
| #export DH_VERBOSE=1 |
| |
| # This has to be exported to make some magic below work. |
| export DH_OPTIONS |
| |
| %: |
| dh $@ |
| |
| hadoop_version=${HADOOP_BASE_VERSION} |
| |
| ifeq (${DEB_BUILD_ARCH},amd64) |
| native_dir=Linux-amd64-64 |
| endif |
| ifeq (${DEB_BUILD_ARCH},i386) |
| native_dir=Linux-i386-32 |
| endif |
| |
| override_dh_auto_build: |
| env HADOOP_VERSION=${hadoop_version} HADOOP_ARCH=${native_dir} \ |
| bash debian/do-component-build -Divy.home=${HOME}/.ivy2 |
| |
| hadoop_svcs=hdfs-namenode hdfs-secondarynamenode hdfs-datanode hdfs-zkfc hdfs-journalnode \ |
| yarn-resourcemanager yarn-nodemanager yarn-proxyserver yarn-timelineserver\ |
| mapreduce-historyserver httpfs |
| |
| $(hadoop_svcs): debian/init.d.tmpl |
| bash $< debian/hadoop-$@.svc deb debian/hadoop-$@.init |
| cp debian/$(firstword $(subst -, ,$@)).default debian/tmp/etc/default/hadoop-$@ |
| echo /etc/default/hadoop-$@ >> debian/hadoop-$@.install |
| # FIXME: workaround for BIGTOP-105 |
| [ -f debian/hadoop-$@.postinst ] || cp debian/hadoop.daemon.postinst.tpl debian/hadoop-$@.postinst |
| sed -i -e "s|@HADOOP_DAEMON@|$@|" debian/hadoop-$@.postinst |
| |
| override_dh_auto_install: |
| env HADOOP_VERSION=${hadoop_version} \ |
| bash debian/install_hadoop.sh \ |
| --prefix=debian/tmp/ \ |
| --distro-dir=debian \ |
| --build-dir=${PWD}/build \ |
| --httpfs-dir=debian/tmp/usr/lib/hadoop-httpfs \ |
| --httpfs-etc-dir=debian/tmp/etc/hadoop-httpfs \ |
| --system-lib-dir=debian/tmp/usr/lib/ \ |
| --system-libexec-dir=debian/tmp/usr/lib/hadoop/libexec/ \ |
| --system-include-dir=debian/tmp/usr/include \ |
| --doc-dir=debian/tmp/usr/share/doc/hadoop-doc \ |
| --man-dir=debian/tmp/usr/share/man \ |
| --example-dir=debian/tmp/usr/share/doc/hadoop/examples \ |
| --native-build-string=${native_dir} \ |
| --installed-lib-dir=/usr/lib/hadoop |
| # Forcing Zookeeper dependency to be on the packaged jar |
| ln -sf /usr/lib/zookeeper/zookeeper.jar debian/tmp/usr/lib/hadoop/lib/zookeeper*.jar |
| # Workaround for BIGTOP-583 |
| rm -f debian/tmp/usr/lib/hadoop-*/lib/slf4j-log4j12-*.jar |
| # FIXME: BIGTOP-463 |
| mkdir -p debian/tmp/etc/default |
| echo 'export JSVC_HOME=/usr/lib/bigtop-utils' >> debian/hadoop.default |
| cp debian/hadoop.default debian/tmp/etc/default/hadoop |
| # Refactored from install-arch |
| cp debian/hadoop-fuse.default debian/tmp/etc/default/hadoop-fuse |
| mkdir -p debian/tmp/etc/security/limits.d |
| cp debian/hdfs.conf debian/yarn.conf debian/mapreduce.conf debian/tmp/etc/security/limits.d |
| |
| override_dh_install: $(hadoop_svcs) |
| dh_install |
| # Drop misc fuse_dfs directories |
| rm -Rf debian/hadoop/usr/lib/hadoop/bin/fuse_dfs |
| rm -Rf debian/hadoop/usr/lib/hadoop/contrib/fuse-dfs |
| rm -Rf debian/hadoop/usr/lib/hadoop/hdfs/contrib/fuse-dfs |