Descriptions parsing improved

This commit is contained in:
Anthony Axenov 2022-08-25 22:33:02 +08:00
parent 7185a3cf7f
commit c1150af922
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
7 changed files with 58 additions and 54 deletions

View File

@ -1,20 +1,20 @@
# Autogenerated at 22.08.2022 19:06 using ./gen-makefile # Autogenerated at 25.08.2022 22:32 using ./gen-makefile
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
#=============================================== #===============================================
# Scripts listed in ./packs # Scripts listed in ./packs
#=============================================== #===============================================
##composer: [PACK] php + composer # [PACK] php + composer
composer: php composer-clean composer: php composer-clean
##flameshot: [TODO] [PACK] qt5 + flameshot from source # [TODO] [PACK] qt5 + flameshot from source
flameshot: qt5 flameshot-build flameshot: qt5 flameshot-build
##lamp: [PACK] Apache + php + mariadb # [PACK] Apache + php + mariadb
lamp: apache php mariadb lamp: apache php mariadb
##omz: [PACK] zsh + omz + powerline10k + MesloLGS font # [PACK] zsh + omz + powerline10k + MesloLGS font
omz: zsh omz-clean omz-fancy omz: zsh omz-clean omz-fancy
chsh -s /usr/bin/zsh chsh -s /usr/bin/zsh
@exec zsh @exec zsh
@ -23,158 +23,160 @@ omz: zsh omz-clean omz-fancy
# Scripts listed in ./install # Scripts listed in ./install
#=============================================== #===============================================
##apache: Install apache2 (latest) # Install apache2 (latest)
apache: apache:
@./install/apache @./install/apache
##apt: Install bunch of software from apt # Install bunch of software from apt
apt: apt:
@./install/apt @./install/apt
##canon-mg2500: Install Canon Pixma MG2500 + ppa # Install Canon Pixma MG2500 + ppa
canon-mg2500: canon-mg2500:
@./install/canon-mg2500 @./install/canon-mg2500
##chrome: Install google chrome (latest) # Install google chrome (latest)
chrome: chrome:
@./install/chrome @./install/chrome
##composer-clean: Install composer (latest) # Install composer (latest)
composer-clean: composer-clean:
@./install/composer-clean @./install/composer-clean
##docker: Install docker (latest) + docker-compose (latest) + ppa # Install docker (latest) + docker-compose (latest) + ppa
docker: docker:
@./install/docker @./install/docker
##droidcam: Install droidcam v1.8.2 # Install droidcam v1.8.2
droidcam: droidcam:
@./install/droidcam @./install/droidcam
##droidcam-obs: Install droidcam-obs plugin v1.5.1 # Install droidcam-obs plugin v1.5.1
droidcam-obs: droidcam-obs:
@./install/droidcam-obs @./install/droidcam-obs
##file-templates-kde: Install file templates (KDE) # Install file templates (KDE)
file-templates-kde: file-templates-kde:
@./install/file-templates-kde @./install/file-templates-kde
##flameshot-build: [TODO] Build flameshot from src (latest) # [TODO] Build flameshot from src (latest)
flameshot-build: flameshot-build:
@./install/flameshot-build @./install/flameshot-build
##git: Install git (latest) # Install git (latest)
git: git:
@./install/git @./install/git
##golang: Install golang v1.18.3 # Install golang v1.18.3
golang: golang:
@./install/golang @./install/golang
##grubc: Install grub-customizer (latest) + ppa # Install grub-customizer (latest) + ppa
grubc: grubc:
@./install/grubc @./install/grubc
##kde-appmenu: Install KDE Window AppMenu Applet # Install KDE Window AppMenu Applet
kde-appmenu: kde-appmenu:
@./install/kde-appmenu @./install/kde-appmenu
##libreoffice: Install libreoffice # Install libreoffice
libreoffice: libreoffice:
@./install/libreoffice @./install/libreoffice
##lite-xl: Install lite-xl v2.0.5 (draft) # Install lite-xl v2.0.5 (draft)
lite-xl: lite-xl:
@./install/lite-xl @./install/lite-xl
##mariadb: Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed) # Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed)
mariadb: mariadb:
@./install/mariadb @./install/mariadb
##nodejs: Install nodejs + npm via nvm # Install nodejs + npm via nvm
nodejs: nodejs:
@./install/nodejs @./install/nodejs
##ntfy: Install ntfy (latest) + ppa # Install ntfy (latest) + ppa
ntfy: ntfy:
@./install/ntfy @./install/ntfy
##omz-clean: Install omz (latest) # Install omz (latest)
omz-clean: omz-clean:
@./install/omz-clean @./install/omz-clean
##omz-fancy: Install omz fancy (powerline10k + MesloLGS font) # Install omz fancy (powerline10k + MesloLGS font)
omz-fancy: omz-fancy:
@./install/omz-fancy @./install/omz-fancy
##papirus: Install papirus-icon-theme (latest) # Install papirus-icon-theme (latest)
papirus: papirus:
@./install/papirus @./install/papirus
##pgsql: Install postgresql (latest) and php-pgsql (if php is installed) # Install postgresql (latest) and php-pgsql (if php is installed)
pgsql: pgsql:
@./install/pgsql @./install/pgsql
##php: Install php v8.1 + ppa # Install php v8.1 + ppa
php: php:
@./install/php @./install/php
##postman: Install postman (latest) # Install postman (latest)
postman: postman:
@./install/postman @./install/postman
##qt5: Install qt5 # Install qt5
qt5: qt5:
@./install/qt5 @./install/qt5
##rustdesk: Install rustdesk client v1.1.9 (deb) # Install rustdesk client v1.1.9 (deb)
rustdesk: rustdesk:
@./install/rustdesk @./install/rustdesk
##snap: Install bunch of software from snap # Install bunch of software from snap
snap: snap:
@./install/snap @./install/snap
##syncthing: Install syncthing (latest) + ppa # Install syncthing (latest) + ppa
syncthing: syncthing:
@./install/syncthing @./install/syncthing
##telebit: Install telebit (latest) # Install telebit (latest)
telebit: telebit:
@./install/telebit @./install/telebit
##ulauncher: Install ulauncher (latest) + ppa # Install ulauncher (latest) + ppa
ulauncher: ulauncher:
@./install/ulauncher @./install/ulauncher
##wine: Install wine (latest) + ppa (focal) # Install wine (latest) + ppa (focal)
wine: wine:
@./install/wine @./install/wine
##zint: Install zint (latest) # Install zint (latest)
zint: zint:
@./install/zint @./install/zint
##zsh: Install vanilla zsh # Install vanilla zsh
zsh: zsh:
@./install/zsh @./install/zsh
self: self:
@./gen-makefile @./gen-makefile
help: Makefile help: Makefile
@echo "Ubuntu software installator" @echo "Ubuntu software installator"
@echo @echo
@echo "Usage:" @echo "Usage:"
@echo "\tmake help\t - Show this help" @echo "\tmake help\t - Show this help"
@echo "\tmake GOAL\t - Install software" @echo "\tmake self\t - Regenerate Makefile (alias of ./gen-makefile)"
@echo "\tmake GOAL\t - Install software"
@echo "\tmake ^GOAL\t - Upgrade software" @echo "\tmake ^GOAL\t - Upgrade software"
@echo "\tmake @GOAL\t - Uninstall software" @echo "\tmake @GOAL\t - Uninstall software"
@echo @echo
@echo "You can combine GOALs, e.g. 'make @docker docker' will reinstall docker." @echo "You can combine GOALs, e.g. 'make @docker docker' will reinstall docker."
@echo @echo
@echo "Available GOALs:" @echo "Available GOALs:"
@sed -n 's/^##//p' $< | column -ts ':' | sed -e "s/^/\t/" @sed -n '/^#/{N;s/# *\(.*\)\n\([^# .].*:\)/\t\2\1/p}' $< | column -ts ':'
+%: +%:
@$(MAKE) $* @$(MAKE) $*
^%: ^%:

