deb-boost.sh
4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
#
# Copyright (C) 2008-2014 National Institute For Space Research (INPE) - Brazil.
#
# This file is part of the TerraLib - a Framework for building GIS enabled applications.
#
# TerraLib is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# TerraLib is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with TerraLib. See COPYING. If not, write to
# TerraLib Team at <terralib-team@terralib.org>.
#
# Description: Boost Package for Linux Ubuntu environment.
#
# Before start, please read the "PACKAGE-INSTRUCTIONS".
#
#
# Set package info:
#
DEBNAME=terralib-boost
DEBVERSION=1.60.0
DEBARC=amd64
LIBNAME=Boost
FILENAME=boost_1_65_0.tar.gz
FOLDERNAME=boost_1_65_0
if [ -z "$OUTPUT_PATH" ]; then
OUTPUT_PATH=`pwd`/../../../3rdparty
fi
#
# Check if the package already exist in the "OUTPUT_PATH":
#
if [ ! -f "${OUTPUT_PATH}/packages/${DEBNAME}_${DEBVERSION}_${DEBARC}.deb" ]; then
#
# Unpack source:
#
if [ ! -d "${FOLDERNAME}" ]; then
tar xzvf ${FILENAME}
fi
#
# Create debian folder:
#
cd ${FOLDERNAME}
rm -rf debian
mkdir -p debian
#
# Create the copyright file:
#
cat > debian/copyright <<EOF
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: TerraLib ${LIBNAME} Library
Upstream-Contact: TerraLib Team <terralib-team@terralib.org>
Source: https://gitlab.dpi.inpe.br/terralib/terralib
Files: *
Copyright: Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil
License: LGPL-3.0
TerraLib is free software, you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
TerraLib is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, write to TerraLib Team at <terralib-team@terralib.org>.
EOF
#
# Create the changelog (no messages needed):
#
dch --create -v ${DEBVERSION} --distribution unstable --package ${DEBNAME} ""
#
# Create control file:
#
cat > debian/control <<EOF
Source: ${DEBNAME}
Maintainer: TerraLib Team <terralib-team@terralib.org>
Section: misc
Priority: optional
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 7)
Package: ${DEBNAME}
Architecture: ${DEBARC}
Depends: \${shlibs:Depends}, \${misc:Depends}, ${DEBNAME} (= ${DEBVERSION})
Description: TerraLib ${LIBNAME} Library, version ${DEBVERSION} (shared libraries)
Replaces:${DEBNAME}
EOF
#
# Create rules file:
#
cat > debian/rules <<EOF
#!/usr/bin/make -f
%:
dh \$@
override_dh_auto_configure:
./bootstrap.sh --prefix=`pwd`/debian/${DEBNAME}/opt/terralib/$TE_VERSION/3rdparty/ --libdir=`pwd`/debian/${DEBNAME}/opt/terralib/$TE_VERSION/3rdparty/lib
override_dh_auto_build:
./b2 -j 4 boost.locale.iconv=off link=shared --prefix=`pwd`/debian/${DEBNAME}/opt/terralib/$TE_VERSION/3rdparty/ dll-path=`pwd`/debian/${DEBNAME}/opt/terralib/$TE_VERSION/3rdparty/lib
override_dh_auto_test:
override_dh_auto_install:
mkdir -p debian/${DEBNAME}/opt/terralib/$TE_VERSION/3rdparty
./b2 -j 4 boost.locale.iconv=off runtime-link=shared link=shared variant=release threading=multi --prefix=`pwd`/debian/${DEBNAME}/opt/terralib/$TE_VERSION/3rdparty/ dll-path=`pwd`/debian/${DEBNAME}/opt/terralib/$TE_VERSION/3rdparty/lib install
EOF
#
# Create some misc files:
#
echo "8" > debian/compat
mkdir -p debian/source
echo "3.0 (quilt)" > debian/source/format
#
# Build the package:
#
# To add a GnuPG key just uncomment the "-k" and change the following key.
nice -n19 ionice -c3 debuild -us -uc -b #-kFBC36213
#
# Clean debian-package folder:
#
cd ..
if [ -f "${DEBNAME}_${DEBVERSION}_${DEBARC}.deb" ]; then
rm -rf ${FOLDERNAME}
mkdir -p ${OUTPUT_PATH}/packages ${OUTPUT_PATH}/build-changes
mv ${DEBNAME}_${DEBVERSION}_${DEBARC}.deb ${OUTPUT_PATH}/packages
mv ${DEBNAME}_${DEBVERSION}_${DEBARC}.changes ${OUTPUT_PATH}/build-changes
mv ${DEBNAME}_${DEBVERSION}_${DEBARC}.build ${OUTPUT_PATH}/build-changes
fi
fi