summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD22
1 files changed, 17 insertions, 5 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 68c5f4a5cb7..4175d627e93 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,15 +2,16 @@
pkgname=flutter-group-pacman-hook
pkgver=1
-pkgrel=1
+pkgrel=2
pkgdesc="Pacman hook to fix permission after flutter install/upgrade"
arch=("any")
license=("GPL")
-depends=("flutter")
+optdepends=("flutter")
source=(flutter-group-template.hook)
-sha512sums=("ec692caa79eebfc17717dd227cc96a677cbca5a24adb4c824908ce24f186b1d8b66bfe5e562a975ef70f9cf34d30e78666ad7d3f89f27049accfa113ba888f01")
+sha512sums=("f4683f18b58a7847af706d3b433c7e488135406711de2e92ca66eb72beb385f871325c2299e1c69b86118ca56a898d966a86414a2f04f6a8f03ea5a2d31554e2")
_group=flutterusers
+_path=/opt/flutter
prepare(){
# use colors only if we have them (taken from Tor Browser AUR package)
@@ -24,17 +25,28 @@ prepare(){
fi
if [[ -z "${FLUTTER_GROUP}" ]]; then
- echo -e "\n ${_COL_BBLUE_}->${_COL_DEFAULT_} ${_COL_BRED_}NOTE:${_COL_DEFAULT_} If you want to package ${_COL_BWHITE_}${pkgname}${_COL_DEFAULT_} with a group different than ${_COL_BWHITE_}flutterusers${_COL_DEFAULT_},"
+ echo -e "\n ${_COL_BBLUE_}->${_COL_DEFAULT_} ${_COL_BRED_}NOTE:${_COL_DEFAULT_} If you want to package ${_COL_BWHITE_}${pkgname}${_COL_DEFAULT_} with a group different than ${_COL_BWHITE_}${_group}${_COL_DEFAULT_},"
echo -e " please set a \`${_COL_YELLOW_}FLUTTER_GROUP${_COL_DEFAULT_}\` environment variable before running makepkg.\n"
echo ' For instance:'
echo -e "\n ${_COL_LIGHTGREY_}FLUTTER_GROUP='flutterusers' makepkg${_COL_DEFAULT_}\n"
fi
+ if [[ -z "${FLUTTER_PATH}" ]]; then
+ echo -e "\n ${_COL_BBLUE_}->${_COL_DEFAULT_} ${_COL_BRED_}NOTE:${_COL_DEFAULT_} If you want to package ${_COL_BWHITE_}${pkgname}${_COL_DEFAULT_} with a path different than ${_COL_BWHITE_}${_path}${_COL_DEFAULT_},"
+ echo -e " please set a \`${_COL_YELLOW_}FLUTTER_PATH${_COL_DEFAULT_}\` environment variable before running makepkg.\n"
+ echo ' For instance:'
+ echo -e "\n ${_COL_LIGHTGREY_}FLUTTER_PATH='/opt/flutter' makepkg${_COL_DEFAULT_}\n"
+ fi
+
if [[ -n "${FLUTTER_GROUP}" ]]; then
_group=$FLUTTER_GROUP
fi
+
+ if [[ -n "${FLUTTER_PATH}" ]]; then
+ _path=${FLUTTER_PATH}
+ fi
- sed 's/\$FLUTTER_GROUP/'${_group}'/g' flutter-group-template.hook > flutter-group.hook
+ sed -e "s/\$FLUTTER_GROUP/${_group}/g" -e "s/\$FLUTTER_PATH/${_path//\//\\\/}/g" flutter-group-template.hook > flutter-group.hook
}
package() {