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