diff options
author | root <root@rshg047.dnsready.net> | 2011-04-14 04:54:18 +0000 |
---|---|---|
committer | root <root@rshg047.dnsready.net> | 2011-04-14 04:54:18 +0000 |
commit | 0917a0682e48c4261e47d743725d990f47f6ec95 (patch) | |
tree | 32b99e036a20918da470922bf40276cedcfe7506 /testing | |
parent | 9c49791f6e912bd4834f00f2c6b3a00e6c12bb73 (diff) |
Thu Apr 14 04:54:18 UTC 2011
Diffstat (limited to 'testing')
27 files changed, 1382 insertions, 15 deletions
diff --git a/testing/bin86/PKGBUILD b/testing/bin86/PKGBUILD new file mode 100644 index 000000000..c3865a24e --- /dev/null +++ b/testing/bin86/PKGBUILD @@ -0,0 +1,30 @@ +# $Id: PKGBUILD 119692 2011-04-13 17:22:23Z andyrtr $ +# Maintainer: Andreas Radke <andyrtr@archlinux.org> +# Contributor: judd <jvinet@zeroflux.org> + +pkgname=bin86 +pkgver=0.16.18 +pkgrel=1 +pkgdesc="A complete 8086 assembler and loader" +arch=(i686 x86_64) +license=('GPL') +url="http://www.debath.co.uk/" +depends=('glibc') +source=(http://www.debath.co.uk/dev86//$pkgname-$pkgver.tar.gz + bin86-0.16.17-x86_64-1.patch) +md5sums=('914068fb649b93642d1cf21857b75699' + '92bdce7b0655cd2e9f83c83fc56d128e') + +build() { + cd $srcdir/$pkgname-$pkgver + if [ "$CARCH" = "x86_64" ]; then + patch -Np1 -i ../bin86-0.16.17-x86_64-1.patch + fi + make PREFIX=/usr +} + +package() { + cd $srcdir/$pkgname-$pkgver + mkdir -p $pkgdir/usr/bin $pkgdir/usr/share/man/man1 + make PREFIX=$pkgdir/usr MANDIR=$pkgdir/usr/share/man/man1 install +} diff --git a/testing/bin86/bin86-0.16.17-x86_64-1.patch b/testing/bin86/bin86-0.16.17-x86_64-1.patch new file mode 100644 index 000000000..152413ee7 --- /dev/null +++ b/testing/bin86/bin86-0.16.17-x86_64-1.patch @@ -0,0 +1,44 @@ +Submitted By: Ken Moffat <ken@kenmoffat.uklinux.net> +Date: 2005-06-28 +Initial Package Version: 0.16.14 +Upstream Status: Submitted Upstream +Origin: from ROCK Linux +Description: Allows bin86 to compile on x86_64, which permits lilo to + be used in a 64-bit system. I'm dubious about ROCK's attempts to + automatically add dual-licensing to all their patches, but bin86 is + already GPL'd. I've heard from the maintainer that this will be + included in the next upload. + + +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/x86/bin86/x86_64.patch +# ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +diff -urN bin86-0.16.14-orig/ld/x86_aout.h bin86-0.16.14/ld/x86_aout.h +--- bin86-0.16.14-orig/ld/x86_aout.h 2004-11-07 20:07:31.506442000 +0100 ++++ bin86-0.16.14/ld/x86_aout.h 2004-11-07 20:07:41.106982496 +0100 +@@ -12,6 +12,9 @@ + #if defined(i386) || defined(__BCC__) || defined(MSDOS) + typedef long Long; + #define __OUT_OK 1 ++#elif defined(__x86_64__) ++typedef int Long; ++#define __OUT_OK 1 + #else + typedef char Long[4]; + #endif diff --git a/testing/coreutils/PKGBUILD b/testing/coreutils/PKGBUILD new file mode 100644 index 000000000..78b74c33f --- /dev/null +++ b/testing/coreutils/PKGBUILD @@ -0,0 +1,69 @@ +# $Id: PKGBUILD 119714 2011-04-14 01:48:09Z allan $ +# Maintainer: Allan McRae <allan@archlinux.org> +# Contributor: judd <jvinet@zeroflux.org> + +pkgname=coreutils +pkgver=8.11 +pkgrel=1 +pkgdesc="The basic file, shell and text manipulation utilities of the GNU operating system" +arch=('i686' 'x86_64') +license=('GPL3') +url="http://www.gnu.org/software/coreutils" +groups=('base') +depends=('glibc' 'shadow' 'pam' 'acl' 'gmp' 'libcap') +replaces=('mktemp') +backup=('etc/pam.d/su') +install=${pkgname}.install +options=('!emptydirs') +source=(ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz + coreutils-uname.patch + coreutils-pam.patch + su.pam) +md5sums=('b623ee9b1b768a14e40dfd35ff446f4c' + 'c4fcca138b6abf6d443d48a6f0cd8833' + 'aad79a2aa6d566c375d7bdd1b0767278' + 'fa85e5cce5d723275b14365ba71a8aad') + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + + # added su wheel group pam patch (from fedora git) + patch -Np1 -i ${srcdir}/coreutils-pam.patch + + # linux specific uname improvement (from gentoo portage) + patch -Np1 -i ${srcdir}/coreutils-uname.patch + + autoreconf -v + ./configure --prefix=/usr \ + --enable-install-program=su \ + --enable-no-install-program=groups,hostname,kill,uptime \ + --enable-pam + make +} + +check() { + cd ${srcdir}/${pkgname}-${pkgver} + make RUN_EXPENSIVE_TESTS=yes check +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver} + make DESTDIR=${pkgdir} install + + cd ${pkgdir}/usr/bin + install -dm755 ${pkgdir}/{bin,usr/sbin} + + # binaries required by FHS + _fhs="cat chgrp chmod chown cp date dd df echo false ln ls \ + mkdir mknod mv pwd rm rmdir stty su sync true uname" + mv ${_fhs} ${pkgdir}/bin + + # binaries required by various Arch scripts + _bin="cut dir dircolors du install mkfifo readlink shred \ + sleep touch tr vdir" + mv ${_bin} ${pkgdir}/bin + ln -sf /bin/sleep ${pkgdir}/usr/bin/sleep + + mv chroot ${pkgdir}/usr/sbin + install -Dm644 ${srcdir}/su.pam ${pkgdir}/etc/pam.d/su +} diff --git a/testing/coreutils/coreutils-pam.patch b/testing/coreutils/coreutils-pam.patch new file mode 100644 index 000000000..e61908f3f --- /dev/null +++ b/testing/coreutils/coreutils-pam.patch @@ -0,0 +1,428 @@ +diff -urNp coreutils-8.4-orig/configure.ac coreutils-8.4/configure.ac +--- coreutils-8.4-orig/configure.ac 2010-01-11 18:20:42.000000000 +0100 ++++ coreutils-8.4/configure.ac 2010-02-12 10:17:46.000000000 +0100 +@@ -126,6 +126,13 @@ if test "$gl_gcc_warnings" = yes; then + AC_SUBST([GNULIB_WARN_CFLAGS]) + fi + ++dnl Give the chance to enable PAM ++AC_ARG_ENABLE(pam, dnl ++[ --enable-pam Enable use of the PAM libraries], ++[AC_DEFINE(USE_PAM, 1, [Define if you want to use PAM]) ++LIB_PAM="-ldl -lpam -lpam_misc" ++AC_SUBST(LIB_PAM)]) ++ + AC_FUNC_FORK + + optional_bin_progs= +diff -urNp coreutils-8.4-orig/doc/coreutils.texi coreutils-8.4/doc/coreutils.texi +--- coreutils-8.4-orig/doc/coreutils.texi 2010-01-03 18:06:20.000000000 +0100 ++++ coreutils-8.4/doc/coreutils.texi 2010-02-12 10:17:46.000000000 +0100 +@@ -15081,8 +15081,11 @@ to certain shells, etc.). + @findex syslog + @command{su} can optionally be compiled to use @code{syslog} to report + failed, and optionally successful, @command{su} attempts. (If the system +-supports @code{syslog}.) However, GNU @command{su} does not check if the +-user is a member of the @code{wheel} group; see below. ++supports @code{syslog}.) ++ ++This version of @command{su} has support for using PAM for ++authentication. You can edit @file{/etc/pam.d/su} to customize its ++behaviour. + + The program accepts the following options. Also see @ref{Common options}. + +@@ -15124,6 +15127,8 @@ environment variables except @env{TERM}, + @env{PATH} to a compiled-in default value. Change to @var{user}'s home + directory. Prepend @samp{-} to the shell's name, intended to make it + read its login startup file(s). ++Additionaly @env{DISPLAY} and @env{XAUTHORITY} environment variables ++are preserved as well for PAM functionality. + + @item -m + @itemx -p +@@ -15163,33 +15168,6 @@ Exit status: + the exit status of the subshell otherwise + @end display + +-@cindex wheel group, not supported +-@cindex group wheel, not supported +-@cindex fascism +-@subsection Why GNU @command{su} does not support the @samp{wheel} group +- +-(This section is by Richard Stallman.) +- +-@cindex Twenex +-@cindex MIT AI lab +-Sometimes a few of the users try to hold total power over all the +-rest. For example, in 1984, a few users at the MIT AI lab decided to +-seize power by changing the operator password on the Twenex system and +-keeping it secret from everyone else. (I was able to thwart this coup +-and give power back to the users by patching the kernel, but I +-wouldn't know how to do that in Unix.) +- +-However, occasionally the rulers do tell someone. Under the usual +-@command{su} mechanism, once someone learns the root password who +-sympathizes with the ordinary users, he or she can tell the rest. The +-``wheel group'' feature would make this impossible, and thus cement the +-power of the rulers. +- +-I'm on the side of the masses, not that of the rulers. If you are +-used to supporting the bosses and sysadmins in whatever they do, you +-might find this idea strange at first. +- +- + @node timeout invocation + @section @command{timeout}: Run a command with a time limit + +diff -urNp coreutils-8.4-orig/src/Makefile.am coreutils-8.4/src/Makefile.am +--- coreutils-8.4-orig/src/Makefile.am 2010-01-03 18:06:20.000000000 +0100 ++++ coreutils-8.4/src/Makefile.am 2010-02-12 10:17:46.000000000 +0100 +@@ -361,7 +361,7 @@ factor_LDADD += $(LIB_GMP) + uptime_LDADD += $(GETLOADAVG_LIBS) + + # for crypt +-su_LDADD += $(LIB_CRYPT) ++su_LDADD += $(LIB_CRYPT) @LIB_PAM@ + + # for various ACL functions + copy_LDADD += $(LIB_ACL) +diff -urNp coreutils-8.4-orig/src/su.c coreutils-8.4/src/su.c +--- coreutils-8.4-orig/src/su.c 2010-02-12 10:15:15.000000000 +0100 ++++ coreutils-8.4/src/su.c 2010-02-12 10:24:29.000000000 +0100 +@@ -37,6 +37,16 @@ + restricts who can su to UID 0 accounts. RMS considers that to + be fascist. + ++#ifdef USE_PAM ++ ++ Actually, with PAM, su has nothing to do with whether or not a ++ wheel group is enforced by su. RMS tries to restrict your access ++ to a su which implements the wheel group, but PAM considers that ++ to be fascist, and gives the user/sysadmin the opportunity to ++ enforce a wheel group by proper editing of /etc/pam.conf ++ ++#endif ++ + Compile-time options: + -DSYSLOG_SUCCESS Log successful su's (by default, to root) with syslog. + -DSYSLOG_FAILURE Log failed su's (by default, to root) with syslog. +@@ -53,6 +63,15 @@ + #include <pwd.h> + #include <grp.h> + ++#ifdef USE_PAM ++# include <signal.h> ++# include <sys/wait.h> ++# include <sys/fsuid.h> ++# include <unistd.h> ++# include <security/pam_appl.h> ++# include <security/pam_misc.h> ++#endif /* USE_PAM */ ++ + #include "system.h" + #include "getpass.h" + +@@ -120,10 +139,17 @@ + /* The user to become if none is specified. */ + #define DEFAULT_USER "root" + ++#ifndef USE_PAM + char *crypt (char const *key, char const *salt); ++#endif + +-static void run_shell (char const *, char const *, char **, size_t) ++static void run_shell (char const *, char const *, char **, size_t, ++ const struct passwd *) ++#ifdef USE_PAM ++ ; ++#else + ATTRIBUTE_NORETURN; ++#endif + + /* If true, pass the `-f' option to the subshell. */ + static bool fast_startup; +@@ -209,7 +235,26 @@ log_su (struct passwd const *pw, bool su + } + #endif + ++#ifdef USE_PAM ++static pam_handle_t *pamh = NULL; ++static int retval; ++static struct pam_conv conv = { ++ misc_conv, ++ NULL ++}; ++ ++#define PAM_BAIL_P if (retval) { \ ++ pam_end(pamh, PAM_SUCCESS); \ ++ return 0; \ ++} ++#define PAM_BAIL_P_VOID if (retval) { \ ++ pam_end(pamh, PAM_SUCCESS); \ ++return; \ ++} ++#endif ++ + /* Ask the user for a password. ++ If PAM is in use, let PAM ask for the password if necessary. + Return true if the user gives the correct password for entry PW, + false if not. Return true without asking for a password if run by UID 0 + or if PW has an empty password. */ +@@ -217,6 +262,44 @@ log_su (struct passwd const *pw, bool su + static bool + correct_password (const struct passwd *pw) + { ++#ifdef USE_PAM ++ struct passwd *caller; ++ char *tty_name, *ttyn; ++ retval = pam_start(PROGRAM_NAME, pw->pw_name, &conv, &pamh); ++ PAM_BAIL_P; ++ ++ if (getuid() != 0 && !isatty(0)) { ++ fprintf(stderr, "standard in must be a tty\n"); ++ exit(1); ++ } ++ ++ caller = getpwuid(getuid()); ++ if(caller != NULL && caller->pw_name != NULL) { ++ retval = pam_set_item(pamh, PAM_RUSER, caller->pw_name); ++ PAM_BAIL_P; ++ } ++ ++ ttyn = ttyname(0); ++ if (ttyn) { ++ if (strncmp(ttyn, "/dev/", 5) == 0) ++ tty_name = ttyn+5; ++ else ++ tty_name = ttyn; ++ retval = pam_set_item(pamh, PAM_TTY, tty_name); ++ PAM_BAIL_P; ++ } ++ retval = pam_authenticate(pamh, 0); ++ PAM_BAIL_P; ++ retval = pam_acct_mgmt(pamh, 0); ++ if (retval == PAM_NEW_AUTHTOK_REQD) { ++ /* password has expired. Offer option to change it. */ ++ retval = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK); ++ PAM_BAIL_P; ++ } ++ PAM_BAIL_P; ++ /* must be authenticated if this point was reached */ ++ return 1; ++#else /* !USE_PAM */ + char *unencrypted, *encrypted, *correct; + #if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP + /* Shadow passwd stuff for SVR3 and maybe other systems. */ +@@ -241,6 +324,7 @@ correct_password (const struct passwd *p + encrypted = crypt (unencrypted, correct); + memset (unencrypted, 0, strlen (unencrypted)); + return STREQ (encrypted, correct); ++#endif /* !USE_PAM */ + } + + /* Update `environ' for the new shell based on PW, with SHELL being +@@ -254,12 +338,18 @@ modify_environment (const struct passwd + /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH. + Unset all other environment variables. */ + char const *term = getenv ("TERM"); ++ char const *display = getenv ("DISPLAY"); ++ char const *xauthority = getenv ("XAUTHORITY"); + if (term) + term = xstrdup (term); + environ = xmalloc ((6 + !!term) * sizeof (char *)); + environ[0] = NULL; + if (term) + xsetenv ("TERM", term); ++ if (display) ++ xsetenv ("DISPLAY", display); ++ if (xauthority) ++ xsetenv ("XAUTHORITY", xauthority); + xsetenv ("HOME", pw->pw_dir); + xsetenv ("SHELL", shell); + xsetenv ("USER", pw->pw_name); +@@ -292,8 +382,13 @@ change_identity (const struct passwd *pw + { + #ifdef HAVE_INITGROUPS + errno = 0; +- if (initgroups (pw->pw_name, pw->pw_gid) == -1) ++ if (initgroups (pw->pw_name, pw->pw_gid) == -1) { ++#ifdef USE_PAM ++ pam_close_session(pamh, 0); ++ pam_end(pamh, PAM_ABORT); ++#endif + error (EXIT_CANCELED, errno, _("cannot set groups")); ++ } + endgrent (); + #endif + if (setgid (pw->pw_gid)) +@@ -302,6 +397,31 @@ change_identity (const struct passwd *pw + error (EXIT_CANCELED, errno, _("cannot set user id")); + } + ++#ifdef USE_PAM ++static int caught=0; ++/* Signal handler for parent process later */ ++static void su_catch_sig(int sig) ++{ ++ ++caught; ++} ++ ++int ++pam_copyenv (pam_handle_t *pamh) ++{ ++ char **env; ++ ++ env = pam_getenvlist(pamh); ++ if(env) { ++ while(*env) { ++ if (putenv (*env)) ++ xalloc_die (); ++ env++; ++ } ++ } ++ return(0); ++} ++#endif ++ + /* Run SHELL, or DEFAULT_SHELL if SHELL is empty. + If COMMAND is nonzero, pass it to the shell with the -c option. + Pass ADDITIONAL_ARGS to the shell as more arguments; there +@@ -309,17 +429,49 @@ change_identity (const struct passwd *pw + + static void + run_shell (char const *shell, char const *command, char **additional_args, +- size_t n_additional_args) ++ size_t n_additional_args, const struct passwd *pw) + { + size_t n_args = 1 + fast_startup + 2 * !!command + n_additional_args + 1; + char const **args = xnmalloc (n_args, sizeof *args); + size_t argno = 1; ++#ifdef USE_PAM ++ int child; ++ sigset_t ourset; ++ int status; ++ ++ retval = pam_open_session(pamh,0); ++ if (retval != PAM_SUCCESS) { ++ fprintf (stderr, "could not open session\n"); ++ exit (1); ++ } ++ ++/* do this at the last possible moment, because environment variables may ++ be passed even in the session phase ++*/ ++ if(pam_copyenv(pamh) != PAM_SUCCESS) ++ fprintf (stderr, "error copying PAM environment\n"); ++ ++ /* Credentials should be set in the parent */ ++ if (pam_setcred(pamh, PAM_ESTABLISH_CRED) != PAM_SUCCESS) { ++ pam_close_session(pamh, 0); ++ fprintf(stderr, "could not set PAM credentials\n"); ++ exit(1); ++ } ++ ++ child = fork(); ++ if (child == 0) { /* child shell */ ++ change_identity (pw); ++ pam_end(pamh, 0); ++#endif + + if (simulate_login) + { + char *arg0; + char *shell_basename; + ++ if(chdir(pw->pw_dir)) ++ error(0, errno, _("warning: cannot change directory to %s"), pw->pw_dir); ++ + shell_basename = last_component (shell); + arg0 = xmalloc (strlen (shell_basename) + 2); + arg0[0] = '-'; +@@ -344,6 +496,67 @@ run_shell (char const *shell, char const + error (0, errno, "%s", shell); + exit (exit_status); + } ++#ifdef USE_PAM ++ } else if (child == -1) { ++ fprintf(stderr, "can not fork user shell: %s", strerror(errno)); ++ pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT); ++ pam_close_session(pamh, 0); ++ pam_end(pamh, PAM_ABORT); ++ exit(1); ++ } ++ /* parent only */ ++ sigfillset(&ourset); ++ if (sigprocmask(SIG_BLOCK, &ourset, NULL)) { ++ fprintf(stderr, "%s: signal malfunction\n", PROGRAM_NAME); ++ caught = 1; ++ } ++ if (!caught) { ++ struct sigaction action; ++ action.sa_handler = su_catch_sig; ++ sigemptyset(&action.sa_mask); ++ action.sa_flags = 0; ++ sigemptyset(&ourset); ++ if (sigaddset(&ourset, SIGTERM) ++ || sigaddset(&ourset, SIGALRM) ++ || sigaction(SIGTERM, &action, NULL) ++ || sigprocmask(SIG_UNBLOCK, &ourset, NULL)) { ++ fprintf(stderr, "%s: signal masking malfunction\n", PROGRAM_NAME); ++ caught = 1; ++ } ++ } ++ if (!caught) { ++ do { ++ int pid; ++ ++ pid = waitpid(-1, &status, WUNTRACED); ++ ++ if (((pid_t)-1 != pid) && (0 != WIFSTOPPED (status))) { ++ kill(getpid(), WSTOPSIG(status)); ++ /* once we get here, we must have resumed */ ++ kill(pid, SIGCONT); ++ } ++ } while (0 != WIFSTOPPED(status)); ++ } ++ ++ if (caught) { ++ fprintf(stderr, "\nSession terminated, killing shell..."); ++ kill (child, SIGTERM); ++ } ++ /* Not checking retval on this because we need to call close session */ ++ pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT); ++ retval = pam_close_session(pamh, 0); ++ PAM_BAIL_P_VOID; ++ retval = pam_end(pamh, PAM_SUCCESS); ++ PAM_BAIL_P_VOID; ++ if (caught) { ++ sleep(2); ++ kill(child, SIGKILL); ++ fprintf(stderr, " ...killed.\n"); ++ exit(-1); ++ } ++ exit ((0 != WIFEXITED (status)) ? WEXITSTATUS (status) ++ : WTERMSIG (status) + 128); ++#endif /* USE_PAM */ + } + + /* Return true if SHELL is a restricted shell (one not returned by +@@ -511,9 +724,9 @@ main (int argc, char **argv) + shell = xstrdup (shell ? shell : pw->pw_shell); + modify_environment (pw, shell); + ++#ifndef USE_PAM + change_identity (pw); +- if (simulate_login && chdir (pw->pw_dir) != 0) +- error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir); ++#endif + + /* error() flushes stderr, but does not check for write failure. + Normally, we would catch this via our atexit() hook of +@@ -523,5 +736,5 @@ main (int argc, char **argv) + if (ferror (stderr)) + exit (EXIT_CANCELED); + +- run_shell (shell, command, argv + optind, MAX (0, argc - optind)); ++ run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw); + } diff --git a/testing/coreutils/coreutils-uname.patch b/testing/coreutils/coreutils-uname.patch new file mode 100644 index 000000000..b458abeba --- /dev/null +++ b/testing/coreutils/coreutils-uname.patch @@ -0,0 +1,173 @@ +On linux platforms, grok /proc/cpuinfo for the CPU/vendor info. + +Prob not suitable for upstream seeing as how it's 100% linux-specific +http://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html + +Patch originally by Carlos E. Gorges <carlos@techlinux.com.br>, but +heavily reworked to suck less. + +To add support for additional platforms, check out the show_cpuinfo() +func in the linux/arch/<ARCH>/ source tree of the kernel. + +--- coreutils/src/uname.c ++++ coreutils/src/uname.c +@@ -50,6 +50,11 @@ + # include <mach-o/arch.h> + #endif + ++#if defined(__linux__) ++# define USE_PROCINFO ++# define UNAME_HARDWARE_PLATFORM ++#endif ++ + #include "system.h" + #include "error.h" + #include "quote.h" +@@ -138,6 +143,117 @@ + exit (status); + } + ++#if defined(USE_PROCINFO) ++ ++# if defined(__s390__) || defined(__s390x__) ++# define CPUINFO_FILE "/proc/sysinfo" ++# define CPUINFO_FORMAT "%64[^\t :]%*[ :]%256[^\n]%c" ++# else ++# define CPUINFO_FILE "/proc/cpuinfo" ++# define CPUINFO_FORMAT "%64[^\t:]\t:%256[^\n]%c" ++# endif ++ ++# define PROCINFO_PROCESSOR 0 ++# define PROCINFO_HARDWARE_PLATFORM 1 ++ ++static void __eat_cpuinfo_space(char *buf) ++{ ++ /* first eat trailing space */ ++ char *tmp = buf + strlen(buf) - 1; ++ while (tmp > buf && isspace(*tmp)) ++ *tmp-- = '\0'; ++ /* then eat leading space */ ++ tmp = buf; ++ while (*tmp && isspace(*tmp)) ++ tmp++; ++ if (tmp != buf) ++ memmove(buf, tmp, strlen(tmp)+1); ++ /* finally collapse whitespace */ ++ tmp = buf; ++ while (tmp[0] && tmp[1]) { ++ if (isspace(tmp[0]) && isspace(tmp[1])) { ++ memmove(tmp, tmp+1, strlen(tmp)); ++ continue; ++ } ++ ++tmp; ++ } ++} ++ ++static int __linux_procinfo(int x, char *fstr, size_t s) ++{ ++ FILE *fp; ++ ++ char *procinfo_keys[] = { ++ /* --processor --hardware-platform */ ++ #if defined(__alpha__) ++ "cpu model", "system type" ++ #elif defined(__arm__) ++ "Processor", "Hardware" ++ #elif defined(__avr32__) ++ "processor", "cpu family" ++ #elif defined(__bfin__) ++ "CPU", "BOARD Name" ++ #elif defined(__cris__) ++ "cpu", "cpu model" ++ #elif defined(__frv__) ++ "CPU-Core", "System" ++ #elif defined(__i386__) || defined(__x86_64__) ++ "model name", "vendor_id" ++ #elif defined(__ia64__) ++ "family", "vendor" ++ #elif defined(__hppa__) ++ "cpu", "model" ++ #elif defined(__m68k__) ++ "CPU", "MMU" ++ #elif defined(__mips__) ++ "cpu model", "system type" ++ #elif defined(__powerpc__) || defined(__powerpc64__) ++ "cpu", "machine" ++ #elif defined(__s390__) || defined(__s390x__) ++ "Type", "Manufacturer" ++ #elif defined(__sh__) ++ "cpu type", "machine" ++ #elif defined(sparc) || defined(__sparc__) ++ "type", "cpu" ++ #elif defined(__vax__) ++ "cpu type", "cpu" ++ #else ++ "unknown", "unknown" ++ #endif ++ }; ++ ++ if ((fp = fopen(CPUINFO_FILE, "r")) != NULL) { ++ char key[65], value[257], eol, *ret = NULL; ++ ++ while (fscanf(fp, CPUINFO_FORMAT, key, value, &eol) != EOF) { ++ __eat_cpuinfo_space(key); ++ if (!strcmp(key, procinfo_keys[x])) { ++ __eat_cpuinfo_space(value); ++ ret = value; ++ break; ++ } ++ if (eol != '\n') { ++ /* we need two fscanf's here in case the previous ++ * length limit caused us to read right up to the ++ * newline ... doing "%*[^\n]\n" wont eat the newline ++ */ ++ fscanf(fp, "%*[^\n]"); ++ fscanf(fp, "\n"); ++ } ++ } ++ fclose(fp); ++ ++ if (ret) { ++ strncpy(fstr, ret, s); ++ return 0; ++ } ++ } ++ ++ return -1; ++} ++ ++#endif ++ + /* Print ELEMENT, preceded by a space if something has already been + printed. */ + +@@ -250,10 +344,14 @@ main (int argc, char **argv) + if (toprint & PRINT_PROCESSOR) + { + char const *element = unknown; +-#if HAVE_SYSINFO && defined SI_ARCHITECTURE ++#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO) + { + static char processor[257]; ++#if defined(USE_PROCINFO) ++ if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof processor)) ++#else + if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) ++#endif + element = processor; + } + #endif +@@ -306,9 +404,13 @@ main (int argc, char **argv) + if (element == unknown) + { + static char hardware_platform[257]; ++#if defined(USE_PROCINFO) ++ if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM, hardware_platform, sizeof hardware_platform)) ++#else + size_t s = sizeof hardware_platform; + static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM }; + if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0) ++#endif + element = hardware_platform; + } + #endif diff --git a/testing/coreutils/coreutils.install b/testing/coreutils/coreutils.install new file mode 100644 index 000000000..8caae6686 --- /dev/null +++ b/testing/coreutils/coreutils.install @@ -0,0 +1,21 @@ +infodir=usr/share/info +filelist=(coreutils.info) + +post_install() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + usr/bin/install-info $infodir/$file.gz $infodir/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + usr/bin/install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null + done +} + diff --git a/testing/coreutils/su.pam b/testing/coreutils/su.pam new file mode 100644 index 000000000..cf15f40f1 --- /dev/null +++ b/testing/coreutils/su.pam @@ -0,0 +1,9 @@ +#%PAM-1.0 +auth sufficient pam_rootok.so +# Uncomment the following line to implicitly trust users in the "wheel" group. +#auth sufficient pam_wheel.so trust use_uid +# Uncomment the following line to require a user to be in the "wheel" group. +#auth required pam_wheel.so use_uid +auth required pam_unix.so +account required pam_unix.so +session required pam_unix.so diff --git a/testing/cups-pk-helper/PKGBUILD b/testing/cups-pk-helper/PKGBUILD new file mode 100644 index 000000000..aaeec33b6 --- /dev/null +++ b/testing/cups-pk-helper/PKGBUILD @@ -0,0 +1,28 @@ +#$Id: PKGBUILD 119655 2011-04-13 10:39:02Z ibiru $ +# Maintainer: Ionut Biru <ibiru@archlinux.org> +pkgname=cups-pk-helper +pkgver=0.1.2 +pkgrel=1 +pkgdesc="A helper that makes system-config-printer use PolicyKit" +arch=(i686 x86_64) +url="http://www.freedesktop.org/software/cups-pk-helper/releases/" +license=('GPL') +depends=(dbus-glib polkit libcups) +makedepends=(intltool) +install= +source=(http://www.freedesktop.org/software/${pkgname}/releases/${pkgname}-${pkgver}.tar.bz2) +sha256sums=('ccc5f35c5232b83c16929431b352775dd4c63cb92759ec45a525edb6fcb805df') + +build() { + cd "$srcdir/$pkgname-$pkgver" + ./configure --prefix=/usr --sysconfdir=/etc \ + --libexecdir=/usr/lib/cups-pk-helper + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + make DESTDIR="$pkgdir" install +} + +# vim:set ts=2 sw=2 et: diff --git a/testing/gnome-control-center/PKGBUILD b/testing/gnome-control-center/PKGBUILD index ee94e2b08..019d63290 100644 --- a/testing/gnome-control-center/PKGBUILD +++ b/testing/gnome-control-center/PKGBUILD @@ -1,12 +1,12 @@ -# $Id: PKGBUILD 118383 2011-04-06 14:33:42Z heftig $ +# $Id: PKGBUILD 119658 2011-04-13 10:50:33Z ibiru $ # Maintainer: Jan de Groot <jgc@archlinux.org> pkgname=gnome-control-center pkgver=3.0.0.1 -pkgrel=1 +pkgrel=2 pkgdesc="The Control Center for GNOME" arch=('i686' 'x86_64') -depends=('gtk3' 'gsettings-desktop-schemas' 'gconf' 'gnome-menus' 'gnome-desktop' 'gnome-settings-daemon' 'upower' 'libgtop') +depends=('gtk3' 'gsettings-desktop-schemas' 'gconf' 'gnome-menus' 'gnome-desktop' 'gnome-settings-daemon' 'upower' 'libgtop' 'cups-pk-helper') makedepends=('gnome-doc-utils' 'intltool' 'networkmanager') url="http://www.gnome.org" groups=('gnome') diff --git a/testing/less/PKGBUILD b/testing/less/PKGBUILD new file mode 100644 index 000000000..707787bbb --- /dev/null +++ b/testing/less/PKGBUILD @@ -0,0 +1,30 @@ +# $Id: PKGBUILD 119700 2011-04-13 21:50:08Z allan $ +# Maintainer: Allan McRae <allan@archlinux.org> +# Contributor: judd <jvinet@zeroflux.org> + +pkgname=less +pkgver=443 +pkgrel=1 +pkgdesc="A terminal based program for viewing text files" +license=('GPL3') +arch=('i686' 'x86_64') +url="http://www.greenwoodsoftware.com/less" +groups=('base') +depends=('ncurses' 'pcre') +source=(http://www.greenwoodsoftware.com/$pkgname/$pkgname-$pkgver.tar.gz) +md5sums=('47db098fb3cdaf847b3c4be05ee954fc') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + + ./configure --prefix=/usr --with-regex=pcre + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + + make prefix=${pkgdir}/usr install + install -dm755 ${pkgdir}/bin + mv ${pkgdir}/usr/bin/${pkgname} ${pkgdir}/bin +} diff --git a/testing/less/zless b/testing/less/zless new file mode 100644 index 000000000..93d560bc5 --- /dev/null +++ b/testing/less/zless @@ -0,0 +1,9 @@ +#!/bin/sh + +: ${PAGER=less} +export PAGER + +PATH="/usr/bin:$PATH" +export PATH + +exec zmore ${1+"$@"} diff --git a/testing/man-db/PKGBUILD b/testing/man-db/PKGBUILD index f3f681169..0c4b05652 100644 --- a/testing/man-db/PKGBUILD +++ b/testing/man-db/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 119509 2011-04-11 20:08:00Z andyrtr $ +# $Id: PKGBUILD 119687 2011-04-13 16:45:31Z andyrtr $ # Maintainer: Andreas Radke <andyrtr@archlinux.org> # Contributor: Sergej Pupykin <sergej@aur.archlinux.org> pkgname=man-db -pkgver=2.6.0.1 +pkgver=2.6.0.2 pkgrel=1 pkgdesc="A utility for reading man pages" arch=('i686' 'x86_64') @@ -21,7 +21,7 @@ install=${pkgname}.install source=(http://savannah.nongnu.org/download/man-db/$pkgname-$pkgver.tar.gz #http://launchpad.net/man-db/main/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz convert-mans man-db.cron.daily) -md5sums=('664519fbee417dc4934f94caf6627fc3' +md5sums=('2b41c96efec032d2b74ccbf2e401f93e' '2b7662a7d5b33fe91f9f3e034361a2f6' 'd30c39ae47560304471b5461719e0f03') options=('!libtool') diff --git a/testing/man-db/man-db.install b/testing/man-db/man-db.install index 6a0f36b67..f6f0f27a6 100644 --- a/testing/man-db/man-db.install +++ b/testing/man-db/man-db.install @@ -10,9 +10,13 @@ post_upgrade() { echo "run \"userdel man\". please also" echo "chown root:root /var/cache/man" fi + # force database rebuild to get rid off badly imported pages + if [ "`vercmp $2 2.6.0.2`" -lt 0 ]; then + echo "(re)building database..." + mandb -c --quiet + fi } post_remove() { rm -rf /var/cache/man } - diff --git a/testing/mdadm/PKGBUILD b/testing/mdadm/PKGBUILD index d6c56b553..b9296a91f 100644 --- a/testing/mdadm/PKGBUILD +++ b/testing/mdadm/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 117346 2011-03-31 06:36:59Z tpowa $ +# $Id: PKGBUILD 119650 2011-04-13 07:07:09Z tpowa $ # Maintainer: Tobias Powalowski <tpowa@archlinux.org> # Contributor: Judd Vinet <jvinet@zeroflux.org> pkgname=mdadm pkgver=3.2.1 -pkgrel=1 +pkgrel=2 pkgdesc="A tool for managing/monitoring Linux md device arrays, also known as Software RAID" arch=(i686 x86_64) license=('GPL') @@ -16,17 +16,14 @@ source=(ftp://ftp.kernel.org/pub/linux/utils/raid/mdadm/mdadm-$pkgver.tar.bz2 mdadm mdadm.conf mdadm_install - mdadm_hook) + mdadm_hook + segfault-3.2.1.patch) install=mdadm.install replaces=('raidtools') -md5sums=('d1e2549202bd79d9e99f1498d1109530' - '7bff0e506fb6017510c8ec4a01896952' - '00cbed931db4f15b6ce49e3e7d433966' - '865c3d39e5f5dae58388160b563981f1' - '1a3eb63832cecd6550f5b0a21d58cfdb') build() { cd $srcdir/$pkgname-$pkgver + patch -Np1 -i ../segfault-3.2.1.patch make CXFLAGS="$CFLAGS" } @@ -43,3 +40,14 @@ package() { make MDASSEMBLE_AUTO=1 mdassemble install -D -m755 mdassemble $pkgdir/sbin/mdassemble } +md5sums=('5af65c32193fe0aea1aac4c4d44ac383' + '7bff0e506fb6017510c8ec4a01896952' + '00cbed931db4f15b6ce49e3e7d433966' + '865c3d39e5f5dae58388160b563981f1' + '1a3eb63832cecd6550f5b0a21d58cfdb') +md5sums=('d1e2549202bd79d9e99f1498d1109530' + '7bff0e506fb6017510c8ec4a01896952' + '00cbed931db4f15b6ce49e3e7d433966' + '865c3d39e5f5dae58388160b563981f1' + '1a3eb63832cecd6550f5b0a21d58cfdb' + '2fd25605bd1836a33c689ac442cb73ed') diff --git a/testing/mdadm/segfault-3.2.1.patch b/testing/mdadm/segfault-3.2.1.patch new file mode 100644 index 000000000..6042d86c2 --- /dev/null +++ b/testing/mdadm/segfault-3.2.1.patch @@ -0,0 +1,68 @@ +From 4019ad07013a5d8618b867f724d1c4a13c5cb05d Mon Sep 17 00:00:00 2001 +From: Jonathan Liu <net147@gmail.com> +Date: Tue, 12 Apr 2011 18:28:01 +1000 +Subject: [PATCH] Monitor: avoid NULL dereference with 0.90 metadata + +0.90 array do not report the metadata type in /proc/mdstat, so +we cannot assume that mse->metadata_version is non-NULL. + +So add an appropriate check. + +This adds an additional check missed by commit +eb28e119b03fd5149886ed516fa4bb006ad3602e. + +Signed-off-by: NeilBrown <neilb@suse.de> +--- + Monitor.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/Monitor.c b/Monitor.c +index a3ea724..55aebeb 100644 +--- a/Monitor.c ++++ b/Monitor.c +@@ -577,7 +577,8 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, + info[i].major = info[i].minor = 0; + } + +- if (strncmp(mse->metadata_version, "external:", 9) == 0 && ++ if (mse->metadata_version && ++ strncmp(mse->metadata_version, "external:", 9) == 0 && + is_subarray(mse->metadata_version+9)) + st->parent_dev = + devname2devnum(mse->metadata_version+10); +-- +1.7.2.3 + +From eb28e119b03fd5149886ed516fa4bb006ad3602e Mon Sep 17 00:00:00 2001 +From: NeilBrown <neilb@suse.de> +Date: Tue, 5 Apr 2011 09:16:57 +1000 +Subject: [PATCH] Monitor: avoid NULL dereference with 0.90 metadata + +0.90 array do not report the metadata type in /proc/mdstat, so +we cannot assume that mse->metadata_version is non-NULL. + +So add an appropriate check. + +Reported-by: Eugene <hdejin@yahoo.com> +Signed-off-by: NeilBrown <neilb@suse.de> +--- + Monitor.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/Monitor.c b/Monitor.c +index 291e465..337785d 100644 +--- a/Monitor.c ++++ b/Monitor.c +@@ -688,7 +688,8 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist, + st->devnum = mse->devnum; + st->percent = -2; + st->expected_spares = -1; +- if (strncmp(mse->metadata_version, "external:", 9) == 0 && ++ if (mse->metadata_version && ++ strncmp(mse->metadata_version, "external:", 9) == 0 && + is_subarray(mse->metadata_version+9)) + st->parent_dev = + devname2devnum(mse->metadata_version+10); +-- +1.7.2.3 + diff --git a/testing/mpd/PKGBUILD b/testing/mpd/PKGBUILD new file mode 100644 index 000000000..1ef47737e --- /dev/null +++ b/testing/mpd/PKGBUILD @@ -0,0 +1,56 @@ +# $Id: PKGBUILD 119708 2011-04-13 22:45:29Z schiv $ +# Maintainer: Angel Velasquez <angvp@archlinux.org> +# Contributor: Andrea Scarpino <andrea@archlinux.org> +# Contributor: Damir Perisa <damir.perisa@bluewin.ch> +# Contributor: Ben <ben@benmazer.net> + +pkgname=mpd +pkgver=0.16.2 +pkgrel=2 +pkgdesc="Music daemon that plays MP3, FLAC, and Ogg Vorbis files" +arch=('i686' 'x86_64') +license=('GPL') +url="http://mpd.wikia.com/wiki/Server" +depends=('libao' 'ffmpeg' 'libmodplug' 'audiofile' 'libshout' 'libmad' 'curl' 'faad2' + 'sqlite3' 'libsamplerate' 'libmms' 'wavpack' 'libmpcdec' 'avahi' 'libid3tag' + 'libpulse') +makedepends=('pkgconfig' 'doxygen' 'jack') +install=${pkgname}.install +source=("http://downloads.sourceforge.net/musicpd/${pkgname}-${pkgver}.tar.bz2" + 'mpd') +md5sums=('dedb75cef8e489f3de5231031876fb77' + 'e5669c2bff4031928531e52475addeb1') + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --enable-lastfm \ + --enable-jack \ + --enable-pulse \ + --enable-documentation \ + --disable-libwrap \ + --disable-cue \ + --disable-sidplay + make +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver} + make DESTDIR=${pkgdir} install + + # set ours dirs in mpd.conf file + sed -i 's|^music_directory.*$|#music_directory "path_to_your_music_collection"|1' doc/mpdconf.example + sed -i 's|playlist_directory.*$|playlist_directory "/var/lib/mpd/playlists"|1' doc/mpdconf.example + sed -i 's|db_file.*$|db_file "/var/lib/mpd/mpd.db"|1' doc/mpdconf.example + sed -i 's|log_file.*$|log_file "/var/log/mpd/mpd.log"|1' doc/mpdconf.example + sed -i 's|error_file.*$|error_file "/var/log/mpd/mpd.error"|1' doc/mpdconf.example + sed -i 's|#pid_file.*$|pid_file "/var/run/mpd/mpd.pid"|1' doc/mpdconf.example + sed -i 's|#state_file.*$|state_file "/var/lib/mpd/mpdstate"|1' doc/mpdconf.example + sed -i 's|#user.*$|user "mpd"|1' doc/mpdconf.example + + install -Dm644 doc/mpdconf.example ${pkgdir}/usr/share/mpd/mpd.conf.example + + install -Dm755 ${srcdir}/mpd ${pkgdir}/etc/rc.d/mpd + install -d ${pkgdir}/var/{lib/mpd/playlists,log/mpd} +} diff --git a/testing/mpd/mpd b/testing/mpd/mpd new file mode 100755 index 000000000..6134e2ed4 --- /dev/null +++ b/testing/mpd/mpd @@ -0,0 +1,36 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + stat_busy "Starting Music Player Daemon" + [ ! -d /var/run/mpd ] && install -d -g 45 -o 45 /var/run/mpd + /usr/bin/mpd /etc/mpd.conf &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon mpd + stat_done + fi + ;; + stop) + stat_busy "Stopping Music Player Daemon" + /usr/bin/mpd --kill /etc/mpd.conf &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon mpd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/mpd/mpd.install b/testing/mpd/mpd.install new file mode 100644 index 000000000..885505a07 --- /dev/null +++ b/testing/mpd/mpd.install @@ -0,0 +1,18 @@ +post_install() { + post_upgrade + echo "==> Create a configuration file /etc/mpd.conf before using MPD (example: /usr/share/mpd/mpd.conf.example)" +} + +post_upgrade() { + getent group "mpd" &>/dev/null || groupadd -r -g 45 mpd 1>/dev/null + getent passwd "mpd" &>/dev/null || useradd -r -u 45 -g mpd -d "/var/lib/mpd" -s "/bin/true" -G "audio" mpd 1>/dev/null + for dir in /var/{lib,log}/mpd; do + chown -R mpd:mpd "$dir" 1>/dev/null + done +} + +post_remove() { + getent passwd "mpd" &>/dev/null && userdel mpd 1>/dev/null + getent group "mpd" &>/dev/null && groupdel mpd 1>/dev/null + [ -f etc/mpd.conf ] && mv etc/mpd.conf etc/mpd.conf.pacsave 1>/dev/null +} diff --git a/testing/opencv/PKGBUILD b/testing/opencv/PKGBUILD new file mode 100644 index 000000000..b371f6930 --- /dev/null +++ b/testing/opencv/PKGBUILD @@ -0,0 +1,78 @@ +# $Id: PKGBUILD 119711 2011-04-13 23:48:14Z schiv $ +# Maintainer: Ray Rashif <schiv@archlinux.org> +# Contributor: Tobias Powalowski <tpowa@archlinux.org> + +pkgname=opencv +_realname=OpenCV +pkgver=2.2.0 +pkgrel=4 +pkgdesc="Open Source Computer Vision Library" +arch=('i686' 'x86_64') +license=('BSD') +url="http://opencv.willowgarage.com" +depends=('jasper' 'gstreamer0.10-base' 'openexr' + 'gtk2' 'xine-lib' 'libdc1394' 'v4l-utils') +makedepends=('pkg-config' 'cmake' 'doxygen' + 'python2-numpy' 'eigen') +optdepends=('eigen' + 'python2-numpy') +options=('!libtool') +source=(http://downloads.sourceforge.net/opencvlibrary/$_realname-$pkgver.tar.bz2 + ptrcvcapture.patch + gcc46.patch + nov4l1.patch) +md5sums=('122c9ac793a46854ef2819fedbbd6b1b' + '461a8b1b0f2264521e13d9ae051d13be' + 'b5fb8d6786578ae7bf272615279e8865' + '0164bdbd54ee28b1f6cba20fcfd53812') + +build() { + cd "$srcdir/$_realname-$pkgver" + + # Please do not remove any patches from trunk # + + # libpng 1.4 compatibility + #patch -Np1 -i "$srcdir/libpng-1.4.patch" + + # fix v4l issue + #patch -Np0 -i "$srcdir/v4l-mmap.patch" + + # fix ffmpeg-related C++ issue + # see http://code.google.com/p/ffmpegsource/source/detail?r=311 + #export CXXFLAGS="$CXXFLAGS -D__STDC_CONSTANT_MACROS" + + # fix linking against highgui + # see https://bugs.archlinux.org/task/22841 + patch -Np0 -i "$srcdir/ptrcvcapture.patch" + + # gcc 4.6 compatibility + # see https://bugs.archlinux.org/task/23741 + patch -Np3 -i "$srcdir/gcc46.patch" + + # distro kernel no longer has v4l1 + # see https://code.ros.org/trac/opencv/ticket/862 + patch -Np1 -i "$srcdir/nov4l1.patch" + + cmake . -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_SKIP_RPATH=ON \ + -DWITH_XINE=ON \ + -DWITH_UNICAP=OFF \ + -DBUILD_EXAMPLES=ON \ + -DBUILD_TESTS=OFF \ + -DINSTALL_C_EXAMPLES=ON \ + -DINSTALL_PYTHON_EXAMPLES=ON + make +} + +package() { + cd "$srcdir/$_realname-$pkgver" + + make DESTDIR="$pkgdir/" install + + # install license file + install -Dm644 "$srcdir/$_realname-$pkgver/doc/license.txt" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + +# vim:set ts=2 sw=2 et: diff --git a/testing/opencv/gcc46.patch b/testing/opencv/gcc46.patch new file mode 100644 index 000000000..a69499b4f --- /dev/null +++ b/testing/opencv/gcc46.patch @@ -0,0 +1,10 @@ +Index: /trunk/opencv/modules/core/include/opencv2/core/core.hpp +=================================================================== +--- /trunk/opencv/modules/core/include/opencv2/core/core.hpp (revision 4804) ++++ /trunk/opencv/modules/core/include/opencv2/core/core.hpp (revision 4861) +@@ -56,4 +56,5 @@ + #include <algorithm> + #include <cmath> ++#include <cstddef> + #include <complex> + #include <map> diff --git a/testing/opencv/libpng-1.4.patch b/testing/opencv/libpng-1.4.patch new file mode 100644 index 000000000..c34c5a58a --- /dev/null +++ b/testing/opencv/libpng-1.4.patch @@ -0,0 +1,12 @@ +diff -Naur OpenCV-2.0.0-orig/src/highgui/grfmt_png.cpp OpenCV-2.0.0/src/highgui/grfmt_png.cpp +--- OpenCV-2.0.0-orig/src/highgui/grfmt_png.cpp 2010-01-21 01:08:46.000000000 -0500 ++++ OpenCV-2.0.0/src/highgui/grfmt_png.cpp 2010-01-21 01:13:11.000000000 -0500 +@@ -223,7 +223,7 @@ + png_set_palette_to_rgb( png_ptr ); + + if( m_color_type == PNG_COLOR_TYPE_GRAY && m_bit_depth < 8 ) +- png_set_gray_1_2_4_to_8( png_ptr ); ++ png_set_expand_gray_1_2_4_to_8( png_ptr ); + + if( CV_MAT_CN(m_type) > 1 && color ) + png_set_bgr( png_ptr ); // convert RGB to BGR diff --git a/testing/opencv/nov4l1.patch b/testing/opencv/nov4l1.patch new file mode 100644 index 000000000..cacdd77b7 --- /dev/null +++ b/testing/opencv/nov4l1.patch @@ -0,0 +1,25 @@ +diff -up OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp.nov4l1 OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp +--- OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp.nov4l1 2011-02-02 16:55:22.844244001 +0100 ++++ OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp 2011-02-02 16:53:22.224244002 +0100 +@@ -214,7 +214,9 @@ make & enjoy! + #include <sys/types.h> + #include <sys/mman.h> + ++#ifdef HAVE_CAMV4L + #include <linux/videodev.h> ++#endif + + #include <string.h> + #include <stdlib.h> +diff -up OpenCV-2.2.0/modules/highgui/src/cap.cpp.nov4l1 OpenCV-2.2.0/modules/highgui/src/cap.cpp +--- OpenCV-2.2.0/modules/highgui/src/cap.cpp.nov4l1 2011-02-04 15:10:51.461243999 +0100 ++++ OpenCV-2.2.0/modules/highgui/src/cap.cpp 2011-02-04 15:11:22.040244001 +0100 +@@ -171,7 +171,7 @@ CV_IMPL CvCapture * cvCreateCameraCaptur + if (capture) + return capture; + #endif +- #if defined (HAVE_CAMV4L) || defined (HAVE_CAMV4L2) ++ #if defined (HAVE_CAMV4L) + capture = cvCreateCameraCapture_V4L (index); + if (capture) + return capture; diff --git a/testing/opencv/ptrcvcapture.patch b/testing/opencv/ptrcvcapture.patch new file mode 100644 index 000000000..c1316f0ea --- /dev/null +++ b/testing/opencv/ptrcvcapture.patch @@ -0,0 +1,17 @@ +Index: modules/highgui/src/cap.cpp +=================================================================== +--- modules/highgui/src/cap.cpp (revision 4283) ++++ modules/highgui/src/cap.cpp (working copy) +@@ -52,10 +52,10 @@ + namespace cv + { + +-template<> inline void Ptr<CvCapture>::delete_obj() ++template<> void Ptr<CvCapture>::delete_obj() + { cvReleaseCapture(&obj); } + +-template<> inline void Ptr<CvVideoWriter>::delete_obj() ++template<> void Ptr<CvVideoWriter>::delete_obj() + { cvReleaseVideoWriter(&obj); } + + } diff --git a/testing/opencv/v4l-mmap.patch b/testing/opencv/v4l-mmap.patch new file mode 100644 index 000000000..b7bbc9b74 --- /dev/null +++ b/testing/opencv/v4l-mmap.patch @@ -0,0 +1,14 @@ +http://code.ros.org/trac/opencv/ticket/141 +http://bugs.gentoo.org/313649 + +--- src/highgui/cvcap_libv4l.cpp ++++ src/highgui/cvcap_libv4l.cpp +@@ -782,7 +782,7 @@ + + capture->buffers[n_buffers].length = buf.length; + capture->buffers[n_buffers].start = +- mmap (NULL /* start anywhere */, ++ v4l2_mmap (NULL /* start anywhere */, + buf.length, + PROT_READ | PROT_WRITE /* required */, + MAP_SHARED /* recommended */, diff --git a/testing/python2/PKGBUILD b/testing/python2/PKGBUILD new file mode 100644 index 000000000..2dadb1ec3 --- /dev/null +++ b/testing/python2/PKGBUILD @@ -0,0 +1,90 @@ +# $Id: PKGBUILD 119684 2011-04-13 16:35:24Z stephane $ +# Maintainer: Allan McRae <allan@archlinux.org> +# Contributer: Stéphane Gaudreault <stephane@archlinux.org> +# Contributer: Jason Chu <jason@archlinux.org> + +pkgname=python2 +pkgver=2.7.1 +pkgrel=8 +_pybasever=2.7 +pkgdesc="A high-level scripting language" +arch=('i686' 'x86_64') +license=('PSF') +url="http://www.python.org/" +depends=('db' 'bzip2' 'gdbm' 'openssl' 'zlib' 'expat' 'sqlite3' 'libffi') +makedepends=('tk') +optdepends=('tk: for IDLE') +conflicts=('python<3') +options=('!makeflags') +source=(http://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.bz2 + python-2.7-db51.diff + python-2.7.1-fix-decimal-in-turkish-locale.patch) +md5sums=('aa27bc25725137ba155910bd8e5ddc4f' + 'd9b8161568ce17a305c1b71e61ccd4b5' + '5032449f1ff2abfe18d14cc674165b23') + +build() { + cd "${srcdir}/Python-${pkgver}" + + patch -Np1 -i ../python-2.7-db51.diff + + # Fix "import decimal" in the Turkish locale + # cf : https://bugzilla.redhat.com/show_bug.cgi?id=694928 + patch -Np1 -i ../python-2.7.1-fix-decimal-in-turkish-locale.patch + + # Temporary workaround for FS#22322 + # See http://bugs.python.org/issue10835 for upstream report + sed -i "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c + + # Enable built-in SQLite3 module to load extensions (fix FS#22122) + sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py + + # Ensure that we are using the system copy of various libraries (expat, zlib and libffi), + # rather than copies shipped in the tarball + rm -r Modules/expat + rm -r Modules/zlib + rm -r Modules/_ctypes/{darwin,libffi}* + + export OPT="${CFLAGS}" + ./configure --prefix=/usr --enable-shared --with-threads --enable-ipv6 \ + --enable-unicode=ucs4 --with-system-expat --with-system-ffi + + make +} + +package() { + cd "${srcdir}/Python-${pkgver}" + make DESTDIR="${pkgdir}" altinstall maninstall + + ln -sf python${_pybasever} "${pkgdir}/usr/bin/python2" + ln -sf python${_pybasever}-config "${pkgdir}/usr/bin/python2-config" + ln -sf python${_pybasever}.1 "${pkgdir}/usr/share/man/man1/python2.1" + + ln -sf ../../libpython${_pybasever}.so \ + "${pkgdir}/usr/lib/python${_pybasever}/config/libpython${_pybasever}.so" + + mv "${pkgdir}/usr/bin/smtpd.py" "${pkgdir}/usr/lib/python${_pybasever}/" + + # some useful "stuff" + install -dm755 "${pkgdir}"/usr/lib/python${_pybasever}/Tools/{i18n,scripts} + install -m755 Tools/i18n/{msgfmt,pygettext}.py \ + "${pkgdir}/usr/lib/python${_pybasever}/Tools/i18n/" + install -m755 Tools/scripts/{README,*py} \ + "${pkgdir}/usr/lib/python${_pybasever}/Tools/scripts/" + + # fix conflicts with python + mv "${pkgdir}"/usr/bin/idle{,2} + mv "${pkgdir}"/usr/bin/pydoc{,2} + mv "${pkgdir}"/usr/bin/2to3{,-2.7} + + # clean up #!s + find "${pkgdir}/usr/lib/python${_pybasever}/" -name '*.py' | \ + xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" + + # clean-up reference to build directory + sed -i "s#${srcdir}/Python-${pkgver}:##" \ + "${pkgdir}/usr/lib/python${_pybasever}/config/Makefile" + + # license + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/testing/python2/python-2.7-db51.diff b/testing/python2/python-2.7-db51.diff new file mode 100644 index 000000000..2da95c375 --- /dev/null +++ b/testing/python2/python-2.7-db51.diff @@ -0,0 +1,42 @@ +diff -Naur Python-2.7-orig//Modules/_bsddb.c Python-2.7/Modules/_bsddb.c +--- Python-2.7-orig//Modules/_bsddb.c 2010-05-10 00:46:46.000000000 +1000 ++++ Python-2.7/Modules/_bsddb.c 2010-10-20 13:19:26.436669911 +1000 +@@ -9765,8 +9765,11 @@ + + ADD_INT(d, DB_REP_PERMANENT); + +-#if (DBVER >= 44) ++#if (DBVER >= 44) && (DBVER <= 48) + ADD_INT(d, DB_REP_CONF_NOAUTOINIT); ++#endif ++ ++#if (DBVER >= 44) + ADD_INT(d, DB_REP_CONF_DELAYCLIENT); + ADD_INT(d, DB_REP_CONF_BULK); + ADD_INT(d, DB_REP_CONF_NOWAIT); +diff -Naur Python-2.7-orig//setup.py Python-2.7/setup.py +--- Python-2.7-orig//setup.py 2010-06-27 22:36:16.000000000 +1000 ++++ Python-2.7/setup.py 2010-10-20 13:10:48.256670026 +1000 +@@ -765,7 +765,7 @@ + # a release. Most open source OSes come with one or more + # versions of BerkeleyDB already installed. + +- max_db_ver = (4, 8) ++ max_db_ver = (5, 1) + min_db_ver = (4, 1) + db_setup_debug = False # verbose debug prints from this script? + +@@ -787,8 +787,12 @@ + return True + + def gen_db_minor_ver_nums(major): +- if major == 4: ++ if major == 5: + for x in range(max_db_ver[1]+1): ++ if allow_db_ver((5, x)): ++ yield x ++ if major == 4: ++ for x in range(9): + if allow_db_ver((4, x)): + yield x + elif major == 3: diff --git a/testing/python2/python-2.7.1-fix-decimal-in-turkish-locale.patch b/testing/python2/python-2.7.1-fix-decimal-in-turkish-locale.patch new file mode 100644 index 000000000..57f527f40 --- /dev/null +++ b/testing/python2/python-2.7.1-fix-decimal-in-turkish-locale.patch @@ -0,0 +1,48 @@ +diff -up Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale Python-2.7.1/Lib/decimal.py +--- Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale 2010-07-08 17:22:54.000000000 -0400 ++++ Python-2.7.1/Lib/decimal.py 2011-04-12 11:30:40.850350842 -0400 +@@ -1720,8 +1720,6 @@ class Decimal(object): + # here self was representable to begin with; return unchanged + return Decimal(self) + +- _pick_rounding_function = {} +- + # for each of the rounding functions below: + # self is a finite, nonzero Decimal + # prec is an integer satisfying 0 <= prec < len(self._int) +@@ -1788,6 +1786,17 @@ class Decimal(object): + else: + return -self._round_down(prec) + ++ _pick_rounding_function = dict( ++ ROUND_DOWN = '_round_down', ++ ROUND_UP = '_round_up', ++ ROUND_HALF_UP = '_round_half_up', ++ ROUND_HALF_DOWN = '_round_half_down', ++ ROUND_HALF_EVEN = '_round_half_even', ++ ROUND_CEILING = '_round_ceiling', ++ ROUND_FLOOR = '_round_floor', ++ ROUND_05UP = '_round_05up', ++ ) ++ + def fma(self, other, third, context=None): + """Fused multiply-add. + +@@ -3705,18 +3714,6 @@ _numbers.Number.register(Decimal) + + ##### Context class ####################################################### + +- +-# get rounding method function: +-rounding_functions = [name for name in Decimal.__dict__.keys() +- if name.startswith('_round_')] +-for name in rounding_functions: +- # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value. +- globalname = name[1:].upper() +- val = globals()[globalname] +- Decimal._pick_rounding_function[val] = name +- +-del name, val, globalname, rounding_functions +- + class _ContextManager(object): + """Context manager class to support localcontext(). |