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
#===============================================
# Scripts listed in ./packs
#===============================================
##composer: [PACK] php + composer
# [PACK] php + composer
composer: php composer-clean
##flameshot: [TODO] [PACK] qt5 + flameshot from source
# [TODO] [PACK] qt5 + flameshot from source
flameshot: qt5 flameshot-build
##lamp: [PACK] Apache + php + mariadb
# [PACK] 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
chsh -s /usr/bin/zsh
@exec zsh
@ -23,158 +23,160 @@ omz: zsh omz-clean omz-fancy
# Scripts listed in ./install
#===============================================
##apache: Install apache2 (latest)
# Install apache2 (latest)
apache:
@./install/apache
##apt: Install bunch of software from apt
# Install bunch of software from apt
apt:
@./install/apt
##canon-mg2500: Install Canon Pixma MG2500 + ppa
# Install Canon Pixma MG2500 + ppa
canon-mg2500:
@./install/canon-mg2500
##chrome: Install google chrome (latest)
# Install google chrome (latest)
chrome:
@./install/chrome
##composer-clean: Install composer (latest)
# Install composer (latest)
composer-clean:
@./install/composer-clean
##docker: Install docker (latest) + docker-compose (latest) + ppa
# Install docker (latest) + docker-compose (latest) + ppa
docker:
@./install/docker
##droidcam: Install droidcam v1.8.2
# Install droidcam v1.8.2
droidcam:
@./install/droidcam
##droidcam-obs: Install droidcam-obs plugin v1.5.1
# Install droidcam-obs plugin v1.5.1
droidcam-obs:
@./install/droidcam-obs
##file-templates-kde: Install file templates (KDE)
# Install file templates (KDE)
file-templates-kde:
@./install/file-templates-kde
##flameshot-build: [TODO] Build flameshot from src (latest)
# [TODO] Build flameshot from src (latest)
flameshot-build:
@./install/flameshot-build
##git: Install git (latest)
# Install git (latest)
git:
@./install/git
##golang: Install golang v1.18.3
# Install golang v1.18.3
golang:
@./install/golang
##grubc: Install grub-customizer (latest) + ppa
# Install grub-customizer (latest) + ppa
grubc:
@./install/grubc
##kde-appmenu: Install KDE Window AppMenu Applet
# Install KDE Window AppMenu Applet
kde-appmenu:
@./install/kde-appmenu
##libreoffice: Install libreoffice
# Install libreoffice
libreoffice:
@./install/libreoffice
##lite-xl: Install lite-xl v2.0.5 (draft)
# Install lite-xl v2.0.5 (draft)
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:
@./install/mariadb
##nodejs: Install nodejs + npm via nvm
# Install nodejs + npm via nvm
nodejs:
@./install/nodejs
##ntfy: Install ntfy (latest) + ppa
# Install ntfy (latest) + ppa
ntfy:
@./install/ntfy
##omz-clean: Install omz (latest)
# Install omz (latest)
omz-clean:
@./install/omz-clean
##omz-fancy: Install omz fancy (powerline10k + MesloLGS font)
# Install omz fancy (powerline10k + MesloLGS font)
omz-fancy:
@./install/omz-fancy
##papirus: Install papirus-icon-theme (latest)
# Install papirus-icon-theme (latest)
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:
@./install/pgsql
##php: Install php v8.1 + ppa
# Install php v8.1 + ppa
php:
@./install/php
##postman: Install postman (latest)
# Install postman (latest)
postman:
@./install/postman
##qt5: Install qt5
# Install qt5
qt5:
@./install/qt5
##rustdesk: Install rustdesk client v1.1.9 (deb)
# Install rustdesk client v1.1.9 (deb)
rustdesk:
@./install/rustdesk
##snap: Install bunch of software from snap
# Install bunch of software from snap
snap:
@./install/snap
##syncthing: Install syncthing (latest) + ppa
# Install syncthing (latest) + ppa
syncthing:
@./install/syncthing
##telebit: Install telebit (latest)
# Install telebit (latest)
telebit:
@./install/telebit
##ulauncher: Install ulauncher (latest) + ppa
# Install ulauncher (latest) + ppa
ulauncher:
@./install/ulauncher
##wine: Install wine (latest) + ppa (focal)
# Install wine (latest) + ppa (focal)
wine:
@./install/wine
##zint: Install zint (latest)
# Install zint (latest)
zint:
@./install/zint
##zsh: Install vanilla zsh
# Install vanilla zsh
zsh:
@./install/zsh
self:
@./gen-makefile
help: Makefile
@echo "Ubuntu software installator"
@echo
@echo "Usage:"
@echo "\tmake help\t - Show this help"
@echo "\tmake GOAL\t - Install software"
@echo "\tmake help\t - Show this help"
@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 - Uninstall software"
@echo
@echo "You can combine GOALs, e.g. 'make @docker docker' will reinstall docker."
@echo
@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) $*
^%:

View File

@ -5,7 +5,7 @@
## Requirements
* 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)
* `wget` (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 `##`:
```makefile
##mypack1: Pack description
# Pack description
mypack1: goal1 goal2 goalX ...
...
##mypackX: Pack description
# Pack description
mypackX: goalA goalB
@cp file1 file2
...

View File

@ -28,26 +28,28 @@ for file in ./install/*; do
name=${name%.sh}
desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file})
[ -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;
cat << "EOF" >> Makefile
self:
@./gen-makefile
help: Makefile
@echo "Ubuntu software installator"
@echo
@echo "Usage:"
@echo "\tmake help\t - Show this help"
@echo "\tmake GOAL\t - Install software"
@echo "\tmake help\t - Show this help"
@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 - Uninstall software"
@echo
@echo "You can combine GOALs, e.g. 'make @docker docker' will reinstall docker."
@echo
@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) $*
^%:
@ -59,4 +61,4 @@ EOF
echo "New ./Makefile has been generated!"
echo "Old one has been saved as ./Makefile.bak"
echo
make -s help
make

View File

@ -1,2 +1,2 @@
##composer: [PACK] php + composer
# [PACK] php + composer
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

View File

@ -1,2 +1,2 @@
##lamp: [PACK] Apache + php + mariadb
# [PACK] 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
chsh -s /usr/bin/zsh
@exec zsh