dot software
build & install software locally with dotsoftware
Quick start | Usage | Installation | Software list | Folder structure | Packaging software
Quick start
For the impatient, just copy and paste the following lines in your bash prompt
# get latest .software
cd
git clone https://github.com/fibo/.software.git
# source it in your profile and in current session
[ -f ~/.bash_profile ] && grep 'source ~/.software/etc/profile' ~/.bash_profile || echo 'source ~/.software/etc/profile' >> ~/.bash_profile && source ~/.software/etc/profile
# you are done!
Give it a try, launch
$ .software_install Golang
Motivation
Why install software locally?
If you have root rights or sudo with a package manager, don’t use me!.
But, sometimes you are in one of the following scenarios
- your host is too old, without vendor support
- you have not root rights, and you need to keep your software up to date
- you want to compile from sources you trust
- you want to try new releases without waiting until they are packaged
- you are a nerd
- you are a nerd, and it is Saturday night
- ok, seriously: you are a nerd and you want to try a new software, avoiding to mess with your system binaries
Usage
.software has only one feature: installing software locally!
It is implemented by a bash function named .software_install
that takes the software want to install as argument.
For example
.software_install Foo
Optionally, a custom version number can be passed as a second argument
.software_install Foo 2.3.4
Typing .software_install in your bash prompt, and hitting TAB will autocomplete with available software. Take a look to Software list, which includes Perl, Node, Golang, Ruby among others.
Installation
Requirements
Please note that .software supports Linux and OS X, but could work on other Unix-like systems, like BSD. In order to run, .software requires bash, Tar, Gzip, Grep, Findutils and Wget. Other requirements are those needed by software builds: Make, gcc, etc.
Get it
Just go to your home directory and clone this repository.
cd
git clone https://github.com/fibo/.software.git
If you don’t have git installed you can try the following commands
cd
wget --no-check-certificate https://github.com/fibo/.software/archive/master.zip
unzip master
mv .software-master .software
rm master
Set your environment
The following command will add source ~/.software/etc/profile
to your .bash_profile only once and load .software features in your current session.
$ [ -f ~/.bash_profile ] && grep 'source ~/.software/etc/profile' ~/.bash_profile || echo 'source ~/.software/etc/profile' >> ~/.bash_profile && source ~/.software/etc/profile
Otherwise you can add manually these lines to your .bash_profile. Note that if you are using .software from a graphical environment rather than a remote server login shell, you should edit .bashrc file instead.
##########################
### .software config start
# Set .software target dir, defaults to "~/.software".
# export DOTSOFTWARE_ROOT_DIR=/path/to/your/software/installation/dir
# Init .software
source ~/.software/etc/profile
### .software config end
########################
DOTSOFTWARE_ROOT_DIR
.software uses enviroment variable DOTSOFTWARE_ROOT_DIR
to know the dir where all your software will be installed.
It defaults to ~/.software.
You maybe want to edit it when
- you have not enough space in your home directory.
- you want to install in a directory common to many users like /usr/local or /opt.
Note that .software by default do not download sources if they are already in folder $DOTSOFTWARE_ROOT_DIR/src. This information can be useful when you need to install software without an Internet connection.
Instead of setting a DOTSOFTWARE_ROOT_DIR
variable, another choice is to create a symbolic link from your /dotsoftware/root/dir to ~/.software/ dir.
Software list
Autoconf
Build not supported.
Install it with a package manager:
# apt-get install autoconf
ctags
version 5.8
Build depends on:
cURL
version 7.53.1
In order to support POST
via https, it is builded --with-ssl
configure flag.
Build depends on:
Dos2Unix
version 7.1
Build depends on:
Expat
version 2.1.0
Build depends on:
Expect
version 5.45
Build depends on:
Findutils
version 4.4.2
It is a .software dependency.
Install it with a package manager:
# apt-get install findutils
Build depends on:
g++
Build not supported.
Install it with a package manager:
# apt-get install g++
gcc
Build not supported.
Install it with a package manager:
# apt-get install gcc
Gettext
Build not supported.
Install it with a package manager:
# apt-get install gettext
Git
version 2.8.2
Build depends on:
git-extras
version 2.2.0
Build depends on:
Golang
version 1.9.1
Golang needs environment variables
GOROOT
which is set to$DOTSOFTWARE_ROOT_DIR/opt/golang
.GOPATH
which should be set by user, for instance$HOME/Golang
.GOBIN
which should be set by user, for instance$GOPATH/bin
, and added toPATH
.
Graphviz
version 2.38.0
Build depends on:
Grep
version 2.21
It is a .software dependency.
Install it with a package manager:
# apt-get install grep
Build depends on:
Gzip
version 1.6
Install it with a package manager:
# apt-get install gzip
Build depends on:
Lua
version 5.3.0
Build depends on:
libxml2
version 2.9.0
Build depends on:
Make
version 3.82
Install it with a package manager:
# apt-get install make
Build depends on:
Netcat
version 0.7.1
Build depends on:
Node
version 8.9.3
Node version above is latest LTS / Stable.
Build depends on:
OpenSSL
Build not supported.
Install it with a package manager:
# apt-get install openssl libssl-dev
# yum install openssl-devel
Readline
Build not supported.
Install it with a package manager:
# apt-get install libreadline-dev
# yum install readline-devel
Squid
version 3.5.11
Build depends on:
patch
version 2.7
Build depends on:
Perl
version 5.20.3
Build depends on:
Python
version 2.7.9
Build depends on:
PostgreSQL
version 9.4.5
Build depends on:
Install requirements with a package manager:
# apt-get install make gcc libreadline-dev zlib1g-dev
Variable PGDATA
defines the directory where PostgreSQL stores data and configuration.
It defaults to $DOTSOFTWARE_ROOT_DIR/opt/pgsql/data
.
On build, commands initdb
and createdb
are launched: this means that
database instance is initialized and a database named as your unix user is created.
Set variable PGDATABASE
in your environment to customize database name.
Common actions are:
- Stop database:
stop_postresql
- Start database:
start_postgresql
- Connect to database:
psql
- Reload configuration:
pg_ctl reload
Configuration files can be found in $PGDATA
directory.
For example, to enable connections to all users and databases from
IP 10.20.30.40, to a PostgreSQL instance running on an host with an IP 1.2.3.4,
edit $PGDATA/postgresql.conf
listen_addresses = '1.2.3.4'
and $PGDATA/pg_hba.conf
host all all 10.20.30.40/32 trust
then launch
pg_ctl reload
To build a Amazon Redshift compatible version launch
.software_install PostgreSQL 8.0.2
Redis
version 3.2.8
Build depends on:
rsync
version 3.1.2
Build depends on:
Ruby
version 2.3.1
Build depends on:
Here version may be not the latest cause it is (manually) up to date with GitHub Pages Dependency versions. However you can install another version, for example with
.software_install Ruby 2.1.7
sed
version 4.2.2
Build depends on:
Tar
version latest
It is a .software dependency.
Install it with a package manager:
# apt-get install tar
Build depends on:
Tcl
version 8.6.4
Build depends on:
Wget
version 1.18
It is a .software dependency.
Install it with a package manager:
# apt-get install wget
Build depends on:
xz
version 5.0.5
Build depends on:
zlib
version 1.2.8
Build depends on:
Install it with a package manager:
# apt-get install zlib1g-dev
# yum install zlib-devel
Folder structure
~/.software/etc/installrc.d/
Software Foo has its homonym file in folder ~/.software/etc/installrc.d.
It defines environment variables needed for installation. It must contain at least SOURCES_URI
.
For example, Wget file contains
SOURCES_URI=http://ftp.gnu.org/gnu/wget/wget-${VERSION}.tar.gz
It can also be used to override functions used by .software_install, which are
- get_sources
- read_sources_filename
- read_current_version_dir
- extract
- build
For example, Perl file contains
SOURCES_URI=http://www.cpan.org/src/5.0/perl-${VERSION}.tar.gz
function _build() {
cd $CURRENT_VERSION_DIR
./Configure -des \
-Dprefix=$DOTSOFTWARE_ROOT_DIR \
-Dscriptdir=$DOTSOFTWARE_ROOT_DIR/bin \
&& make test \
&& make install
}
~/.software/etc/profile
Implements the .software_install function.
~/.software/etc/profile.d/
Contains profile files for every software, where needed.
~/.software/README.md
This file, contains also software versions. Every software must have an homonym section in this file where version number is in the second row, like this
### [Foo](http://url-of-foo-homepage.xxx)
> version 1.2.3
Packaging software
.software installs software locally downloading and compiling sources. This process can be time and cpu consuming, so, if you have two or more similar machines is not that difficult to build only once, then package your result and installing it on other hosts. The requirement are
- The hosts has the same system software (OS, kernel, etc) and environment.
- The variable DOTSOFTWARE_ROOT_DIR has the same value on every host. Note that, using default value implies that users has the same name.
If you are using default .software configuration you could launch
$ cd
$ tar czf dotsoftware.tar.gz .software/
$ scp dotsoftware.tar.gz host1.example.com:~
$ ssh host1.example.com tar xzf dotsoftware.tar.gz
$ ssh host1.example.com rm dotsoftware.tar.gz