relpipe-data/examples/release-v0.9.sh
author František Kučera <franta-hg@frantovo.cz>
Fri, 18 Jan 2019 21:34:58 +0100
branchv_0
changeset 241 f71d300205b7
parent 221 relpipe-data/examples/release-v0.8.sh@fb8956bb44ec
permissions -rw-r--r--
Release v0.9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Install dependencies as root:
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
su -c "apt install g++ make cmake mercurial pkg-config"
241
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
     3
su -c "apt install libxerces-c-dev" # needed only for relpipe-in-xml module
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
# Run rest of installation as a non-root user:
241
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
     6
export RELPIPE_VERSION="v0.9"
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
export RELPIPE_SRC=~/src
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
export RELPIPE_BUILD=~/build
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
export RELPIPE_INSTALL=~/install
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
export PKG_CONFIG_PATH="$RELPIPE_INSTALL/lib/pkgconfig/:$PKG_CONFIG_PATH"
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
export PATH="$RELPIPE_INSTALL/bin:$PATH"
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
241
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    13
rm -rf "$RELPIPE_BUILD"/relpipe-*
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    14
mkdir -p "$RELPIPE_SRC" "$RELPIPE_BUILD" "$RELPIPE_INSTALL"
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
# Helper functions:
241
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    17
relpipe_download() { for m in "$@"; do cd "$RELPIPE_SRC" && ([[ -d "relpipe-$m.cpp" ]] && hg pull -R "relpipe-$m.cpp" && hg update -R "relpipe-$m.cpp" "$RELPIPE_VERSION" || hg clone -u "$RELPIPE_VERSION" https://hg.globalcode.info/relpipe/relpipe-$m.cpp) || break; done; }
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    18
relpipe_install()  { for m in "$@"; do cd "$RELPIPE_BUILD" && mkdir -p relpipe-$m.cpp && cd relpipe-$m.cpp && cmake -DCMAKE_INSTALL_PREFIX:PATH="$RELPIPE_INSTALL" "$RELPIPE_SRC/relpipe-$m.cpp" && make && make install || break; done; }
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
# Download all sources:
241
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    21
relpipe_download lib-protocol lib-reader lib-writer lib-cli lib-xmlwriter in-cli in-fstab in-xml in-csv in-filesystem out-gui.qt out-nullbyte out-ods out-tabular out-xml out-csv tr-cut tr-grep tr-python tr-sed tr-validator
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
# Build and install libraries:
241
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    24
relpipe_install lib-protocol lib-reader lib-writer lib-cli lib-xmlwriter
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
# Build and install tools:
241
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    27
relpipe_install in-fstab in-cli in-fstab in-xml in-csv tr-cut tr-grep tr-sed out-nullbyte out-ods out-tabular out-xml out-csv
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    28
f71d300205b7 Release v0.9
František Kučera <franta-hg@frantovo.cz>
parents: 221
diff changeset
    29
# relpipe_install in-filesystem # requires GCC 8 or patching (see below)
219
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
# Clean-up:
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
unset -f relpipe_install
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
unset -f relpipe_download
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
unset -v RELPIPE_VERSION
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
unset -v RELPIPE_SRC
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
unset -v RELPIPE_BUILD
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
unset -v RELPIPE_INSTALL
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
# View your fstab like on an 80s green screen terminal!
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
relpipe-in-fstab | relpipe-out-tabular