distributions/debian/build.sh
author František Kučera <franta-hg@frantovo.cz>
Mon, 29 Apr 2019 01:27:26 +0200
branchv_0
changeset 247 3380ae5275be
parent 238 4a1864c3e867
child 250 aae5009bd0af
permissions -rwxr-xr-x
getTableName() is needed for the metadata
franta-hg@112
     1
#!/bin/bash
franta-hg@112
     2
franta-hg@112
     3
# SQL-DK
franta-hg@112
     4
# Copyright © 2013 František Kučera (frantovo.cz)
franta-hg@112
     5
# 
franta-hg@112
     6
# This program is free software: you can redistribute it and/or modify
franta-hg@112
     7
# it under the terms of the GNU General Public License as published by
franta-hg@112
     8
# the Free Software Foundation, either version 3 of the License, or
franta-hg@112
     9
# (at your option) any later version.
franta-hg@112
    10
# 
franta-hg@112
    11
# This program is distributed in the hope that it will be useful,
franta-hg@112
    12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@112
    13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@112
    14
# GNU General Public License for more details.
franta-hg@112
    15
# 
franta-hg@112
    16
# You should have received a copy of the GNU General Public License
franta-hg@112
    17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@112
    18
franta-hg@112
    19
franta-hg@112
    20
# TODO: build .deb package properly; without equivs
franta-hg@112
    21
franta-hg@112
    22
mkdir -p TMP/usr/bin/ &&
franta-hg@112
    23
mkdir -p TMP/usr/share/sql-dk/ &&
franta-hg@112
    24
mkdir -p TMP/etc/bash_completion.d/ &&
franta-hg@112
    25
franta-hg@112
    26
pushd TMP &&
franta-hg@112
    27
franta-hg@172
    28
cp ../../../scripts/sql-dk.sh                                                   sql-dk &&
franta-hg@172
    29
cp ../../../xml/config.xsd                                                      config.xsd &&
franta-hg@172
    30
cp ../../../xml/config.rnc                                                      config.rnc &&
franta-hg@172
    31
cp ../../../xml/config.xsl                                                      config.xsl &&
franta-hg@238
    32
cp ../../../java/sql-dk/target/sql-dk-*.jar                                     sql-dk.jar &&
franta-hg@237
    33
cp ../../../java/jdbc-loopback-driver/target/jdbc-loopback-driver-*.jar         jdbc-loopback-driver.jar &&
franta-hg@238
    34
cp ../../../java/sql-dk/target/bash-completion.sh                               SQL-DK && # TODO: should be sql-dk – name conflict with sql-dk in /usr/bin/ (equivs bug)
franta-hg@112
    35
franta-hg@112
    36
chmod 755 sql-dk &&
franta-hg@238
    37
chmod 644 SQL-DK &&
franta-hg@112
    38
franta-hg@112
    39
EMAIL=`echo c3FsLWRrLmRlYmlhbkBwdWIuZnJhbnRvdm8uY3oK | base64 -d` &&
franta-hg@112
    40
NAME="Ing. František Kučera <$EMAIL>" &&
franta-hg@112
    41
CONTROL_FILE="equivs-control" &&
franta-hg@112
    42
COPYRIGHT_FILE="copyright" &&
franta-hg@112
    43
URL="https://sql-dk.globalcode.info/" &&
franta-hg@179
    44
VERSION="0.10" &&
franta-hg@112
    45
franta-hg@112
    46
echo "Section: database
franta-hg@112
    47
Priority: optional
franta-hg@112
    48
Homepage: $URL
franta-hg@112
    49
Standards-Version: 3.9.2
franta-hg@112
    50
franta-hg@112
    51
Package: sql-dk
franta-hg@112
    52
Version: $VERSION
franta-hg@112
    53
Maintainer: $NAME
franta-hg@188
    54
Depends: java7-runtime-headless | java7-runtime | java8-runtime-headless | java8-runtime
franta-hg@112
    55
Suggests: libpostgresql-jdbc-java,libmysql-java
franta-hg@112
    56
Copyright: $COPYRIGHT_FILE
franta-hg@121
    57
Extra-Files: config.xsd, config.rnc, config.xsl
franta-hg@112
    58
Files: sql-dk /usr/bin/
franta-hg@112
    59
 sql-dk.jar /usr/share/sql-dk/
franta-hg@172
    60
 jdbc-loopback-driver.jar /usr/share/sql-dk/
franta-hg@112
    61
 SQL-DK /etc/bash_completion.d/
franta-hg@112
    62
Description: SQL batch client
franta-hg@157
    63
 SQL-DK is a command-line client for relational databases." > $CONTROL_FILE &&
franta-hg@112
    64
franta-hg@112
    65
echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
franta-hg@112
    66
Upstream-Name: SQL-DK
franta-hg@112
    67
Source: https://hg.frantovo.cz/sql-dk/
franta-hg@112
    68
franta-hg@112
    69
Files: *
franta-hg@112
    70
Copyright: Copyright 2014 $NAME
franta-hg@112
    71
License: GPL-3+
franta-hg@112
    72
 This program is free software: you can redistribute it and/or modify
franta-hg@112
    73
 it under the terms of the GNU General Public License as published by
franta-hg@112
    74
 the Free Software Foundation, either version 3 of the License, or
franta-hg@112
    75
 (at your option) any later version.
franta-hg@112
    76
 .
franta-hg@112
    77
 This program is distributed in the hope that it will be useful,
franta-hg@112
    78
 but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@112
    79
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@112
    80
 GNU General Public License for more details.
franta-hg@112
    81
 .
franta-hg@112
    82
 You should have received a copy of the GNU General Public License
franta-hg@112
    83
 along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@112
    84
 .
franta-hg@112
    85
 On Debian systems, the full text of the GNU General Public
franta-hg@112
    86
 License version 3 can be found in the file
franta-hg@112
    87
 \`/usr/share/common-licenses/GPL-3'." > $COPYRIGHT_FILE &&
franta-hg@112
    88
franta-hg@112
    89
equivs-build $CONTROL_FILE &&
franta-hg@112
    90
franta-hg@112
    91
lintian sql-dk_*.deb &&
franta-hg@112
    92
franta-hg@112
    93
popd &&
franta-hg@112
    94
franta-hg@112
    95
mv TMP/sql-dk_*.deb . &&
franta-hg@112
    96
rm -rf TMP/