aboutsummaryrefslogtreecommitdiffstats
path: root/community/pn/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/pn/APKBUILD')
-rw-r--r--community/pn/APKBUILD64
1 files changed, 64 insertions, 0 deletions
diff --git a/community/pn/APKBUILD b/community/pn/APKBUILD
new file mode 100644
index 0000000000..2e7cda6429
--- /dev/null
+++ b/community/pn/APKBUILD
@@ -0,0 +1,64 @@
+# Contributor: Maarten van Gompel <proycon@anaproy.nl>
+# Maintainer: Anjandev Momi <anjan@momi.ca>
+pkgname=pn
+pkgver=0.0.0_git20210128
+pkgrel=0
+_commit="41e1215397129ed0d42b5f137fb35b5e0648edda"
+arch="all"
+url="https://github.com/Orange-OpenSource/pn"
+pkgdesc="libphonenumber command-line wrapper"
+source="$pkgname-$_commit.tar.gz::$url/archive/$_commit.tar.gz"
+license="Apache-2.0"
+makedepends="cmake icu-dev libphonenumber-dev gawk"
+builddir="$srcdir/$pkgname-$_commit"
+subpackages="$pkgname-doc $pkgname-gawk"
+
+build() {
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ cmake -B build \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DCMAKE_BUILD_TYPE=None \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ $CMAKE_CROSSOPTS
+ cmake --build build
+}
+
+check() {
+ cd build
+
+ ./pn valid +33123456789
+ ./pn valid -c US '(202) 555-0110'
+
+ ./pn valid '(202) 555-0110' && exit 1
+
+ [ "$(./pn format "+1 20 2 555 01 10")" = "+12025550110" ]
+ [ "$(./pn format -c FR "0123456789")" = "+33123456789" ]
+ [ "$(./pn format -c FR -f nat "0123456789")" = "01 23 45 67 89" ]
+ [ "$(./pn format -f int "+12025550110")" = "+1 202-555-0110" ]
+
+ [ "$(./pn find -c "" "+330611234345")" = "+33611234345" ]
+
+ [ "$(./pn find -f nat "2017/04/20: You have 2 messsages, call +1-202-555-0110 to listen to them.")" = "(202) 555-0110" ]
+
+ [ "$(./pn find -c FR "rappelle-moi au 01 23 4 56789 ou au 06 78 90 12 34 après 20h00" | head -1)" = "+33123456789" ]
+ [ "$(./pn find -c FR "rappelle-moi au 01 23 4 56789 ou au 06 78 90 12 34 après 20h00" | tail -1)" = "+33678901234" ]
+}
+
+package() {
+ DESTDIR="$pkgdir" cmake --build build --target install
+ mkdir "$pkgdir/usr/share"
+ mv "$pkgdir/usr/man" "$pkgdir/usr/share/"
+}
+
+gawk() {
+ amove usr/lib/gawk
+}
+
+sha512sums="
+5910b22743181d9ff4ecf5e1947d1e175dd2d2667972d682a8e55631b5a0aa33f63d782aeeca5da4ef1528cfbe7cf5406d762c4e631ba041e82f4ce950782a5c pn-41e1215397129ed0d42b5f137fb35b5e0648edda.tar.gz
+"