View File

@ -5,7 +5,7 @@
## Requirements ## Requirements
* Ubuntu >= 20.04 (not tested with version < 20) * Ubuntu >= 20.04 (not tested with version < 20)
* `bash`, `zsh` or other `sh`-compatible shell * `bash`, `zsh` or other POSIX-compatible shell
* `make` (optional but recommended) * `make` (optional but recommended)
* `wget` (necessary for some scripts) * `wget` (necessary for some scripts)
* `git` (necessary for some scripts) * `git` (necessary for some scripts)
@ -61,11 +61,11 @@ You can create new file inside `./packs` dir.
Syntax is same as classic makefile with one important and necessary addition -- a comment started with `##`: Syntax is same as classic makefile with one important and necessary addition -- a comment started with `##`:
```makefile ```makefile
##mypack1: Pack description # Pack description
mypack1: goal1 goal2 goalX ... mypack1: goal1 goal2 goalX ...
... ...
##mypackX: Pack description # Pack description
mypackX: goalA goalB mypackX: goalA goalB
@cp file1 file2 @cp file1 file2
... ...

View File

@ -28,26 +28,28 @@ for file in ./install/*; do
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 "# ${desc}\n${name}:\n\t@${file}\n" >> Makefile
done; done;
cat << "EOF" >> Makefile cat << "EOF" >> Makefile
self: self:
@./gen-makefile @./gen-makefile
help: Makefile help: Makefile
@echo "Ubuntu software installator" @echo "Ubuntu software installator"
@echo @echo
@echo "Usage:" @echo "Usage:"
@echo "\tmake help\t - Show this help" @echo "\tmake help\t - Show this help"
@echo "\tmake GOAL\t - Install software" @echo "\tmake self\t - Regenerate Makefile (alias of ./gen-makefile)"
@echo "\tmake GOAL\t - Install software"
@echo "\tmake ^GOAL\t - Upgrade software" @echo "\tmake ^GOAL\t - Upgrade software"
@echo "\tmake @GOAL\t - Uninstall software" @echo "\tmake @GOAL\t - Uninstall software"
@echo @echo
@echo "You can combine GOALs, e.g. 'make @docker docker' will reinstall docker." @echo "You can combine GOALs, e.g. 'make @docker docker' will reinstall docker."
@echo @echo
@echo "Available GOALs:" @echo "Available GOALs:"
@sed -n 's/^##//p' $< | column -ts ':' | sed -e "s/^/\t/" @sed -n '/^#/{N;s/# *\(.*\)\n\([^# .].*:\)/\t\2\1/p}' $< | column -ts ':'
+%: +%:
@$(MAKE) $* @$(MAKE) $*
^%: ^%:
@ -59,4 +61,4 @@ EOF
echo "New ./Makefile has been generated!" echo "New ./Makefile has been generated!"
echo "Old one has been saved as ./Makefile.bak" echo "Old one has been saved as ./Makefile.bak"
echo echo
make -s help make

View File

@ -1,2 +1,2 @@
##composer: [PACK] php + composer # [PACK] php + composer
composer: php composer-clean composer: php composer-clean

View File

@ -1,2 +1,2 @@
##flameshot: [TODO] [PACK] qt5 + flameshot from source # [TODO] [PACK] qt5 + flameshot from source
flameshot: qt5 flameshot-build flameshot: qt5 flameshot-build

View File

@ -1,2 +1,2 @@
##lamp: [PACK] Apache + php + mariadb # [PACK] Apache + php + mariadb
lamp: apache php mariadb lamp: apache php mariadb

View File

@ -1,4 +1,4 @@
##omz: [PACK] zsh + omz + powerline10k + MesloLGS font # [PACK] zsh + omz + powerline10k + MesloLGS font
omz: zsh omz-clean omz-fancy omz: zsh omz-clean omz-fancy
chsh -s /usr/bin/zsh chsh -s /usr/bin/zsh
@exec zsh @exec zsh