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

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
3 4
## 0. Table of contents

5 6 7 8 9
- [Features](#1-features)
- [Installation](#2-installation)
- [Sample use](#3-sample-use)
- [Documentation](#4-documentation)
- [Dependencies](#5-dependencies)
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
10
- [Tested software](#6-tested-software)
11 12
- [Docker image](#7-docker-image)
- [License](#8-license)
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
13

14
**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
15

16
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 [JDK](http://jdk.java.net/). 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
17

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
18
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
19

20
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
21

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

24
It is developed on [Debian GNU/Linux](https://www.debian.org) version 9.4 using **dash** version 0.5.8-2.4.
25 26

Additionally, tests are done on Debian version 8.10 with dash version 0.5.7-4+b1.
pyfourmond's avatar
pyfourmond committed
27

28
`liar` conformance to **sh** syntax is checked with [ShellCheck](https://www.shellcheck.net) and [checkbashisms](https://sourceforge.net/projects/checkbaskisms/) tools.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
29

30 31
## 1. Features

32
`liar` provides installation, listing and removal of tarball packaged software in a simple command with:
33

34
- Installation of software archives located on filesystem or network
35
- Destination folder selection
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
36
- Internal software archives cache, optional for local archives
37
- Download user agent choice (wget, curl or aria2c) for network archives
38
- Download resume (network archives)
39
- Secure installation to prevent software duplicates in a given destination folder
40
- Integrity for non `liar` installed software or unknown folder as `liar` does not remove nor list software it has not installed itself
41 42
- Secure software removal guaranteed by interactive user confirmation
- Optional root usage
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
43
- Symbolic links creation for installed binaries with folder selection and binaries filtering
44
- Bash command line completion to help entry of options, commands and parameters
45

46
For a list of tarball delivered software installable with `liar`, see [Tested Software](#6-tested-software).
47

48 49
### 1.1 New features

50
Starting from [0.2-dev version](https://framagit.org/grumpyf0x48/liar/tree/master), the following features and changes have been added:
51 52 53 54

- 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
55
- Automatic completion of software names and urls for more than 15 tested softwares (for x86_64 architecture)
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
56
- Remove command is now able to remove several softwares at a time
57
- Complete rewrite of command line completion
58
- list command output can be sorted by any column
59
- Ability to upgrade liar in development version
60

pyfourmond's avatar
pyfourmond committed
61
## 2. Installation
pyfourmond's avatar
pyfourmond committed
62

63
`liar` first released version is [version 0.1](https://framagit.org/grumpyf0x48/liar/tree/0.1).
64

65
It has been released on Fri, 14 Apr 2017.
66

67
View the most commonly used commands in the [Getting started with Linux Installer for Archives](https://asciinema.org/a/109135) video:
68

69 70 71
<a href="https://asciinema.org/a/109135?autoplay=1" title="Getting started with Linux Installer for Archives" target="_blank"><img src="GettingStarted.png" width="65%" height="65%" /></a>

To install the released version, jump to [Released version installation](#22-released-version-installation).
72

73
Otherwise, go on with the development version.
74

75 76
### 2.1 Development version installation

77
`liar` current development version is [version 0.2-dev](https://framagit.org/grumpyf0x48/liar/tree/master).
78 79 80 81 82 83 84

This version adds to the released version:

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

85
It also adds automatic Bash completion of software names and urls for [tested softwares](#6-tested-software):
86 87

- When pressing TAB key after 'install' keyword, tested softwares are proposed
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
88
- After the software name is entered, a TAB key press completes the command line with the latest known URL (for x86_64 architecture)
89

90
Please consult the following section to know more about [new features](#11-new-features).
91

92
### 2.1.1 Basic installation
93

94 95 96 97 98 99 100 101 102 103 104 105
    $ sudo curl -L https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar -o /usr/local/bin/liar

or you can use wget instead:

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

Then:

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

### 2.1.2 Bash completion installation

106 107 108
`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:
109

110
    $ sudo curl -L https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar-completion -o /etc/bash_completion.d/liar-completion
111 112 113

Alternatively you can also use wget:

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

116 117
Then, start a new Bash interpreter.

118 119 120 121 122
### 2.2 Released version installation

### 2.2.1 Basic installation

To install `liar` 0.1 version, simply enter:
123

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

126
Or you can use wget instead:
127

128
    $ sudo wget https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar -O /usr/local/bin/liar
129 130 131

Then:

132
    $ sudo chmod 755 /usr/local/bin/liar
pyfourmond's avatar
pyfourmond committed
133

134
### 2.2.2 All-in-one command installation
135

136
More simply, you can also use the all-in-one install command:
137 138 139 140 141

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

Or:

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

144
### 2.2.3 Installation without sysadmin rights
145 146

Without sysadmin rights, use the following command:
147

148
    $ curl -L https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar -o ~/bin/liar && chmod 0755 !#:4
149 150 151

Or:

152
    $ wget https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar -O ~/bin/liar && chmod 0755 !#:3
153

154
### 2.2.4 Bash completion installation
155

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

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

Alternatively you can also use wget:

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

Then, start a new Bash interpreter.

pyfourmond's avatar
pyfourmond committed
166 167
## 3. Sample use

168
### 3.1 Installing a JDK in the default destination folder
pyfourmond's avatar
pyfourmond committed
169

170 171 172 173
    $ liar install jdk8 https://download.java.net/openjdk/jdk8u40/ri/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz
    Installing 'jdk8' from 'https://download.java.net/openjdk/jdk8u40/ri/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz' to '/home/debian/Programs/jdk8'
    2018-07-22 14:29:16 URL:https://download.java.net/openjdk/jdk8u40/ri/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz [174937067/174937067] -> "/home/debian/.liar_cache/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz" [1]
    Extracting '/home/debian/.liar_cache/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz' to '/home/debian/Programs/jdk8'
pyfourmond's avatar
pyfourmond committed
174

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
175
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
176

177
### 3.1.1 Installing a JDK with symbolic links created
178

179
    $ liar -v -l -s ~/bin -p "jre/bin/*" install jdk8 Downloads/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz
180
    Enabling verbose mode
181 182
    Setting BIN_FOLDER to '/home/debian/bin'
    Setting BIN_PATTERN to 'jre/bin/*'
183
    DESTINATION option is not set, Using '/home/debian/Programs' by default
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
    Installing 'jdk8' from 'Downloads/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz' to '/home/debian/Programs/jdk8'
    Creating '/home/debian/Programs/jdk8'
    Checking if an installation of 'Downloads/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz' already exists in '/home/debian/Programs' ...
    Extracting 'Downloads/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz' to '/home/debian/Programs/jdk8'
    Creating link: '/home/debian/bin/servertool' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/servertool'
    Creating link: '/home/debian/bin/pack200' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/pack200'
    Creating link: '/home/debian/bin/policytool' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/policytool'
    Creating link: '/home/debian/bin/orbd' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/orbd'
    Creating link: '/home/debian/bin/rmiregistry' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/rmiregistry'
    Creating link: '/home/debian/bin/unpack200' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/unpack200'
    Creating link: '/home/debian/bin/rmid' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/rmid'
    Creating link: '/home/debian/bin/jjs' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/jjs'
    Creating link: '/home/debian/bin/java' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/java'
    Creating link: '/home/debian/bin/keytool' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/keytool'
    Creating link: '/home/debian/bin/tnameserv' -> '/home/debian/Programs/jdk8/java-se-8u40-ri/jre/bin/tnameserv'
199

200
### 3.2 Installing Sublime Text in another destination folder
pyfourmond's avatar
pyfourmond committed
201

202 203 204
    $ 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
205

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

208
### 3.3 Installing Sublime Text from the http url
209

210 211 212
    $ 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
213 214 215 216 217 218 219
    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
220

221 222 223 224
    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'

225
### 3.4 Installing Robomongo with symbolic links created
226 227 228 229 230

    $ 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'
231

232
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
233

234
### 3.5 Installing Maven
235

236 237 238 239 240 241
    $ 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'
242

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
243
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
244 245

To restrict which files are symlinked:
246

247 248 249 250
    $ 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'
251

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

254
### 3.6 Installing IntelliJ IDEA in verbose mode with one symbolic link created
255

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
256
    $ liar -v -l -p idea.sh install idea-community https://download.jetbrains.com/idea/ideaIC-2017.1.tar.gz
257
    Enabling verbose mode
258
    DESTINATION option is not set, Using '/home/debian/Programs' by default
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
259 260 261
    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
262 263 264
    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
265 266
    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
267 268 269
    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
270 271
    Taille : 427717734 (408M) [binary/octet-stream]
    Sauvegarde en : « /home/debian/.liar_cache/ideaIC-2017.1.tar.gz »
272 273 274

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

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

    Creating '/home/debian/Programs/idea-community'
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
278 279
    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'
280
    Creating link: '/home/debian/bin/idea.sh'
281 282 283

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

284
### 3.7 Installing IntelliJ IDEA with checksum verification
285 286 287 288 289 290 291 292 293 294 295 296

    $ 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'

297
### 3.8 Installing Tor Browser
pyfourmond's avatar
pyfourmond committed
298

299 300 301 302
    $ 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
303

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

306
### 3.9 Installing Gradle
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
307 308 309 310 311 312 313 314 315 316 317

    $ 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'

318
### 3.10 Installing a software while being root
319

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

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

325
Then when adding `-r` option:
326

327
    $ sudo liar -r install maven ~/Downloads/apache-maven-3.3.9-bin.tar.gz
328
    Allowing root usage
329 330
    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'
331

332
### 3.11 List what you have installed
333 334

    $ liar list
335
    Listing installed software in '/home/debian/Programs'
336

337
    Name           Folder             File Path                              Date        Time
338

339 340 341
    torbrowser     tor-browser_fr     tor-browser-linux64-6.5_fr.tar.xz      2017/01/30  09:42:33
    asciinema      asciinema-1.2.0-   asciinema-1.2.0-linux-amd64.tar.gz     2017/01/26  08:17:52
    sublime        sublime_text_3     sublime_text_3_build_3126_x64.tar.bz   2016/12/20  11:55:32
342

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

345
### 3.12 Removing previously installed software
346

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
347 348 349
    $ 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
350

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
351 352 353 354 355
When removing a software, a confirmation is asked to the user unless '-f' option is used.

Moreover, this command can also remove multiple software at once, for example:

    $ liar remove sublime3 robo3t
pyfourmond's avatar
pyfourmond committed
356

pyfourmond's avatar
pyfourmond committed
357 358
## 4. Documentation

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

361
### 4.1 Commands
pyfourmond's avatar
pyfourmond committed
362

363
`liar` supports the following commands:
364 365 366 367 368 369

- help
- install
- list
- remove
- version
370
- upgrade
371 372 373 374 375 376

used to:

- Getting help
- Install a software
- List installed software
377
- Remove one or several softwares
378
- Getting `liar` version
379
- Upgrade `liar` (development version only)
380

381
#### 4.1.1 help
382

383
To get help of `liar` usage, simply enter:
384 385

    $ liar help
386 387 388 389 390 391 392
       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.
393
                        -l      Create symbolic links in /home/user/bin folder after installation.
394 395
                        -s      Specify the folder for SYMBOLIC links creation.
                        -p      Specify the file PATTERN to restrict symbolic links creation.
396
                        -a      Specify the download user AGENT: wget, curl or aria2c. By default, wget is used.
397 398
                        -c      Specify the file path expected CHECKSUM.
                        -t      Specify the checksum TYPE: md5, sha1, sha256 or sha512. By default sha1 is used.
399
                        -S      Specify the sort COLUMN to use in list command.
400 401
                        -v      Activate VERBOSE mode.
                        -r      Allow ROOT usage.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
402 403
                        -b      Bypass CACHE use for local archives.
                        -f      Bypass user CONFIRMATION.
404

405
              COMMANDS:
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
406
                        help                        Display this help.
407
                        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
408
                        list                        List installed software.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
409
                        remove NAMES...             Remove the software(s) named NAMES.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
410
                        version                     Print the version of liar.
411
                        upgrade                     Upgrade liar.
412

413 414 415 416 417
With `-v` option, `liar` help output also includes sample commands:

    $ liar -v help

    ...
418
              EXAMPLES:
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
419
                        liar install sublime Downloads/sublime_text_3_build_3126_x64.tar.bz2
420 421 422 423
                        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
424
                        liar remove sublime
425 426
                        liar -S4 list
                        liar -v -S-5 list
427
                        liar -r -d /opt/liar-installations list
428

429
#### 4.1.2 install
430

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
431
In its simplest form, the install command takes only two parameters.
432 433 434 435

For example:

    $ liar install jdk8 ~/Downloads/jdk-8u101-linux-x64.tar.gz
436
    Installing 'jdk8' from '/home/user/Downloads/jdk-8u101-linux-x64.tar.gz' to '/home/user/Programs/jdk8'
437
    Extracting '/home/user/.liar_cache/jdk-8u101-linux-x64.tar.gz' to '/home/user/Programs/jdk8'
438 439 440

The parameters are:

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
441
- the name to give to the software being installed
442 443
- the input archive containing the software

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

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

448
#### 4.1.3 list
449

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
450
The list command displays which software are installed in the DESTINATION folder:
451 452 453

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

455
    Name           Folder             File Path                              Date        Time
456

457 458 459 460
    torbrowser     tor-browser_fr     tor-browser-linux64-6.5_fr.tar.xz      2017/01/30  09:42:33
    asciinema      asciinema-1.2.0-   asciinema-1.2.0-linux-amd64.tar.gz     2017/01/26  08:17:52
    jdk8           jdk1.8.0_111       jdk-8u111-linux-x64.tar.gz             2017/01/26  08:54:05
    sublime        sublime_text_3     sublime_text_3_build_3126_x64.tar.bz   2016/12/20  11:55:32
461 462 463 464 465 466 467 468

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'

469
    Name           Folder             File Path                              Sha1       Date        Time       Links
470

471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
    torbrowser     tor-browser_fr     tor-browser-linux64-6.5_fr.tar.xz      1f8b211e   2017/01/30  09:42:33   1
    asciinema      asciinema-1.2.0-   asciinema-1.2.0-linux-amd64.tar.gz     816c149e   2017/01/26  08:17:52   1
    jdk8           jdk1.8.0_111       jdk-8u111-linux-x64.tar.gz             b6432ce4   2017/01/26  08:54:05   58
    sublime        sublime_text_3     sublime_text_3_build_3126_x64.tar.bz   dd95e628   2016/12/20  11:55:32   0

By default, the list command output is ordered by last installation date.

To sort the output using another column, `-S` option may be used. For example, to sort according to the name:

    $ liar -S1 list
    Setting sort column to: 1
    Setting sort order to: 'normal'
    Listing installed software in '/home/user/Programs'

    Name           Folder             File Name                              Date

    atom           atom-beta-1.14.0   atom-amd64.tar.gz                      2017/03/29
    firefox_quan   firefox            firefox-57.0.tar.bz2                   2017/11/18
    gradle         gradle-4.2.1       gradle-4.2.1-bin.zip                   2017/10/15
    hugo           hugo               hugo_0.31.1_Linux-64bit.tar.gz         2017/12/09
    idea-communi   idea-IC-181.4668   ideaIC-2018.1.2.tar.gz                 2018/05/06
    maven          apache-maven-3.3   apache-maven-3.3.9-bin.tar.gz          2017/03/26
    netbeans       netbeans           netbeans-8.2-201609300101-javaee.zip   2017/10/16
    pycharm        pycharm-communit   pycharm-community-2017.1.tar.gz        2017/03/27
    quantum_node   firefox            firefox-57.0.2.tar.bz2                 2017/12/17
    rubymine       RubyMine-2017.2.   RubyMine-2017.2.4.tar.gz               2017/10/15
    torbrowser     tor-browser_fr     tor-browser-linux64-7.5.3_fr.tar.xz    2018/05/07
    umongo         umongo-linux-all   umongo-linux-all_1-6-1.zip             2017/03/29
    webstorm       WebStorm-172.415   WebStorm-2017.2.4.tar.gz               2017/10/15

A negative value supplied to `-S` option will reverse the sort.
502

503
#### 4.1.4 remove
504

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

507 508
A remove sample use is:

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
509 510 511
    $ 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
512

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
513 514 515 516 517
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'
518 519 520

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

521
#### 4.1.5 version
522

523
To display the version of `liar` being used, enter:
524 525

    $ liar version
526
    liar version 0.1
527

528 529 530 531
#### 4.1.6 upgrade

The upgrade command is for development purposes and can only be used when you have installed the current developement version.

532 533 534 535 536 537 538
This command allows to upgrade liar with the latest development version available.

When `liar` has been installed with root:

    $ sudo liar -r upgrade

For non-root installations:
539 540 541

    $ liar upgrade

542
### 4.2 Options and parameters
543

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

General options are:
pyfourmond's avatar
pyfourmond committed
547 548

- DESTINATION folder
549
- VERBOSE mode
pyfourmond's avatar
pyfourmond committed
550
- ROOT usage
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
551 552
- Bypass CACHE
- Bypass user CONFIRMATION
553
- Download user AGENT
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
554
- CHECKSUM type and value
pyfourmond's avatar
pyfourmond committed
555

556 557 558 559 560 561
Symbolic links creation options are:

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

Command parameters are:
pyfourmond's avatar
pyfourmond committed
562 563 564 565

- software NAME
- archive FILE_PATH

566
#### 4.2.1 Destination folder
pyfourmond's avatar
pyfourmond committed
567

568
`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
569

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

572 573
This option can be used with install, list and remove commands.

574
#### 4.2.2 Name
pyfourmond's avatar
pyfourmond committed
575

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

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

580
The NAME parameter is also mandatory when removing a software. Several NAME parameters may also be supplied to the remove command when removing several softwares at a time.
pyfourmond's avatar
pyfourmond committed
581

582
#### 4.2.3 File path
pyfourmond's avatar
pyfourmond committed
583 584

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

586 587
The FILE_PATH parameter is specific to the install command.

588
#### 4.2.4 Symbolic links creation
pyfourmond's avatar
pyfourmond committed
589

590
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
591

592 593 594
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
595

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

pyfourmond's avatar
pyfourmond committed
598 599
- `/usr/local/bin` for root installation
- `$HOME/bin` otherwise
pyfourmond's avatar
pyfourmond committed
600

601
#### 4.2.5 Verbose mode
602

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

605
#### 4.2.6 Root usage
pyfourmond's avatar
pyfourmond committed
606

607
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
608

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
609
#### 4.2.7 Bypass cache
610

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
611 612 613 614 615 616 617 618 619
`liar` uses an internal cache for the archives it installs. It is used for example for download resume. This cache may be disabled when installing a local archive using `-b` option.

#### 4.2.8 Bypass user confirmation

When removing one or several softwares, a confirmation is asked to the user to prevent unwanted removal. To skip this confirmation, `-f` option may be used.

#### 4.2.9 Download user agent

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

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

623
- aria2c
624 625 626
- curl
- wget

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
627 628 629 630 631 632 633 634 635 636
#### 4.2.10 Checksum type and value

`liar` supports checksum verification for downloaded file path.

To set the checksum of the file to install, use the `-c` option followed by the SHA1 checksum. If the checksum is not a SHA1 but a MD5, SHA256 or SHA512, you can set the checksum type using the `-t` flag.

For example:

    $ liar -t sha256 -c a5a4f948d259734ac5649122d0c2f7e885b48162cde78e43415638cbfd7a7aa3 install idea_community https://download-cf.jetbrains.com/idea/ideaIC-2018.1.1.tar.gz

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
637 638 639 640 641 642 643 644 645 646
### 4.3 Configuration files

`liar` uses two configuration files located in `$HOME`.

These files are created automatically at `liar` first use.

The user can modify these files, but he should keep in mind that these modifications may be lost if the configuration files are updated by a new version of `liar`.

#### 4.3.1 .liar_mime_types

647
When creating [symbolic links](#424-symbolic-links-creation), this file is used to determine whether a file is an executable or not.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662

`.liar_mime_types` looks like:

```
# Updated by liar at mardi 17 juillet 2018, 20:28:59 (UTC+0200)
application/x-executable
application/x-perl
application/x-sh
application/x-shellscript
application/x-tcl
text/x-perl
text/x-python
text/x-sh
```

663
#### 4.3.2 .liar_software
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
664

665
This file describes which software `liar` can install and where to download them. It is used by [command line completion](#21-development-version-installation).
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
666 667 668 669 670 671 672 673 674 675 676 677 678 679

The beginning of `.liar_software` is:

```
software="asciinema ant atom firefox gradle groovy hugo icecat idea_community idea_ultimate jdk7 jdk8 jdk9 jdk10 maven netbeans netbeans_dev pycharm_community pycharm_professional robo3t rubymine sublimetext torbrowser webstorm"

asciinema=https://github.com/asciinema/asciinema/releases/download/v1.2.0/asciinema-1.2.0-linux-amd64.tar.gz
ant=http://apache.crihan.fr/dist//ant/binaries/apache-ant-1.10.4-bin.zip
atom=https://github.com/atom/atom/releases/download/v1.28.1/atom-amd64.tar.gz
firefox=https://download-installer.cdn.mozilla.net/pub/firefox/releases/61.0/linux-x86_64/fr/firefox-61.0.tar.bz2
gradle=https://downloads.gradle.org/distributions/gradle-4.8.1-bin.zip
...
```

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
680
Of course, the user can add software to this file to suit his needs.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
681

pyfourmond's avatar
pyfourmond committed
682
## 5. Dependencies
pyfourmond's avatar
pyfourmond committed
683

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

686 687 688 689 690 691
- **coreutils**
- **debianutils**
- **diffutils**
- **findutils**
- **mawk**
- **tar**
692

693
Additionally, the following packages providing compression programs are required depending of the archive format used:
694

695
- **bzip2**: .tar.bz2 .tbz2
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
696 697
- **gzip**: .tar.gz .tgz
- **ncompress**: .tar.Z
698
- **unzip**: .zip
699
- **xz-utils**: .tar.xz
700

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
701
Moreover, **aria2**, **curl** or **wget** package is needed when using archive download feature.
702

703 704 705
If installed, **xdg-utils** package will be used to filter executables when creating links.

Finally, **bash-completion** is required when using Bash command line completion.
pyfourmond's avatar
pyfourmond committed
706

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
707
## 6. Tested software
708 709 710 711 712 713

`liar` has been tested with the following softwares:

- Apache Ant
- Apache Maven
- Atom
714
- Go
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
715
- Gradle
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
716
- Groovy
717
- Hugo
718
- Icecat
719
- JDK
720
- JetBrains IDE (IntelliJ IDEA, GoLand, PyCharm, RubyMine, WebStorm, ...)
721
- Mozilla Firefox
722 723
- NetBeans
- Robo 3T (Formerly RoboMongo)
724 725 726
- Sublime Text
- Tor Browser

727
Asciinema is no longer tested as it is not delivered anymore as an [archive](https://discourse.asciinema.org/t/changes-in-asciinema-packaging/90).
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
728

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
729
## 7. Docker image
730

731
`liar` docker image is based on Debian Stretch and has the latest development version of liar installed.
732 733 734 735 736 737

To use it:

    $ docker run -it grumpyf0x48/liar

## 8. License
pyfourmond's avatar
pyfourmond committed
738

739 740
Copyright (C) 2017 Pierre-Yves Fourmond.

741
`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.md).
pyfourmond's avatar
pyfourmond committed
742

743
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.
744

745
<a href="https://www.gnu.org/licenses/gpl-3.0.en.html" title="General Public License" target="_blank"><img src="https://www.gnu.org/graphics/gplv3-with-text-84x42.png" /></a>