summaryrefslogtreecommitdiff
path: root/extra/libbsd
diff options
context:
space:
mode:
Diffstat (limited to 'extra/libbsd')
-rw-r--r--extra/libbsd/LICENSE28
-rw-r--r--extra/libbsd/PKGBUILD36
-rw-r--r--extra/libbsd/spt.patch50
3 files changed, 77 insertions, 37 deletions
diff --git a/extra/libbsd/LICENSE b/extra/libbsd/LICENSE
deleted file mode 100644
index 7dcbfc2ba..000000000
--- a/extra/libbsd/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-/*-
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
diff --git a/extra/libbsd/PKGBUILD b/extra/libbsd/PKGBUILD
index 9fdf78b95..703d14ace 100644
--- a/extra/libbsd/PKGBUILD
+++ b/extra/libbsd/PKGBUILD
@@ -1,30 +1,48 @@
-# $Id: PKGBUILD 180872 2013-03-27 14:45:32Z tpowa $
+# $Id: PKGBUILD 188690 2013-06-18 01:22:22Z heftig $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
pkgname=libbsd
-pkgver=0.4.2
-pkgrel=1.1
+pkgver=0.5.2
+pkgrel=2
pkgdesc="Provides useful functions commonly found on BSD systems like strlcpy()"
arch=('i686' 'x86_64' 'mips64el')
url="http://libbsd.freedesktop.org"
license=('custom')
depends=('glibc')
-source=(http://libbsd.freedesktop.org/releases/$pkgname-$pkgver.tar.gz)
-md5sums=('591fc9de4ca22f78cf87a94e648a92f4')
+options=('!libtool')
+source=(http://libbsd.freedesktop.org/releases/$pkgname-$pkgver.tar.xz{,.asc}
+ spt.patch)
+md5sums=('be8b2e0dc4614699834c49693574fd1a'
+ 'SKIP'
+ '56236fb72c8ec6cbdbd0daa5f404bccb')
+
+prepare() {
+ cd $pkgname-$pkgver
+
+ # Paper over a firefox crash
+ # http://lists.freedesktop.org/archives/libbsd/2013-June/000085.html
+ patch -Np1 -i ../spt.patch
+}
build() {
- cd $srcdir/$pkgname-$pkgver
+ cd $pkgname-$pkgver
./configure --prefix=/usr
make
}
+check() {
+ cd $pkgname-$pkgver
+
+ make check
+}
+
package() {
- cd $srcdir/$pkgname-$pkgver
+ cd $pkgname-$pkgver
- make DESTDIR=$pkgdir install
- install -D -m644 COPYING $pkgdir/usr/share/licenses/$pkgname/LICENSE
+ make DESTDIR="$pkgdir" install
+ install -D -m644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
# vim:set ts=2 sw=2 et:
diff --git a/extra/libbsd/spt.patch b/extra/libbsd/spt.patch
new file mode 100644
index 000000000..b19dc9b87
--- /dev/null
+++ b/extra/libbsd/spt.patch
@@ -0,0 +1,50 @@
+diff -u -r libbsd-0.5.2-orig/src/setproctitle.c libbsd-0.5.2/src/setproctitle.c
+--- libbsd-0.5.2-orig/src/setproctitle.c 2013-06-08 18:26:04.000000000 +0200
++++ libbsd-0.5.2/src/setproctitle.c 2013-06-18 02:35:59.441393418 +0200
+@@ -86,7 +86,7 @@
+ if (environ != envp)
+ return 0;
+
+- /* Make a copy of the old environ array of pointers, in case
++ /* Make a deep copy of the old environ array of pointers, in case
+ * clearenv() or setenv() is implemented to free the internal
+ * environ array, because we will need to access the old environ
+ * contents to make the new copy. */
+@@ -94,11 +94,13 @@
+ envcopy = malloc(envsize);
+ if (envcopy == NULL)
+ return errno;
+- memcpy(envcopy, envp, envsize);
++ for (i = 0; envp[i]; i++) envcopy[i] = strdup(envp[i]);
++ envcopy[i] = NULL;
+
+ error = spt_clearenv();
+ if (error) {
+ environ = envp;
++ for(i = 0; envcopy[i]; i++) free(envcopy[i]);
+ free(envcopy);
+ return error;
+ }
+@@ -116,18 +118,20 @@
+ if (error) {
+ #ifdef HAVE_CLEARENV
+ /* Because the old environ might not be available
+- * anymore we will make do with the shallow copy. */
++ * anymore we will make do with the deep copy. */
+ environ = envcopy;
+ #else
+ environ = envp;
++ for(i = 0; envcopy[i]; i++) free(envcopy[i]);
+ free(envcopy);
+ #endif
+ return error;
+ }
+ }
+
+- /* Dispose of the shallow copy, now that we've finished transfering
++ /* Dispose of the deep copy, now that we've finished transfering
+ * the old environment. */
++ for(i = 0; envcopy[i]; i++) free(envcopy[i]);
+ free(envcopy);
+
+ return 0;