#!/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 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 patch: patch-stamp patch-stamp: touch $@ #Architecture build: build-stamp build-stamp: patch-stamp dh_testdir env HADOOP_VERSION=${hadoop_version} HADOOP_ARCH=${native_dir} \ bash debian/do-component-build -Divy.home=${HOME}/.ivy2 touch $@ clean: dh_testdir dh_testroot rm -f build-arch-stamp build-indep-stamp build-stamp dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs 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 # Run dh_lintian if we've got it - this doesn't exist on debhelper 6 (eg Ubuntu Hardy) (dh_lintian) || /bin/true hadoop_svcs=hdfs-namenode hdfs-secondarynamenode hdfs-datanode hdfs-zkfc \ yarn-resourcemanager yarn-nodemanager yarn-proxyserver \ mapreduce-historyserver httpfs $(hadoop_svcs): debian/init.d.tmpl bash $< debian/hadoop-$@.svc > 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 install-indep: $(hadoop_svcs) # FIXME: BIGTOP-463 echo 'export JSVC_HOME=/usr/lib/bigtop-utils' >> debian/hadoop.default mkdir -p debian/tmp/etc/default cp debian/hadoop.default debian/tmp/etc/default/hadoop dh_install --sourcedir=debian/tmp -i rm -Rf debian/hadoop/usr/lib/hadoop/bin/fuse_dfs # rm -Rf debian/hadoop/usr/bin/hadoop-fuse-dfs rm -Rf debian/hadoop/usr/lib/hadoop/contrib/fuse-dfs rm -Rf debian/hadoop/usr/lib/hadoop/hdfs/contrib/fuse-dfs install-arch: mkdir -p debian/tmp/etc/default 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 dh_install --sourcedir=debian/tmp -s # Must not depend on anything. This is to be called by # binary-arch/binary-indep # in another 'make' thread. binary-common: dh_testdir dh_testroot #dh_installchangelogs CHANGES.txt -phadoop # dh_installdocs ## PL this line and the above/below are only temp # #sh debian/append_licenses.sh # dh_installexamples # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_python dh_installinit # dh_installcron # dh_installinfo dh_installman dh_link dh_strip dh_compress # dh_fixperms -Xtask-controller # dh_perl dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb # Build architecture independant packages using the common target. binary-indep: build install install-indep $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common # Build architecture dependant packages using the common target. binary-arch: build install install-arch $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common binary: binary-arch binary-indep .PHONY: build clean binary-indep binary-arch binary install configure