--- rpm 파일 해제
rpm2cpio hadoop_2_3_2_0_2950-2.7.1.2.3.2.0-2950.el6.x86_64.rpm |cpio -idv
--- 디렉토리 생성
mkdir hadoop_2_3_2_0_2950-2.7.1.2.3.2.0-2950.el6.x86_64
--- 해제된 디렉토리를 위에서 생성한 디렉토리에 복사(디렉토리 안에 usr/ var/ 등이 포함되어야 함
cp -rp /tmp/imsi/usr/ ranger_2_3_2_0_2950-hdfs-plugin-0.5.0.2.3.2.0-2950.el6.x86_64/
--- 패치 파일을 원하는 디렉토리에 복사
cp /tmp/imsi/hadoop-common-2.7.1.2.3.2.0-2950.jar /tmp/imsi/hadoop_2_3_2_0_2950-2.7.1.2.3.2.0-2950.el6.x86_64/usr/hdp/2.3.2.0-2950/hadoop
--- 임시 디렉토리로 돌아감
cd /tmp/imsi
--- 수정된 파일을 담은 디렉토리를 tar.gz로 압축
tar cvzf hadoop_2_3_2_0_2950-2.7.1.2.3.2.0-2950.el6.x86_64.tar.gz hadoop_2_3_2_0_2950-2.7.1.2.3.2.0-2950.el6.x86_64
--- rpm 파일 정보 확인
rpm -qip 파일.rpm 으로 파일 정보 확인 아래와 같은 정보를 spec파일에 수정
Name : ranger_2_3_2_0_2950-hdfs-plugin Relocations: (not relocatable)
Version : 0.5.0.2.3.2.0 Vendor: (none)
Release : 2950.el6 Build Date: Thu 01 Oct 2015 08:40:31 AM KST
Install Date: (not installed) Build Host: c66-slave-20176e25-6.novalocal
Group : System/Daemons Source RPM: ranger_2_3_2_0_2950-0.5.0.2.3.2.0-2950.el6.src.rpm
Size : 31839942 License: Apache License v2.0
Signature : RSA/SHA1, Thu 01 Oct 2015 08:56:01 AM KST, Key ID b9733a7a07513cad
URL : http://ranger.apache.org/
Summary : ranger plugin for hdfs
Description :
Ranger HDFS plugnin component runs within namenode to provoide enterprise security using ranger framework
--- 의존성 관련 패키지 수정
rpm -qRp hadoop_2_3_2_0_2950-2.7.1.2.3.2.0-2950.el6.x86_64.rpm 실행 후 나오는 값 저장하여 아래와 같이 Requires: 추가
Requires: rpmlib(FileDigests) <= 4.6.0-1
Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: rpmlib(CompressedFileNames) <= 3.0.4-1
Requires: /bin/bash
Requires: /usr/bin/python
Requires: rpmlib(PayloadIsXz) <= 5.2-1
--- 위의 정보로 spec 파일 수정
vi /root/rpmbuild/SPEC/hadoop_2_3_2_0_2950-yarn-2.7.1.2.3.2.0-2950.el6.x86_64.spec
Summary: The Hadoop NextGen MapReduce (YARN) <--- 수정
Name: hadoop_2_3_2_0_2950-yarn <--- 수정
Version: 2.7.1.2.3.2.0 <--- 수정
Release: 2950.el6 <--- 수정
Prefix: /root
Group: Development/Libraries
Source: %{name}-%{version}-2950.el6.x86_64.tar.gz <--- 수정
BuildRoot: /root/rpmbuild/%{name}-%{version}
License: GPL
URL: http://hadoop.apache.org/core/ <--- 수정
Requires: hadoop_2_3_2_0_2950 = 2.7.1.2.3.2.0-2950.el6 <--- 수정
Requires: /bin/sh
Requires: rpmlib(FileDigests) <= 4.6.0-1
Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: rpmlib(CompressedFileNames) <= 3.0.4-1
Requires: /bin/bash
Requires: /usr/bin/env
Requires: libc.so.6()(64bit)
Requires: libc.so.6(GLIBC_2.2.5)(64bit)
Requires: libc.so.6(GLIBC_2.3)(64bit)
Requires: rpmlib(PayloadIsXz) <= 5.2-1
%description <--- 수정
YARN (Hadoop NextGen MapReduce) is a general purpose data-computation framework.
The fundamental idea of YARN is to split up the two major functionalities of the
JobTracker, resource management and job scheduling/monitoring, into separate daemons:
ResourceManager and NodeManager.
The ResourceManager is the ultimate authority that arbitrates resources among all
the applications in the system. The NodeManager is a per-node slave managing allocation
of computational resources on a single node. Both work in support of per-application
ApplicationMaster (AM).
An ApplicationMaster is, in effect, a framework specific library and is tasked with
negotiating resources from the ResourceManager and working with the NodeManager(s) to
execute and monitor the tasks.
%prep
%setup -n hadoop_2_3_2_0_2950-yarn-2.7.1.2.3.2.0-2950.el6.x86_64 <--- 수정
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD
cp -rp /root/rpmbuild/BUILD/%{name}-%{version}-2950.el6.x86_64/ $RPM_BUILD_ROOT/
%files
/usr <--- 수정
/var <--- 수정
%clean
--- rpm build
rpmbuild -ba hadoop_2_3_2_0_2950-yarn-2.7.1.2.3.2.0-2950.el6.x86_64.spec
--- rpm 테스트
rpm --test -vv -Uvh hadoop_2_3_2_0_2950-2.7.1.2.3.2.0-2950.el6.x86_64.rpm
rpm --test -vv -Uvh hadoop_2_3_2_0_2950-yarn-2.7.1.2.3.2.0-2950.el6.x86_64.rpm
rpm --test -vv -Uvh ranger_2_3_2_0_2950-hdfs-plugin-0.5.0.2.3.2.0-2950.el6.x86_64.rpm