Makefile instead of start.sh + generator

This commit is contained in:
Anthony Axenov 2022-07-04 17:56:45 +08:00
parent 2c37621542
commit ad34d5c64a
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
34 changed files with 255 additions and 81 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.bak

112
Makefile
View File

@ -1,14 +1,112 @@
## droidcam: Install droidcam # Autogenerated at 04.07.2022 17:32 by ./gen-makefile.sh
droidcam:
./install/droidcam.sh
## droidcam-obs: Install droidcam-obs plugin ## apache: Install apache2 (latest)
apache:
./install/apache.sh
## apt: Install bunch of software from apt
apt:
./install/apt.sh
## chrome: Install google chrome (latest)
chrome:
./install/chrome.sh
## composer: Install composer (latest)
composer:
./install/composer.sh
## docker: Install docker (latest) + docker-compose (latest) + ppa
docker:
./install/docker.sh
## droidcam-obs: Install droidcam-obs plugin v1.5.1
droidcam-obs: droidcam-obs:
./install/droidcam-obs.sh ./install/droidcam-obs.sh
#--------------------------------------------------- ## droidcam: Install droidcam v1.8.2
droidcam:
./install/droidcam.sh
## help: This message ## git: Install git (latest)
git:
./install/git.sh
## golang: Install golang v1.18.3
golang:
./install/golang.sh
## grubc: Install grub-customizer (latest) + ppa
grubc:
./install/grubc.sh
## kde-appmenu: Install KDE Window AppMenu Applet
kde-appmenu:
./install/kde-appmenu.sh
## lite-xl: Install lite-xl v2.0.5 (draft)
lite-xl:
./install/lite-xl.sh
## mariadb: Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed)
mariadb:
./install/mariadb.sh
## nodejs: Install nodejs + npm via nvm
nodejs:
./install/nodejs.sh
## pgsql: Install postgresql (latest) and php-pgsql (if php is installed)
pgsql:
./install/pgsql.sh
## php: Install php v8.1 + ppa
php:
./install/php.sh
## postman: Install postman (latest)
postman:
./install/postman.sh
## rustdesk: Install rustdesk v1.1.8 (deb)
rustdesk:
./install/rustdesk.sh
## snap: Install bunch of software from snap
snap:
./install/snap.sh
## syncthing: Install syncthing (latest) + ppa
syncthing:
./install/syncthing.sh
## telebit: Install telebit (latest)
telebit:
./install/telebit.sh
## ulauncher: Install ulauncher (latest) + ppa
ulauncher:
./install/ulauncher.sh
## wine: Installwine (latest) + ppa (focal)
wine:
./install/wine.sh
## zint: Install zint (latest)
zint:
./install/zint.sh
## zsh: Install zsh + omz (latest)
zsh:
./install/zsh.sh
## help: Show this help message
help: Makefile help: Makefile
@echo "Choose a command run:" @echo "Usage:"
@echo "\tmake <goal>\n"
@echo "Available goals:"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e "s/^/\t/" @sed -n 's/^##//p' $< | column -t -s ':' | sed -e "s/^/\t/"
## <goal>_: Same as 'cat ./install/<goal>.sh'
%_:
@cat ./install/$*.sh

View File

