From 90dc1b4d8b89ee0f7ce805972bb59f076aa91461 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Wed, 28 Dec 2022 15:20:25 +0800 Subject: [PATCH] Revert "Descriptions parsing improved" (c1150af9) + php tools fixes --- Makefile | 161 ++++++++++++++++++++++------------------------ README.md | 6 +- gen-makefile | 27 ++++---- install/composer | 11 ++-- install/php-psalm | 3 +- packs/flameshot | 6 +- packs/lamp | 7 +- packs/obs | 6 +- packs/omz | 7 +- packs/php-stack | 4 -- packs/php-tools | 9 --- packs/phpstack | 2 + packs/phptools | 2 + 13 files changed, 114 insertions(+), 137 deletions(-) delete mode 100644 packs/php-stack delete mode 100644 packs/php-tools create mode 100644 packs/phpstack create mode 100644 packs/phptools diff --git a/Makefile b/Makefile index f365281..402535e 100644 --- a/Makefile +++ b/Makefile @@ -1,199 +1,199 @@ -# Autogenerated at 11.12.2022 14:30 using ./gen-makefile +# Autogenerated at 28.12.2022 14:46 using ./gen-makefile .DEFAULT_GOAL := help #=============================================== # Scripts listed in ./install #=============================================== -# Install apache2 (latest) +##apache: Install apache2 (latest) apache: @./install/apache -# Install bunch of software from apt +##apt: Install bunch of software from apt apt: @./install/apt -# Install Canon Pixma MG2500 + ppa +##canon-mg2500: Install Canon Pixma MG2500 + ppa canon-mg2500: @./install/canon-mg2500 -# Install google chrome (latest) +##chrome: Install google chrome (latest) chrome: @./install/chrome -# Install composer (latest) +##composer: Install composer (latest) composer: @./install/composer -# Install docker (latest) + docker-compose (latest) + ppa +##docker: Install docker (latest) + docker-compose (latest) + ppa docker: @./install/docker -# Install dotfiles +##dots: Install dotfiles dots: @./install/dots -# Install droidcam v1.8.2 +##droidcam: Install droidcam v1.8.2 droidcam: @./install/droidcam -# Install droidcam-obs plugin v1.5.1 +##droidcam-obs: Install droidcam-obs plugin v1.5.1 droidcam-obs: @./install/droidcam-obs -# [TODO] Build flameshot from src (latest) +##flameshot-build: [TODO] Build flameshot from src (latest) flameshot-build: @./install/flameshot-build -# Install git (latest) +##git: Install git (latest) git: @./install/git -# Install golang v1.18.3 +##golang: Install golang v1.18.3 golang: @./install/golang -# Install grub-customizer (latest) + ppa +##grubc: Install grub-customizer (latest) + ppa grubc: @./install/grubc -# Install KDE Window AppMenu Applet +##kde-appmenu: Install KDE Window AppMenu Applet kde-appmenu: @./install/kde-appmenu -# Install KDE Backports + ppa +##kde-backports: Install KDE Backports + ppa kde-backports: @./install/kde-backports -# Install file templates (KDE) +##kde-file-templates: Install file templates (KDE) kde-file-templates: @./install/kde-file-templates -# Install KDE portal +##kde-portal: Install KDE portal kde-portal: @./install/kde-portal -# Install libreoffice +##libreoffice: Install libreoffice libreoffice: @./install/libreoffice -# Install lite-xl +##lite-xl: Install lite-xl lite-xl: @./install/lite-xl -# Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed) +##mariadb: Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed) mariadb: @./install/mariadb -# Install nodejs + npm via nvm +##nodejs: Install nodejs + npm via nvm nodejs: @./install/nodejs -# Install ntfy (latest) + ppa +##ntfy: Install ntfy (latest) + ppa ntfy: @./install/ntfy -# Install obs-studio (latest snap) +##obs-studio: Install obs-studio (latest snap) obs-studio: @./install/obs-studio -# Install omz (latest) +##omz-clean: Install omz (latest) omz-clean: @./install/omz-clean -# Install omz fancy (powerline10k + MesloLGS font) +##omz-fancy: Install omz fancy (powerline10k + MesloLGS font) omz-fancy: @./install/omz-fancy -# Install openvpn v2.5.8 (src) +##openvpn: Install openvpn v2.5.8 (src) openvpn: @./install/openvpn -# Install papirus-icon-theme (latest) +##papirus: Install papirus-icon-theme (latest) papirus: @./install/papirus -# Install postgresql (latest) and php-pgsql (if php is installed) +##pgsql: Install postgresql (latest) and php-pgsql (if php is installed) pgsql: @./install/pgsql -# Install php v8.1 + ppa +##php: Install php v8.1 + ppa php: @./install/php -# Install phpcs + php-cs-fixer +##phpcs: Install phpcs + php-cs-fixer phpcs: @./install/phpcs -# Install phpmd +##phpmd: Install phpmd phpmd: @./install/phpmd -# Install psalm +##php-psalm: Install psalm php-psalm: @./install/php-psalm -# Install php-spx +##php-spx: Install php-spx php-spx: @./install/php-spx -# Install phpstan +##phpstan: Install phpstan phpstan: @./install/phpstan -# Install phpunit +##phpunit: Install phpunit phpunit: @./install/phpunit -# Install postman (latest) +##postman: Install postman (latest) postman: @./install/postman -# Install qt5 +##qt5: Install qt5 qt5: @./install/qt5 -# Install rustdesk client v1.1.9 (deb) +##rustdesk: Install rustdesk client v1.1.9 (deb) rustdesk: @./install/rustdesk -# Install bunch of software from snap +##snap: Install bunch of software from snap snap: @./install/snap -# Install syncthing (latest) + ppa +##syncthing: Install syncthing (latest) + ppa syncthing: @./install/syncthing -# Install telebit (latest) +##telebit: Install telebit (latest) telebit: @./install/telebit -# Install ulauncher (latest) + ppa +##ulauncher: Install ulauncher (latest) + ppa ulauncher: @./install/ulauncher -# Install Vivaldi + ppa +##vivaldi: Install Vivaldi + ppa vivaldi: @./install/vivaldi -# Install wine (latest) + ppa (focal) +##wine: Install wine (latest) + ppa (focal) wine: @./install/wine -# Install youtube-dl +##youtube-dl: Install youtube-dl youtube-dl: @./install/youtube-dl -# Install ytdlcue +##ytdlcue: Install ytdlcue ytdlcue: @./install/ytdlcue -# Install zint (latest) +##zint: Install zint (latest) zint: @./install/zint -# Install vanilla zsh +##zsh: Install vanilla zsh zsh: @./install/zsh @@ -202,44 +202,25 @@ zsh: # Scripts listed in ./packs #=============================================== -# [TODO] [PACK] Install qt5 + flameshot from source -flameshot: - qt5 - flameshot-build +##flameshot: [TODO] qt5 + flameshot from source +flameshot: qt5 flameshot-build -# [PACK] Install apache + php + mariadb -lamp: - apache - php-stack - mariadb +##lamp: [PACK] Apache + php + mariadb +lamp: apache phpstack mariadb -# [PACK] Install OBS Studio + droidcam-obs -obs: - obs-studio - droidcam-obs +##obs: [PACK] Install OBS Studio + droidcam-obs +obs: obs-studio droidcam-obs -# [PACK] Install zsh + omz + powerline10k + MesloLGS font -omz: - zsh - omz-clean - omz-fancy +##omz: [PACK] zsh + omz + powerline10k + MesloLGS font +omz: zsh omz-clean omz-fancy chsh -s /usr/bin/zsh @exec zsh -# [PACK] Install full php stack with tooling -phptools: - php - php-tools +##phptools: [PACK] Install only php tooling (composer, phpunit, psalm, phpcs, php-cs-fixer, php-spx, phpmd) +phptools: composer php-psalm php-spx phpcs phpmd phpstan phpunit -# [PACK] Install only php tooling (composer, phpunit, psalm, phpcs, php-cs-fixer, php-spx, phpmd) -php-stack: - composer - php-psalm - php-spx - phpcs - phpmd - phpstan - phpunit +##phpstack: [PACK] Install full php stack with tooling +phpstack: php phptools #=============================================== # Scripts listed in ./upgrade @@ -271,13 +252,23 @@ php-stack: self: @./gen-makefile - help: Makefile @echo "Ubuntu software installator" @echo - @echo "Usage:\n make help|- show this help\n make self|- regenerate Makefile (alias of ./gen-makefile)\n make GOAL|- install software\n make ^GOAL|- upgrade software\n make /GOAL|- uninstall software" | column -ts '|' + @echo "Usage:" + @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 "\nYou can combine GOALs, here are some examples:" - @echo "\tmake @docker docker" - @echo "\tmake php @docker ^omz" + @echo "\tmake /docker docker" + @echo "\tmake php /docker ^omz" @echo "\nAvailable GOALs:" - @sed -n '/^#/{N;s/# *\(.*\)\n\([^# .].*:\)/\t\2\1/p}' $< | column -ts ':' + @sed -n 's/^##//p' $< | column -ts ':' | sed -e "s/^/\t/" ++%: + @ +^%: + @./upgrade/ +@%: + @./uninstall/ diff --git a/README.md b/README.md index 69dfa99..e884355 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Requirements * Ubuntu >= 20.04 (not tested with version < 20) -* `bash`, `zsh` or other POSIX-compatible shell +* `bash`, `zsh` or other `sh`-compatible shell * `make` (optional but recommended) * `wget` (necessary for some scripts) * `git` (necessary for some scripts) @@ -66,11 +66,11 @@ Syntax is same as classic makefile. It is important to add a comment with short description: ```makefile -# Pack description +##mypack1: Pack description mypack1: goal1 goal2 goalX ... ... -# Pack description +##mypackX: Pack description mypackX: goalA goalB @cp file1 file2 ... diff --git a/gen-makefile b/gen-makefile index c362165..6e616db 100755 --- a/gen-makefile +++ b/gen-makefile @@ -18,7 +18,7 @@ for file in ./install/*; do name=${name%.sh} desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file}) [ -z "$desc" ] && desc='' - echo -e "# ${desc}\n${name}:\n\t@${file}\n" >> Makefile + echo -e "##${name}: ${desc}\n${name}:\n\t@${file}\n" >> Makefile done; cat << EOF >> Makefile @@ -72,21 +72,26 @@ cat << EOF >> Makefile self: @./gen-makefile - help: Makefile @echo "Ubuntu software installator" @echo - @echo "Usage:\n \ - make help|- show this help\n \ - make self|- regenerate Makefile (alias of ./gen-makefile)\n \ - make GOAL|- install software\n \ - make ${CHR_UPGRADE}GOAL|- upgrade software\n \ - make ${CHR_UNINSTALL}GOAL|- uninstall software" | column -ts '|' + @echo "Usage:" + @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 ${CHR_UPGRADE}GOAL\t - upgrade software" + @echo "\tmake ${CHR_UNINSTALL}GOAL\t - uninstall software" @echo "\nYou can combine GOALs, here are some examples:" - @echo "\tmake @docker docker" - @echo "\tmake php @docker ^omz" + @echo "\tmake ${CHR_UNINSTALL}docker docker" + @echo "\tmake php ${CHR_UNINSTALL}docker ${CHR_UPGRADE}omz" @echo "\nAvailable GOALs:" - @sed -n '/^#/{N;s/# *\(.*\)\n\([^# .].*:\)/\t\2\1/p}' $< | column -ts ':' + @sed -n 's/^##//p' $< | column -ts ':' | sed -e "s/^/\t/" ++%: + @$(MAKE) $* +^%: + @./upgrade/$* +@%: + @./uninstall/$* EOF echo "New ./Makefile has been generated!" diff --git a/install/composer b/install/composer index 4fc8693..13204a4 100755 --- a/install/composer +++ b/install/composer @@ -17,10 +17,11 @@ installed() { if installed "composer"; then echo "WARNING: Removing current composer to install its actual version" sudo apt remove -y --autoremove composer - sudo rm /bin/composer - sudo rm /usr/bin/composer - sudo rm /usr/local/bin/composer - sudo rm /usr/src/composer + sudo rm -f $HOME/.local/bin/composer + sudo rm -f /bin/composer + sudo rm -f /usr/bin/composer + sudo rm -f /usr/local/bin/composer + sudo rm -f /usr/src/composer rm $HOME/.local/bin/composer fi @@ -37,7 +38,7 @@ if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then exit 1 fi php composer-setup.php --quiet -cp $HOME/install/composer.phar $HOME/.local/bin/composer +mv -f $HOME/install/composer.phar $HOME/.local/bin/composer cd - >/dev/null COMPOSER_GLOBAL_HOME="$(composer config -g home)" diff --git a/install/php-psalm b/install/php-psalm index 35b1300..2891041 100755 --- a/install/php-psalm +++ b/install/php-psalm @@ -27,5 +27,4 @@ echo echo "Finish!" echo -phpcs --version # phpcbf --version -php-cs-fixer --version +psalm --version diff --git a/packs/flameshot b/packs/flameshot index 9b11b26..8b6e870 100644 --- a/packs/flameshot +++ b/packs/flameshot @@ -1,4 +1,2 @@ -# [TODO] [PACK] Install qt5 + flameshot from source -flameshot: - qt5 - flameshot-build +##flameshot: [TODO] [PACK] qt5 + flameshot from source +flameshot: qt5 flameshot-build diff --git a/packs/lamp b/packs/lamp index 9d1b76d..356e271 100644 --- a/packs/lamp +++ b/packs/lamp @@ -1,5 +1,2 @@ -# [PACK] Install apache + php + mariadb -lamp: - apache - php-stack - mariadb +##lamp: [PACK] Apache + php + mariadb +lamp: apache phpstack mariadb diff --git a/packs/obs b/packs/obs index ec4208f..d3a1901 100644 --- a/packs/obs +++ b/packs/obs @@ -1,4 +1,2 @@ -# [PACK] Install OBS Studio + droidcam-obs -obs: - obs-studio - droidcam-obs +##obs: [PACK] Install OBS Studio + droidcam-obs +obs: obs-studio droidcam-obs diff --git a/packs/omz b/packs/omz index 7bcbdab..c364876 100644 --- a/packs/omz +++ b/packs/omz @@ -1,7 +1,4 @@ -# [PACK] Install zsh + omz + powerline10k + MesloLGS font -omz: - zsh - omz-clean - omz-fancy +##omz: [PACK] zsh + omz + powerline10k + MesloLGS font +omz: zsh omz-clean omz-fancy chsh -s /usr/bin/zsh @exec zsh diff --git a/packs/php-stack b/packs/php-stack deleted file mode 100644 index 7e4dfa2..0000000 --- a/packs/php-stack +++ /dev/null @@ -1,4 +0,0 @@ -# [PACK] Install full php stack with tooling -phptools: - php - php-tools diff --git a/packs/php-tools b/packs/php-tools deleted file mode 100644 index 16a46ce..0000000 --- a/packs/php-tools +++ /dev/null @@ -1,9 +0,0 @@ -# [PACK] Install only php tooling (composer, phpunit, psalm, phpcs, php-cs-fixer, php-spx, phpmd) -php-stack: - composer - php-psalm - php-spx - phpcs - phpmd - phpstan - phpunit diff --git a/packs/phpstack b/packs/phpstack new file mode 100644 index 0000000..e5efc7d --- /dev/null +++ b/packs/phpstack @@ -0,0 +1,2 @@ +##phptools: [PACK] Install only php tooling (composer, phpunit, psalm, phpcs, php-cs-fixer, php-spx, phpmd) +phptools: composer php-psalm php-spx phpcs phpmd phpstan phpunit diff --git a/packs/phptools b/packs/phptools new file mode 100644 index 0000000..934de10 --- /dev/null +++ b/packs/phptools @@ -0,0 +1,2 @@ +##phpstack: [PACK] Install full php stack with tooling +phpstack: php phptools