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