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