blob: a91637d20959b686fb8a6a8b38f8bf40572c64bb [file] [log] [blame]
velandy9d1a08d2016-06-27 16:48:41 +02001#!/bin/bash
Austin Cormier3a1c3352016-05-23 21:46:17 -04002#
3# Copyright 2016 RIFT.IO Inc
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# Author(s): Austin Cormier
18# Creation Date: 2016/05/23
19#
Austin Cormier3aeed122016-05-23 19:12:00 -040020#
21# This shell script is used to create a descriptor package
22# The main functions of this script include:
23# - Generate checksums.txt file
24# - Generate a tar.gz file
25
26# Usage: generate_descriptor_pkg.sh <package-directory> <dest_package_dir>
27
28mkdir -p $1
29mkdir -p $2
30
31dest_dir=$(cd $1 && pwd)
32pkg_dir=$(cd $2 && pwd)
33
34echo $(pwd)
35cd ${pkg_dir}
36rm -rf checksums.txt
37find * -type f |
38 while read file; do
39 md5sum $file >> checksums.txt
40 done
41cd ..
42tar -zcvf ${dest_dir}/$(basename $pkg_dir).tar.gz $(basename $pkg_dir)