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