summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD22
-rw-r--r--flutter-group-template.hook5
3 files changed, 23 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 18bbaaa87b6..40ef248454f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,12 @@
pkgbase = flutter-group-pacman-hook
pkgdesc = Pacman hook to fix permission after flutter install/upgrade
pkgver = 1
- pkgrel = 1
+ pkgrel = 2
arch = any
license = GPL
- depends = flutter
+ optdepends = flutter
source = flutter-group-template.hook
- sha512sums = ec692caa79eebfc17717dd227cc96a677cbca5a24adb4c824908ce24f186b1d8b66bfe5e562a975ef70f9cf34d30e78666ad7d3f89f27049accfa113ba888f01
+ sha512sums = f4683f18b58a7847af706d3b433c7e488135406711de2e92ca66eb72beb385f871325c2299e1c69b86118ca56a898d966a86414a2f04f6a8f03ea5a2d31554e2
pkgname = flutter-group-pacman-hook
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() {
diff --git a/flutter-group-template.hook b/flutter-group-template.hook
index 279798bcb71..597346685d5 100644
--- a/flutter-group-template.hook
+++ b/flutter-group-template.hook
@@ -3,8 +3,9 @@ Type = Package
Operation = Upgrade
Operation = Install
Target = flutter
+Target = flutter-group-pacman-hook
[Action]
-Description = Granting permission to group $FLUTTER_GROUP for flutter SDK
+Description = Granting permission to group $FLUTTER_GROUP for flutter SDK ($FLUTTER_PATH)
When = PostTransaction
-Exec = /bin/sh -c 'chown -R :$FLUTTER_GROUP /opt/flutter && chmod -R g+w /opt/flutter' \ No newline at end of file
+Exec = /bin/sh -c 'chown -R :$FLUTTER_GROUP "$FLUTTER_PATH" && chmod -R g+w "$FLUTTER_PATH"'