Removed .sh from names, packs support

This commit is contained in:
Anthony Axenov 2022-07-04 19:34:00 +08:00
parent 4a71dd0ae8
commit e9cd7ee2ae
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
29 changed files with 68 additions and 34 deletions

View File

@ -1,112 +1,119 @@
# Autogenerated at 04.07.2022 19:08 using ./gen-makefile.sh # Autogenerated at 04.07.2022 19:25 using ./gen-makefile.sh
## apache: Install apache2 (latest) ##lamp: Apache + php + mariadb
lamp: apache php mariadb
##apache: Install apache2 (latest)
apache: apache:
./install/apache.sh ./install/apache
## apt: Install bunch of software from apt ##apt: Install bunch of software from apt
apt: apt:
./install/apt.sh ./install/apt.sh
## chrome: Install google chrome (latest) ##chrome: Install google chrome (latest)
chrome: chrome:
./install/chrome.sh ./install/chrome.sh
## composer: Install composer (latest) ##composer: Install composer (latest)
composer: composer:
./install/composer.sh ./install/composer.sh
## docker: Install docker (latest) + docker-compose (latest) + ppa ##docker: Install docker (latest) + docker-compose (latest) + ppa
docker: docker:
./install/docker.sh ./install/docker.sh
## droidcam-obs: Install droidcam-obs plugin v1.5.1 ##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 v1.8.2
droidcam: droidcam:
./install/droidcam.sh ./install/droidcam.sh
## git: Install git (latest) ##git: Install git (latest)
git: git:
./install/git.sh ./install/git.sh
## golang: Install golang v1.18.3 ##golang: Install golang v1.18.3
golang: golang:
./install/golang.sh ./install/golang.sh
## grubc: Install grub-customizer (latest) + ppa ##grubc: Install grub-customizer (latest) + ppa
grubc: grubc:
./install/grubc.sh ./install/grubc.sh
## kde-appmenu: Install KDE Window AppMenu Applet ##kde-appmenu: Install KDE Window AppMenu Applet
kde-appmenu: kde-appmenu:
./install/kde-appmenu.sh ./install/kde-appmenu.sh
## lite-xl: Install lite-xl v2.0.5 (draft) ##lite-xl: Install lite-xl v2.0.5 (draft)
lite-xl: lite-xl:
./install/lite-xl.sh ./install/lite-xl.sh
## mariadb: Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed) ##mariadb: Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed)
mariadb: mariadb:
./install/mariadb.sh ./install/mariadb.sh
## nodejs: Install nodejs + npm via nvm ##nodejs: Install nodejs + npm via nvm
nodejs: nodejs:
./install/nodejs.sh ./install/nodejs.sh
## pgsql: Install postgresql (latest) and php-pgsql (if php is installed) ##pgsql: Install postgresql (latest) and php-pgsql (if php is installed)
pgsql: pgsql:
./install/pgsql.sh ./install/pgsql.sh
## php: Install php v8.1 + ppa ##php: Install php v8.1 + ppa
php: php:
./install/php.sh ./install/php.sh
## postman: Install postman (latest) ##postman: Install postman (latest)
postman: postman:
./install/postman.sh ./install/postman.sh
## rustdesk: Install rustdesk v1.1.8 (deb) ##rustdesk: Install rustdesk v1.1.8 (deb)
rustdesk: rustdesk:
./install/rustdesk.sh ./install/rustdesk.sh
## snap: Install bunch of software from snap ##snap: Install bunch of software from snap
snap: snap:
./install/snap.sh ./install/snap.sh
## syncthing: Install syncthing (latest) + ppa ##syncthing: Install syncthing (latest) + ppa
syncthing: syncthing:
./install/syncthing.sh ./install/syncthing.sh
## telebit: Install telebit (latest) ##telebit: Install telebit (latest)
telebit: telebit:
./install/telebit.sh ./install/telebit.sh
## ulauncher: Install ulauncher (latest) + ppa ##todo: <no description>
todo:
./install/todo
##ulauncher: Install ulauncher (latest) + ppa
ulauncher: ulauncher:
./install/ulauncher.sh ./install/ulauncher.sh
## wine: Installwine (latest) + ppa (focal) ##wine: Installwine (latest) + ppa (focal)
wine: wine:
./install/wine.sh ./install/wine.sh
## zint: Install zint (latest) ##zint: Install zint (latest)
zint: zint:
./install/zint.sh ./install/zint.sh
## zsh: Install zsh + omz (latest) ##zsh: Install zsh + omz (latest)
zsh: zsh:
./install/zsh.sh ./install/zsh.sh
## help: Show this help message ##help: Show this help message
help: Makefile help: Makefile
@echo "Usage:" @echo "Usage:"
@echo "\tmake <goal>\n" @echo "\tmake <goal>\n"
@echo "Available goals:" @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' ##<goal>_: Same as 'cat ./install/<goal>.sh'
%_: %_:
@cat ./install/$*.sh @cat ./install/$*.sh

View File

@ -39,7 +39,7 @@ wget -qO - https://git.axenov.dev/anthony/my-env/raw/branch/master/install/apt.s
./install/apt.sh ./install/apt.sh
``` ```
## How to add a new software script here ## How to add a new software script?
1. Create new `./install/*.sh` script. 1. Create new `./install/*.sh` script.
At the beggining of a file you must write these two lines: At the beggining of a file you must write these two lines:
@ -50,3 +50,24 @@ wget -qO - https://git.axenov.dev/anthony/my-env/raw/branch/master/install/apt.s
2. Test your script 2. Test your script
3. Run `./gen-makefile.sh` to generate new `./Makefile` 3. Run `./gen-makefile.sh` to generate new `./Makefile`
## How to create packs?
You can create new file inside `./packs` dir.
Syntax is same as classic makefile with one important and necessary addition -- a comment started with `##`:
```makefile
##mypack1: Pack description
mypack1: goal1 goal2 goalX ...
...
##mypackX: Pack description
mypackY: goalA goalB
@cp file1 file2
...
...
```
where:
* `mypack*` is the pack name
* `goal*` are script names in `./install`

View File

@ -2,23 +2,27 @@
mv Makefile Makefile.bak mv Makefile Makefile.bak
echo -e "# Autogenerated at $(date +'%d.%m.%Y %H:%M') using ${BASH_SOURCE[0]}\n" > Makefile echo -e "# Autogenerated at $(date +'%d.%m.%Y %H:%M') using ${BASH_SOURCE[0]}\n" > Makefile
for file in ./install/*.sh; do for file in ./packs/*; do
cat ${file} >> Makefile
done;
for file in ./install/*; do
name=${file##*/} name=${file##*/}
name=${name%.sh} name=${name%.sh}
desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file}) desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file})
[ -z "$desc" ] && desc='<no description>' [ -z "$desc" ] && desc='<no description>'
echo -e "## ${name}: ${desc}\n${name}:\n\t${file}\n" >> Makefile echo -e "##${name}: ${desc}\n${name}:\n\t${file}\n" >> Makefile
done; done;
cat << EOF >> Makefile cat << EOF >> Makefile
## help: Show this help message ##help: Show this help message
help: Makefile help: Makefile
@echo "Usage:" @echo "Usage:"
@echo "\tmake <goal>\n" @echo "\tmake <goal>\n"
@echo "Available goals:" @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' ##<goal>_: Same as 'cat ./install/<goal>.sh'
%_: %_:
@cat ./install/\$*.sh @cat ./install/\$*.sh
EOF EOF

2
packs/lamp.makefile Normal file
View File

@ -0,0 +1,2 @@
##lamp: Apache + php + mariadb
lamp: apache php mariadb