summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Vybíhal2023-11-15 20:51:29 +0100
committerJosef Vybíhal2023-11-15 20:51:29 +0100
commit58a01208cfd31c801142b8a242bdbc3a5516c920 (patch)
tree1c7ea1c8408677a58e03db8dcd7d23e8797b83e4
parentefae2457619734a80780e4cf5d214bfe10e96f78 (diff)
downloadaur-58a01208cfd31c801142b8a242bdbc3a5516c920.tar.gz
update: v6.58, new maintrainer
My attempt to revive this package and make it work. The upstram project author focuses mainly on binary distribution. The biggest problem imho in packing this is storing credentials in users config dir and NOT in gam.py folder. Previous maintaner tried to bring the issue (https://github.com/GAM-team/GAM/issues/792), but nobody seems to be bothered to do something about it. The xdg_config_dirs.patch works good enough for me to try maintaning this package.
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD14
-rw-r--r--xdg_config_dirs.patch25
3 files changed, 29 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e82b1a24f596..ebf06254dd16 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,27 +1,29 @@
pkgbase = gam
pkgdesc = Command-line tool for Google GSuite admins to manage settings quickly and easily
- pkgver = 5.11
+ pkgver = 6.58
pkgrel = 1
url = https://github.com/jay0lee/GAM
arch = any
license = Apache
depends = python-dateutil
+ depends = python-distro
depends = python-dnspython
+ depends = python-filelock
depends = python-google-api-core
depends = python-google-api-python-client
depends = python-google-auth
depends = python-google-auth-httplib2
depends = python-google-auth-oauthlib
depends = python-httplib2
+ depends = python-pathvalidate
depends = python-passlib
- source = gam-5.11.tar.gz::https://github.com/jay0lee/GAM/archive/v5.11.tar.gz
+ source = gam-6.58.tar.gz::https://github.com/jay0lee/GAM/archive/v6.58.tar.gz
source = xdg_config_dirs.patch
source = disable_update_checks.patch
source = gam.sh
- sha256sums = 47e12a770f78d55a158569734ade7fac9c014ddb9752344367516dc29eecb150
- sha256sums = 31d97ff8515d6b5e214b18affb1cb7be88fc8cddb0022f46d6d7ccf848819bf9
+ sha256sums = 755f6974ed92c475949cb92dd7655a52567ec582ab132d8f5a0f754585af2085
+ sha256sums = 69875ddfe63523579a6be45fdcac4211503b4149765f3ee66514a40503a5e374
sha256sums = 1be3b23bc2ee2fb5a43c6a999919243c93877fc9ea13c5e301097d1b5cd53baa
sha256sums = f8613546b8d4a51f05342d3680553c20a2e0995c3be90e469f1da3bb83ca172e
pkgname = gam
-
diff --git a/PKGBUILD b/PKGBUILD
index 1a87895bfddf..8c8a954f4838 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,8 +1,9 @@
-# Maintainer: Ainola
+# Maintainer: Josef Vybíhal <josef.vybihal@gmail.com>
+# Contributor: Ainola
# Contributor: Ethan Schoonover
pkgname=gam
-pkgver=5.11
+pkgver=6.58
pkgrel=1
pkgdesc="Command-line tool for Google GSuite admins to manage settings quickly and easily"
arch=('any')
@@ -10,13 +11,16 @@ url="https://github.com/jay0lee/GAM"
license=('Apache')
depends=(
'python-dateutil'
+ 'python-distro'
'python-dnspython'
+ 'python-filelock'
'python-google-api-core'
'python-google-api-python-client'
'python-google-auth'
'python-google-auth-httplib2'
'python-google-auth-oauthlib'
'python-httplib2'
+ 'python-pathvalidate'
'python-passlib'
)
@@ -27,8 +31,8 @@ source=(
"gam.sh"
)
-sha256sums=('47e12a770f78d55a158569734ade7fac9c014ddb9752344367516dc29eecb150'
- '31d97ff8515d6b5e214b18affb1cb7be88fc8cddb0022f46d6d7ccf848819bf9'
+sha256sums=('755f6974ed92c475949cb92dd7655a52567ec582ab132d8f5a0f754585af2085'
+ '69875ddfe63523579a6be45fdcac4211503b4149765f3ee66514a40503a5e374'
'1be3b23bc2ee2fb5a43c6a999919243c93877fc9ea13c5e301097d1b5cd53baa'
'f8613546b8d4a51f05342d3680553c20a2e0995c3be90e469f1da3bb83ca172e')
@@ -54,6 +58,8 @@ package() {
find "$pkgdir/usr/share/$pkgname" -name '*_test.py' -exec rm {} +
install -Dm755 "$pkgname-$pkgver/src/gam.py" -t "$pkgdir/usr/share/$pkgname/"
+ install -Dm755 "$pkgname-$pkgver/src/GamCommands.txt" -t "$pkgdir/usr/share/$pkgname/"
+ install -Dm755 "$pkgname-$pkgver/src/roots.pem" -t "$pkgdir/usr/share/$pkgname/"
install -Dm755 gam.sh "$pkgdir/usr/bin/gam"
}
diff --git a/xdg_config_dirs.patch b/xdg_config_dirs.patch
index ba0d723475ef..e4bbfc1962fe 100644
--- a/xdg_config_dirs.patch
+++ b/xdg_config_dirs.patch
@@ -1,8 +1,8 @@
---- src/gam/var.py 2020-05-14 08:28:44.595484330 -0700
-+++ src/gam/var.py 2020-05-14 08:30:42.780304096 -0700
-@@ -22,6 +22,19 @@
+--- src/gam/var.py 2023-04-26 14:42:13.000000000 +0200
++++ src/gam/var.py 2023-11-15 20:05:25.960900169 +0100
+@@ -35,6 +35,18 @@
GAM_LATEST_RELEASE = GAM_ALL_RELEASES + '/latest'
- GAM_PROJECT_FILEPATH = 'https://raw.githubusercontent.com/jay0lee/GAM/master/src/'
+ GAM_PROJECT_FILEPATH = 'https://raw.githubusercontent.com/GAM-team/GAM/master/src/'
+try:
+ XDG_CONFIG_DIR = os.environ['XDG_CONFIG_HOME']
@@ -11,27 +11,26 @@
+CONFIG_DIR = XDG_CONFIG_DIR + 'gam/'
+
+try:
-+ os.makedirs(CONFIG_DIR, mode=700)
++ os.makedirs(CONFIG_DIR, mode=0o700)
+except OSError:
+ if not os.path.isdir(CONFIG_DIR):
+ raise
+
-+
true_values = ['on', 'yes', 'enabled', 'true', '1']
false_values = ['off', 'no', 'disabled', 'false', '0']
usergroup_types = [
-@@ -36,8 +49,8 @@
- WARNING_PREFIX = 'WARNING: '
+@@ -51,8 +63,8 @@
UTF8 = 'utf-8'
UTF8_SIG = 'utf-8-sig'
+ FN_ENABLEDASA_TXT = 'enabledasa.txt'
-FN_EXTRA_ARGS_TXT = 'extra-args.txt'
-FN_LAST_UPDATE_CHECK_TXT = 'lastupdatecheck.txt'
+FN_EXTRA_ARGS_TXT = CONFIG_DIR + 'extra-args.txt'
+FN_LAST_UPDATE_CHECK_TXT = CONFIG_DIR + 'lastupdatecheck.txt'
MY_CUSTOMER = 'my_customer'
# See https://support.google.com/drive/answer/37603
- MAX_GOOGLE_SHEET_CELLS = 5000000
-@@ -1071,9 +1084,9 @@
+ MAX_GOOGLE_SHEET_CELLS = 10000000
+@@ -1246,9 +1258,9 @@
#
_DEFAULT_CHARSET = UTF8
@@ -41,10 +40,10 @@
+_FN_CLIENT_SECRETS_JSON = CONFIG_DIR + 'client_secrets.json'
+_FN_OAUTH2SERVICE_JSON = CONFIG_DIR + 'oauth2service.json'
+_FN_OAUTH2_TXT = CONFIG_DIR + 'oauth2.txt'
+ _FN_ROOTS_PEM = 'roots.pem'
#
GM_Globals = {
- GM_SYSEXITRC: 0,
-@@ -1119,7 +1132,7 @@
+@@ -1296,7 +1308,7 @@
GC_CLIENT_SECRETS_JSON = 'client_secrets_json'
# GAM config directory containing client_secrets.json, oauth2.txt,
# oauth2service.json, extra_args.txt
@@ -52,4 +51,4 @@
+GC_CONFIG_DIR = CONFIG_DIR
# custmerId from gam.cfg or retrieved from Google
GC_CUSTOMER_ID = 'customer_id'
- # If debug_level > 0: extra_args[u'prettyPrint'] = True,
+ # Admin email address, required when enable_dasa is true, overrides oauth2.txt value otherwise