| garciadeblas | 17f074b | 2018-11-20 17:38:13 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 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 | |
| lombardofr | c3051ef | 2019-01-16 10:59:18 +0100 | [diff] [blame] | 17 | |
| lombardofr | 3fcf21a | 2019-03-11 10:26:08 +0100 | [diff] [blame] | 18 | PKG_DIRECTORIES="authosm descriptorhandler instancehandler lib projecthandler sdnctrlhandler sf_t3d static template userhandler vimhandler packagehandler netslicehandler wimhandler" |
| garciadeblas | e3ae537 | 2018-11-29 09:50:58 +0100 | [diff] [blame] | 19 | PKG_FILES="bower.json django.ini LICENSE manage.py nginx-app.conf README.md requirements.txt supervisor-app.conf .bowerrc" |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 20 | MDG_NAME=lightui |
| 21 | DEB_INSTALL=debian/osm-${MDG_NAME}.install |
| 22 | export DEBEMAIL="gerardo.garciadeblas@telefonica.com" |
| 23 | export DEBFULLNAME="Gerardo Garcia" |
| 24 | |
| 25 | PKG_VERSION=$(git describe --match "v*" --tags --abbrev=0) |
| 26 | PKG_VERSION_PREFIX=$(echo $PKG_VERSION | sed -e 's/v//g') |
| 27 | PKG_VERSION_POST=$(git rev-list $PKG_VERSION..HEAD | wc -l) |
| 28 | if [ "$PKG_VERSION_POST" -eq 0 ]; then |
| garciadeblas | 17f074b | 2018-11-20 17:38:13 +0100 | [diff] [blame] | 29 | PKG_DIR="deb_dist/osm-${MDG_NAME}-${PKG_VERSION_PREFIX}" |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 30 | else |
| garciadeblas | 17f074b | 2018-11-20 17:38:13 +0100 | [diff] [blame] | 31 | PKG_DIR="deb_dist/osm-${MDG_NAME}-$PKG_VERSION_PREFIX.post${PKG_VERSION_POST}" |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 32 | fi |
| 33 | |
| 34 | rm -rf $PKG_DIR |
| 35 | rm -f *.orig.tar.xz |
| 36 | rm -f *.deb |
| 37 | rm -f $DEB_INSTALL |
| 38 | mkdir -p $PKG_DIR |
| 39 | |
| 40 | for dir in $PKG_DIRECTORIES; do |
| 41 | ln -s $PWD/$dir $PKG_DIR/. |
| 42 | echo "$dir/* usr/share/osm-$MDG_NAME/$dir" >> $DEB_INSTALL |
| 43 | done |
| 44 | for f in $PKG_FILES; do |
| 45 | cp $f $PKG_DIR/. |
| 46 | echo "$f usr/share/osm-$MDG_NAME" >> $DEB_INSTALL |
| 47 | done |
| 48 | cp -R debian $PKG_DIR/. |
| 49 | |
| garciadeblas | 17f074b | 2018-11-20 17:38:13 +0100 | [diff] [blame] | 50 | pushd $PKG_DIR |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 51 | dh_make -y --indep --createorig --a -c apache |
| 52 | dpkg-buildpackage -uc -us -tc -rfakeroot |
| garciadeblas | 17f074b | 2018-11-20 17:38:13 +0100 | [diff] [blame] | 53 | popd |
| 54 | |
| garciadeblas | f5c3307 | 2018-09-27 18:03:45 +0200 | [diff] [blame] | 55 | |