php + composer pack and fixes

This commit is contained in:
Anthony Axenov 2022-07-12 23:20:11 +08:00
parent bdcd8e6bec
commit d3263e6da5
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
3 changed files with 21 additions and 15 deletions

View File

@ -1,4 +1,7 @@
# Autogenerated at 05.07.2022 10:52 using ./gen-makefile
# Autogenerated at 12.07.2022 23:14 using ./gen-makefile
##composer: [PACK] php + composer
composer: php composer-clean
##flameshot: [TODO] [PACK] qt5 + flameshot from source
flameshot: qt5 flameshot-build
@ -21,9 +24,9 @@ apt:
chrome:
./install/chrome
##composer: Install composer (latest)
composer:
./install/composer
##composer-clean: Install composer (latest)
composer-clean:
./install/composer-clean
##docker: Install docker (latest) + docker-compose (latest) + ppa
docker:

View File

@ -1,12 +1,13 @@
#!/bin/bash
##makedesc: Install composer (latest)
echo
echo "==============================================="
echo "Installing composer (latest)..."
echo "==============================================="
echo
# https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
installed() {
command -v "$1" >/dev/null 2>&1
}
@ -16,18 +17,19 @@ installed() {
if installed "composer"; then
echo "WARNING: Removing current composer to install its actual version"
sudo apt remove -y --autoremove composer
sudo rm -f /bin/composer
sudo rm -f /usr/bin/composer
sudo rm -f /usr/local/bin/composer
sudo rm -rf /usr/src/composer
sudo rm /bin/composer
sudo rm /usr/bin/composer
sudo rm /usr/local/bin/composer
sudo rm /usr/src/composer
rm $HOME/.local/bin/composer
fi
sudo mkdir -m 0777 -p /usr/src/composer
cd /usr/src/composer
mkdir -p $HOME/install && cd $HOME/install
# mkdir -p $HOME/.local/bin
# https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
wget https://getcomposer.org/installer -O composer-setup.php
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
>&2 echo 'ERROR: Invalid installer checksum'
@ -35,7 +37,6 @@ if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
exit 1
fi
php composer-setup.php --quiet
sudo cp /usr/src/composer/composer.phar /usr/local/bin/composer
cp $HOME/install/composer.phar $HOME/.local/bin/composer
cd - >/dev/null
sudo rm -rf /usr/src/composer/
installed "composer" && composer --version

2
packs/composer Normal file
View File

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