1 | #!/bin/sh |
---|
2 | |
---|
3 | # Licensed to the Apache Software Foundation (ASF) under one or more |
---|
4 | # contributor license agreements. See the NOTICE file distributed with |
---|
5 | # this work for additional information regarding copyright ownership. |
---|
6 | # The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
7 | # (the "License"); you may not use this file except in compliance with |
---|
8 | # the License. You may obtain a copy of the License at |
---|
9 | # |
---|
10 | # http://www.apache.org/licenses/LICENSE-2.0 |
---|
11 | # |
---|
12 | # Unless required by applicable law or agreed to in writing, software |
---|
13 | # distributed under the License is distributed on an "AS IS" BASIS, |
---|
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
15 | # See the License for the specific language governing permissions and |
---|
16 | # limitations under the License. |
---|
17 | |
---|
18 | |
---|
19 | # packageNativeHadoop.sh - A simple script to help package native-hadoop libraries |
---|
20 | |
---|
21 | # |
---|
22 | # Note: |
---|
23 | # This script relies on the following environment variables to function correctly: |
---|
24 | # * BASE_NATIVE_LIB_DIR |
---|
25 | # * BUILD_NATIVE_DIR |
---|
26 | # * DIST_LIB_DIR |
---|
27 | # All these are setup by build.xml. |
---|
28 | # |
---|
29 | |
---|
30 | TAR='tar cf -' |
---|
31 | UNTAR='tar xfBp -' |
---|
32 | |
---|
33 | # Copy the pre-built libraries in $BASE_NATIVE_LIB_DIR |
---|
34 | if [ -d $BASE_NATIVE_LIB_DIR ] |
---|
35 | then |
---|
36 | for platform in `ls $BASE_NATIVE_LIB_DIR` |
---|
37 | do |
---|
38 | if [ ! -d $DIST_LIB_DIR/$platform ] |
---|
39 | then |
---|
40 | mkdir -p $DIST_LIB_DIR/$platform |
---|
41 | echo "Created $DIST_LIB_DIR/$platform" |
---|
42 | fi |
---|
43 | echo "Copying libraries in $BASE_NATIVE_LIB_DIR/$platform to $DIST_LIB_DIR/$platform/" |
---|
44 | cd $BASE_NATIVE_LIB_DIR/$platform/ |
---|
45 | $TAR *hadoop* | (cd $DIST_LIB_DIR/$platform/; $UNTAR) |
---|
46 | done |
---|
47 | fi |
---|
48 | |
---|
49 | # Copy the custom-built libraries in $BUILD_DIR |
---|
50 | if [ -d $BUILD_NATIVE_DIR ] |
---|
51 | then |
---|
52 | for platform in `ls $BUILD_NATIVE_DIR` |
---|
53 | do |
---|
54 | if [ ! -d $DIST_LIB_DIR/$platform ] |
---|
55 | then |
---|
56 | mkdir -p $DIST_LIB_DIR/$platform |
---|
57 | echo "Created $DIST_LIB_DIR/$platform" |
---|
58 | fi |
---|
59 | echo "Copying libraries in $BUILD_NATIVE_DIR/$platform/lib to $DIST_LIB_DIR/$platform/" |
---|
60 | cd $BUILD_NATIVE_DIR/$platform/lib |
---|
61 | $TAR *hadoop* | (cd $DIST_LIB_DIR/$platform/; $UNTAR) |
---|
62 | done |
---|
63 | fi |
---|
64 | |
---|
65 | #vim: ts=2: sw=2: et |
---|