summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Littley2018-09-17 09:44:45 -0700
committerSamuel Littley2018-09-17 09:44:45 -0700
commitad87db404ddf99dbb20e3992c7e77052cea0b570 (patch)
treeafcf399caee03aa91d070c6986275fca482681db
downloadaur-ad87db404ddf99dbb20e3992c7e77052cea0b570.tar.gz
Initial commit
-rw-r--r--.SRCINFO22
-rw-r--r--.gitignore2
-rw-r--r--Makefile.patch13
-rw-r--r--PKGBUILD40
-rw-r--r--google-compute-engine-oslogin-git.install7
-rw-r--r--google_oslogin_control.patch17
6 files changed, 101 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..15bdc6cdbb6e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = google-compute-engine-oslogin-git
+ pkgdesc = Google Cloud OS Login support for Google Compute Engine instances.
+ pkgver = e725e85
+ pkgrel = 1
+ url = https://github.com/GoogleCloudPlatform/compute-image-packages
+ install = google-compute-engine-oslogin-git.install
+ arch = x86_64
+ license = Apache
+ makedepends = git
+ makedepends = make
+ depends = pam
+ depends = curl
+ depends = json-c
+ source = git://github.com/GoogleCloudPlatform/compute-image-packages.git
+ source = google_oslogin_control.patch
+ source = Makefile.patch
+ sha256sums = SKIP
+ sha256sums = 969587d7876624cfd1256ad31481dccbc3e78446249d06c88927fc7f88798b86
+ sha256sums = d9b73fb7044ed0d6b8a8b0711a6aefa9139221067de3b1d9534afc577b29243e
+
+pkgname = google-compute-engine-oslogin-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..2db8a955068b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+compute-image-packages/
+*.pkg.tar*
diff --git a/Makefile.patch b/Makefile.patch
new file mode 100644
index 000000000000..c43af83e8d45
--- /dev/null
+++ b/Makefile.patch
@@ -0,0 +1,13 @@
+--- Makefile.orig 2018-09-16 15:04:26.659632933 -0700
++++ Makefile 2018-09-16 15:06:07.499628438 -0700
+@@ -11,8 +11,8 @@
+ LIBNSS_CACHE_OSLOGIN_SONAME = $(LIBNSS_CACHE_OSLOGIN).so.2
+ NSS_LIBRARY_NAME = libnss_$(NAME)-$(MAJOR).$(MINOR).$(REVISION).so
+ NSS_LIBRARY_SONAME = libnss_$(BASENAME).so.2
+-NSS_INSTALL_PATH = /lib
+-PAM_INSTALL_PATH = /lib/security
++NSS_INSTALL_PATH = /usr/lib
++PAM_INSTALL_PATH = /usr/lib/security
+ AUTHKEYS_INSTALL_PATH = /usr/bin
+
+ JSON_INCLUDE_PATH = /usr/include/json-c
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..869137145330
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: Samuel Littley <samuel.littley@toastwaffle.com>
+pkgname=google-compute-engine-oslogin-git
+pkgver=e725e85
+pkgrel=1
+pkgdesc='Google Cloud OS Login support for Google Compute Engine instances.'
+arch=('x86_64')
+url='https://github.com/GoogleCloudPlatform/compute-image-packages'
+license=('Apache')
+depends=('pam' 'curl' 'json-c')
+makedepends=('git' 'make')
+source=('git://github.com/GoogleCloudPlatform/compute-image-packages.git'
+ 'google_oslogin_control.patch'
+ 'Makefile.patch')
+install="${pkgname}.install"
+sha256sums=('SKIP'
+ '969587d7876624cfd1256ad31481dccbc3e78446249d06c88927fc7f88798b86'
+ 'd9b73fb7044ed0d6b8a8b0711a6aefa9139221067de3b1d9534afc577b29243e')
+
+_srcpath=compute-image-packages/google_compute_engine_oslogin
+
+prepare() {
+ cd "${srcdir}/${_srcpath}"
+ patch -p0 bin/google_oslogin_control "${srcdir}/google_oslogin_control.patch"
+ patch -p0 Makefile "${srcdir}/Makefile.patch"
+}
+
+pkgver() {
+ cd "${srcdir}/${_srcpath}"
+ echo "$(git describe --always |sed "s#${_pkgname}-##g;s#-#_#g;s#v##")"
+}
+
+build() {
+ cd "${srcdir}/${_srcpath}"
+ make
+}
+
+package() {
+ cd "${srcdir}/${_srcpath}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/google-compute-engine-oslogin-git.install b/google-compute-engine-oslogin-git.install
new file mode 100644
index 000000000000..7e4c26d80291
--- /dev/null
+++ b/google-compute-engine-oslogin-git.install
@@ -0,0 +1,7 @@
+post_install() {
+ /usr/bin/google_oslogin_control activate
+}
+
+pre_remove() {
+ /usr/bin/google_oslogin_control deactivate
+}
diff --git a/google_oslogin_control.patch b/google_oslogin_control.patch
new file mode 100644
index 000000000000..0c745f4c96e6
--- /dev/null
+++ b/google_oslogin_control.patch
@@ -0,0 +1,17 @@
+--- bin/google_oslogin_control.orig 2018-09-16 14:44:41.663018937 -0700
++++ bin/google_oslogin_control 2018-09-16 15:25:33.539576737 -0700
+@@ -15,7 +15,7 @@
+
+ script_name=$(basename "$0")
+ nss_config="/etc/nsswitch.conf"
+-pam_config="/etc/pam.d/sshd"
++pam_config="/etc/pam.d/system-login"
+ sshd_config="/etc/ssh/sshd_config"
+ el_release_file="/etc/redhat-release"
+ sudoers_dir="/var/google-sudoers.d"
+@@ -241,3 +241,5 @@
+ if [ $# -lt 2 ] || [ "$2" != "--norestartsshd" ]; then
+ restart_sshd
+ fi
++
++exit 0