aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2016-08-17 16:28:08 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2016-08-17 16:28:26 +0200
commita961a79b60a23f2441ca78237d3e7781c825cd59 (patch)
treeb73bbaa1d22a70016c641061c2a650aefe677540 /testing
parent910b16538ef3a9158772e7a5415d3610ed9570a7 (diff)
downloadaports-a961a79b60a23f2441ca78237d3e7781c825cd59.tar.bz2
aports-a961a79b60a23f2441ca78237d3e7781c825cd59.tar.xz
testing/abook: upgrade to 0.6.1
Diffstat (limited to 'testing')
-rw-r--r--testing/abook/APKBUILD41
-rw-r--r--testing/abook/gcc6.patch24
-rw-r--r--testing/abook/vcard-compat.patch346
3 files changed, 49 insertions, 362 deletions
diff --git a/testing/abook/APKBUILD b/testing/abook/APKBUILD
index b86d480993..b081c6f22d 100644
--- a/testing/abook/APKBUILD
+++ b/testing/abook/APKBUILD
@@ -1,40 +1,49 @@
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Maintainer:
-
pkgname=abook
-pkgver=0.6.0_pre2
+pkgver=0.6.1
_ver=${pkgver/_pre/pre}
pkgrel=2
pkgdesc="Text-based addressbook designed for use with Mutt"
url="http://abook.sourceforge.net"
license="GPL2"
arch="all"
-makedepends="ncurses-dev readline-dev"
+makedepends="ncurses-dev readline-dev automake autoconf gettext-dev"
subpackages="$pkgname-doc $pkgname-lang"
source="http://$pkgname.sourceforge.net/devel/$pkgname-${_ver}.tar.gz
- vcard-compat.patch"
+ gcc6.patch"
-_builddir=$srcdir/$pkgname-$_ver
+builddir=$srcdir/$pkgname-$_ver
prepare() {
- cd "$_builddir"
- patch -Np1 -i "$srcdir"/vcard-compat.patch
+ default_prepare || return 1
+ cd "$builddir"
+
+ aclocal && automake --add-missing && autoconf -v
+ sed 's/0.18/0.19/g' -i po/Makefile.in.in
}
build() {
- cd "$_builddir"
- ./configure --prefix=/usr --mandir=/usr/share/man || return 1
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ || return 1
make || return 1
}
package() {
- cd "$_builddir"
+ cd "$builddir"
make DESTDIR="$pkgdir" install || return 1
rm -f "$pkgdir"/usr/lib/charset.alias
}
-md5sums="1e4a7210b3507db7b3d47ee7a2457934 abook-0.6.0pre2.tar.gz
-c7c4972eab913483198d86697ecbbaa1 vcard-compat.patch"
-sha256sums="59d444504109dd96816e003b3023175981ae179af479349c34fa70bc12f6d385 abook-0.6.0pre2.tar.gz
-11ecc05519021fdf08da943fe2ea81e68abbc67e909e16abdc02cd639de5b5cc vcard-compat.patch"
-sha512sums="d1bc437981964a5dd873b12458833c60306d37b36904a04b072cefe7501175933dd7817ca51f8634bbd6722f79f768b39e00b68d0699086d5efaf28d0cbdf1ed abook-0.6.0pre2.tar.gz
-e51311c10f9bfe6e5c8feb65bf66856719d286aa497aad5e7ace7e5b81c5d36aea419e28f29eb24b4d9bd1b05a403914b71eab7d3e46316f6766ddae4237117e vcard-compat.patch"
+md5sums="4bffd4c47ac41b688abd58f65bfe0bfb abook-0.6.1.tar.gz
+43074804f0b76e388d73242a1b8d43d1 gcc6.patch"
+sha256sums="f0a90df8694fb34685ecdd45d97db28b88046c15c95e7b0700596028bd8bc0f9 abook-0.6.1.tar.gz
+1eb89bc9ec6d4baed8a44d1ac9a8fb57742423e0699f26f354e810dfc63052cb gcc6.patch"
+sha512sums="993895ef2fd6d98d50db610699f8f0a28112778065ac56484373eb814afd8ab7371201fc21506c090514f4b29570ec229dc62c606ab068301152567e2c47fe66 abook-0.6.1.tar.gz
+21ab6475512ea9baae1a6509749628d6b610e96e77c64139d09697d272d66556875058e91c9b948c4ebaf65795a97d8532bae25e5d7e71cc4a20af49897cd867 gcc6.patch"
diff --git a/testing/abook/gcc6.patch b/testing/abook/gcc6.patch
new file mode 100644
index 0000000000..e7422187e3
--- /dev/null
+++ b/testing/abook/gcc6.patch
@@ -0,0 +1,24 @@
+diff -up abook-git-6e550af8a907a680dc845c22a7d6c36d89e900c1/database.c.gcc5 abook-git-6e550af8a907a680dc845c22a7d6c36d89e900c1/database.c
+--- abook-git-6e550af8a907a680dc845c22a7d6c36d89e900c1/database.c.gcc5 2014-11-28 16:29:52.000000000 +0100
++++ abook-git-6e550af8a907a680dc845c22a7d6c36d89e900c1/database.c 2015-02-11 16:02:15.837789303 +0100
+@@ -859,7 +859,7 @@ item_merge(list_item dest, list_item src
+ */
+
+ /* quick lookup by "standard" field number */
+-inline int
++extern inline int
+ field_id(int i)
+ {
+ assert((i >= 0) && (i < ITEM_FIELDS));
+diff -up abook-git-6e550af8a907a680dc845c22a7d6c36d89e900c1/database.h.gcc5 abook-git-6e550af8a907a680dc845c22a7d6c36d89e900c1/database.h
+--- abook-git-6e550af8a907a680dc845c22a7d6c36d89e900c1/database.h.gcc5 2014-11-28 16:29:52.000000000 +0100
++++ abook-git-6e550af8a907a680dc845c22a7d6c36d89e900c1/database.h 2015-02-11 16:02:23.465818915 +0100
+@@ -61,7 +61,7 @@ struct db_enumerator {
+ /*
+ * Field operations
+ */
+-inline int field_id(int i);
++extern inline int field_id(int i);
+ abook_field *find_standard_field(char *key, int do_declare);
+ abook_field *real_find_field(char *key, abook_field_list *list, int *nb);
+ #define find_field(key, list) real_find_field(key, list, NULL)
diff --git a/testing/abook/vcard-compat.patch b/testing/abook/vcard-compat.patch
deleted file mode 100644
index c73240a5e6..0000000000
--- a/testing/abook/vcard-compat.patch
+++ /dev/null
@@ -1,346 +0,0 @@
-diff -aur old/filter.c new/filter.c
---- old/filter.c 2006-09-06 15:26:10.000000000 +1000
-+++ new/filter.c 2012-05-31 17:48:18.644744197 +1000
-@@ -44,6 +44,7 @@
- static int csv_parse_file(FILE *in);
- static int allcsv_parse_file(FILE *in);
- static int palmcsv_parse_file(FILE *in);
-+static int vcard_parse_file(FILE *in);
-
- /*
- * export filter prototypes
-@@ -75,6 +76,7 @@
- { "csv", N_("comma separated values"), csv_parse_file },
- { "allcsv", N_("comma separated values (all fields)"), allcsv_parse_file },
- { "palmcsv", N_("Palm comma separated values"), palmcsv_parse_file },
-+ { "vcard", N_("vCard file"), vcard_parse_file },
- { "\0", NULL, NULL }
- };
-
-@@ -1331,6 +1333,263 @@
- */
-
- /*
-+ * vCard import filter
-+ */
-+
-+static char *vcard_fields[] = {
-+ "FN", /* NAME */
-+ "EMAIL", /* EMAIL */
-+ "ADR", /* ADDRESS */
-+ "ADR", /* ADDRESS2 - not used */
-+ "ADR", /* CITY */
-+ "ADR", /* STATE */
-+ "ADR", /* ZIP */
-+ "ADR", /* COUNTRY */
-+ "TEL", /* PHONE */
-+ "TEL", /* WORKPHONE */
-+ "TEL", /* FAX */
-+ "TEL", /* MOBILEPHONE */
-+ "NICKNAME", /* NICK */
-+ "URL", /* URL */
-+ "NOTE", /* NOTES */
-+ "BDAY", /* ANNIVERSARY */
-+ NULL
-+};
-+
-+/*
-+ * mappings between vCard ADR field and abook's ADDRESS
-+ * see rfc2426 section 3.2.1
-+ */
-+static int vcard_address_fields[] = {
-+ -1, /* vCard(post office box) - not used */
-+ -1, /* vCard(the extended address) - not used */
-+ 2, /* vCard(the street address) - ADDRESS */
-+ 4, /* vCard(the locality) - CITY */
-+ 5, /* vCard(the region) - STATE */
-+ 6, /* vCard(the postal code) - ZIP */
-+ 7 /* vCard(the country name) - COUNTRY */
-+};
-+
-+enum {
-+ VCARD_KEY = 0,
-+ VCARD_KEY_ATTRIBUTE,
-+ VCARD_VALUE,
-+};
-+
-+static char *
-+vcard_get_line_element(char *line, int element)
-+{
-+ int i;
-+ char *line_copy = 0;
-+ char *result = 0;
-+ char *key = 0;
-+ char *key_attr = 0;
-+ char *value = 0;
-+
-+ line_copy = xstrdup(line);
-+
-+ /* make newline characters if exist end of string */
-+ for(i=0; line_copy[i]; i++) {
-+ if(line_copy[i] == '\r' || line_copy[i] == '\n') {
-+ line_copy[i] = '\0';
-+ break;
-+ }
-+ }
-+
-+ /* separate key from value */
-+ for(i=0; line_copy[i]; i++) {
-+ if(line_copy[i] == ':') {
-+ line_copy[i] = '\0';
-+ key = line_copy;
-+ value = &line_copy[i+1];
-+ break;
-+ }
-+ }
-+
-+ /* separate key from key attributes */
-+ if (key) {
-+ for(i=0; key[i]; i++) {
-+ if(key[i] == ';') {
-+ key[i] = '\0';
-+ key_attr = &key[i+1];
-+ break;
-+ }
-+ }
-+ }
-+
-+ switch(element) {
-+ case VCARD_KEY:
-+ if(key)
-+ result = xstrdup(key);
-+ break;
-+ case VCARD_KEY_ATTRIBUTE:
-+ if(key_attr)
-+ result = xstrdup(key_attr);
-+ break;
-+ case VCARD_VALUE:
-+ if(value)
-+ result = xstrdup(value);
-+ break;
-+ }
-+
-+ xfree(line_copy);
-+ return result;
-+}
-+
-+static void
-+vcard_parse_email(list_item item, char *line)
-+{
-+ char *email;
-+
-+ email = vcard_get_line_element(line, VCARD_VALUE);
-+
-+ if(item[1]) {
-+ item[1] = strconcat(item[1], ",", email, 0);
-+ xfree(email);
-+ }
-+ else {
-+ item[1] = email;
-+ }
-+}
-+
-+static void
-+vcard_parse_address(list_item item, char *line)
-+{
-+ int i;
-+ int k;
-+ char *value;
-+ char *address_field;
-+
-+ value = vcard_get_line_element(line, VCARD_VALUE);
-+ if(!value)
-+ return;
-+
-+ address_field = value;
-+ for(i=k=0; value[i]; i++) {
-+ if(value[i] == ';') {
-+ value[i] = '\0';
-+ if(vcard_address_fields[k] >= 0) {
-+ item[vcard_address_fields[k]] = xstrdup(address_field);
-+ }
-+ address_field = &value[i+1];
-+ k++;
-+ if((k+1)==(sizeof(vcard_address_fields)/sizeof(*vcard_address_fields)))
-+ break;
-+ }
-+ }
-+ item[vcard_address_fields[k]] = xstrdup(address_field);
-+ xfree(value);
-+}
-+
-+static void
-+vcard_parse_phone(list_item item, char *line)
-+{
-+ int index = 8;
-+ char *type = vcard_get_line_element(line, VCARD_KEY_ATTRIBUTE);
-+ char *value = vcard_get_line_element(line, VCARD_VALUE);
-+
-+ /* set the standard number */
-+ if (!type) {
-+ item[index] = value;
-+ }
-+
-+ /*
-+ * see rfc2426 section 3.3.1
-+ */
-+ else if (strstr(type, "TYPE=") == type){
-+ if (strcasestr(type, "home")) {
-+ item[index] = xstrdup(value);
-+ }
-+ if (strcasestr(type, "work")) {
-+ item[index+1] = xstrdup(value);
-+ }
-+ if (strcasestr(type, "fax")) {
-+ item[index+2] = xstrdup(value);
-+ }
-+ if (strcasestr(type, "cell")) {
-+ item[index+3] = xstrdup(value);
-+ }
-+
-+ xfree(type);
-+ xfree(value);
-+ }
-+}
-+
-+static void
-+vcard_parse_line(list_item item, char *line)
-+{
-+ int i;
-+ char *key;
-+
-+ for(i=0; vcard_fields[i]; i++) {
-+ key = vcard_fields[i];
-+
-+ if(!strncmp(key, line, strlen(key))) {
-+ if(i == 1) {
-+ vcard_parse_email(item, line);
-+ }
-+ else if(i == 2) {
-+ vcard_parse_address(item, line);
-+ }
-+ else if(i == 8) {
-+ vcard_parse_phone(item, line);
-+ }
-+ else {
-+ item[i] = vcard_get_line_element(line, VCARD_VALUE);
-+ }
-+ break;
-+ }
-+ }
-+}
-+
-+static void
-+vcard_parse_item(FILE *in)
-+{
-+ char *line = NULL;
-+ list_item item = item_create();
-+
-+ while(!feof(in)) {
-+ line = getaline(in);
-+
-+ if(line && !strncmp("END:VCARD", line, 9)) {
-+ xfree(line);
-+ break;
-+ }
-+ else if(line) {
-+ vcard_parse_line(item, line);
-+ xfree(line);
-+ }
-+ }
-+
-+ add_item2database(item);
-+ item_free(&item);
-+}
-+
-+static int
-+vcard_parse_file(FILE *in)
-+{
-+ char *line = NULL;
-+
-+ while(!feof(in)) {
-+ line = getaline(in);
-+
-+ if(line && !strncmp("BEGIN:VCARD", line, 11)) {
-+ xfree(line);
-+ vcard_parse_item(in);
-+ }
-+ else if(line) {
-+ xfree(line);
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+/*
-+ * end of vCard import filter
-+ */
-+
-+/*
- * csv addressbook export filters
- */
-
-@@ -1547,10 +1806,18 @@
-
- free(name);
-
-+ if(db_fget(e.item, NICK))
-+ fprintf(out, "NICKNAME:%s\r\n",
-+ db_fget(e.item, NICK));
-+
-+ if(db_fget(e.item, ANNIVERSARY))
-+ fprintf(out, "BDAY:%s\r\n",
-+ db_fget(e.item, ANNIVERSARY));
-+
- if(db_fget(e.item, ADDRESS))
-- fprintf(out, "ADR:;;%s;%s;%s;%s;%s;%s\r\n",
-- safe_str(db_fget(e.item, ADDRESS)),
-+ fprintf(out, "ADR:;%s;%s;%s;%s;%s;%s\r\n",
- safe_str(db_fget(e.item, ADDRESS2)),
-+ safe_str(db_fget(e.item, ADDRESS)),
- safe_str(db_fget(e.item, CITY)),
- safe_str(db_fget(e.item, STATE)),
- safe_str(db_fget(e.item, ZIP)),
-diff -aur old/misc.c new/misc.c
---- old/misc.c 2006-09-05 05:24:18.000000000 +1000
-+++ new/misc.c 2012-05-31 17:40:46.241284874 +1000
-@@ -77,6 +77,27 @@
- return 1;
- }
-
-+char *
-+strcasestr(char *haystack, char *needle)
-+{
-+ int i;
-+ int k;
-+
-+ assert(haystack != NULL);
-+ assert(needle != NULL);
-+
-+ for(i=0; i<strlen(haystack)-strlen(needle)+1; i++) {
-+ for(k=0; k<strlen(needle); k++, i++) {
-+ if (tolower(haystack[i]) != tolower(needle[k]))
-+ break;
-+ else if ((k+1) == strlen(needle))
-+ return &haystack[i];
-+ }
-+ }
-+
-+ return NULL;
-+}
-+
-
- #ifdef HAVE_CONFIG_H
- # include "config.h"
-diff -aur old/misc.h new/misc.h
---- old/misc.h 2006-09-05 05:24:18.000000000 +1000
-+++ new/misc.h 2012-05-31 17:40:46.241284874 +1000
-@@ -18,6 +18,8 @@
-
- int is_number(char *s);
-
-+char *strcasestr(char *haystack, char *needle);
-+
- char *strdup_printf(const char *format, ... );
- char *strconcat(const char *str, ...);