relpipe-data/examples/release-v0.8.sh
author František Kučera <franta-hg@frantovo.cz>
Sat, 26 Oct 2019 20:57:42 +0200
branchv_0
changeset 276 cfaf1fa94154
parent 221 fb8956bb44ec
permissions -rw-r--r--
rename --keep-file to --file-keep
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"
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# Run rest of installation as a non-root user:
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
export RELPIPE_VERSION="v0.8"
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
export RELPIPE_SRC=~/src
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
export RELPIPE_BUILD=~/build
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
export RELPIPE_INSTALL=~/install
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
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
    10
export PATH="$RELPIPE_INSTALL/bin:$PATH"
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
mkdir "$RELPIPE_SRC" "$RELPIPE_BUILD" "$RELPIPE_INSTALL"
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# Helper functions:
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
relpipe_download() { for m in "$@"; do cd "$RELPIPE_SRC" && hg clone -u "$RELPIPE_VERSION" https://hg.globalcode.info/relpipe/relpipe-$m.cpp || break; done; }
221
fb8956bb44ec install script: use variable for ~/src
František Kučera <franta-hg@frantovo.cz>
parents: 219
diff changeset
    16
relpipe_install()  { for m in "$@"; do cd "$RELPIPE_BUILD" && mkdir 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
    17
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
# Download all sources:
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
relpipe_download lib-protocol lib-reader lib-writer lib-cli in-cli in-fstab out-gui.qt out-nullbyte out-ods out-tabular out-xml tr-cut tr-grep tr-python tr-sed tr-validator
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
# Build and install libraries:
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
relpipe_install lib-protocol lib-reader lib-writer lib-cli
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
# Build and install tools:
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
relpipe_install in-fstab in-cli tr-cut tr-grep tr-sed out-nullbyte out-ods out-tabular out-xml
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
# Clean-up:
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
unset -f relpipe_install
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
unset -f relpipe_download
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
unset -v RELPIPE_VERSION
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
unset -v RELPIPE_SRC
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
unset -v RELPIPE_BUILD
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
unset -v RELPIPE_INSTALL
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
a94eb371f77e Release v0.8
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
# 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
    36
relpipe-in-fstab | relpipe-out-tabular