summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorClar Fon2019-01-29 16:29:21 -0500
committerClar Fon2019-01-29 16:29:21 -0500
commit4a5b8ffce7f7281e5263fc7b1a29b6e9c4773102 (patch)
tree3d34b3467d0cd303d60bbec6a3cf6e3dff422aa5
downloadaur-4a5b8ffce7f7281e5263fc7b1a29b6e9c4773102.tar.gz
Initial commit
-rw-r--r--.SRCINFO26
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD50
-rw-r--r--cxxflags.patch25
4 files changed, 106 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..047c7b1ff018
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = uap-cpp-git
+ pkgdesc = C++ implementation of ua-parser
+ pkgver = r71.87fe432
+ pkgrel = 1
+ url = https://github.com/ua-parser/uap-cpp
+ arch = x86_64
+ arch = i686
+ arch = arm
+ arch = armv6h
+ arch = armv7h
+ arch = aarch64
+ license = MIT
+ makedepends = git
+ makedepends = boost
+ depends = yaml-cpp
+ depends = boost-libs
+ depends = uap-core
+ provides = uap-cpp
+ conflicts = uap-cpp
+ source = git+https://github.com/ua-parser/uap-cpp.git
+ source = cxxflags.patch
+ sha256sums = SKIP
+ sha256sums = aad58cf62a9fea7276b452d99954d86896e096749911efae431edb7bc96f672a
+
+pkgname = uap-cpp-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..78aeae588013
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*.tar.gz
+*.pkg.tar.xz
+pkg/
+src/
+uap-cpp/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..aacca0c914c5
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: Clar Fon <them@lightdark.xyz>
+
+_pkgname=uap-cpp
+pkgname=$_pkgname-git
+pkgver=r71.87fe432
+pkgrel=1
+pkgdesc="C++ implementation of ua-parser"
+arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64')
+url='https://github.com/ua-parser/uap-cpp'
+license=('MIT')
+provides=('uap-cpp')
+conflicts=('uap-cpp')
+makedepends=('git' 'boost')
+depends=('yaml-cpp' 'boost-libs' 'uap-core')
+source=(
+ git+https://github.com/ua-parser/uap-cpp.git
+ cxxflags.patch
+)
+sha256sums=(
+ 'SKIP'
+ 'aad58cf62a9fea7276b452d99954d86896e096749911efae431edb7bc96f672a'
+)
+
+pkgver() {
+ cd "${srcdir}/${_pkgname}"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "${srcdir}/${_pkgname}"
+ git submodule init
+ git submodule update
+}
+
+build() {
+ cd "${srcdir}/${_pkgname}"
+ patch < "../cxxflags.patch"
+ make libuaparser_cpp.a libuaparser_cpp.so
+}
+
+check() {
+ cd "${srcdir}/${_pkgname}"
+ cp /usr/share/uap-core/regexes.yaml uap-core
+ make test
+}
+
+package() {
+ install -Dm755 "${srcdir}/${_pkgname}/libuaparser_cpp.so" "${pkgdir}/usr/lib/libuaparser_cpp.so"
+ install -Dm644 "${srcdir}/${_pkgname}/libuaparser_cpp.a" "${pkgdir}/usr/lib/libuaparser_cpp.a"
+}
diff --git a/cxxflags.patch b/cxxflags.patch
new file mode 100644
index 000000000000..135256221e09
--- /dev/null
+++ b/cxxflags.patch
@@ -0,0 +1,25 @@
+diff --git a/Makefile b/Makefile
+index 424812c..b0b785f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,9 +1,5 @@
+-ifndef LDFLAGS
+- LDFLAGS=-lboost_regex -lyaml-cpp
+-endif
+-ifndef CXXFLAGS
+- CXXFLAGS=-std=c++0x -Wall -Werror -fPIC -g -O3
+-endif
++LDFLAGS += -lboost_regex -lyaml-cpp
++CXXFLAGS += -std=c++0x -Wall -Werror -g -fPIC -O3
+
+ # wildcard object build target
+ %.o: %.cpp
+@@ -16,7 +12,7 @@ libuaparser_cpp.a: UaParser.o
+ ar rcs $@ $^
+
+ libuaparser_cpp.so: UaParser.o
+- $(LD) $< -shared $(LDFLAGS) -o $@
++ $(CXX) $< -shared $(LDFLAGS) -o $@
+
+ UaParserTest: libuaparser_cpp.a UaParserTest.o
+ $(CXX) $^ -o $@ libuaparser_cpp.a $(LDFLAGS) -lgtest -lpthread