blob: 75ffecadc482939c06c88485ae442776c436da9b [file] [log] [blame]
garciadeblas14346732020-05-07 15:05:58 +00001#!/bin/bash
2# Copyright 2018 Telefonica
3# All Rights Reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# 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, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17
kumaran.m3b4814a2020-05-01 19:48:54 +053018PKG_DIRECTORIES="nginx src"
Barath Kumar R5abb2742020-11-22 20:15:10 +053019PKG_FILES="angular.json .browserslistrc CONTRIBUTING.md package.json proxy.conf.json tsconfig.json tslint.json LICENSE README.md"
garciadeblas14346732020-05-07 15:05:58 +000020MDG_NAME=ngui
21DEB_INSTALL=debian/osm-${MDG_NAME}.install
22export DEBEMAIL="gerardo.garciadeblas@telefonica.com"
23export DEBFULLNAME="Gerardo Garcia"
24
25PKG_VERSION=$(git describe --match "v*" --tags --abbrev=0)
26PKG_VERSION_PREFIX=$(echo $PKG_VERSION | sed -e 's/v//g')
27PKG_VERSION_POST=$(git rev-list $PKG_VERSION..HEAD | wc -l)
28PKG_VERSION_HASH=$(git describe --match "v*" --tags | awk '{print $3}' FS=-)
29if [ "$PKG_VERSION_POST" -eq 0 ]; then
30 PKG_DIR="deb_dist/osm-${MDG_NAME}-${PKG_VERSION_PREFIX}"
31else
32 PKG_DIR="deb_dist/osm-${MDG_NAME}-$PKG_VERSION_PREFIX.post${PKG_VERSION_POST}+${PKG_VERSION_HASH}"
33fi
34
35rm -rf $PKG_DIR
36rm -f *.orig.tar.xz
37rm -f *.deb
38rm -f $DEB_INSTALL
39mkdir -p $PKG_DIR
40
41for dir in $PKG_DIRECTORIES; do
42 ln -s $PWD/$dir $PKG_DIR/.
43 echo "$dir/* usr/share/osm-$MDG_NAME/$dir" >> $DEB_INSTALL
44done
45for f in $PKG_FILES; do
46 cp $f $PKG_DIR/.
47 echo "$f usr/share/osm-$MDG_NAME" >> $DEB_INSTALL
48done
49cp -R debian $PKG_DIR/.
50
51pushd $PKG_DIR
52dh_make -y --indep --createorig --a -c apache
53dpkg-buildpackage -uc -us -tc -rfakeroot
54popd