README.md 27.6 KB
Newer Older
pyfourmond's avatar
pyfourmond committed
1
# Linux Installer for ARchives
2

3
**L**inux **I**nstaller for **AR**chives a.k.a `liar` is an easy to use command to install software packaged as an archive on Linux systems.
pyfourmond's avatar
pyfourmond committed
4

5
Nowadays more and more software and tools are delivered as a tarball or compressed one instead of being installed from Linux official repositories. A typical example of this is Oracle JDK. It also happens that a software present in the Linux repository is not up to date enough for your needs.
pyfourmond's avatar
pyfourmond committed
6

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
7
Moreover there is an increasing need to not only being able to install software without having administrator privileges but also to have the ability to install several versions of the same software on the same machine.
pyfourmond's avatar
pyfourmond committed
8

9
That's why `liar` addresses simply these needs with a standalone Shell script to install, list and remove software packaged in an archive file of one of the following formats: **.tar** **.tar.bz2** **.tar.gz** **.tar.xz** **.tar.Z** **.tbz2** **.tgz** and **.zip**.
pyfourmond's avatar
pyfourmond committed
10

11
Very few dependencies are needed, see [Dependencies] (#5-dependencies) section for details.
pyfourmond's avatar
pyfourmond committed
12

13
It is developed and tested on [Debian GNU/Linux] (https://www.debian.org) version 8.9 using **dash** version 0.5.7-4+b1.
pyfourmond's avatar
pyfourmond committed
14

15
`liar` conformance to **sh** syntax is checked regularly with [ShellCheck] (https://www.shellcheck.net) and [checkbashisms] (https://sourceforge.net/projects/checkbaskisms/) tools.
pyfourmond's avatar
pyfourmond committed
16

17 18
## 1. Features

19
`liar` provides installation, listing and removal of tarball packaged software in a simple command line with:
20

21
- Installation of software archives located on filesystem or network
22
- Destination folder selection
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
23
- Internal software archives cache, optional for local archives
24
- Download user agent choice (wget, curl or aria2c) for network archives
25
- Download resume (network archives)
26
- Secure installation to prevent software duplicates in a given destination folder
27
- Integrity for non `liar` installed software or unknown folder as `liar` does not remove nor list software it has not installed itself
28 29
- Secure software removal guaranteed by interactive user confirmation
- Optional root usage
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
30
- Symbolic links creation for installed binaries with folder selection and binaries filtering
31
- Bash command line completion to help entry of options, commands and parameters
32

33 34
For a list of tarballl delivered software installable with `liar`, see [Tested Software] (#6-tested-software).

35 36
### 1.1 New features

37
Starting from [0.2-dev version] (https://framagit.org/grumpyf0x48/liar/tree/master), the following features and changes have been added:
38 39 40 41 42 43

- Software archive checksum verification (md5, sha1, sha256 or sha512)
- Improvements for binaries filtering in symbolic links creation
- Simplified usage with samples only displayed in verbose mode
- Automatic completion of software names and urls for tested softwares (for x86_64 architecture)

pyfourmond's avatar
pyfourmond committed
44
## 2. Installation
pyfourmond's avatar
pyfourmond committed
45

46
`liar` first released version is [version 0.1] (https://framagit.org/grumpyf0x48/liar/tree/0.1). It has been released on Fri, 14 Apr 2017.
47

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
48
View the most commonly used commands in the [Getting started with Linux Installer for Archives (liar)](https://asciinema.org/a/109135?autoplay=1) video:
49

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
50
<a href="https://asciinema.org/a/109135?autoplay=1" title="Getting started with Linux Installer for Archives (liar)" target="_blank"><img src="GettingStarted.png" width="65%" height="65%" /></a>
51 52 53 54 55 56 57

To install the released version, see [Released version installation] (#21-released-version-installation).

Otherwise, if you want to install the development version, jump to [Development version installation] (#22-development-version-installation).

### 2.1 Released version installation

58
### 2.1.1 Basic installation
59

60 61
To install `liar`, simply enter:

62
    $ sudo curl -L https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar -o /usr/local/bin/liar
63

64
Or you can use wget instead:
65

66
    $ sudo wget https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar -O /usr/local/bin/liar
67 68 69

Then:

70
    $ sudo chmod 755 /usr/local/bin/liar
pyfourmond's avatar
pyfourmond committed
71

72
#### 2.1.1.1 Installation without sysadmin rights
73

74
If you do not want or cannot install `liar` with sysadmin rights, simply remove the `sudo` keyword in the previous commands and replace the path `/usr/local/bin` by `~/bin` for example.
75

76
### 2.1.2 All-in-one command installation
77

78
More simply, you can also use the all-in-one install command:
79 80 81 82 83 84 85

    $ sudo curl -L https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar -o /usr/local/bin/liar && sudo chmod 0755 !#:5

Or:

    $ sudo wget https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar -O /usr/local/bin/liar && sudo chmod 0755 !#:5

86
#### 2.1.2.1 Installation without sysadmin rights
87 88

Without sysadmin rights, use the following command:
89 90 91 92 93 94 95

    $ curl -L https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar -o /usr/local/bin/liar && sudo chmod 0755 !#:4

Or:

    $ wget https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar -O /usr/local/bin/liar && sudo chmod 0755 !#:4

96
### 2.1.3 Bash completion installation
97 98 99 100 101 102 103 104 105 106 107 108 109

`liar` supports Bash command line completion for options, commands and parameters. Default values for options with parameters is also handled.

To use it, enter the following command:

    $ sudo curl -L https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar-completion -o /etc/bash_completion.d/liar

Alternatively you can also use wget:

    $ sudo wget https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar-completion -O /etc/bash_completion.d/liar

Then, start a new Bash interpreter.

110 111
### 2.2 Development version installation

112
`liar` current development version is [version 0.2-dev] (https://framagit.org/grumpyf0x48/liar/tree/master).
113 114 115 116 117

This version adds to the released version:

- Support for software archive checksum verification
- Improvements for binaries filtering in symbolic links creation
118
- Simplified usage with samples only displayed in verbose mode
119

120 121 122
It also adds automatic Bash completion of software names and urls for [tested softwares] (#6-tested-software):

- When pressing TAB key after 'install' keyword, tested softwares are proposed
123
- After the software name is entered, a TAB key press completes the command with the latest known URL (for x86_64 architecture)
124

125
### 2.2.1 Basic installation
126

127
    $ sudo curl -L https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar -o /usr/local/bin/liar
128 129 130

or you can use wget instead:

131
    $ sudo wget https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar -O /usr/local/bin/liar
132 133 134

Then:

135
    $ sudo chmod 755 /usr/local/bin/liar
136

137
### 2.2.2 Bash completion installation
138 139 140

To install Bash command line completion, enter the following command:

141
    $ sudo curl -L https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar-completion -o /etc/bash_completion.d/liar
142

143
Alternatively you can also use wget:
144

145
    $ sudo wget https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar-completion -O /etc/bash_completion.d/liar
pyfourmond's avatar
pyfourmond committed
146

pyfourmond's avatar
pyfourmond committed
147 148
## 3. Sample use

149
### 3.1 Installing a JDK in the default destination folder
pyfourmond's avatar
pyfourmond committed
150

151 152 153
    $ liar install jdk8 ~/Downloads/jdk-8u121-linux-x64.tar.gz
    Installing 'jdk8' from '/home/debian/Downloads/jdk-8u121-linux-x64.tar.gz' to '/home/debian/Programs/jdk8'
    Extracting '/home/debian/.liar_cache/jdk-8u121-linux-x64.tar.gz' to '/home/debian/Programs/jdk8'
pyfourmond's avatar
pyfourmond committed
154

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
155
In this first sample, The JDK has been installed under the name jdk8 in `$HOME/Programs`, which is the default destination folder.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
156

157
### 3.1.1 Installing a JDK with symbolic links created
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179

    $ liar -v -l -s ~/bin -p "jre/bin/*" install jdk ~/Downloads/jdk-8u144-linux-i586.tar.gz
    Enabling verbose mode
    DESTINATION option is not set, Using '/home/debian/Programs' by default
    Installing 'jdk' from '/home/debian/Downloads/jdk-8u144-linux-i586.tar.gz' to '/home/debian/Programs/jdk'
    Creating '/home/debian/Programs/jdk'
    Checking if an installation of '/home/debian/Downloads/jdk-8u144-linux-i586.tar.gz' already exists in '/home/debian/Programs' ...
    Extracting '/home/debian/Downloads/jdk-8u144-linux-i586.tar.gz' to '/home/debian/Programs/jdk'
    Creating link: '/home/debian/bin/java' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/java'
    Creating link: '/home/debian/bin/rmid' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/rmid'
    Creating link: '/home/debian/bin/servertool' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/servertool'
    Creating link: '/home/debian/bin/pack200' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/pack200'
    Creating link: '/home/debian/bin/javaws' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/javaws'
    Creating link: '/home/debian/bin/tnameserv' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/tnameserv'
    Creating link: '/home/debian/bin/jcontrol' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/jcontrol'
    Creating link: '/home/debian/bin/unpack200' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/unpack200'
    Creating link: '/home/debian/bin/orbd' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/orbd'
    Creating link: '/home/debian/bin/rmiregistry' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/rmiregistry'
    Creating link: '/home/debian/bin/keytool' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/keytool'
    Creating link: '/home/debian/bin/jjs' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/jjs'
    Creating link: '/home/debian/bin/policytool' -> '/home/debian/Programs/jdk/jdk1.8.0_144/jre/bin/policytool'

180
### 3.2 Installing Sublime Text in another destination folder
pyfourmond's avatar
pyfourmond committed
181

182 183 184
    $ liar -d ~/Extras/ install sublime Downloads/sublime_text_3_build_3126_x64.tar.bz2
    Installing 'sublime' from 'Downloads/sublime_text_3_build_3126_x64.tar.bz2' to '/home/debian/Extras/sublime'
    Extracting '/home/debian/.liar_cache/sublime_text_3_build_3126_x64.tar.bz2' to '/home/debian/Extras/sublime'
pyfourmond's avatar
pyfourmond committed
185

186
Here, Sublime Text has been installed in `$HOME/Extras`, the destination folder specified with option `-d`.
pyfourmond's avatar
pyfourmond committed
187

188
### 3.3 Installing Sublime Text from the http url
189

190 191 192
    $ liar install sublime3 http://download.sublimetext.com/sublime_text_3_build_3126_x64.tar.bz2
    Installing 'sublime3' from 'http://download.sublimetext.com/sublime_text_3_build_3126_x64.tar.bz2' to '/home/debian/Programs/sublime3'
    --2017-01-24 10:42:17--  http://download.sublimetext.com/sublime_text_3_build_3126_x64.tar.bz2
193 194 195 196 197 198 199
    Résolution de download.sublimetext.com (download.sublimetext.com)… 104.236.0.104
    Connexion à download.sublimetext.com (download.sublimetext.com)|104.236.0.104|:443… connecté.
    requête HTTP transmise, en attente de la réponse… 200 OK
    Taille : 9313954 (8,9M) [application/octet-stream]
    Sauvegarde en : « /home/debian/.liar_cache/sublime_text_3_build_3126_x64.tar.bz2 »

    /home/debian/.liar_cache/sublime_ 100%[=============================================================>]   8,88M  1,04MB/s   ds 7,3s
pyfourmond's avatar
pyfourmond committed
200

201 202 203 204
    2017-01-24 10:42:25 (1,22 MB/s) — « /home/debian/.liar_cache/sublime_text_3_build_3126_x64.tar.bz2 » sauvegardé [9313954/9313954]

    Extracting '/home/debian/.liar_cache/sublime_text_3_build_3126_x64.tar.bz2' to '/home/debian/Programs/sublime3'

205
### 3.4 Installing Robomongo with symbolic links created
206 207 208 209 210

    $ liar -l install robomongo ~/Downloads/robomongo-0.9.0-linux-x86_64-0786489.tar.gz
    Installing 'robomongo' from '/home/debian/Downloads/robomongo-0.9.0-linux-x86_64-0786489.tar.gz' to '/home/debian/Programs/robomongo'
    Extracting '/home/debian/.liar_cache/robomongo-0.9.0-linux-x86_64-0786489.tar.gz' to '/home/debian/Programs/robomongo'
    Creating link: '/home/debian/bin/robomongo'
211

212
With this third example, Robomongo has been installed with symbolic links created in `~/bin` for all executables found. In this example, only one executable has been found. When `liar` removes a software all symbolic links created during installation are removed.
pyfourmond's avatar
pyfourmond committed
213

214
### 3.5 Installing Maven
215

216 217 218 219 220 221
    $ liar -l install maven3 ~/Downloads/apache-maven-3.3.9-bin.zip
    Installing 'maven3' from '/home/debian/Downloads/apache-maven-3.3.9-bin.zip' to '/home/debian/Programs/maven3'
    Extracting '/home/debian/.liar_cache/apache-maven-3.3.9-bin.zip' to '/home/debian/Programs/maven3'
    Creating link: '/home/debian/bin/mvn'
    Creating link: '/home/debian/bin/mvnyjp'
    Creating link: '/home/debian/bin/mvnDebug'
222

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
223
Maven has been installed with symbolic links created in `~/bin` for all executables. In this example, three executables has been found.
pyfourmond's avatar
pyfourmond committed
224 225

To restrict which files are symlinked:
226

227 228 229 230
    $ liar -l -p mvn install maven3 ~/Downloads/apache-maven-3.3.9-bin.zip
    Installing 'maven3' from '/home/debian/Downloads/apache-maven-3.3.9-bin.zip' to '/home/debian/Programs/maven3'
    Extracting '/home/debian/Downloads/apache-maven-3.3.9-bin.zip' to '/home/debian/Programs/maven3'
    Creating link: '/home/debian/bin/mvn'
231

232
Here we have restricted symlink creation to the mvn executable.
pyfourmond's avatar
pyfourmond committed
233

234
### 3.6 Installing IntelliJ IDEA in verbose mode with one symbolic link created
235

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
236
    $ liar -v -l -p idea.sh install idea-community https://download.jetbrains.com/idea/ideaIC-2017.1.tar.gz
237
    Enabling verbose mode
238
    DESTINATION option is not set, Using '/home/debian/Programs' by default
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
239 240 241
    Installing 'idea-community' from 'https://download.jetbrains.com/idea/ideaIC-2017.1.tar.gz' to '/home/debian/Programs/idea-community'
    Downloading 'https://download.jetbrains.com/idea/ideaIC-2017.1.tar.gz' to '/home/debian/.liar_cache/ideaIC-2017.1.tar.gz'
    --2017-01-24 10:57:10--  https://download.jetbrains.com/idea/ideaIC-2017.1.tar.gz
242 243 244
    Résolution de download.jetbrains.com (download.jetbrains.com)… 54.217.236.18
    Connexion à download.jetbrains.com (download.jetbrains.com)|54.217.236.18|:443… connecté.
    requête HTTP transmise, en attente de la réponse… 302 Moved Temporarily
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
245 246
    Emplacement : https://download-cf.jetbrains.com/idea/ideaIC-2017.1.tar.gz [suivant]
    --2017-01-24 10:57:11--  https://download-cf.jetbrains.com/idea/ideaIC-2017.1.tar.gz
247 248 249
    Résolution de download-cf.jetbrains.com (download-cf.jetbrains.com)… 52.85.69.86, 52.85.69.93, 52.85.69.184, ...
    Connexion à download-cf.jetbrains.com (download-cf.jetbrains.com)|52.85.69.86|:443… connecté.
    requête HTTP transmise, en attente de la réponse… 200 OK
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
250 251
    Taille : 427717734 (408M) [binary/octet-stream]
    Sauvegarde en : « /home/debian/.liar_cache/ideaIC-2017.1.tar.gz »
252 253 254

    /home/debian/.liar_cache/ideaIC-2 100%[=============================================================>] 391,57M  7,49MB/s   ds 52s

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
255
    2017-01-24 10:58:03 (7,47 MB/s) — « /home/debian/.liar_cache/ideaIC-2017.1.tar.gz » sauvegardé [427717734/427717734]
256 257

    Creating '/home/debian/Programs/idea-community'
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
258 259
    Checking if an installation of '/home/debian/.liar_cache/ideaIC-2017.1.tar.gz' already exists in '/home/debian/Programs' ...
    Extracting '/home/debian/.liar_cache/ideaIC-2017.1.tar.gz' to '/home/debian/Programs/idea-community'
260
    Creating link: '/home/debian/bin/idea.sh'
261 262 263

The other executables available are the ones of the JDK, so we do not create links for them.

264
### 3.7 Installing IntelliJ IDEA with checksum verification
265 266 267 268 269 270 271 272 273 274 275 276

    $ liar -v -c fa2dfe2697d3e7637cd16f14cec00931d2097c84 install idea ~/Downloads/ideaIC-2017.2.5.tar.gz
    Enabling verbose mode
    Setting checksum to 'fa2dfe2697d3e7637cd16f14cec00931d2097c84'
    DESTINATION option is not set, Using '/home/debian/Programs' by default
    CHECKSUM type is not set, Using 'sha1' by default
    Installing 'idea' from '/home/debian/Downloads/ideaIC-2017.2.5.tar.gz' to '/home/debian/Programs/idea'
    Creating '/home/debian/Programs/idea'
    Checking if an installation of '/home/debian/Downloads/ideaIC-2017.2.5.tar.gz' already exists in '/home/debian/Programs' ...
    Checking '/home/debian/Downloads/ideaIC-2017.2.5.tar.gz' 'sha1' checksum verification
    Extracting '/home/debian/Downloads/ideaIC-2017.2.5.tar.gz' to '/home/debian/Programs/idea'

277
### 3.8 Installing Tor Browser
pyfourmond's avatar
pyfourmond committed
278

279 280 281 282
    $ liar -l -p start-tor-browser install torbrowser ~/Downloads/tor-browser-linux64-6.0.8_fr.tar.xz
    Installing 'torbrowser' from '/home/debian/Downloads/tor-browser-linux64-6.0.8_fr.tar.xz' to '/home/debian/Programs/torbrowser'
    Extracting '/home/debian/.liar_cache/tor-browser-linux64-6.0.8_fr.tar.xz' to '/home/debian/Programs/torbrowser'
    Creating link: '/home/debian/bin/start-tor-browser'
pyfourmond's avatar
pyfourmond committed
283

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
284
In the Tor Browser installation, we have restricted symbolic link creation to the start-tor-browser executable.
pyfourmond's avatar
pyfourmond committed
285

286
### 3.9 Installing Gradle
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
287 288 289 290 291 292 293 294 295 296 297

    $ liar -v -l -p gradle install gradle ~/Downloads/gradle-4.2.1-bin.zip
    Enabling verbose mode
    DESTINATION option is not set, Using '/home/debian/Programs' by default
    Installing 'gradle' from '/home/debian/Downloads/gradle-4.2.1-bin.zip' to '/home/debian/Programs/gradle'
    Caching '/home/debian/Downloads/gradle-4.2.1-bin.zip' to '/home/debian/.liar_cache/gradle-4.2.1-bin.zip'
    Creating '/home/debian/Programs/gradle'
    Checking if an installation of '/home/debian/.liar_cache/gradle-4.2.1-bin.zip' already exists in '/home/debian/Programs' ...
    Extracting '/home/debian/.liar_cache/gradle-4.2.1-bin.zip' to '/home/debian/Programs/gradle'
    Creating link: '/home/debian/bin/gradle' -> '/home/debian/Programs/gradle/gradle-4.2.1/bin/gradle'

298
### 3.10 Installing a software while being root
299

300
    $ sudo liar install maven ~/Downloads/apache-maven-3.3.9-bin.tar.gz
301
    liar cannot be run as root. Please use '-r' option.
302

303
By default `liar` does not allow root installation for security reasons.
pyfourmond's avatar
pyfourmond committed
304

305
Then when adding `-r` option:
306

307
    $ sudo liar -r install maven ~/Downloads/apache-maven-3.3.9-bin.tar.gz
308
    Allowing root usage
309 310
    Installing 'maven' from '/home/debian/Downloads/apache-maven-3.3.9-bin.tar.gz' to '/root/Programs/maven'
    Extracting '/root/.liar_cache/apache-maven-3.3.9-bin.tar.gz' to '/root/Programs/maven'
311

312
### 3.11 List what you have installed
313 314

    $ liar list
315
    Listing installed software in '/home/debian/Programs'
316

317
    Name           Folder             File Path                              Date
318

319 320 321
    sublime        sublime_text_3     sublime_text_3_build_3126_x64.tar.bz   12/20/16 11:55:32
    asciinema      asciinema-1.2.0-   asciinema-1.2.0-linux-amd64.tar.gz     01/26/17 08:17:52
    torbrowser     tor-browser_fr     tor-browser-linux64-6.5_fr.tar.xz      01/30/17 09:42:33
322

323
list command displays installation name, folder, from which archive file the installation was done and the installation date.
pyfourmond's avatar
pyfourmond committed
324

325
### 3.12 Removing previously installed software
326

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
327 328 329
    $ liar remove sublime3
    Removing 'sublime3' installed in '/home/debian/Programs/sublime3'
    Do you want to remove 'sublime3' installed in '/home/debian/Programs/sublime3' (Y/N) ? Y
pyfourmond's avatar
pyfourmond committed
330

pyfourmond's avatar
pyfourmond committed
331 332
When removing a software, a confirmation is asked to the user.

pyfourmond's avatar
pyfourmond committed
333 334
## 4. Documentation

335
This section describes how `liar` works, which commands options and parameters it accepts.
pyfourmond's avatar
pyfourmond committed
336

337
### 4.1 Commands
pyfourmond's avatar
pyfourmond committed
338

339
`liar` supports the following commands:
340 341 342 343 344 345 346 347 348 349 350 351 352

- help
- install
- list
- remove
- version

used to:

- Getting help
- Install a software
- List installed software
- Remove a software
353
- Getting `liar` version
354

355
#### 4.1.1 help
356

357
To get help of `liar` usage, simply enter:
358 359

    $ liar help
360 361 362 363 364 365 366
       Usage: liar [OPTIONS...] COMMAND [PARAMETERS...]

              Handles installation, removal and listing of software packaged in an archive.
              Supported archive types are: .tar .tar.bz2 .tar.gz .tar.xz .tar.Z .tbz2 .tgz .zip

              OPTIONS:
                        -d      Specify DESTINATION folder. If unspecified, installation will be done in /home/user/Programs.
367
                        -l      Create symbolic links in /home/user/bin folder after installation.
368 369
                        -s      Specify the folder for SYMBOLIC links creation.
                        -p      Specify the file PATTERN to restrict symbolic links creation.
370
                        -a      Specify the download user AGENT: wget, curl or aria2c. By default, wget is used.
371 372
                        -c      Specify the FILE_PATH expected checksum.
                        -t      Specify the CHECKSUM type: md5, sha1, sha256 or sha512. By default sha1 is used.
373 374
                        -v      Activate VERBOSE mode.
                        -r      Allow ROOT usage.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
375 376
                        -b      Bypass CACHE use for local archives.
                        -f      Bypass user CONFIRMATION.
377

378
              COMMANDS:
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
379
                        help                        Display this help.
380
                        install NAME FILE_PATH      Install a software packaged in the archive FILE_PATH into the folder DESTINATION under the name NAME.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
381 382 383
                        list                        List installed software.
                        remove NAME                 Remove the software named NAME.
                        version                     Print the version of liar.
384

385 386 387 388 389
With `-v` option, `liar` help output also includes sample commands:

    $ liar -v help

    ...
390
              EXAMPLES:
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
391
                        liar install sublime Downloads/sublime_text_3_build_3126_x64.tar.bz2
392 393 394 395
                        liar install maven http://apache.crihan.fr/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
                        liar -l -p "sublime*" install sublime Downloads/sublime_text_3_build_3126_x64.tar.bz2
                        liar -v -l install jre Downloads/jre-8u121-linux-x64.tar.gz
                        liar -v -a curl -l -p pycharm.sh install pycharm https://download-cf.jetbrains.com/python/pycharm-community-2017.1.tar.gz
396
                        liar remove sublime
397
                        liar -r -d /opt/liar-installations list
398

399
#### 4.1.2 install
400 401 402 403 404 405

In its simpliest form, the install command takes only two parameters.

For example:

    $ liar install jdk8 ~/Downloads/jdk-8u101-linux-x64.tar.gz
406
    Installing 'jdk8' from '/home/user/Downloads/jdk-8u101-linux-x64.tar.gz' to '/home/user/Programs/jdk8'
407
    Extracting '/home/user/.liar_cache/jdk-8u101-linux-x64.tar.gz' to '/home/user/Programs/jdk8'
408 409 410

The parameters are:

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
411
- the name to give to the software being installed
412 413
- the input archive containing the software

414
Additionnaly, ALL `liar` options can be used to alter the install command behavior.
415

416
See [Options and parameters] (#42-options-and-parameters) section for more details.
417

418
#### 4.1.3 list
419

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
420
The list command displays which software are installed in the DESTINATION folder:
421 422 423

    $ liar list
    Listing installed software in '/home/user/Programs'
424

425
    Name           Folder             File Path                              Date
426

427 428 429 430 431 432 433 434 435 436 437 438 439 440
    sublime        sublime_text_3     sublime_text_3_build_3126_x64.tar.bz   12/20/16 11:55:32
    jdk8           jdk1.8.0_111       jdk-8u111-linux-x64.tar.gz             01/26/17 08:54:05
    asciinema      asciinema-1.2.0-   asciinema-1.2.0-linux-amd64.tar.gz     01/26/17 08:17:52
    torbrowser     tor-browser_fr     tor-browser-linux64-6.5_fr.tar.xz      01/30/17 09:42:33

When using verbose mode, more info is displayed:

    $ liar -v list
    Enabling verbose mode
    DESTINATION option is not set, Using '/home/user/Programs' by default
    Listing installed software in '/home/user/Programs'

    Name           Folder             File Path                              Sha1       Date                Links

441
    sublime        sublime_text_3     sublime_text_3_build_3126_x64.tar.bz   dd95e628   12/20/16 11:55:32   0
442
    jdk8           jdk1.8.0_111       jdk-8u111-linux-x64.tar.gz             b6432ce4   01/26/17 08:54:05   58
443 444
    asciinema      asciinema-1.2.0-   asciinema-1.2.0-linux-amd64.tar.gz     816c149e   01/26/17 08:17:52   1
    torbrowser     tor-browser_fr     tor-browser-linux64-6.5_fr.tar.xz      1f8b211e   01/30/17 09:42:33   1
445

446
#### 4.1.4 remove
447

448
The remove command takes an unique parameter, the name of the software to remove, which is the one that was given when installing.
449

450 451
A remove sample use is:

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
452 453 454
    $ liar remove maven3
    Removing 'maven3' installed in '/home/user/Programs/maven3'
    Do you want to remove 'maven3' installed in '/home/user/Programs/maven3' (Y/N) ? Y
455

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
456 457 458 459 460
When removing a software, a confirmation is asked to the user. This confirmation can be removed if `-f` option is used:

    $ liar -f remove maven3
    Enabling force mode
    Removing 'maven3' installed in '/home/user/Programs/maven3'
461 462 463

The remove command can be used with the general options described below.

464
#### 4.1.5 version
465

466
To display the version of `liar` being used, enter:
467 468

    $ liar version
469
    liar version 0.1
470

471
### 4.2 Options and parameters
472

473
Now that we have seen which commands `liar` implements, let's see the options they can use, and the parameters they need.
474 475

General options are:
pyfourmond's avatar
pyfourmond committed
476 477

- DESTINATION folder
478
- VERBOSE mode
pyfourmond's avatar
pyfourmond committed
479
- ROOT usage
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
480 481
- Bypass CACHE
- Bypass user CONFIRMATION
482
- Download user AGENT
pyfourmond's avatar
pyfourmond committed
483

484 485 486 487 488 489
Symbolic links creation options are:

- folder for SYMBOLIC links creation
- file PATTERN for SYMBOLIC links

Command parameters are:
pyfourmond's avatar
pyfourmond committed
490 491 492 493

- software NAME
- archive FILE_PATH

494
#### 4.2.1 Destination folder
pyfourmond's avatar
pyfourmond committed
495

496
`liar` helps you to install remove and list software that is packaged as a tarball, the FILE_PATH, in a folder of your choice, the DESTINATION folder.
pyfourmond's avatar
pyfourmond committed
497

pyfourmond's avatar
pyfourmond committed
498
DESTINATION folder default value is: `$HOME/Programs`.
pyfourmond's avatar
pyfourmond committed
499

500 501
This option can be used with install, list and remove commands.

502
#### 4.2.2 Name
pyfourmond's avatar
pyfourmond committed
503

504
When installing a software `liar` needs two mandatory parameters, the NAME and the FILE_PATH.
pyfourmond's avatar
pyfourmond committed
505

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
506
NAME is used to create a sub-folder in the DESTINATION folder in order to install the desired software.
pyfourmond's avatar
pyfourmond committed
507

508
The NAME parameter is also mandatory when removing a software.
pyfourmond's avatar
pyfourmond committed
509

510
#### 4.2.3 File path
pyfourmond's avatar
pyfourmond committed
511 512

FILE_PATH is the path of the archive containing the software to install.
pyfourmond's avatar
pyfourmond committed
513

514 515
The FILE_PATH parameter is specific to the install command.

516
#### 4.2.4 Symbolic links creation
pyfourmond's avatar
pyfourmond committed
517

518
After a software is installed `liar` can optionally create symbolic links for installed executables to a folder of your choice, the folder for SYMBOLIC links creation.
pyfourmond's avatar
pyfourmond committed
519

520 521 522
Symlinking can be done for all or only some of the executables installed: in this case the file PATTERN used to filter the executables to symlink is a pattern understood by the **find** command **-wholename** flag.

For convenience, an initial `*` is added to the beginning of the pattern if not already present.
pyfourmond's avatar
pyfourmond committed
523

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
524
The folder for SYMBOLIC links creation is optional and has the following default values:
pyfourmond's avatar
pyfourmond committed
525

pyfourmond's avatar
pyfourmond committed
526 527
- `/usr/local/bin` for root installation
- `$HOME/bin` otherwise
pyfourmond's avatar
pyfourmond committed
528

529
#### 4.2.5 Verbose mode
530

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
531
When option `-v` is set, verbose mode is activated. In this mode, some commands display more detailed output when executed.
532

533
#### 4.2.6 Root usage
pyfourmond's avatar
pyfourmond committed
534

535
By default, `liar` will not let you install, list nor remove software when logged as root. To allow root usage `-r` option should be used.
pyfourmond's avatar
pyfourmond committed
536

537
#### 4.2.7 Download user agent
538 539 540 541 542

When installing an archive that is downloaded from the internet, the default user agent used is `wget`.

It is possible to change this behavior using `-a` flag with one of the following values:

543
- aria2c
544 545 546
- curl
- wget

pyfourmond's avatar
pyfourmond committed
547
## 5. Dependencies
pyfourmond's avatar
pyfourmond committed
548

549
`liar` requires nothing more than a Bourne Shell i.e. **sh** or compatible one with the following packages installed:
pyfourmond's avatar
pyfourmond committed
550

551 552 553 554 555 556
- **coreutils**
- **debianutils**
- **diffutils**
- **findutils**
- **mawk**
- **tar**
557

558
**unzip** and **compress** commands are required when using the respective archive formats **.zip** and **.tar.Z**.
559

560 561 562
Additionally **wget**, **curl** or **aria2** package is required when using archive download feature.

Finally, if installed, **xdg-utils** package will be used to filter executables when creating links.
pyfourmond's avatar
pyfourmond committed
563

564 565 566 567 568 569
## 6. Tested Software

`liar` has been tested with the following softwares:

- Apache Ant
- Apache Maven
570
- Asciinema
571
- Atom
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
572
- Gradle
573
- JetBrains IDE (IntelliJ IDEA, PyCharm, RubyMine, WebStorm, ...)
574
- NetBeans
575
- Oracle JDK and JRE
576
- Robo 3T (Formerly RoboMongo)
577 578 579 580
- Sublime Text
- Tor Browser

## 7. License
pyfourmond's avatar
pyfourmond committed
581

582 583 584
Copyright (C) 2017 Pierre-Yves Fourmond.

`liar` is free software, distributed under the terms of the [GNU] (https://www.gnu.org) General Public License as published by the [Free Software Foundation] (https://www.fsf.org), version 3 of the License (or any later version). For more information, see the file [LICENSE] (LICENSE).
pyfourmond's avatar
pyfourmond committed
585

586
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.
587 588

![License] (https://www.gnu.org/graphics/gplv3-88x31.png  "General Public License")