forked from toddlipcon/hadoop-lzo-packager
-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.spec
50 lines (42 loc) · 1.67 KB
/
template.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Summary: GPL Compression Libraries for Hadoop
Name: @PACKAGE_NAME@
Version: @VERSION@
Release: @RELEASE@
License: GPL
Source0: @PACKAGE_NAME@-@[email protected]
Group: Development/Libraries
URL: @PACKAGE_HOMEPAGE@
Packager: @PACKAGER@ <@PACKAGER_EMAIL@>
Buildroot: %{_tmppath}/%{name}-%{version}
BuildRequires: ant, ant-nodeps, gcc-c++, lzo-devel
Requires: lzo
%define _use_internal_dependency_generator 0
%define hadoop_home @HADOOP_HOME@
%define hadoop_home_mapred @HADOOP_HOME_MAPRED@
%description
GPLed Compression Libraries for Hadoop, built at $DATE on $HOST
%prep
%setup
# Requires: exclude libjvm.so since it generally isn't installed
# on the system library path, and we don't want to have to install
# with --nodeps
# RHEL doesn't have nice macros. Oh well. Do it old school.
%define our_req_script %{name}-find-req.sh
cat <<__EOF__ > %{our_req_script}
#!/bin/sh
%{__find_requires} | grep -v libjvm
__EOF__
%define __find_requires %{_builddir}/%{name}-%{version}/%{our_req_script}
chmod +x %{__find_requires}
%build
ant -Dname=%{name} -Dversion=%{version} compile-native package
%install
mkdir -p $RPM_BUILD_ROOT/%{hadoop_home}/lib/native
mkdir -p $RPM_BUILD_ROOT/%{hadoop_home_mapred}/lib/native
install -m644 $RPM_BUILD_DIR/%{name}-%{version}/build/%{name}-%{version}.jar $RPM_BUILD_ROOT/%{hadoop_home}/lib/
rsync -av --no-t $RPM_BUILD_DIR/%{name}-%{version}/build/%{name}-%{version}/lib/native/*/* $RPM_BUILD_ROOT/%{hadoop_home}/lib/native/
install -m644 $RPM_BUILD_DIR/%{name}-%{version}/build/%{name}-%{version}.jar $RPM_BUILD_ROOT/%{hadoop_home_mapred}/lib/
%files
%{hadoop_home}/lib/%{name}-%{version}.jar
%{hadoop_home}/lib/native/
%{hadoop_home_mapred}/lib/%{name}-%{version}.jar