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

pyfourmond's avatar
pyfourmond committed
3
## 1. Introduction
pyfourmond's avatar
pyfourmond committed
4

5
**L**inux **I**nstaller for **AR**chives a.k.a **liar** is a simple command to
pyfourmond's avatar
pyfourmond committed
6
install software packaged as an archive on Linux systems.
pyfourmond's avatar
pyfourmond committed
7

pyfourmond's avatar
pyfourmond committed
8
Nowadays more and more software and tools are delivered as a tarball or
9 10 11
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 need.
pyfourmond's avatar
pyfourmond committed
12

pyfourmond's avatar
pyfourmond committed
13 14
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
pyfourmond's avatar
pyfourmond committed
15
several versions of the same software on the same machine.
pyfourmond's avatar
pyfourmond committed
16

17 18 19 20
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

pyfourmond's avatar
pyfourmond committed
22
It needs very few dependencies, see [Dependencies] (#5-dependencies) section
pyfourmond's avatar
pyfourmond committed
23
for details.
pyfourmond's avatar
pyfourmond committed
24

pyfourmond's avatar
pyfourmond committed
25 26 27
liar is developed and tested on [Debian GNU/Linux] (https://www.debian.org)
version 7.11 using **dash** version 0.5.7-3.

pyfourmond's avatar
pyfourmond committed
28

pyfourmond's avatar
pyfourmond committed
29
## 2. Installation
pyfourmond's avatar
pyfourmond committed
30

31 32
### 2.1. Basic installation

pyfourmond's avatar
pyfourmond committed
33 34 35
    $ sudo curl \
        -L https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar \
        -o /usr/local/bin/liar
36 37 38

or you can also use wget:

pyfourmond's avatar
pyfourmond committed
39 40 41
    $ sudo wget \
        https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar \
        -O /usr/local/bin/liar
42 43 44 45

Then:

    $ sudo chmod a+rx /usr/local/bin/liar
pyfourmond's avatar
pyfourmond committed
46

47 48
### 2.2. Bash completion installation

49
liar supports Bash command line completion for both options and commands.
50 51 52 53 54 55 56 57 58 59 60 61 62

To use it, enter the following commands:

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

or you can also use wget:

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

pyfourmond's avatar
pyfourmond committed
63

pyfourmond's avatar
pyfourmond committed
64 65
## 3. Sample use

66
### 3.1. Installing a JDK in the default destination folder
pyfourmond's avatar
pyfourmond committed
67

68 69 70
    $ liar install jdk8 ~/Downloads/jdk-8u101-linux-x64.tar.gz
    Installing 'jdk8' from '/home/user/Downloads/jdk-8u101-linux-x64.tar.gz' to '/home/user/Programs/jdk8'
    Extracting '/home/user/Downloads/jdk-8u101-linux-x64.tar.gz' to '/home/user/Programs/jdk8'
pyfourmond's avatar
pyfourmond committed
71

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
72 73
The JDK has been installed in `$HOME/Programs`, which is the default destination folder.

74
### 3.2. Installing Sublime Text in another destination folder
pyfourmond's avatar
pyfourmond committed
75

76 77 78
    $ liar -d ~/Extras install sublime ~/Downloads/sublime_text_3_build_3114_x64.tar.bz2 
    Installing 'sublime' from '/home/user/Downloads/sublime_text_3_build_3114_x64.tar.bz2' to '/home/user/Extras/sublime'
    Extracting '/home/user/Downloads/sublime_text_3_build_3114_x64.tar.bz2' to '/home/user/Extras/sublime'
pyfourmond's avatar
pyfourmond committed
79

80
### 3.3. Installing Robomongo with symbolic links created
pyfourmond's avatar
pyfourmond committed
81

82 83 84 85 86
    $ liar -l install robomongo ~/Downloads/robomongo-0.9.0-rc10-linux-x86_64-33c89ea.tar.gz 
    Installing 'robomongo' from '/home/user/Downloads/robomongo-0.9.0-rc10-linux-x86_64-33c89ea.tar.gz' to '/home/user/Programs/robomongo'
    Extracting '/home/user/Downloads/robomongo-0.9.0-rc10-linux-x86_64-33c89ea.tar.gz' to '/home/user/Programs/robomongo'
    Creating link: '/home/user/bin/robomongo'

pyfourmond's avatar
pyfourmond committed
87
### 3.4. Installing Maven
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102

    $ liar -l install maven ~/Downloads/apache-maven-3.3.9-bin.tar.gz
    Installing 'maven' from '/home/user/Downloads/apache-maven-3.3.9-bin.tar.gz' to '/home/user/Programs/maven'
    Extracting '/home/user/Downloads/apache-maven-3.3.9-bin.tar.gz' to '/home/user/Programs/maven'
    Creating link: '/home/user/bin/mvnyjp'
    Creating link: '/home/user/bin/mvnDebug'
    Creating link: '/home/user/bin/mvn'

or to restrict with files are symlinked:

    $ liar -l -p mvn install maven ~/Downloads/apache-maven-3.3.9-bin.tar.gz
    Installing 'maven' from '/home/user/Downloads/apache-maven-3.3.9-bin.tar.gz' to '/home/user/Programs/maven'
    Extracting '/home/user/Downloads/apache-maven-3.3.9-bin.tar.gz' to '/home/user/Programs/maven'
    Creating link: '/home/user/bin/mvn'

pyfourmond's avatar
pyfourmond committed
103 104 105 106 107 108 109 110
### 3.5. Installing Tor Browser

    $ liar -l -p start-tor-browser install torbrowser ~/Downloads/tor-browser-linux64-6.0.5_fr.tar.xz 
    Installing 'torbrowser' from '/home/user/Downloads/tor-browser-linux64-6.0.5_fr.tar.xz' to '/home/user/Programs/torbrowser'
    Extracting '/home/user/Downloads/tor-browser-linux64-6.0.5_fr.tar.xz' to '/home/user/Programs/torbrowser'
    Creating link: '/home/user/bin/start-tor-browser'

### 3.6. Installing a software while being root
111 112 113 114 115 116 117 118 119 120 121

    $ sudo liar install maven /home/user/Downloads/apache-maven-3.3.9-bin.tar.gz
    liar cannot be run as root

Adding '-r' option:

    $ sudo liar -r install maven /home/user/Downloads/apache-maven-3.3.9-bin.tar.gz
    Allowing root usage
    Installing 'maven' from '/home/user/Downloads/apache-maven-3.3.9-bin.tar.gz' to '/root/Programs/maven'
    Extracting '/home/user/Downloads/apache-maven-3.3.9-bin.tar.gz' to '/root/Programs/maven'

pyfourmond's avatar
pyfourmond committed
122
### 3.7. List what you have installed
123 124 125

    $ liar list
    Listing installed software in '/home/user/Programs'
126 127 128 129
    jdk8: jdk1.8.0_101 installed samedi 10 septembre 2016, 09:21:28 (UTC+0200) from jdk-8u101-linux-x64.tar.gz
    maven: apache-maven-3.3.9 installed samedi 10 septembre 2016, 08:59:15 (UTC+0200) from apache-maven-3.3.9-bin.tar.gz
    sublime: sublime_text_3 installed jeudi 8 septembre 2016, 20:01:28 (UTC+0200) from sublime_text_3_build_3114_x64.tar.bz2
    torbrowser: tor-browser_fr installed samedi 8 octobre 2016, 07:53:26 (UTC+0200) from tor-browser-linux64-6.0.5_fr.tar.xz
130

pyfourmond's avatar
pyfourmond committed
131
### 3.8. Removing previously installed software
132 133 134 135

    $ liar remove sublime
    Removing 'sublime' installed in '/home/user/Programs/sublime'
    Do you want to remove 'sublime' installed in '/home/user/Programs/sublime' (Y/N) ? Y
pyfourmond's avatar
pyfourmond committed
136

pyfourmond's avatar
pyfourmond committed
137 138 139 140 141 142 143 144 145 146 147 148 149

## 4. Documentation

This section describes how liar works with its options and parameters.

### 4.1. Options and parameters

Options are:

- DESTINATION folder
- create symbolic links
    - folder for SYMBOLIC links creation
    - file PATTERN for SYMBOLIC links
150
- VERBOSE mode
pyfourmond's avatar
pyfourmond committed
151 152 153 154 155 156 157 158 159 160 161
- ROOT usage

Parameters are:

- software NAME
- archive FILE_PATH

### 4.2. Destination folder

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
162

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

pyfourmond's avatar
pyfourmond committed
165
### 4.3. Name
pyfourmond's avatar
pyfourmond committed
166

167 168
When installing a software liar needs two mandatory parameters, the NAME and the
FILE_PATH.
pyfourmond's avatar
pyfourmond committed
169

pyfourmond's avatar
pyfourmond committed
170 171
NAME is used to create a sub-folder in the DESTINATION folder in order to
install the desired software.
pyfourmond's avatar
pyfourmond committed
172 173 174

This NAME is also mandatory when removing a software.

pyfourmond's avatar
pyfourmond committed
175
### 4.4. File path
pyfourmond's avatar
pyfourmond committed
176 177

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

pyfourmond's avatar
pyfourmond committed
179
### 4.5. Symbolic links creation
pyfourmond's avatar
pyfourmond committed
180

181 182 183
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
184

185 186 187
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.
pyfourmond's avatar
pyfourmond committed
188

189 190
The folder for SYMBOLIC links creation is optional and has the following default
values:
pyfourmond's avatar
pyfourmond committed
191

pyfourmond's avatar
pyfourmond committed
192 193
- `/usr/local/bin` for root installation
- `$HOME/bin` otherwise
pyfourmond's avatar
pyfourmond committed
194

195 196 197 198 199 200
### 4.6. Verbose mode

When option `-v` is set, verbose mode is activated. In this mode, some commands
display more detailed output when executed.

### 4.7. Root usage
pyfourmond's avatar
pyfourmond committed
201 202

By default liar will not let you install software when logged as root. To allow
pyfourmond's avatar
pyfourmond committed
203
root usage `-r` option should be used.
pyfourmond's avatar
pyfourmond committed
204

205
### 4.8. Getting help
pyfourmond's avatar
pyfourmond committed
206 207

To get help and examples of liar usage, simply enter:
pyfourmond's avatar
pyfourmond committed
208 209 210

    $ liar help

pyfourmond's avatar
pyfourmond committed
211

pyfourmond's avatar
pyfourmond committed
212
## 5. Dependencies
pyfourmond's avatar
pyfourmond committed
213

pyfourmond's avatar
pyfourmond committed
214
liar requires nothing more than a Bourne Shell i.e. **sh** or compatible one
pyfourmond's avatar
pyfourmond committed
215
with the following packages installed: **coreutils**, **findutils** and **tar**.
pyfourmond's avatar
pyfourmond committed
216 217 218

Additionally **unzip** and **compress** commands are required when using the
respective formats **.zip** and **.tar.Z**.
pyfourmond's avatar
pyfourmond committed
219 220


pyfourmond's avatar
pyfourmond committed
221
## 6. License
pyfourmond's avatar
pyfourmond committed
222

pyfourmond's avatar
pyfourmond committed
223
liar is released under the [GNU GENERAL PUBLIC LICENSE Version 3]
pyfourmond's avatar
pyfourmond committed
224
(https://www.gnu.org/licenses/gpl-3.0.en.html).
pyfourmond's avatar
pyfourmond committed
225 226

Written by: Pierre-Yves Fourmond aka 'grumpyf0x48'.