#!/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_VERSION} hadoop_build_path=$(shell pwd)/build/hadoop-${hadoop_version} ifeq (${DEB_BUILD_ARCH},amd64) native_dir=Linux-amd64-64 endif ifeq (${DEB_BUILD_ARCH},i386) native_dir=Linux-i386-32 endif #Architecture build: build-stamp build-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 ant clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs bash debian/install_hadoop.sh \ --distro-dir=debian \ --build-dir=${hadoop_build_path} \ --src-dir=debian/tmp/usr/src/hadoop \ --lib-dir=debian/tmp/usr/lib/hadoop \ --etc-dir=debian/tmp/etc/hadoop \ --prefix=debian/tmp \ --doc-dir=debian/tmp/usr/share/doc/hadoop-doc \ --example-dir=debian/tmp/usr/share/doc/hadoop/examples \ --native-build-string=${native_dir} \ --installed-lib-dir=/usr/lib/hadoop # Run dh_lintian if we've got it - this doesn't exist on debhelper 6 (eg Ubuntu Hardy) (dh_lintian) || /bin/true namenode_user=hdfs secondarynamenode_user=hdfs datanode_user=hdfs jobtracker_user=mapred tasktracker_user=mapred namenode secondarynamenode jobtracker tasktracker datanode: debian/service-init.d.tpl sed -e "s|@HADOOP_DAEMON@|$@|" \ -e "s|@HADOOP_MAJOR_VERSION@|$hadoop_version|" \ -e "s|@DAEMON_USER@|$($@_user)|" $< > debian/hadoop-$@.init # FIXME: workaround for BIGTOP-105 sed -e "s|@HADOOP_DAEMON@|$@|" < debian/hadoop.daemon.postinst.tpl > debian/hadoop-$@.postinst install-indep: namenode secondarynamenode jobtracker tasktracker datanode 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/lib/native rm -Rf debian/hadoop/usr/lib/hadoop/sbin 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 # FIXME: The following is a workaround for BIGTOP-139 rm -Rf debian/hadoop/usr/lib/hadoop/libexec/jsvc* rm -Rf debian/hadoop/usr/lib/hadoop/bin/task-controller 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/mapred.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 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