summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlad Wenter2022-04-05 19:37:38 +0200
committerAlad Wenter2022-04-05 19:39:53 +0200
commit5fb38dad9d50c9a7e207bb18b418dedd6ad6ce79 (patch)
tree5066d0dab8c9f220fb7a5094cfd47dec3cd7d64a
downloadaur-5fb38dad9d50c9a7e207bb18b418dedd6ad6ce79.tar.gz
overlayfs-tools-git: initial commit
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD45
-rw-r--r--ldflags.patch19
-rw-r--r--xattr_include_paths.patch26
4 files changed, 107 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b450d8da94d9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = overlayfs-tools-git
+ pkgdesc = maintenance tools for overlay filesystem
+ pkgver = r31.291c7f4
+ pkgrel = 1
+ url = https://github.com/kmxz/overlayfs-tools
+ arch = x86_64
+ license = custom
+ makedepends = attr
+ depends = glibc
+ source = git+https://github.com/kmxz/overlayfs-tools.git
+ source = xattr_include_paths.patch
+ source = ldflags.patch
+ md5sums = SKIP
+ md5sums = e277d33cf8506ff96563f3aee2639564
+ md5sums = de8fd91f1c4e12e6a27e1b53413a039c
+
+pkgname = overlayfs-tools-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..2e51f2f2ee09
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Alad Wenter <alad@archlinux.org>
+pkgname=overlayfs-tools-git
+_pkgname=overlayfs-tools
+pkgver=r31.291c7f4
+pkgrel=1
+pkgdesc="maintenance tools for overlay filesystem"
+arch=('x86_64')
+url="https://github.com/kmxz/overlayfs-tools"
+license=('custom')
+depends=('glibc')
+makedepends=('attr')
+source=("git+https://github.com/kmxz/overlayfs-tools.git"
+ "xattr_include_paths.patch"
+ "ldflags.patch")
+md5sums=('SKIP'
+ 'e277d33cf8506ff96563f3aee2639564'
+ 'de8fd91f1c4e12e6a27e1b53413a039c')
+
+prepare() {
+ cd "$_pkgname"
+ patch -p1 < "$srcdir"/xattr_include_paths.patch
+ patch -p1 < "$srcdir"/ldflags.patch
+}
+
+pkgver() {
+ cd "$_pkgname"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ cd "$_pkgname"
+ make
+}
+
+check() {
+ cd "$_pkgname"
+ # XXX: tests require sudo, so they can't be run in the PKGBUILD
+ #make tests
+}
+
+package() {
+ cd "$_pkgname"
+ install -Dm755 overlay "$pkgdir"/usr/bin/overlay
+ install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
diff --git a/ldflags.patch b/ldflags.patch
new file mode 100644
index 000000000000..3deca37eaee7
--- /dev/null
+++ b/ldflags.patch
@@ -0,0 +1,19 @@
+diff --git a/makefile b/makefile
+index fb1bed4..a0c0084 100644
+--- a/makefile
++++ b/makefile
+@@ -1,11 +1,11 @@
+-CFLAGS = -Wall -std=c99
+-LFLAGS = -lm
++CFLAGS ?= -Wall -std=c99
++LFLAGS ?= -lm
+ CC = gcc
+
+ all: overlay
+
+ overlay: main.o logic.o sh.o
+- $(CC) $(LFLAGS) main.o logic.o sh.o -o overlay
++ $(CC) $(LFLAGS) $(LDFLAGS) main.o logic.o sh.o -o overlay
+
+ main.o: main.c logic.h
+ $(CC) $(CFLAGS) -c main.c
diff --git a/xattr_include_paths.patch b/xattr_include_paths.patch
new file mode 100644
index 000000000000..86f522c83d69
--- /dev/null
+++ b/xattr_include_paths.patch
@@ -0,0 +1,26 @@
+diff --git a/logic.c b/logic.c
+index 97767f5..9763701 100644
+--- a/logic.c
++++ b/logic.c
+@@ -7,7 +7,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <unistd.h>
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #include <attr/attributes.h>
+ #include <fts.h>
+ #include <libgen.h>
+diff --git a/main.c b/main.c
+index 8019923..72b01f7 100644
+--- a/main.c
++++ b/main.c
+@@ -13,7 +13,7 @@
+ #include <linux/limits.h>
+ #include <stdbool.h>
+ #include <sys/stat.h>
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #ifndef _SYS_STAT_H
+ #include <linux/stat.h>
+ #endif