@ -1,49 +1,52 @@
# Окружение рабочего стола # My Ubuntu environment
Набор скриптов для развёртывания привычной рабочей среды на Ubuntu. `make`-ready bunch of scripts for easily installation of different software.
## Полная установка ## Prerequisites
Если установлен `git` * `bash`, `zsh` or other `sh`-compatible shell
* `make`
* `git` or `wget`
## Usage
### Clone this repo (recommended)
```shell ```shell
git clone git@git.anthonyaxenov.ru:anthony/my-env.git --depth=1 # if git is installed
git clone git@git.axenov.dev:anthony/my-env.git --depth=1
# if git is not installed
wget -qO - https://git.axenov.dev/anthony/my-env/archive/master.tar.gz | tar -zxf -
# switch to repo dir
cd my-env cd my-env
sudo ./start.sh
# get full list of `make` goals
make help
# generate new ./Makefile and get full list of `make` goals
./gen-makefile.sh
``` ```
Если не установлен `git` ### Selective straightforward installation
```shell ```shell
wget -qO - http://git.anthonyaxenov.ru/anthony/my-env/archive/master.tar.gz | tar -zxf - # from remote file
cd my-env wget -qO - https://git.axenov.dev/anthony/my-env/raw/branch/master/install/apt.sh | bash
sudo ./start.sh
# from locally cloned repo
./install/apt.sh
``` ```
Скрипт `start.sh` обработает все `*.sh`-скрипты из [`/install`](/install) по порядку. ## How to add a new software script here
## Частичная установка 1. Create new `./install/*.sh` script.
At the beggining of a file you must write these two lines:
```shell
#!/bin/bash
##makedesc: Your description for Makefile
```
2. Test your script
3. Run `./gen-makefile.sh` to generate new `./Makefile`
Без полного развёртывания репозитория
```shell
wget -qO - http://git.anthonyaxenov.ru/anthony/my-env/raw/branch/master/install/000-apt.sh | bash
```
После полного развёртывания репозитория (см. полную установку):
```shell
cd my-env
sudo ./install/000-apt.sh
```
## Тема оформления (только MATE)
Также можно установить визуальное оформление:
* тема: [Budgie Desktop Dark Theme](https://www.pling.com/p/1276879)
* икoнки: [Papirus](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/)
* курсоры: [Bridge](https://www.mate-look.org/s/Mate/p/999983/), [Capitaine Cursors](https://www.gnome-look.org/p/1148692/)
```shell
sudo ./theme/install.sh
```

30
gen-makefile.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
mv Makefile Makefile.bak
echo -e "# Autogenerated at $(date +'%d.%m.%Y %H:%M') by ${BASH_SOURCE[0]}\n" > Makefile
for file in ./install/*.sh; do
name=${file##*/}
name=${name%.sh}
desc=$(cat ${file} | sed -n 2p | sed -n 's/^##makedesc: //p')
[ -z "$desc" ] && desc='<no description>'
echo -e "## ${name}: ${desc}\n${name}:\n\t${file}\n" >> Makefile
done;
cat << EOF >> Makefile
## help: Show this help message
help: Makefile
@echo "Usage:"
@echo "\tmake <goal>\n"
@echo "Available goals:"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e "s/^/\t/"
## <goal>_: Same as 'cat ./install/<goal>.sh'
%_:
@cat ./install/\$*.sh
EOF
echo "New ./Makefile has been generated!"
echo "Old one has been saved as ./Makefile.bak"
echo
make help

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
##makedesc: Install apache2 (latest)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing apache2..." echo "Installing apache2..."

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
##makedesc: Install bunch of software from apt
echo echo
echo "===============================================" echo "==============================================="
echo "Installing software from apt..." echo "Installing software from apt..."

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
##makedesc: Install google chrome (latest)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing google chrome (latest)..." echo "Installing google chrome (latest)..."

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install composer (latest)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing composer..." echo "Installing composer (latest)..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install docker (latest) + docker-compose (latest) + ppa
echo echo
echo "===============================================" echo "==============================================="
echo "Installing docker..." echo "Installing docker (latest)..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
##makedesc: Install droidcam-obs plugin v1.5.1
# https://www.dev47apps.com/droidcam/linux/ # https://www.dev47apps.com/droidcam/linux/
# https://www.dev47apps.com/obs/ # https://www.dev47apps.com/obs/
# https://www.dev47apps.com/obs/usage.html # https://www.dev47apps.com/obs/usage.html

View File

@ -1,9 +1,11 @@
#!/bin/bash #!/bin/bash
##makedesc: Install droidcam v1.8.2
# https://www.dev47apps.com/droidcam/linux/ # https://www.dev47apps.com/droidcam/linux/
echo echo
echo "===============================================" echo "==============================================="
echo "Installing droidcam..." echo "Installing droidcam v1.8.2..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
##makedesc: Install git (latest)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing git (latest)..." echo "Installing git (latest)..."
@ -11,7 +13,6 @@ installed() {
ENVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ENVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
! installed make && sudo apt install -y make ! installed make && sudo apt install -y make
! installed curl && sudo apt install -y curl
if installed git; then if installed git; then
sudo rm -rf /usr/src/git sudo rm -rf /usr/src/git
@ -21,6 +22,7 @@ if installed git; then
sudo make prefix=/usr/local all sudo make prefix=/usr/local all
sudo make prefix=/usr/local install sudo make prefix=/usr/local install
else else
! installed wget && sudo apt install -y wget
wget https://github.com/git/git/archive/master.zip -O /tmp/git.zip wget https://github.com/git/git/archive/master.zip -O /tmp/git.zip
sudo unzip -q /tmp/git.zip -d /usr/src/git sudo unzip -q /tmp/git.zip -d /usr/src/git
rm /tmp/git.zip rm /tmp/git.zip
@ -32,6 +34,5 @@ else
sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git
sudo chown -R $USER: /usr/src/git sudo chown -R $USER: /usr/src/git
fi fi
cd -
cp "$ENVDIR"/dotfiles/.gitconfig $HOME/.gitconfig
git --version git --version

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
##makedesc: Install golang v1.18.3
# https://go.dev/dl/ # https://go.dev/dl/
# https://golang.org/doc/install # https://golang.org/doc/install

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install grub-customizer (latest) + ppa
echo echo
echo "===============================================" echo "==============================================="
echo "Installing grub-customizer..." echo "Installing grub-customizer (latest)..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash (latest)
##makedesc: Install KDE Window AppMenu Applet
echo echo
echo "===============================================" echo "==============================================="
echo "Installing KDE Window AppMenu Applet..." echo "Installing KDE Window AppMenu Applet..."

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
##makedesc: Install lite-xl v2.0.5 (draft)
# DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT # DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
# DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT # DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
@ -11,7 +13,7 @@
[ $1 ] && LITEXLVER="$1" || LITEXLVER="2.0.5" [ $1 ] && LITEXLVER="$1" || LITEXLVER="2.0.5"
echo echo
echo "===============================================" echo "==============================================="
echo "Installing lite-xl${LITEXLVER}..." echo "Installing lite-xl v${LITEXLVER}..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing mariadb..." echo "Installing mariadb (latest)..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
##makedesc: Install nodejs + npm via nvm
echo echo
echo "===============================================" echo "==============================================="
echo "Installing nodejs..." echo "Installing nodejs..."

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install postgresql (latest) and php-pgsql (if php is installed)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing postgresql..." echo "Installing postgresql (latest)..."
echo "===============================================" echo "==============================================="
echo echo
@ -11,4 +13,4 @@ installed() {
sudo apt install -y --autoremove postgresql postgresql-contrib sudo apt install -y --autoremove postgresql postgresql-contrib
sudo service postgresql restart sudo service postgresql restart
installed php && sudo apt install -y --autoremove php-pgsql installed 'php' && sudo apt install -y --autoremove php-pgsql

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
PHPVER="8.1" ##makedesc: Install php v8.1 + ppa
[ $1 ] && PHPVER="$1" || PHPVER="8.1"
echo echo
echo "===============================================" echo "==============================================="
echo "Installing php${PHPVER}..." echo "Installing php${PHPVER}..."

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
##makedesc: Install postman (latest)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing postman (latest)..." echo "Installing postman (latest)..."

View File

@ -1,14 +1,16 @@
#!/bin/bash #!/bin/bash
VER="1.1.8" ##makedesc: Install rustdesk v1.1.8 (deb)
[ $1 ] && RDVER="$1" || RDVER="1.1.8"
echo echo
echo "===============================================" echo "==============================================="
echo "Installing rustdesk v${VER}..." echo "Installing rustdesk v${RDVER}..."
echo "===============================================" echo "==============================================="
echo echo
# https://github.com/rustdesk/rustdesk # https://github.com/rustdesk/rustdesk
sudo apt install libxdo3 sudo apt install libxdo3
wget "http://github.com/rustdesk/rustdesk/releases/download/${VER}/rustdesk-${VER}.deb" -qO /tmp/rustdesk.deb wget "http://github.com/rustdesk/rustdesk/releases/download/${RDVER}/rustdesk-${RDVER}.deb" -qO /tmp/rustdesk.deb
sudo dpkg -i /tmp/rustdesk.deb sudo dpkg -i /tmp/rustdesk.deb
rm /tmp/rustdesk.deb rm /tmp/rustdesk.deb

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install bunch of software from snap
echo echo
echo "===============================================" echo "==============================================="
echo "Installing snap and its software..." echo "Installing software from snap..."
echo "===============================================" echo "==============================================="
echo echo
@ -19,22 +21,22 @@ if ! installed snapd; then
sudo apt install -y --autoremove snapd gnome-software-plugin-snap sudo apt install -y --autoremove snapd gnome-software-plugin-snap
fi fi
snapi snap-store # snapi snap-store
snapi telegram-desktop snapi telegram-desktop
snapi code snapi code
snapi phpstorm # snapi phpstorm
snapi skype snapi skype
snapi audacity # snapi audacity
snapi flameshot # snapi flameshot
snapi gtk-common-themes # snapi gtk-common-themes
snapi gtk2-common-themes # snapi gtk2-common-themes
snapi kde-frameworks-5-core18 # snapi kde-frameworks-5-core18
snapi zoom-client snapi zoom-client
snapi peek snapi peek
# https://certbot.eff.org/ # https://certbot.eff.org/
snapi certbot # snapi certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot # sudo ln -s /snap/bin/certbot /usr/bin/certbot
# snapi mysql-workbench-community # snapi mysql-workbench-community
# snapi dbeaver-ce # snapi dbeaver-ce

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install syncthing (latest) + ppa
echo echo
echo "===============================================" echo "==============================================="
echo "Installing syncthing..." echo "Installing syncthing (latest) + ppa..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install telebit (latest)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing telebit..." echo "Installing telebit (latest)..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install ulauncher (latest) + ppa
echo echo
echo "===============================================" echo "==============================================="
echo "Installing ulauncher..." echo "Installing ulauncher (latest) + ppa..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Installwine (latest) + ppa (focal)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing wine..." echo "Installing wine (latest)..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install zint (latest)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing zint..." echo "Installing zint (latest)..."
echo "===============================================" echo "==============================================="
echo echo
@ -14,7 +16,7 @@ sudo apt install -y --autoremove \
if installed git; then if installed git; then
# 2.9.* =============================================================================== # 2.9.* ===============================================================================
sudo git clone git://git.code.sf.net/p/zint/code /usr/src/zint sudo git clone git@github.com:zint/zint.git /usr/src/zint
cd /usr/src/zint cd /usr/src/zint
sudo cmake . sudo cmake .
sudo make sudo make

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
##makedesc: Install zsh + omz (latest)
echo echo
echo "===============================================" echo "==============================================="
echo "Installing zsh + oh-my-zsh" echo "Installing zsh + omz (latest)..."
echo "===============================================" echo "==============================================="
echo echo

View File

@ -1,6 +0,0 @@
#!/bin/bash
set -e
for script in "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/install/*.sh
do
. "$script"
done