distributions/debian/build.sh
author František Kučera <franta-hg@frantovo.cz>
Thu, 02 Jan 2014 19:38:26 +0100
branchv_0
changeset 112 de0bcc3859cf
child 116 87bc76fd9a14
permissions -rwxr-xr-x
Debian package: interim build script for .deb packages
     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 ../../../java/sql-dk/dist/sql-dk.jar           sql-dk.jar &&
    30 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)
    31 
    32 chmod 755 sql-dk &&
    33 chmod 755 SQL-DK &&
    34 
    35 EMAIL=`echo c3FsLWRrLmRlYmlhbkBwdWIuZnJhbnRvdm8uY3oK | base64 -d` &&
    36 NAME="Ing. František Kučera <$EMAIL>" &&
    37 CONTROL_FILE="equivs-control" &&
    38 COPYRIGHT_FILE="copyright" &&
    39 URL="https://sql-dk.globalcode.info/" &&
    40 VERSION="0.8" &&
    41 
    42 echo "Section: database
    43 Priority: optional
    44 Homepage: $URL
    45 Standards-Version: 3.9.2
    46 
    47 Package: sql-dk
    48 Version: $VERSION
    49 Maintainer: $NAME
    50 Depends: java7-runtime-headless | java7-runtime
    51 Suggests: libpostgresql-jdbc-java,libmysql-java
    52 Copyright: $COPYRIGHT_FILE
    53 # TODO: Extra-Files: config.xsd, config.rnc
    54 Files: sql-dk /usr/bin/
    55  sql-dk.jar /usr/share/sql-dk/
    56  SQL-DK /etc/bash_completion.d/
    57 Description: SQL batch client
    58  SQL-DK is and command-line client for relational databases." > $CONTROL_FILE &&
    59 
    60 echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
    61 Upstream-Name: SQL-DK
    62 Source: https://hg.frantovo.cz/sql-dk/
    63 
    64 Files: *
    65 Copyright: Copyright 2014 $NAME
    66 License: GPL-3+
    67  This program is free software: you can redistribute it and/or modify
    68  it under the terms of the GNU General Public License as published by
    69  the Free Software Foundation, either version 3 of the License, or
    70  (at your option) any later version.
    71  .
    72  This program is distributed in the hope that it will be useful,
    73  but WITHOUT ANY WARRANTY; without even the implied warranty of
    74  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    75  GNU General Public License for more details.
    76  .
    77  You should have received a copy of the GNU General Public License
    78  along with this program. If not, see <http://www.gnu.org/licenses/>.
    79  .
    80  On Debian systems, the full text of the GNU General Public
    81  License version 3 can be found in the file
    82  \`/usr/share/common-licenses/GPL-3'." > $COPYRIGHT_FILE &&
    83 
    84 equivs-build $CONTROL_FILE &&
    85 
    86 lintian sql-dk_*.deb &&
    87 
    88 popd &&
    89 
    90 mv TMP/sql-dk_*.deb . &&
    91 rm -rf TMP/