From 61e22e4684e3e045ea42e5625d1f27fbfaed4b29 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 11 Sep 2012 12:38:24 +0200 Subject: [PATCH] Added package generating script --- gen_package.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 gen_package.sh diff --git a/gen_package.sh b/gen_package.sh new file mode 100755 index 0000000000..9108e6b917 --- /dev/null +++ b/gen_package.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +VERSION=${VERSION:-3.6.0} +MAINTAINER=${MAINTAINER:-C12G Labs } +LICENSE=${LICENSE:-Apache} +PACKAGE_NAME=${PACKAGE_NAME:-apptools} +VENDOR=${VENDOR:-C12G Labs} +DESC=" +AppTools description +" +DESCRIPTION=${DESCRIPTION:-$DESC} +PACKAGE_TYPE=${PACKAGE_TYPE:-deb} +URL=${URL:-http://opennebula.pro} + +SCRIPTS_DIR=$PWD +NAME="${PACKAGE_NAME}_${VERSION}.${PACKAGE_TYPE}" +rm $NAME + +DIRS="env" +export DESTDIR=$PWD/tmp + +rm -rf $DESTDIR +mkdir $DESTDIR + +for TOOL in $DIRS; do + ( + cd $TOOL + ./install.sh + ) +done + +cd tmp + +fpm -n "$PACKAGE_NAME" -t "$PACKAGE_TYPE" -s dir --vendor "$VENDOR" \ + --license "$LICENSE" --description "$DESCRIPTION" --url "$URL" \ + -m "$MAINTAINER" -v "$VERSION" \ + -a all -p $SCRIPTS_DIR/$NAME * + +# --after-install $SCRIPTS_DIR/postinstall \ + +echo $NAME + +