summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /core
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'core')
-rw-r--r--core/acl/PKGBUILD33
-rw-r--r--core/attr/PKGBUILD44
-rw-r--r--core/bash/PKGBUILD85
-rw-r--r--core/bash/bash.install20
-rw-r--r--core/bash/dot.bash_logout3
-rw-r--r--core/bash/dot.bash_profile5
-rw-r--r--core/bash/dot.bashrc9
-rw-r--r--core/bash/system.bash_logout3
-rw-r--r--core/bash/system.bashrc23
-rw-r--r--core/bin86/PKGBUILD27
-rw-r--r--core/bin86/bin86-0.16.17-x86_64-1.patch44
-rw-r--r--core/binutils/PKGBUILD84
-rw-r--r--core/binutils/binutils.git-39637246.patch700
-rw-r--r--core/binutils/binutils.install17
-rw-r--r--core/bison/ChangeLog19
-rw-r--r--core/bison/PKGBUILD28
-rw-r--r--core/bison/bison.install16
-rw-r--r--core/bridge-utils/PKGBUILD33
-rw-r--r--core/bridge-utils/bridges.conf.d27
-rw-r--r--core/btrfs-progs-unstable/PKGBUILD25
-rw-r--r--core/btrfs-progs-unstable/btrfs-progs-build-fixes.patch32
-rw-r--r--core/bzip2/PKGBUILD57
-rw-r--r--core/cloog-ppl/PKGBUILD31
-rw-r--r--core/coreutils/PKGBUILD65
-rw-r--r--core/coreutils/coreutils-pam.patch428
-rw-r--r--core/coreutils/coreutils-uname.patch173
-rw-r--r--core/coreutils/coreutils.install21
-rw-r--r--core/coreutils/su.pam9
-rw-r--r--core/cracklib/PKGBUILD29
-rw-r--r--core/crda/PKGBUILD33
-rw-r--r--core/crda/crda.install18
-rwxr-xr-xcore/crda/crda.rc26
-rw-r--r--core/cryptsetup/PKGBUILD36
-rw-r--r--core/cryptsetup/encrypt_hook131
-rw-r--r--core/cryptsetup/encrypt_install26
-rw-r--r--core/dash/PKGBUILD28
-rw-r--r--core/db/PKGBUILD32
-rw-r--r--core/db/db.install5
-rw-r--r--core/dbus-core/PKGBUILD54
-rw-r--r--core/dbus-core/dbus57
-rw-r--r--core/dbus-core/dbus.install24
-rw-r--r--core/dcron/PKGBUILD50
-rw-r--r--core/dcron/dcron-logname.patch25
-rw-r--r--core/dcron/dcron.conf.d4
-rw-r--r--core/dcron/dcron.install10
-rw-r--r--core/dcron/dcron.rc.d47
-rw-r--r--core/dhcpcd/PKGBUILD49
-rw-r--r--core/dhcpcd/dhcpcd.conf.d6
-rw-r--r--core/dialog/PKGBUILD27
-rw-r--r--core/diffutils/PKGBUILD27
-rw-r--r--core/diffutils/diffutils.install20
-rw-r--r--core/dmraid/PKGBUILD35
-rw-r--r--core/dmraid/dmraid.install14
-rw-r--r--core/dmraid/dmraid_hook18
-rw-r--r--core/dmraid/dmraid_install20
-rw-r--r--core/dnsutils/PKGBUILD38
-rw-r--r--core/dnsutils/tools-only.patch25
-rw-r--r--core/e2fsprogs/MIT-LICENSE25
-rw-r--r--core/e2fsprogs/PKGBUILD48
-rw-r--r--core/e2fsprogs/e2fsprogs.install20
-rw-r--r--core/e2fsprogs/mke2fs.conf26
-rw-r--r--core/ed/PKGBUILD32
-rw-r--r--core/ed/ed.install22
-rw-r--r--core/elfutils/PKGBUILD32
-rw-r--r--core/eventlog/ChangeLog10
-rw-r--r--core/eventlog/PKGBUILD29
-rw-r--r--core/expat/CVE-2009-3560.patch13
-rw-r--r--core/expat/CVE-2009-3720.patch12
-rw-r--r--core/expat/PKGBUILD33
-rw-r--r--core/fakeroot/PKGBUILD36
-rw-r--r--core/fakeroot/fakeroot.install14
-rw-r--r--core/file/PKGBUILD44
-rw-r--r--core/file/file-5.05-python-3.2.patch11
-rw-r--r--core/file/file-5.05-zip64.patch11
-rw-r--r--core/findutils/PKGBUILD31
-rw-r--r--core/findutils/findutils.install22
-rw-r--r--core/flex/PKGBUILD55
-rw-r--r--core/flex/flex-2.5.35-gcc44.patch22
-rw-r--r--core/flex/flex-2.5.35-hardening.patch36
-rw-r--r--core/flex/flex-2.5.35-missing-prototypes.patch53
-rw-r--r--core/flex/flex-2.5.35-sign.patch11
-rw-r--r--core/flex/flex.install22
-rw-r--r--core/flex/lex.sh3
-rw-r--r--core/gawk/PKGBUILD36
-rw-r--r--core/gawk/gawk.install22
-rw-r--r--core/gcc/PKGBUILD228
-rw-r--r--core/gcc/gcc-ada.install22
-rw-r--r--core/gcc/gcc-fortran.install18
-rw-r--r--core/gcc/gcc-hash-style-both.patch163
-rw-r--r--core/gcc/gcc-libs.install14
-rw-r--r--core/gcc/gcc.install22
-rw-r--r--core/gcc/gcc_pure64.patch26
-rw-r--r--core/gdbm/PKGBUILD59
-rw-r--r--core/gdbm/gdbm-1.8.3-fhs.patch138
-rw-r--r--core/gdbm/gdbm-1.8.3-zeroheaders.patch44
-rw-r--r--core/gdbm/gdbm.install21
-rw-r--r--core/gen-init-cpio/Makefile42
-rw-r--r--core/gen-init-cpio/PKGBUILD26
-rw-r--r--core/gen-init-cpio/gen_init_cpio.c595
-rw-r--r--core/gettext/PKGBUILD29
-rw-r--r--core/gettext/gettext.install22
-rw-r--r--core/glib2/PKGBUILD37
-rw-r--r--core/glib2/glib2.csh1
-rw-r--r--core/glib2/glib2.sh1
-rw-r--r--core/glibc/PKGBUILD164
-rw-r--r--core/glibc/glibc-2.10-bz4781.patch42
-rw-r--r--core/glibc/glibc-2.10-dont-build-timezone.patch13
-rw-r--r--core/glibc/glibc-2.12.1-static-shared-getpagesize.patch11
-rw-r--r--core/glibc/glibc-2.12.2-ignore-origin-of-privileged-program.patch26
-rw-r--r--core/glibc/glibc-2.13-prelink.patch26
-rw-r--r--core/glibc/glibc-__i686.patch13
-rw-r--r--core/glibc/glibc.install20
-rwxr-xr-xcore/glibc/locale-gen42
-rw-r--r--core/glibc/locale.gen.txt23
-rwxr-xr-xcore/glibc/nscd40
-rw-r--r--core/gmp/PKGBUILD31
-rw-r--r--core/gmp/gmp.install20
-rw-r--r--core/gpm/PKGBUILD39
-rwxr-xr-xcore/gpm/gpm41
-rw-r--r--core/gpm/gpm.conf.d4
-rw-r--r--core/gpm/gpm.install16
-rwxr-xr-xcore/gpm/gpm.sh3
-rw-r--r--core/grep/PKGBUILD29
-rw-r--r--core/grep/grep.install21
-rw-r--r--core/groff/PKGBUILD43
-rw-r--r--core/groff/groff.install20
-rw-r--r--core/groff/site.tmac16
-rw-r--r--core/gzip/PKGBUILD39
-rw-r--r--core/gzip/gzip.install20
-rw-r--r--core/hdparm/PKGBUILD42
-rw-r--r--core/hdparm/wiper.sh.2_6.max-ranges.patch84
-rw-r--r--core/heimdal/001_all_heimdal-no_libedit.patch10
-rw-r--r--core/heimdal/002_all_heimal-fPIC.patch12
-rw-r--r--core/heimdal/003_all_heimdal-rxapps.patch22
-rw-r--r--core/heimdal/005_all_heimdal-suid_fix.patch20
-rw-r--r--core/heimdal/012_all_heimdal-berkdb.patch124
-rw-r--r--core/heimdal/013_all_heimdal-pthread-lib.patch11
-rw-r--r--core/heimdal/014_all_heimdal-path.patch50
-rw-r--r--core/heimdal/PKGBUILD113
-rw-r--r--core/heimdal/heimdal-kdc.rc40
-rw-r--r--core/heimdal/heimdal.install20
-rw-r--r--core/heimdal/kadmind.rc40
-rw-r--r--core/heimdal/kpasswd.rc40
-rw-r--r--core/heirloom-mailx/PKGBUILD64
-rw-r--r--core/idnkit/PKGBUILD32
-rw-r--r--core/ifenslave/PKGBUILD29
-rw-r--r--core/ifenslave/bonding.conf.d12
-rw-r--r--core/inetutils/PKGBUILD62
-rw-r--r--core/inetutils/ftpd.conf4
-rw-r--r--core/inetutils/ftpd.rc37
-rw-r--r--core/inetutils/inetutils.install20
-rw-r--r--core/inetutils/rexec.xinetd10
-rw-r--r--core/inetutils/rlogin.xinetd10
-rw-r--r--core/inetutils/rsh.xinetd10
-rw-r--r--core/inetutils/talk.xinetd10
-rw-r--r--core/inetutils/telnet.xinetd10
-rw-r--r--core/iproute2/PKGBUILD43
-rw-r--r--core/iproute2/iproute2-fhs.patch84
-rw-r--r--core/iptables/PKGBUILD53
-rw-r--r--core/iptables/empty.rules6
-rwxr-xr-xcore/iptables/ip6tables97
-rwxr-xr-xcore/iptables/iptables95
-rw-r--r--core/iptables/iptables.conf.d8
-rw-r--r--core/iptables/simple_firewall.rules11
-rw-r--r--core/iputils/PKGBUILD65
-rw-r--r--core/iputils/iputils-s20101006-manpages.patch1044
-rw-r--r--core/iputils/permission-fix.patch15
-rw-r--r--core/isdn4k-utils/PKGBUILD34
-rw-r--r--core/isdn4k-utils/config100
-rw-r--r--core/isdn4k-utils/isdn4k-utils-3.2p1-build.patch2028
-rw-r--r--core/iw/PKGBUILD24
-rw-r--r--core/jfsutils/PKGBUILD25
-rw-r--r--core/kbd/PKGBUILD37
-rw-r--r--core/less/PKGBUILD30
-rw-r--r--core/less/zless9
-rw-r--r--core/libarchive/PKGBUILD35
-rw-r--r--core/libcap/PKGBUILD26
-rw-r--r--core/libedit/PKGBUILD29
-rw-r--r--core/libevent/PKGBUILD27
-rw-r--r--core/libfetch/Makefile89
-rw-r--r--core/libfetch/PKGBUILD46
-rw-r--r--core/libgcrypt/PKGBUILD33
-rw-r--r--core/libgcrypt/libgcrypt.install22
-rw-r--r--core/libgpg-error/PKGBUILD32
-rw-r--r--core/libgssglue/PKGBUILD34
-rw-r--r--core/libgssglue/gssapi_mech.conf22
-rw-r--r--core/libldap/PKGBUILD78
-rw-r--r--core/libldap/ntlm.patch230
-rw-r--r--core/libmpc/PKGBUILD35
-rw-r--r--core/libmpc/libmpc-0.9-configure_cflags_egrep_issue.patch63
-rw-r--r--core/libmpc/libmpc.install20
-rw-r--r--core/libnl/PKGBUILD28
-rw-r--r--core/libnl/fix-compilation.patch10
-rw-r--r--core/libpcap/PKGBUILD36
-rw-r--r--core/librpcsecgss/PKGBUILD38
-rw-r--r--core/librpcsecgss/librpcsecgss-0.18-heimdal.patch33
-rw-r--r--core/libsasl/PKGBUILD54
-rw-r--r--core/libsasl/cyrus-sasl-2.1.19-checkpw.c.patch170
-rw-r--r--core/libsasl/cyrus-sasl-db.patch34
-rw-r--r--core/libtirpc/PKGBUILD28
-rw-r--r--core/libtirpc/libtirpc-0.2.1-fortify.patch18
-rw-r--r--core/libtool/PKGBUILD31
-rw-r--r--core/libtool/libtool.install22
-rw-r--r--core/libusb-compat/PKGBUILD26
-rw-r--r--core/libusb/PKGBUILD25
-rw-r--r--core/lilo/PKGBUILD40
-rw-r--r--core/lilo/lilo.conf28
-rw-r--r--core/lilo/lilo.install5
-rw-r--r--core/links/PKGBUILD47
-rw-r--r--core/links/links.desktop7
-rw-r--r--core/linux-api-headers/PKGBUILD38
-rw-r--r--core/linux-atm/PKGBUILD30
-rw-r--r--core/linux-atm/man-pages.patch45
-rw-r--r--core/logrotate/PKGBUILD39
-rw-r--r--core/logrotate/logrotate.conf31
-rwxr-xr-xcore/logrotate/logrotate.cron.daily3
-rw-r--r--core/lvm2/PKGBUILD61
-rw-r--r--core/lvm2/lvm2_hook23
-rw-r--r--core/lvm2/lvm2_install29
-rw-r--r--core/lzo2/PKGBUILD36
-rw-r--r--core/m4/PKGBUILD28
-rw-r--r--core/m4/m4.install20
-rw-r--r--core/make/PKGBUILD28
-rw-r--r--core/make/make.install20
-rw-r--r--core/man-db/PKGBUILD52
-rw-r--r--core/man-db/convert-mans11
-rwxr-xr-xcore/man-db/man-db.cron.daily39
-rw-r--r--core/man-db/man-db.install18
-rw-r--r--core/mdadm/PKGBUILD41
-rwxr-xr-xcore/mdadm/mdadm38
-rw-r--r--core/mdadm/mdadm.conf67
-rw-r--r--core/mdadm/mdadm.install10
-rwxr-xr-xcore/mdadm/mdadm_hook44
-rw-r--r--core/mdadm/mdadm_install46
-rw-r--r--core/mkinitcpio-busybox/PKGBUILD31
-rw-r--r--core/mkinitcpio-busybox/config986
-rw-r--r--core/mkinitcpio-busybox/loadfont-setfont-optional-psf2-font-support.patch453
-rw-r--r--core/mkinitcpio-nfs-utils/PKGBUILD23
-rw-r--r--core/mlocate/PKGBUILD52
-rw-r--r--core/mlocate/mlocate.install18
-rw-r--r--core/mlocate/updatedb.conf5
-rwxr-xr-xcore/mlocate/updatedb.cron.daily29
-rw-r--r--core/module-init-tools/PKGBUILD39
-rw-r--r--core/module-init-tools/modprobe.conf3
-rw-r--r--core/mpfr/PKGBUILD34
-rw-r--r--core/mpfr/mpfr-3.0.0-p8.patch1945
-rw-r--r--core/mpfr/mpfr.install20
-rw-r--r--core/nano/PKGBUILD34
-rw-r--r--core/nano/nano.install20
-rw-r--r--core/ncurses/PKGBUILD73
-rw-r--r--core/ncurses/set_field_buffer.patch9
-rw-r--r--core/net-tools/PKGBUILD40
-rw-r--r--core/net-tools/gcc340.patch46
-rw-r--r--core/net-tools/net-tools-1.60-2.6-compilefix.patch23
-rw-r--r--core/net-tools/net-tools-1.60-miiioctl.patch17
-rw-r--r--core/net-tools/net-tools-1.60-nameif.patch58
-rw-r--r--core/net-tools/net-tools-1.60-nameif_strncpy.patch13
-rw-r--r--core/net-tools/net-tools.patch52
-rw-r--r--core/net-tools/nisdomainname.conf.d3
-rw-r--r--core/nfs-utils/PKGBUILD87
-rw-r--r--core/nfs-utils/exports15
-rw-r--r--core/nfs-utils/idmapd.conf14
-rw-r--r--core/nfs-utils/nfs-common319
-rw-r--r--core/nfs-utils/nfs-common.conf40
-rw-r--r--core/nfs-utils/nfs-server303
-rw-r--r--core/nfs-utils/nfs-server.conf29
-rw-r--r--core/nfs-utils/nfs-utils-1.1.2-kerberos-ac.patch138
-rw-r--r--core/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch39
-rw-r--r--core/nfs-utils/nfs-utils-1.1.4-no-exec.patch15
-rw-r--r--core/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch69
-rw-r--r--core/nfs-utils/nfs-utils-1.1.6-no_libgssapi.patch57
-rw-r--r--core/nfs-utils/nfs-utils.install32
-rw-r--r--core/nfs-utils/start-statd.patch22
-rw-r--r--core/nfsidmap/PKGBUILD32
-rw-r--r--core/nilfs-utils/PKGBUILD22
-rw-r--r--core/openssh/PKGBUILD55
-rwxr-xr-xcore/openssh/sshd48
-rw-r--r--core/openssh/sshd.confd4
-rw-r--r--core/openssh/sshd.pam10
-rw-r--r--core/openssl/PKGBUILD56
-rw-r--r--core/openssl/ca-dir.patch33
-rw-r--r--core/openssl/fix-manpages.patch1920
-rw-r--r--core/openssl/no-rpath.patch11
-rw-r--r--core/openvpn/PKGBUILD61
-rw-r--r--core/openvpn/openvpn-tapdev.conf12
-rwxr-xr-xcore/openvpn/openvpn-tapdev.rc40
-rwxr-xr-xcore/openvpn/openvpn.rc43
-rw-r--r--core/pacman/PKGBUILD71
-rw-r--r--core/pacman/makepkg.conf114
-rw-r--r--core/pacman/pacman.conf80
-rw-r--r--core/pacman/pacman.conf.x86_6485
-rw-r--r--core/pacman/pacman.install62
-rw-r--r--core/pam/PKGBUILD56
-rw-r--r--core/pam/other5
-rw-r--r--core/pam/pam.install12
-rw-r--r--core/patch/PKGBUILD31
-rw-r--r--core/patch/patch-2.6.1-get-arg.patch12
-rw-r--r--core/pciutils/PKGBUILD31
-rw-r--r--core/pcmciautils/60-pcmcia.rules30
-rw-r--r--core/pcmciautils/PKGBUILD32
-rw-r--r--core/pcre/PKGBUILD36
-rw-r--r--core/perl/ChangeLog50
-rw-r--r--core/perl/PKGBUILD208
-rw-r--r--core/perl/fix-h2ph-and-tests.patch104
-rw-r--r--core/perl/perl.install18
-rwxr-xr-xcore/perl/perlbin.sh23
-rw-r--r--core/pkg-config/PKGBUILD34
-rw-r--r--core/pkg-config/autoconf-2.66.patch12
-rw-r--r--core/popt/PKGBUILD41
-rw-r--r--core/ppl/PKGBUILD28
-rw-r--r--core/ppp/PKGBUILD80
-rw-r--r--core/ppp/ip-down12
-rw-r--r--core/ppp/ip-down.d.dns.sh3
-rw-r--r--core/ppp/ip-up12
-rw-r--r--core/ppp/ip-up.d.dns.sh7
-rw-r--r--core/ppp/options352
-rw-r--r--core/ppp/plog7
-rw-r--r--core/ppp/poff103
-rw-r--r--core/ppp/pon32
-rw-r--r--core/ppp/pon.1121
-rw-r--r--core/ppp/ppp36
-rw-r--r--core/pptpclient/PKGBUILD33
-rw-r--r--core/procinfo-ng/PKGBUILD37
-rw-r--r--core/procps/PKGBUILD75
-rw-r--r--core/procps/groff-top-manpage.patch39
-rw-r--r--core/procps/procps-3.2.7-free-hlmem.patch23
-rw-r--r--core/procps/procps-3.2.7-longcmd.patch22
-rw-r--r--core/procps/procps-3.2.7-ps-man-fmt.patch12
-rw-r--r--core/procps/procps-3.2.7-psman.patch22
-rw-r--r--core/procps/procps-3.2.7-slabtop-once.patch113
-rw-r--r--core/procps/procps-3.2.7-top-clrscr.patch19
-rw-r--r--core/procps/procps-3.2.7-top-cpu0.patch20
-rw-r--r--core/procps/procps-3.2.7-top-env-cpuloop.patch84
-rw-r--r--core/procps/procps-3.2.7-top-manpage.patch32
-rw-r--r--core/procps/procps-3.2.7-top-remcpu.patch98
-rw-r--r--core/procps/procps-3.2.7-top-sorthigh.patch37
-rw-r--r--core/procps/procps-3.2.7-w-best.patch16
-rw-r--r--core/procps/procps-3.2.7-watch-unicode.patch139
-rw-r--r--core/procps/procps-3.2.8+gmake-3.82.patch14
-rw-r--r--core/procps/procps-3.2.8-linux-ver-init.patch23
-rw-r--r--core/procps/procps-3.2.8-setlocale.patch66
-rw-r--r--core/procps/procps-3.2.8-threads.patch49
-rw-r--r--core/procps/sysctl.conf13
-rw-r--r--core/psmisc/ChangeLog40
-rw-r--r--core/psmisc/PKGBUILD27
-rw-r--r--core/readline/PKGBUILD59
-rw-r--r--core/readline/inputrc36
-rw-r--r--core/readline/readline.install21
-rw-r--r--core/reiserfsprogs/PKGBUILD29
-rw-r--r--core/rfkill/60-rfkill.rules1
-rw-r--r--core/rfkill/PKGBUILD38
-rw-r--r--core/rfkill/rfkill.conf.d20
-rwxr-xr-xcore/rfkill/rfkill.rc.d38
-rw-r--r--core/rp-pppoe/PKGBUILD40
-rwxr-xr-xcore/rp-pppoe/adsl35
-rw-r--r--core/rp-pppoe/rp-pppoe.install12
-rw-r--r--core/rpcbind/PKGBUILD37
-rwxr-xr-xcore/rpcbind/rpcbind39
-rw-r--r--core/rpcbind/rpcbind-sunrpc.patch22
-rw-r--r--core/run-parts/PKGBUILD25
-rw-r--r--core/sdparm/PKGBUILD28
-rw-r--r--core/sed/PKGBUILD28
-rw-r--r--core/sed/sed.install20
-rw-r--r--core/shadow/PKGBUILD98
-rw-r--r--core/shadow/adduser399
-rw-r--r--core/shadow/chage6
-rw-r--r--core/shadow/chgpasswd4
-rw-r--r--core/shadow/chpasswd6
-rw-r--r--core/shadow/chsh6
-rw-r--r--core/shadow/defaults.pam6
-rw-r--r--core/shadow/login20
-rw-r--r--core/shadow/login.defs218
-rw-r--r--core/shadow/newusers6
-rw-r--r--core/shadow/passwd4
-rw-r--r--core/shadow/shadow6
-rw-r--r--core/shadow/shadow-4.1.4.2-groupmod-pam-check.patch21
-rwxr-xr-xcore/shadow/shadow.cron.daily6
-rw-r--r--core/shadow/shadow.install8
-rw-r--r--core/shadow/useradd.defaults9
-rw-r--r--core/shadow/xstrdup.patch9
-rw-r--r--core/sqlite3/PKGBUILD93
-rw-r--r--core/sqlite3/license.txt33
-rw-r--r--core/sudo/PKGBUILD52
-rw-r--r--core/sudo/sudo.pam3
-rw-r--r--core/sudo/sudo_l.patch21
-rw-r--r--core/sudo/sudo_noninteractive.patch15
-rw-r--r--core/sudo/sudo_validate_exitval.patch15
-rw-r--r--core/sysfsutils/PKGBUILD31
-rw-r--r--core/syslinux/PKGBUILD49
-rw-r--r--core/syslinux/syslinux-dont-build-dos-windows-targets.patch12
-rw-r--r--core/syslinux/syslinux-install_update459
-rw-r--r--core/syslinux/syslinux.cfg79
-rw-r--r--core/syslinux/syslinux.install13
-rw-r--r--core/syslog-ng/PKGBUILD45
-rw-r--r--core/syslog-ng/syslog-ng.conf92
-rw-r--r--core/syslog-ng/syslog-ng.logrotate7
-rwxr-xr-xcore/syslog-ng/syslog-ng.rc39
-rw-r--r--core/sysvinit/PKGBUILD27
-rw-r--r--core/sysvinit/sysvinit.install3
-rw-r--r--core/tar/PKGBUILD33
-rw-r--r--core/tar/tar.1364
-rw-r--r--core/tar/tar.install21
-rw-r--r--core/tcp_wrappers/01_all_redhat-bug11881.patch35
-rw-r--r--core/tcp_wrappers/02_all_redhat-bug17795.patch49
-rw-r--r--core/tcp_wrappers/03_all_wildcard.patch93
-rw-r--r--core/tcp_wrappers/04_all_fixgethostbyname.patch27
-rw-r--r--core/tcp_wrappers/07_all_sig.patch39
-rw-r--r--core/tcp_wrappers/08_all_strerror.patch27
-rw-r--r--core/tcp_wrappers/09_all_gcc-3.4.patch12
-rw-r--r--core/tcp_wrappers/10_all_more-headers.patch209
-rw-r--r--core/tcp_wrappers/11_inet6_fixes.patch41
-rw-r--r--core/tcp_wrappers/PKGBUILD74
-rw-r--r--core/tcp_wrappers/hosts.allow5
-rw-r--r--core/tcp_wrappers/hosts.deny7
-rw-r--r--core/tcp_wrappers/safe_finger.834
-rw-r--r--core/tcp_wrappers/shared_lib_plus_plus-1.patch784
-rw-r--r--core/tcp_wrappers/tcp-wrappers-7.6-ipv6-1.14.patch1233
-rw-r--r--core/tcp_wrappers/try-from.828
-rw-r--r--core/texinfo/PKGBUILD30
-rw-r--r--core/texinfo/texinfo.install21
-rw-r--r--core/tzdata/Makefile.patch140
-rw-r--r--core/tzdata/PKGBUILD40
-rw-r--r--core/udev/80-drivers.rules14
-rw-r--r--core/udev/81-arch.rules138
-rw-r--r--core/udev/PKGBUILD112
-rwxr-xr-xcore/udev/cdsymlinks.sh44
-rwxr-xr-xcore/udev/load-modules.sh80
-rw-r--r--core/udev/udev.install38
-rw-r--r--core/usbutils/PKGBUILD31
-rw-r--r--core/util-linux/PKGBUILD32
-rw-r--r--core/vi/PKGBUILD46
-rw-r--r--core/vi/exrc.sample5
-rw-r--r--core/vi/increase-tube.patch13
-rw-r--r--core/vi/navkeys.patch55
-rw-r--r--core/vi/preserve_dir.patch81
-rw-r--r--core/vpnc/PKGBUILD35
-rw-r--r--core/vpnc/vpnc.conf17
-rw-r--r--core/vpnc/vpnc.rc35
-rw-r--r--core/wget/PKGBUILD42
-rw-r--r--core/wget/wget-1.12-CVE-2010-2252.patch155
-rw-r--r--core/wget/wget.install20
-rw-r--r--core/which/PKGBUILD27
-rw-r--r--core/which/which.install20
-rw-r--r--core/wireless_tools/PKGBUILD27
-rw-r--r--core/wpa_actiond/PKGBUILD25
-rw-r--r--core/wpa_supplicant/PKGBUILD45
-rw-r--r--core/wpa_supplicant/config404
-rw-r--r--core/wpa_supplicant/dbus.patch61
-rw-r--r--core/xfsprogs/PKGBUILD29
-rw-r--r--core/xinetd/PKGBUILD44
-rw-r--r--core/xinetd/servers10
-rw-r--r--core/xinetd/services10
-rwxr-xr-xcore/xinetd/xinetd38
-rw-r--r--core/xinetd/xinetd.conf14
-rw-r--r--core/xz/PKGBUILD41
-rw-r--r--core/zlib/PKGBUILD34
-rw-r--r--core/zlib/zlib-1.2.5-lfs-decls.patch13
457 files changed, 31194 insertions, 0 deletions
diff --git a/core/acl/PKGBUILD b/core/acl/PKGBUILD
new file mode 100644
index 000000000..bfee4e73f
--- /dev/null
+++ b/core/acl/PKGBUILD
@@ -0,0 +1,33 @@
+# $Id: PKGBUILD 105458 2011-01-09 04:03:58Z stephane $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+pkgname=acl
+pkgver=2.2.49
+pkgrel=2
+pkgdesc="Access control list utilities, libraries and headers"
+arch=('i686' 'x86_64')
+url="http://savannah.nongnu.org/projects/acl"
+license=('LGPL')
+depends=('attr>=2.4.41')
+replaces=('xfsacl')
+provides=('xfsacl')
+conflicts=('xfsacl')
+options=('!libtool')
+source=(http://mirrors.zerg.biz/nongnu/${pkgname}/${pkgname}-${pkgver}.src.tar.gz)
+sha256sums=('b9c7f4752e4ef4930a62fa5aa0d7efe1cba2b5a3a2d6ee2b45c0a70c72b7e5d5')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ export INSTALL_USER=root INSTALL_GROUP=root
+ ./configure --prefix=/usr --libdir=/lib --libexecdir=/usr/lib
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DIST_ROOT="${pkgdir}" install install-lib install-dev
+
+ rm ${pkgdir}/lib/libacl.a
+ chmod 0755 ${pkgdir}/lib/libacl.so.*.*.*
+}
diff --git a/core/attr/PKGBUILD b/core/attr/PKGBUILD
new file mode 100644
index 000000000..f8b942259
--- /dev/null
+++ b/core/attr/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id: PKGBUILD 115738 2011-03-20 22:30:28Z allan $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+pkgname=attr
+pkgver=2.4.44
+pkgrel=3
+pkgdesc="Extended attribute support library for ACL support"
+arch=('i686' 'x86_64')
+url="http://oss.sgi.com/projects/xfs/"
+license=('LGPL')
+depends=('glibc')
+makedepends=('gettext')
+replaces=('xfsattr')
+provides=('xfsattr')
+conflicts=('xfsattr')
+options=('!libtool')
+source=(ftp://ftp.archlinux.org/other/attr/attr-${pkgver}.src.tar.gz)
+sha256sums=('e01fa00686072a02dddf994e6217be950f51c1dc0852ad2e210c48b6e8de793a')
+
+build() {
+ cd $srcdir/attr-$pkgver
+
+ # prevent binaries being owned by nobody:nobody
+ sed -i 's#-o $(PKG_USER) -g $(PKG_GROUP)##' include/buildmacros
+
+ autoconf
+ ./configure --prefix=/usr
+ sed -i -e 's/man2//g' man/Makefile
+ make
+}
+
+package() {
+ cd $srcdir/attr-$pkgver
+ make prefix=${pkgdir}/usr install install-lib install-dev
+
+ # tidy up
+ cd "${pkgdir}"
+
+ install -dm755 lib
+ mv -v usr/lib/libattr.so* lib/
+ ln -sv ../../lib/libattr.so.1 usr/lib/libattr.so
+
+ mv -v usr/libexec/libattr.{a,la} usr/lib/
+ rm -rvf usr/libexec
+}
diff --git a/core/bash/PKGBUILD b/core/bash/PKGBUILD
new file mode 100644
index 000000000..b02b49641
--- /dev/null
+++ b/core/bash/PKGBUILD
@@ -0,0 +1,85 @@
+# $Id: PKGBUILD 114694 2011-03-15 13:55:01Z allan $
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+# Maintainer: Allan McRae <allan@archlinux.org>
+
+pkgname=bash
+_basever=4.2
+_patchlevel=008 #prepare for some patches
+pkgver=$_basever.$_patchlevel
+pkgrel=1
+pkgdesc="The GNU Bourne Again shell"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.gnu.org/software/bash/bash.html"
+groups=('base')
+backup=(etc/bash.bash{rc,_logout} etc/skel/.bash{rc,_profile,_logout})
+depends=('readline>=6.1' 'glibc')
+provides=('sh')
+install=bash.install
+source=(http://ftp.gnu.org/gnu/bash/bash-$_basever.tar.gz
+ dot.bashrc
+ dot.bash_profile
+ dot.bash_logout
+ system.bashrc
+ system.bash_logout)
+if [ $_patchlevel -gt 000 ]; then
+ for (( p=1; p<=$((10#${_patchlevel})); p++ )); do
+ source=(${source[@]} http://ftp.gnu.org/gnu/bash/bash-$_basever-patches/bash${_basever//./}-$(printf "%03d" $p))
+ done
+fi
+
+build() {
+ cd ${srcdir}/${pkgname}-$_basever
+ for p in ../bash${_basever//./}-*; do
+ [[ -e "$p" ]] || continue
+ msg "applying patch ${p}"
+ patch -Np0 -i ${p}
+ done
+
+ _bashconfig=(-DDEFAULT_PATH_VALUE=\'\"/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin\"\'
+ -DSTANDARD_UTILS_PATH=\'\"/usr/bin:/bin:/usr/sbin:/sbin\"\'
+ -DSYS_BASHRC=\'\"/etc/bash.bashrc\"\'
+ -DSYS_BASH_LOGOUT=\'\"/etc/bash.bash_logout\"\')
+ export CFLAGS="${CFLAGS} ${_bashconfig[@]}"
+
+ ./configure --prefix=/usr --with-curses --enable-readline \
+ --without-bash-malloc --with-installed-readline \
+ --bindir=/bin --mandir=/usr/share/man --infodir=/usr/share/info
+ make
+ make check
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-$_basever
+ make DESTDIR=${pkgdir} install
+
+ # for now, bash is our default /bin/sh
+ cd ${pkgdir}/bin
+ ln -s bash sh
+
+ install -dm755 ${pkgdir}/etc/skel/
+
+ # system-wide configuration files
+ install -m644 ${srcdir}/system.bashrc ${pkgdir}/etc/bash.bashrc
+ install -m644 ${srcdir}/system.bash_logout ${pkgdir}/etc/bash.bash_logout
+
+ # user configuration file skeletons
+ install -m644 ${srcdir}/dot.bashrc ${pkgdir}/etc/skel/.bashrc
+ install -m644 ${srcdir}/dot.bash_profile ${pkgdir}/etc/skel/.bash_profile
+ install -m644 ${srcdir}/dot.bash_logout ${pkgdir}/etc/skel/.bash_logout
+}
+
+md5sums=('3fb927c7c33022f1c327f14a81c0d4b0'
+ '027d6bd8f5f6a06b75bb7698cb478089'
+ '2902e0fee7a9168f3a4fd2ccd60ff047'
+ '42f4400ed2314bd7519c020d0187edc5'
+ 'fe5d3a367f7d5f754214dc05e3d958ab'
+ '472f536d7c9e8250dc4568ec4cfaf294'
+ '1100bc1dda2cdc06ac44d7e5d17864a3'
+ '30e7948079921d3261efcc6a40722135'
+ '9ea06decec43a198f3d7cf29acc602f8'
+ 'fb48f6134d7b013135929476aa0c250c'
+ 'e70e45de33426b38153b390be0dbbcd4'
+ 'ce4e5c484993705b27daa151eca242c2'
+ '88d1f96db29461767602e2546803bda7'
+ '24c574bf6d6a581e300823d9c1276af6')
diff --git a/core/bash/bash.install b/core/bash/bash.install
new file mode 100644
index 000000000..bc75e9b6a
--- /dev/null
+++ b/core/bash/bash.install
@@ -0,0 +1,20 @@
+info_dir=usr/share/info
+info_files=(bash.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for f in ${info_files[@]}; do
+ usr/bin/install-info ${info_dir}/$f.gz ${info_dir}/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ for f in ${info_files[@]}; do
+ usr/bin/install-info --delete ${info_dir}/$f.gz ${info_dir}/dir 2> /dev/null
+ done
+}
diff --git a/core/bash/dot.bash_logout b/core/bash/dot.bash_logout
new file mode 100644
index 000000000..0e4e4f184
--- /dev/null
+++ b/core/bash/dot.bash_logout
@@ -0,0 +1,3 @@
+#
+# ~/.bash_logout
+#
diff --git a/core/bash/dot.bash_profile b/core/bash/dot.bash_profile
new file mode 100644
index 000000000..5545f007e
--- /dev/null
+++ b/core/bash/dot.bash_profile
@@ -0,0 +1,5 @@
+#
+# ~/.bash_profile
+#
+
+[[ -f ~/.bashrc ]] && . ~/.bashrc
diff --git a/core/bash/dot.bashrc b/core/bash/dot.bashrc
new file mode 100644
index 000000000..a355b0cd3
--- /dev/null
+++ b/core/bash/dot.bashrc
@@ -0,0 +1,9 @@
+#
+# ~/.bashrc
+#
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+alias ls='ls --color=auto'
+PS1='[\u@\h \W]\$ '
diff --git a/core/bash/system.bash_logout b/core/bash/system.bash_logout
new file mode 100644
index 000000000..a76e48e4a
--- /dev/null
+++ b/core/bash/system.bash_logout
@@ -0,0 +1,3 @@
+#
+# /etc/bash.bash_logout
+#
diff --git a/core/bash/system.bashrc b/core/bash/system.bashrc
new file mode 100644
index 000000000..84de2898c
--- /dev/null
+++ b/core/bash/system.bashrc
@@ -0,0 +1,23 @@
+#
+# /etc/bash.bashrc
+#
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+PS1='[\u@\h \W]\$ '
+PS2='> '
+PS3='> '
+PS4='+ '
+
+case ${TERM} in
+ xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
+ PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
+
+ ;;
+ screen)
+ PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
+ ;;
+esac
+
+[ -r /etc/bash_completion ] && . /etc/bash_completion
diff --git a/core/bin86/PKGBUILD b/core/bin86/PKGBUILD
new file mode 100644
index 000000000..b068ab833
--- /dev/null
+++ b/core/bin86/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 87909 2010-08-18 18:45:21Z andyrtr $
+# Maintainer: judd <jvinet@zeroflux.org>
+pkgname=bin86
+pkgver=0.16.17
+pkgrel=5
+pkgdesc="A complete 8086 assembler and loader"
+arch=(i686 x86_64)
+license=('GPL')
+url="http://www.debath.co.uk/"
+depends=('glibc')
+source=(http://homepage.ntlworld.com/robert.debath/dev86/$pkgname-$pkgver.tar.gz
+ bin86-0.16.17-x86_64-1.patch)
+md5sums=('c9e8d72dd2e7457b52d0e3164fc199a1' '92bdce7b0655cd2e9f83c83fc56d128e')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ if [ "$CARCH" = "x86_64" ]; then
+ patch -Np1 -i ../bin86-0.16.17-x86_64-1.patch || return 1
+ 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/core/bin86/bin86-0.16.17-x86_64-1.patch b/core/bin86/bin86-0.16.17-x86_64-1.patch
new file mode 100644
index 000000000..152413ee7
--- /dev/null
+++ b/core/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/core/binutils/PKGBUILD b/core/binutils/PKGBUILD
new file mode 100644
index 000000000..da43e8b5e
--- /dev/null
+++ b/core/binutils/PKGBUILD
@@ -0,0 +1,84 @@
+# $Id: PKGBUILD 109378 2011-02-09 08:54:49Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+
+# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
+
+pkgname=binutils
+pkgver=2.21
+pkgrel=4
+_date=20110209
+pkgdesc="A set of programs to assemble and manipulate binary and object files"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/binutils/"
+license=('GPL')
+groups=('base')
+depends=('glibc>=2.13' 'zlib')
+makedepends=('dejagnu')
+options=('!libtool' '!distcc' '!ccache')
+install=binutils.install
+source=(ftp://ftp.archlinux.org/other/${pkgname}/${pkgname}-${pkgver}_${_date}.tar.bz2
+ binutils.git-39637246.patch)
+md5sums=('673ef8f4fc0b497232b4458982e76179'
+ 'dd72cb6df5467bc6237cff2a886099d0')
+
+mksource() {
+ mkdir ${pkgname}-${_date}
+ cd ${pkgname}-${_date}
+ export _TAG=binutils-2_21-branch
+ export 'CVSROOT=:pserver:anoncvs@sourceware.org:/cvs/src'
+ cvs -z9 co -r $_TAG binutils || return 1
+ mv src binutils
+ tar -cvjf ../binutils-${pkgver}_${_date}.tar.bz2 binutils/*
+}
+
+build() {
+ cd ${srcdir}/binutils
+ patch -Np1 -i ${srcdir}/binutils.git-39637246.patch
+
+ cd ${srcdir}
+ mkdir binutils-build && cd binutils-build
+
+ [[ $CARCH == "x86_64" ]] && CONFIGFLAG="--enable-64-bit-bfd --disable-multilib"
+
+ ${srcdir}/binutils/configure --prefix=/usr \
+ --enable-ld=default --enable-gold \
+ --enable-plugins --enable-threads \
+ --enable-shared $CONFIGFLAG
+
+ # This checks the host environment and makes sure all the necessary tools are available to compile Binutils.
+ make configure-host
+
+ make tooldir=${pkgdir}/usr
+
+ # do not abort on errors - manually check log files
+ make -k -j1 check || true
+}
+
+package() {
+ cd ${srcdir}/binutils-build
+ make prefix=${pkgdir}/usr tooldir=${pkgdir}/usr install
+
+ # Add some useful headers
+ install -m644 ${srcdir}/binutils/include/libiberty.h ${pkgdir}/usr/include
+ install -m644 ${srcdir}/binutils/include/demangle.h ${pkgdir}/usr/include
+
+ # Rebuild libiberty.a with -fPIC
+ make -C libiberty clean
+ make CFLAGS="$CFLAGS -fPIC" -C libiberty
+ install -m644 libiberty/libiberty.a ${pkgdir}/usr/lib
+
+ # Rebuild libbfd.a with -fPIC
+ make -C bfd clean
+ # hidden visability prevent 3rd party shared libraries exporting bfd non-stable API
+ make CFLAGS="$CFLAGS -fPIC -fvisibility=hidden" -C bfd
+ install -m644 bfd/libbfd.a ${pkgdir}/usr/lib
+
+ # Remove Windows/Novell specific man pages
+ rm -f ${pkgdir}/usr/share/man/man1/{dlltool,nlmconv,windres,windmc}*
+
+ # Remove these symlinks, they are not ABI stable.
+ # Programs should compile static to the .a file.
+ rm -f ${pkgdir}/usr/lib/lib{bfd,opcodes}.so
+ echo "INPUT ( /usr/lib/libbfd.a -liberty -lz )" >${pkgdir}/usr/lib/libbfd.so
+ echo "INPUT ( /usr/lib/libopcodes.a -lbfd )" >${pkgdir}/usr/lib/libopcodes.so
+}
diff --git a/core/binutils/binutils.git-39637246.patch b/core/binutils/binutils.git-39637246.patch
new file mode 100644
index 000000000..460450e43
--- /dev/null
+++ b/core/binutils/binutils.git-39637246.patch
@@ -0,0 +1,700 @@
+diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
+index 777d7cf..c4c34a1 100644
+--- a/gas/config/tc-i386.c
++++ b/gas/config/tc-i386.c
+@@ -1060,7 +1060,6 @@ i386_align_code (fragS *fragP, int count)
+ else
+ patt = f32_patt;
+ break;
+- case PROCESSOR_PENTIUMPRO:
+ case PROCESSOR_PENTIUM4:
+ case PROCESSOR_NOCONA:
+ case PROCESSOR_CORE:
+@@ -1080,6 +1079,7 @@ i386_align_code (fragS *fragP, int count)
+ case PROCESSOR_I386:
+ case PROCESSOR_I486:
+ case PROCESSOR_PENTIUM:
++ case PROCESSOR_PENTIUMPRO:
+ case PROCESSOR_GENERIC32:
+ patt = f32_patt;
+ break;
+diff --git a/gas/testsuite/gas/i386/nops-1-i686.d b/gas/testsuite/gas/i386/nops-1-i686.d
+index 7752ee2..137d5c2 100644
+--- a/gas/testsuite/gas/i386/nops-1-i686.d
++++ b/gas/testsuite/gas/i386/nops-1-i686.d
+@@ -10,25 +10,41 @@ Disassembly of section .text:
+
+ 0+ <nop15>:
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 0d jmp 10 <nop14>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+10 <nop14>:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 8d b4 26 00 00 00 00 lea 0x0\(%esi,%eiz,1\),%esi
++[ ]*[a-f0-9]+: 8d bc 27 00 00 00 00 lea 0x0\(%edi,%eiz,1\),%edi
+
+ 0+20 <nop13>:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 8d b6 00 00 00 00 lea 0x0\(%esi\),%esi
++[ ]*[a-f0-9]+: 8d bc 27 00 00 00 00 lea 0x0\(%edi,%eiz,1\),%edi
+
+ 0+30 <nop12>:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 8d b6 00 00 00 00 lea 0x0\(%esi\),%esi
++[ ]*[a-f0-9]+: 8d bf 00 00 00 00 lea 0x0\(%edi\),%edi
+
+ 0+40 <nop11>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -36,7 +52,8 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 2e 0f 1f 84 00 00 00 00 00 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 8d 74 26 00 lea 0x0\(%esi,%eiz,1\),%esi
++[ ]*[a-f0-9]+: 8d bc 27 00 00 00 00 lea 0x0\(%edi,%eiz,1\),%edi
+
+ 0+50 <nop10>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -45,7 +62,8 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 8d 76 00 lea 0x0\(%esi\),%esi
++[ ]*[a-f0-9]+: 8d bc 27 00 00 00 00 lea 0x0\(%edi,%eiz,1\),%edi
+
+ 0+60 <nop9>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -55,7 +73,8 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw 0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 89 f6 mov %esi,%esi
++[ ]*[a-f0-9]+: 8d bc 27 00 00 00 00 lea 0x0\(%edi,%eiz,1\),%edi
+
+ 0+70 <nop8>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -66,7 +85,8 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 8d b4 26 00 00 00 00 lea 0x0\(%esi,%eiz,1\),%esi
+
+ 0+80 <nop7>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -78,7 +98,7 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 80 00 00 00 00 nopl 0x0\(%eax\)
++[ ]*[a-f0-9]+: 8d b4 26 00 00 00 00 lea 0x0\(%esi,%eiz,1\),%esi
+
+ 0+90 <nop6>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -91,7 +111,7 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 8d b6 00 00 00 00 lea 0x0\(%esi\),%esi
+
+ 0+a0 <nop5>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -105,7 +125,8 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 8d 74 26 00 lea 0x0\(%esi,%eiz,1\),%esi
+
+ 0+b0 <nop4>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -120,7 +141,7 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
++[ ]*[a-f0-9]+: 8d 74 26 00 lea 0x0\(%esi,%eiz,1\),%esi
+
+ 0+c0 <nop3>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -136,7 +157,7 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 00 nopl \(%eax\)
++[ ]*[a-f0-9]+: 8d 76 00 lea 0x0\(%esi\),%esi
+
+ 0+d0 <nop2>:
+ [ ]*[a-f0-9]+: 90 nop
+diff --git a/gas/testsuite/gas/i386/nops-3-i686.d b/gas/testsuite/gas/i386/nops-3-i686.d
+index 30d2627..5c114f4 100644
+--- a/gas/testsuite/gas/i386/nops-3-i686.d
++++ b/gas/testsuite/gas/i386/nops-3-i686.d
+@@ -9,9 +9,37 @@ Disassembly of section .text:
+
+ 0+ <nop>:
+ [ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: eb 1d jmp 20 <nop\+0x20>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+ [ ]*[a-f0-9]+: 89 c3 mov %eax,%ebx
+-[ ]*[a-f0-9]+: 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: 8d b4 26 00 00 00 00 lea 0x0\(%esi,%eiz,1\),%esi
++[ ]*[a-f0-9]+: 8d bc 27 00 00 00 00 lea 0x0\(%edi,%eiz,1\),%edi
+ #pass
+diff --git a/gas/testsuite/gas/i386/nops-4-i686.d b/gas/testsuite/gas/i386/nops-4-i686.d
+index 3d8420b..c61f08d 100644
+--- a/gas/testsuite/gas/i386/nops-4-i686.d
++++ b/gas/testsuite/gas/i386/nops-4-i686.d
+@@ -9,30 +9,135 @@ Disassembly of section .text:
+
+ 0+ <nop31>:
+ [ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: eb 1d jmp 20 <nop30>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+ 0+20 <nop30>:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 1c jmp 40 <nop29>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+40 <nop29>:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 1b jmp 60 <nop28>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+60 <nop28>:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 1a jmp 80 <nop27>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+80 <nop27>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -40,8 +145,32 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 19 jmp a0 <nop26>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+a0 <nop26>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -50,8 +179,31 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 2e 0f 1f 84 00 00 00 00 00 data32 nopw %cs:0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 18 jmp c0 <nop25>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+c0 <nop25>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -61,8 +213,30 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 17 jmp e0 <nop24>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+e0 <nop24>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -73,8 +247,29 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw 0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 16 jmp 100 <nop23>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+100 <nop23>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -86,8 +281,28 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 15 jmp 120 <nop22>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+120 <nop22>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -100,8 +315,27 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 80 00 00 00 00 nopl 0x0\(%eax\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 14 jmp 140 <nop21>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+140 <nop21>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -115,8 +349,26 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 13 jmp 160 <nop20>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+160 <nop20>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -131,8 +383,25 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%eax,%eax,1\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 12 jmp 180 <nop19>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+180 <nop19>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -148,8 +417,24 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 11 jmp 1a0 <nop18>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+1a0 <nop18>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -166,8 +451,23 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 0f 1f 00 nopl \(%eax\)
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 10 jmp 1c0 <nop17>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+1c0 <nop17>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -185,8 +485,22 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 90 xchg %ax,%ax
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
++[ ]*[a-f0-9]+: eb 0f jmp 1e0 <nop16>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+
+ 0+1e0 <nop16>:
+ [ ]*[a-f0-9]+: 90 nop
+@@ -205,6 +519,19 @@ Disassembly of section .text:
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: eb 0e jmp 200 <align>
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
++[ ]*[a-f0-9]+: 90 nop
+ [ ]*[a-f0-9]+: 90 nop
+-[ ]*[a-f0-9]+: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+ #pass
diff --git a/core/binutils/binutils.install b/core/binutils/binutils.install
new file mode 100644
index 000000000..8bf9f3a47
--- /dev/null
+++ b/core/binutils/binutils.install
@@ -0,0 +1,17 @@
+infodir=usr/share/info
+filelist=(as.info bfd.info binutils.info configure.info gprof.info ld.info standards.info)
+
+post_upgrade() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
diff --git a/core/bison/ChangeLog b/core/bison/ChangeLog
new file mode 100644
index 000000000..5bb22be1d
--- /dev/null
+++ b/core/bison/ChangeLog
@@ -0,0 +1,19 @@
+2010-03-25 Eric Belanger <eric@archlinux.org>
+
+ * bison 2.4.2-1
+ * Upstream update
+ * Removed texinfo dependency in install scriptlet
+ * Updated license
+ * Added sh depends
+
+2008-12-11 Eric Belanger <eric@archlinux.org>
+
+ * bison 2.4.1-1
+ * Upstream update
+
+2008-11-08 Eric Belanger <eric@archlinux.org>
+
+ * bison 2.4-1
+ * Upstream update
+ * Added info file support
+ * Added ChangeLog
diff --git a/core/bison/PKGBUILD b/core/bison/PKGBUILD
new file mode 100644
index 000000000..1e04f381e
--- /dev/null
+++ b/core/bison/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 87221 2010-08-11 03:29:16Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Eric Belanger <eric@archlinux.org>
+
+pkgname=bison
+pkgver=2.4.3
+pkgrel=1
+pkgdesc="The GNU general-purpose parser generator"
+arch=('i686' 'x86_64')
+license=('GPL3')
+url="http://www.gnu.org/software/bison/bison.html"
+depends=('glibc' 'm4' 'sh')
+groups=('base-devel')
+install=bison.install
+source=(ftp://ftp.gnu.org/gnu/bison/${pkgname}-${pkgver}.tar.bz2)
+md5sums=('c1d3ea81bc370dbd43b6f0b2cd21287e')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --datadir=/usr/share
+ make
+ make check
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/core/bison/bison.install b/core/bison/bison.install
new file mode 100644
index 000000000..890eb0366
--- /dev/null
+++ b/core/bison/bison.install
@@ -0,0 +1,16 @@
+infodir=/usr/share/info
+file=bison.info.gz
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ install-info $infodir/$file $infodir/dir 2> /dev/null
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+}
diff --git a/core/bridge-utils/PKGBUILD b/core/bridge-utils/PKGBUILD
new file mode 100644
index 000000000..75993cfa7
--- /dev/null
+++ b/core/bridge-utils/PKGBUILD
@@ -0,0 +1,33 @@
+# $Id: PKGBUILD 112055 2011-03-03 12:52:38Z stephane $
+# Maintainer:
+# Contributor: Judd Vinet <judd@archlinux.org>
+
+pkgname=bridge-utils
+pkgver=1.4
+pkgrel=4
+pkgdesc="Utilities for configuring the Linux ethernet bridge"
+arch=('i686' 'x86_64')
+url="http://www.linuxfoundation.org/en/Net:Bridge"
+license=('GPL2')
+backup=('etc/conf.d/bridges')
+depends=('glibc')
+source=(http://downloads.sourceforge.net/bridge/bridge-utils-$pkgver.tar.gz
+ bridges.conf.d)
+md5sums=('0182fcac3a2b307113bbec34e5f1c673'
+ 'f5d691282653580dd5fd4a1092ef365b')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ aclocal
+ autoconf
+ ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ # install config file
+ install -Dm644 ../bridges.conf.d "${pkgdir}/etc/conf.d/bridges"
+}
diff --git a/core/bridge-utils/bridges.conf.d b/core/bridge-utils/bridges.conf.d
new file mode 100644
index 000000000..2609cf51f
--- /dev/null
+++ b/core/bridge-utils/bridges.conf.d
@@ -0,0 +1,27 @@
+#
+# Settings for layer-2 bridges
+#
+# For each bridge interface declared in INTERFACES (in rc.conf), declare
+# a bridge_${IF} variable that contains the real ethernet interfaces that
+# should be bridged togeether.
+#
+# Then list the bridge interface name in the BRIDGE_INTERFACES array.
+#
+
+# example:
+#
+# in /etc/rc.conf:
+# eth0="eth0 up"
+# eth1="eth1 up"
+# br0="br0 192.168.0.2 netmask 255.255.255.0 up"
+# INTERFACES=(lo eth0 eth1 br0)
+#
+# in /etc/conf.d/bridges
+# bridge_br0="eth0 eth1"
+# BRIDGE_INTERFACES=(br0)
+#
+
+
+#bridge_br0="eth0 eth1"
+#BRIDGE_INTERFACES=(br0)
+
diff --git a/core/btrfs-progs-unstable/PKGBUILD b/core/btrfs-progs-unstable/PKGBUILD
new file mode 100644
index 000000000..466829f8c
--- /dev/null
+++ b/core/btrfs-progs-unstable/PKGBUILD
@@ -0,0 +1,25 @@
+# $Id: PKGBUILD 107578 2011-01-26 20:59:54Z tpowa $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+pkgname=btrfs-progs-unstable
+pkgver=0.19.20101006
+pkgrel=1
+pkgdesc="btrfs filesystem utilities"
+arch=(i686 x86_64)
+depends=('glibc' 'e2fsprogs')
+source=(ftp://ftp.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.bz2)
+url="http://btrfs.wiki.kernel.org/"
+license=('GPL2')
+
+build() {
+ cd $srcdir/$pkgname
+ make CFLAGS="$CFLAGS" all convert
+}
+
+package() {
+ cd $srcdir/$pkgname
+ make prefix=$pkgdir/usr bindir=$pkgdir/sbin install
+ # fix manpage
+ mkdir -p $pkgdir/usr/share/
+ mv $pkgdir/usr/man $pkgdir/usr/share/man
+}
+md5sums=('6bce610ed1720e6b9dc9fa96cbd8b73e')
diff --git a/core/btrfs-progs-unstable/btrfs-progs-build-fixes.patch b/core/btrfs-progs-unstable/btrfs-progs-build-fixes.patch
new file mode 100644
index 000000000..d189c5a77
--- /dev/null
+++ b/core/btrfs-progs-unstable/btrfs-progs-build-fixes.patch
@@ -0,0 +1,32 @@
+--- btrfs-progs-0.19/btrfsck.c
++++ btrfs-progs-0.19/btrfsck.c
+@@ -21,6 +21,9 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
+ #include "kerncompat.h"
+ #include "ctree.h"
+ #include "disk-io.h"
+--- btrfs-progs-0.19/mkfs.c
++++ btrfs-progs-0.19/mkfs.c
+@@ -341,7 +341,7 @@ int main(int ac, char **av)
+ u64 alloc_start = 0;
+ u64 metadata_profile = BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_DUP;
+ u64 data_profile = BTRFS_BLOCK_GROUP_RAID0;
+- u32 leafsize = getpagesize();
++ u32 leafsize = sysconf(_SC_PAGESIZE);
+ u32 sectorsize = 4096;
+ u32 nodesize = leafsize;
+ u32 stripesize = 4096;
+@@ -398,7 +398,7 @@ int main(int ac, char **av)
+ print_usage();
+ }
+ }
+- sectorsize = max(sectorsize, (u32)getpagesize());
++ sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
+ if (leafsize < sectorsize || (leafsize & (sectorsize - 1))) {
+ fprintf(stderr, "Illegal leafsize %u\n", leafsize);
+ exit(1);
diff --git a/core/bzip2/PKGBUILD b/core/bzip2/PKGBUILD
new file mode 100644
index 000000000..26634ee4a
--- /dev/null
+++ b/core/bzip2/PKGBUILD
@@ -0,0 +1,57 @@
+# $Id: PKGBUILD 91051 2010-09-21 12:28:55Z ibiru $
+# Maintainer:
+# Contributor: Judd <jvinet@zeroflux.org>
+
+pkgname=bzip2
+pkgver=1.0.6
+pkgrel=1
+pkgdesc="A high-quality data compression program"
+arch=('i686' 'x86_64')
+license=('custom')
+url="http://sources.redhat.com/bzip2"
+groups=('base')
+depends=('glibc')
+source=(http://www.bzip.org/$pkgver/bzip2-$pkgver.tar.gz)
+md5sums=('00b516f4704d4a7cb50a1d97e6e8e15b')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # add large-file support
+ sed -e 's/^CFLAGS=\(.*\)$/CFLAGS=\1 \$(BIGFILES)/' -i ./Makefile-libbz2_so
+
+ # use our optimization
+ sed -i "s|-O2|${CFLAGS}|g" Makefile
+ sed -i "s|-O2|${CFLAGS}|g" Makefile-libbz2_so
+
+ make -f Makefile-libbz2_so
+ make bzip2recover libbz2.a
+
+ install -dm755 $pkgdir/bin
+ install -m755 bzip2-shared $pkgdir/bin/bzip2
+ install -m755 bzip2recover $pkgdir/bin
+ ln -sf bzip2 $pkgdir/bin/bunzip2
+ ln -sf bzip2 $pkgdir/bin/bzcat
+
+ install -dm755 $pkgdir/usr/bin
+ install -m755 bzdiff bzgrep bzmore $pkgdir/usr/bin
+
+ install -Dm755 libbz2.so.1.0.6 $pkgdir/lib/libbz2.so.1.0.6
+ ln -s libbz2.so.1.0.6 $pkgdir/lib/libbz2.so
+ ln -s libbz2.so.1.0.6 $pkgdir/lib/libbz2.so.1
+ ln -s libbz2.so.1.0.6 $pkgdir/lib/libbz2.so.1.0
+
+ install -Dm644 libbz2.a ${pkgdir}/usr/lib/libbz2.a
+ ln -sf ../../lib/libbz2.so ${pkgdir}/usr/lib/libbz2.so
+
+ install -Dm644 bzlib.h $pkgdir/usr/include/bzlib.h
+
+ install -Dm644 bzip2.1 $pkgdir/usr/share/man/man1/bzip2.1
+ ln -sf bzip2.1 $pkgdir/usr/share/man/man1/bunzip2.1
+ ln -sf bzip2.1 $pkgdir/usr/share/man/man1/bzcat.1
+ ln -sf bzip2.1 $pkgdir/usr/share/man/man1/bzip2recover.1
+
+ install -Dm644 $srcdir/${pkgname}-${pkgver}/LICENSE \
+ $pkgdir/usr/share/licenses/${pkgname}/LICENSE
+}
+
diff --git a/core/cloog-ppl/PKGBUILD b/core/cloog-ppl/PKGBUILD
new file mode 100644
index 000000000..c5d01e5b3
--- /dev/null
+++ b/core/cloog-ppl/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 104416 2011-01-02 12:23:31Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: ezzetabi <ezzetabi at gawab dot com>
+
+pkgname=cloog-ppl
+pkgver=0.15.10
+pkgrel=2
+pkgdesc="Library that generates loops for scanning polyhedra"
+arch=('i686' 'x86_64')
+url="http://www.cloog.org/"
+license=('GPL')
+depends=('ppl>=0.11')
+options=('!libtool')
+source=(ftp://gcc.gnu.org/pub/gcc/infrastructure/${pkgname}-${pkgver}.tar.gz)
+md5sums=('04aa756179b6d850d9ffa50f61b91895')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ ./autogen.sh
+ ./configure --prefix=/usr --includedir=/usr/include/cloog-ppl \
+ --with-bits=gmp --with-ppl=/usr
+ make
+ make check
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir/ install
+ mv $pkgdir/usr/bin/cloog{,-ppl}
+}
diff --git a/core/coreutils/PKGBUILD b/core/coreutils/PKGBUILD
new file mode 100644
index 000000000..a994defcf
--- /dev/null
+++ b/core/coreutils/PKGBUILD
@@ -0,0 +1,65 @@
+# $Id: PKGBUILD 108936 2011-02-04 23:03:34Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=coreutils
+pkgver=8.10
+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=('4bb81c051da6e5436fc1ad9a67ae44fe'
+ '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
+ 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/core/coreutils/coreutils-pam.patch b/core/coreutils/coreutils-pam.patch
new file mode 100644
index 000000000..e61908f3f
--- /dev/null
+++ b/core/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/core/coreutils/coreutils-uname.patch b/core/coreutils/coreutils-uname.patch
new file mode 100644
index 000000000..b458abeba
--- /dev/null
+++ b/core/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/core/coreutils/coreutils.install b/core/coreutils/coreutils.install
new file mode 100644
index 000000000..8caae6686
--- /dev/null
+++ b/core/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/core/coreutils/su.pam b/core/coreutils/su.pam
new file mode 100644
index 000000000..cf15f40f1
--- /dev/null
+++ b/core/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/core/cracklib/PKGBUILD b/core/cracklib/PKGBUILD
new file mode 100644
index 000000000..fb91d8651
--- /dev/null
+++ b/core/cracklib/PKGBUILD
@@ -0,0 +1,29 @@
+# $Id: PKGBUILD 106685 2011-01-17 20:46:24Z tpowa $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Federico Quagliata (quaqo) <quaqo@despammed.com>
+
+pkgname=cracklib
+pkgver=2.8.18
+pkgrel=1
+pkgdesc="Password Checking Library"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://sourceforge.net/projects/cracklib"
+depends=('glibc' 'zlib')
+options=('!libtool')
+source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
+md5sums=('79053ad8bc714a44cd660cb12116211b')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ ./configure --prefix=/usr --without-python
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install
+ install -Dm644 dicts/cracklib-small $pkgdir/usr/share/dict/cracklib-small
+ sh ./util/cracklib-format dicts/cracklib-small \
+ | sh ./util/cracklib-packer $pkgdir/usr/share/cracklib/pw_dict
+}
diff --git a/core/crda/PKGBUILD b/core/crda/PKGBUILD
new file mode 100644
index 000000000..4fbb20111
--- /dev/null
+++ b/core/crda/PKGBUILD
@@ -0,0 +1,33 @@
+# $Id: PKGBUILD 79865 2010-05-08 15:22:52Z thomas $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgname=crda
+pkgver=1.1.1
+pkgrel=1
+pkgdesc="Central Regulatory Domain Agent"
+arch=(i686 x86_64)
+url="http://wireless.kernel.org/en/developers/Regulatory/CRDA"
+license=('custom')
+depends=('wireless-regdb' 'libnl' 'libgcrypt' 'udev' 'iw')
+makedepends=('python-m2crypto')
+install=crda.install
+source=(http://wireless.kernel.org/download/crda/${pkgname}-${pkgver}.tar.bz2
+ crda.rc)
+md5sums=('5fc77af68b3e21736b8ef2f8b061c810'
+ '014eef3f8655e9a130064ec6891317fc')
+
+build() {
+ # Install crda, regdbdump and udev rules
+ msg "Compiling and installing crda ..."
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make crda regdbdump || return 1
+ make DESTDIR=${pkgdir} install || return 1
+ # This rule automatically sets the regulatory domain when cfg80211 is loaded
+ echo 'ACTION=="add" SUBSYSTEM=="module", DEVPATH=="/module/cfg80211", RUN+="/etc/rc.d/wireless-regdom start >/dev/null"' >> ${pkgdir}/lib/udev/rules.d/85-regulatory.rules || return 1
+
+ msg "Installing license ..."
+ install -D -m644 ${srcdir}/${pkgname}-${pkgver}/LICENSE ${pkgdir}/usr/share/licenses/crda/LICENSE || return 1
+
+ msg "Installing boot script ..."
+ install -D -m755 ${srcdir}/crda.rc ${pkgdir}/etc/rc.d/wireless-regdom || return 1
+}
diff --git a/core/crda/crda.install b/core/crda/crda.install
new file mode 100644
index 000000000..c18e15f71
--- /dev/null
+++ b/core/crda/crda.install
@@ -0,0 +1,18 @@
+## arg 1: the new package version
+post_install() {
+ echo "Uncomment the right regulatory domain in /etc/conf.d/wireless-regdom."
+ echo "It will automatically be set when necessary."
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+post_upgrade() {
+ # In an upgrade from 1.0.1-1 or older, the wireless-regdom file moves from the crda package
+ # to the new wireless-regdb package. If the user changed the file, it is save to overwrite the one
+ # from wireless-regdb by the user-defined one
+ if [ $(vercmp $2 1.0.1-2) -lt 0 ]; then
+ if [ -f /etc/conf.d/wireless-regdom.pacorig -a -n "$(grep -v ^# /etc/conf.d/wireless-regdom.pacorig 2>/dev/null | grep -v ^$)" ]; then
+ mv /etc/conf.d/wireless-regdom.pacorig /etc/conf.d/wireless-regdom
+ fi
+ fi
+}
diff --git a/core/crda/crda.rc b/core/crda/crda.rc
new file mode 100755
index 000000000..13dbd870e
--- /dev/null
+++ b/core/crda/crda.rc
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/wireless-regdom
+
+case "$1" in
+ start)
+ if [ -n "${WIRELESS_REGDOM}" ]; then
+ stat_busy "Setting wireless regulatory domain: ${WIRELESS_REGDOM}"
+ if iw reg set ${WIRELESS_REGDOM}; then
+ stat_done
+ else
+ stat_fail
+ fi
+ fi
+ ;;
+ stop)
+ ;;
+ restart)
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 start"
+esac
+exit 0
diff --git a/core/cryptsetup/PKGBUILD b/core/cryptsetup/PKGBUILD
new file mode 100644
index 000000000..67006a82a
--- /dev/null
+++ b/core/cryptsetup/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 103928 2010-12-23 22:10:05Z thomas $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+pkgname=cryptsetup
+pkgver=1.2.0
+pkgrel=1
+pkgdesc="Userspace setup tool for transparent encryption of block devices using the Linux 2.6 cryptoapi"
+arch=(i686 x86_64)
+license=('GPL')
+url="http://code.google.com/p/cryptsetup/"
+groups=('base')
+depends=('device-mapper' 'libgcrypt' 'popt')
+conflicts=('mkinitcpio<0.5.99')
+options=('!libtool' '!emptydirs')
+source=(http://cryptsetup.googlecode.com/files/${pkgname}-${pkgver}.tar.bz2
+ encrypt_hook
+ encrypt_install)
+sha256sums=('411129817ff29e6a957bcbdcd9a2c4c953c1539acd8af912c383262ba901b5ea'
+ '64601eae6fbf3e3afceccec5877557aa208a82497c33cc94ad0a686b4022b5dc'
+ '8e4920bb4b5ce96508aa0c42b9b07326b70daf630519f1aa1d8082bca709c12a')
+
+build() {
+ cd $srcdir/$pkgname-${pkgver}
+ ./configure --prefix=/usr --disable-static --sbindir=/sbin --libdir=/lib
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-${pkgver}
+ make DESTDIR=$pkgdir install
+ # install hook
+ install -D -m644 $srcdir/encrypt_hook $pkgdir/lib/initcpio/hooks/encrypt
+ install -D -m644 $srcdir/encrypt_install $pkgdir/lib/initcpio/install/encrypt
+ # Fix pkgconfig location
+ install -d -m755 $pkgdir/usr/lib
+ mv $pkgdir/lib/pkgconfig $pkgdir/usr/lib/
+}
diff --git a/core/cryptsetup/encrypt_hook b/core/cryptsetup/encrypt_hook
new file mode 100644
index 000000000..e84bc6ed7
--- /dev/null
+++ b/core/cryptsetup/encrypt_hook
@@ -0,0 +1,131 @@
+# vim: set ft=sh:
+# TODO this one needs some work to work with lots of different
+# encryption schemes
+run_hook ()
+{
+ /sbin/modprobe -a -q dm-crypt >/dev/null 2>&1
+ if [ -e "/sys/class/misc/device-mapper" ]; then
+ if [ ! -e "/dev/mapper/control" ]; then
+ /bin/mknod "/dev/mapper/control" c $(cat /sys/class/misc/device-mapper/dev | sed 's|:| |')
+ fi
+ [ "${quiet}" = "y" ] && CSQUIET=">/dev/null"
+
+ # Get keyfile if specified
+ ckeyfile="/crypto_keyfile.bin"
+ if [ "x${cryptkey}" != "x" ]; then
+ ckdev="$(echo "${cryptkey}" | cut -d: -f1)"
+ ckarg1="$(echo "${cryptkey}" | cut -d: -f2)"
+ ckarg2="$(echo "${cryptkey}" | cut -d: -f3)"
+ if poll_device "${ckdev}" ${rootdelay}; then
+ case ${ckarg1} in
+ *[!0-9]*)
+ # Use a file on the device
+ # ckarg1 is not numeric: ckarg1=filesystem, ckarg2=path
+ mkdir /ckey
+ mount -r -t ${ckarg1} ${ckdev} /ckey
+ dd if=/ckey/${ckarg2} of=${ckeyfile} >/dev/null 2>&1
+ umount /ckey
+ ;;
+ *)
+ # Read raw data from the block device
+ # ckarg1 is numeric: ckarg1=offset, ckarg2=length
+ dd if=${ckdev} of=${ckeyfile} bs=1 skip=${ckarg1} count=${ckarg2} >/dev/null 2>&1
+ ;;
+ esac
+ fi
+ [ ! -f ${ckeyfile} ] && echo "Keyfile could not be opened. Reverting to passphrase."
+ fi
+
+ if [ -n "${cryptdevice}" ]; then
+ DEPRECATED_CRYPT=0
+ cryptdev="$(echo "${cryptdevice}" | cut -d: -f1)"
+ cryptname="$(echo "${cryptdevice}" | cut -d: -f2)"
+ else
+ DEPRECATED_CRYPT=1
+ cryptdev="${root}"
+ cryptname="root"
+ fi
+
+ warn_deprecated() {
+ echo "The syntax 'root=${root}' where '${root}' is an encrypted volume is deprecated"
+ echo "Use 'cryptdevice=${root}:root root=/dev/mapper/root' instead."
+ }
+
+ if poll_device "${cryptdev}" ${rootdelay}; then
+ if /sbin/cryptsetup isLuks ${cryptdev} >/dev/null 2>&1; then
+ [ ${DEPRECATED_CRYPT} -eq 1 ] && warn_deprecated
+ dopassphrase=1
+ # If keyfile exists, try to use that
+ if [ -f ${ckeyfile} ]; then
+ if eval /sbin/cryptsetup --key-file ${ckeyfile} luksOpen ${cryptdev} ${cryptname} ${CSQUIET}; then
+ dopassphrase=0
+ else
+ echo "Invalid keyfile. Reverting to passphrase."
+ fi
+ fi
+ # Ask for a passphrase
+ if [ ${dopassphrase} -gt 0 ]; then
+ echo ""
+ echo "A password is required to access the ${cryptname} volume:"
+
+ #loop until we get a real password
+ while ! eval /sbin/cryptsetup luksOpen ${cryptdev} ${cryptname} ${CSQUIET}; do
+ sleep 2;
+ done
+ fi
+ if [ -e "/dev/mapper/${cryptname}" ]; then
+ if [ ${DEPRECATED_CRYPT} -eq 1 ]; then
+ export root="/dev/mapper/root"
+ fi
+ else
+ err "Password succeeded, but ${cryptname} creation failed, aborting..."
+ exit 1
+ fi
+ elif [ -n "${crypto}" ]; then
+ [ ${DEPRECATED_CRYPT} -eq 1 ] && warn_deprecated
+ msg "Non-LUKS encrypted device found..."
+ if [ $# -ne 5 ]; then
+ err "Verify parameter format: crypto=hash:cipher:keysize:offset:skip"
+ err "Non-LUKS decryption not attempted..."
+ return 1
+ fi
+ exe="/sbin/cryptsetup create ${cryptname} ${cryptdev}"
+ tmp=$(echo "${crypto}" | cut -d: -f1)
+ [ -n "${tmp}" ] && exe="${exe} --hash \"${tmp}\""
+ tmp=$(echo "${crypto}" | cut -d: -f2)
+ [ -n "${tmp}" ] && exe="${exe} --cipher \"${tmp}\""
+ tmp=$(echo "${crypto}" | cut -d: -f3)
+ [ -n "${tmp}" ] && exe="${exe} --key-size \"${tmp}\""
+ tmp=$(echo "${crypto}" | cut -d: -f4)
+ [ -n "${tmp}" ] && exe="${exe} --offset \"${tmp}\""
+ tmp=$(echo "${crypto}" | cut -d: -f5)
+ [ -n "${tmp}" ] && exe="${exe} --skip \"${tmp}\""
+ if [ -f ${ckeyfile} ]; then
+ exe="${exe} --key-file ${ckeyfile}"
+ else
+ exe="${exe} --verify-passphrase"
+ echo ""
+ echo "A password is required to access the ${cryptname} volume:"
+ fi
+ eval "${exe} ${CSQUIET}"
+
+ if [ $? -ne 0 ]; then
+ err "Non-LUKS device decryption failed. verify format: "
+ err " crypto=hash:cipher:keysize:offset:skip"
+ exit 1
+ fi
+ if [ -e "/dev/mapper/${cryptname}" ]; then
+ if [ ${DEPRECATED_CRYPT} -eq 1 ]; then
+ export root="/dev/mapper/root"
+ fi
+ else
+ err "Password succeeded, but ${cryptname} creation failed, aborting..."
+ exit 1
+ fi
+ else
+ err "Failed to open encryption mapping: The device ${cryptdev} is not a LUKS volume and the crypto= paramater was not specified."
+ fi
+ fi
+ rm -f ${ckeyfile}
+ fi
+}
diff --git a/core/cryptsetup/encrypt_install b/core/cryptsetup/encrypt_install
new file mode 100644
index 000000000..9446e6864
--- /dev/null
+++ b/core/cryptsetup/encrypt_install
@@ -0,0 +1,26 @@
+# vim: set ft=sh:
+
+install ()
+{
+ if [ -z "${CRYPTO_MODULES}" ]; then
+ MODULES=" dm-crypt $(all_modules "/crypto/") "
+ else
+ MODULES=" dm-crypt ${CRYPTO_MODULES} "
+ fi
+ FILES=""
+ SCRIPT="encrypt"
+ add_dir "/dev/mapper"
+ [ -f "/sbin/cryptsetup" ] && add_binary "/sbin/cryptsetup" "/sbin/cryptsetup"
+ [ -f "/usr/sbin/cryptsetup" ] && add_binary "/usr/sbin/cryptsetup" "/sbin/cryptsetup"
+ add_binary "/sbin/dmsetup"
+ add_file "/lib/udev/rules.d/10-dm.rules"
+ add_file "/lib/udev/rules.d/13-dm-disk.rules"
+ add_file "/lib/udev/rules.d/95-dm-notify.rules"
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook allows for an encrypted root device.
+HELPEOF
+}
diff --git a/core/dash/PKGBUILD b/core/dash/PKGBUILD
new file mode 100644
index 000000000..578f4b17f
--- /dev/null
+++ b/core/dash/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 105861 2011-01-13 15:23:08Z stephane $
+# Maintainer: Dan McGee <dan@archlinux.org>
+
+pkgname=dash
+pkgver=0.5.6.1
+pkgrel=2
+pkgdesc="A POSIX compliant shell that aims to be as small as possible"
+arch=('i686' 'x86_64')
+url="http://gondor.apana.org.au/~herbert/dash/"
+license=('BSD')
+groups=('base')
+depends=('glibc')
+source=("http://gondor.apana.org.au/~herbert/dash/files/${pkgname}-${pkgver}.tar.gz")
+md5sums=('1c846f4f5a33c0050b2045a6f7037e56')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --mandir=/usr/share/man --exec-prefix=""
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ # license
+ install -m644 -D COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
+}
diff --git a/core/db/PKGBUILD b/core/db/PKGBUILD
new file mode 100644
index 000000000..c9e1369f6
--- /dev/null
+++ b/core/db/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 108790 2011-02-03 13:05:02Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=db
+pkgver=5.1.25
+_basever=5.1.25
+pkgrel=1
+pkgdesc="The Berkeley DB embedded database system"
+arch=('i686' 'x86_64')
+url="http://www.oracle.com/technology/software/products/berkeley-db/index.html"
+license=('custom')
+depends=('gcc-libs' 'sh')
+options=('!libtool')
+install=db.install
+source=(http://download-uk.oracle.com/berkeley-db/db-${_basever}.tar.gz)
+md5sums=('06656429bfc1abb6c0498eaeff70cd04')
+
+build() {
+ cd ${srcdir}/$pkgname-${_basever}/build_unix
+ ../dist/configure --prefix=/usr --enable-compat185 \
+ --enable-shared --enable-static --enable-cxx --enable-dbm
+ make LIBSO_LIBS=-lpthread
+}
+
+package() {
+ cd ${srcdir}/$pkgname-${_basever}/build_unix
+ make DESTDIR=${pkgdir} install
+ rm -rf ${pkgdir}/usr/docs
+ install -Dm644 ${srcdir}/${pkgname}-${_basever}/LICENSE \
+ ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
diff --git a/core/db/db.install b/core/db/db.install
new file mode 100644
index 000000000..03b64042d
--- /dev/null
+++ b/core/db/db.install
@@ -0,0 +1,5 @@
+post_upgrade() {
+ if [ "$(vercmp $2 5.1)" -lt 0 ]; then
+ echo " >> Major version update. Consider running db_upgrade on Berkeley DB databases."
+ fi
+}
diff --git a/core/dbus-core/PKGBUILD b/core/dbus-core/PKGBUILD
new file mode 100644
index 000000000..99df87de7
--- /dev/null
+++ b/core/dbus-core/PKGBUILD
@@ -0,0 +1,54 @@
+# $Id: PKGBUILD 103698 2010-12-22 15:04:52Z jgc $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+# Contributor: Link Dupont <link@subpop.net>
+#
+pkgname=dbus-core
+pkgver=1.4.1
+pkgrel=1
+pkgdesc="Freedesktop.org message bus system"
+url="http://www.freedesktop.org/Software/dbus"
+arch=(i686 x86_64)
+license=('GPL' 'custom')
+depends=('expat>=2.0.1' 'coreutils' 'filesystem')
+conflicts=('dbus<1.2.3-2')
+options=(!libtool)
+install=dbus.install
+source=(http://dbus.freedesktop.org/releases/dbus/dbus-${pkgver}.tar.gz
+ dbus)
+md5sums=('99cb057700c0455fb68f8d57902f77ac'
+ '08f93dd19cffd1b45ab05c1fd4efb560')
+
+build() {
+ cd "${srcdir}/dbus-${pkgver}"
+ ECHO="echo" ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
+ --libexecdir=/usr/lib/dbus-1.0 --with-dbus-user=81 \
+ --with-system-pid-file=/var/run/dbus.pid \
+ --enable-inotify --disable-dnotify \
+ --disable-verbose-mode --disable-static \
+ --disable-tests --disable-asserts --without-x \
+ --with-systemdsystemunitdir=/lib/systemd/system
+ make
+ make DESTDIR="${pkgdir}" install
+
+ rm -f "${pkgdir}/usr/bin/dbus-launch"
+ rm -f "${pkgdir}/usr/share/man/man1/dbus-launch.1"
+
+ chown 81:81 "${pkgdir}/var/run/dbus"
+
+ install -m755 -d "${pkgdir}/etc/rc.d"
+ install -m755 "${srcdir}/dbus" "${pkgdir}/etc/rc.d/"
+
+ #Fix configuration file
+ sed -i -e 's|<user>81</user>|<user>dbus</user>|' "${pkgdir}/etc/dbus-1/system.conf"
+
+ #install .keep files so pacman doesn't delete empty dirs
+ touch "${pkgdir}/usr/share/dbus-1/services/.keep"
+ touch "${pkgdir}/usr/share/dbus-1/system-services/.keep"
+ touch "${pkgdir}/etc/dbus-1/session.d/.keep"
+ touch "${pkgdir}/etc/dbus-1/system.d/.keep"
+
+ rmdir "${pkgdir}/usr/lib/dbus-1.0/dbus-1"
+
+ install -d -m755 "${pkgdir}/usr/share/licenses/dbus-core"
+ install -m644 COPYING "${pkgdir}/usr/share/licenses/dbus-core/"
+}
diff --git a/core/dbus-core/dbus b/core/dbus-core/dbus
new file mode 100644
index 000000000..66b84cae0
--- /dev/null
+++ b/core/dbus-core/dbus
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# general config
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting D-BUS system messagebus"
+ if [ ! -x /var/run/dbus ] ; then
+ install -m755 -g 81 -o 81 -d /var/run/dbus
+ fi
+ if [ -x /usr/bin/dbus-uuidgen ] ; then
+ /usr/bin/dbus-uuidgen --ensure
+ fi
+
+ /usr/bin/dbus-daemon --system
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon dbus
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping D-BUS system messagebus"
+ [ -f /var/run/dbus.pid ] && kill `cat /var/run/dbus.pid` >/dev/null 2>&1
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm -f /var/run/dbus.pid
+ rm_daemon dbus
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ reload)
+ stat_busy "Reloading D-BUS configuration"
+ [ -f /var/run/dbus.pid ] && /usr/bin/dbus-send \
+ --system --type=method_call \
+ --dest=org.freedesktop.DBus \
+ / org.freedesktop.DBus.ReloadConfig
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart|reload}"
+ ;;
+esac
+exit 0
diff --git a/core/dbus-core/dbus.install b/core/dbus-core/dbus.install
new file mode 100644
index 000000000..44f4475ee
--- /dev/null
+++ b/core/dbus-core/dbus.install
@@ -0,0 +1,24 @@
+post_install() {
+ getent group dbus >/dev/null || usr/sbin/groupadd -g 81 dbus
+ getent passwd dbus >/dev/null || usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus
+ usr/bin/passwd -l dbus &>/dev/null
+ dbus-uuidgen --ensure
+}
+
+post_upgrade() {
+ post_install
+
+ #Make sure new rc script can shutdown running dbus
+ if [ -f var/run/dbus/pid ]; then
+ mv var/run/dbus/pid var/run/dbus.pid
+ fi
+}
+
+post_remove() {
+ if getent passwd dbus >/dev/null; then
+ usr/sbin/userdel dbus
+ fi
+ if getent group dbus >/dev/null; then
+ usr/sbin/groupdel dbus
+ fi
+}
diff --git a/core/dcron/PKGBUILD b/core/dcron/PKGBUILD
new file mode 100644
index 000000000..61999c950
--- /dev/null
+++ b/core/dcron/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: Paul Mattal <paul.archlinux.org>
+
+pkgname=dcron
+pkgver=4.4
+pkgrel=2
+pkgdesc="dillon's lightweight cron daemon"
+arch=(i686 x86_64)
+license=('GPL')
+url="http://www.jimpryor.net/linux/dcron"
+backup=(var/spool/cron/root etc/conf.d/crond)
+depends=('glibc')
+provides=('cron')
+groups=('base')
+source=("http://www.jimpryor.net/linux/releases/${pkgname}-${pkgver}.tar.gz"
+ 'dcron-logname.patch'
+ 'dcron.rc.d'
+ 'dcron.conf.d')
+md5sums=('02d848ba043a9df5bf2102a9f4bc04bd'
+ 'c6054421b48100f7a2a7a36e2d33c92a'
+ '73693cdd59df526e729cdec99c5ed8fb'
+ '5bfa07beb54d0beaf3f38225e4d5a9fa')
+optdepends=('smtp-server: sending cron job output via email')
+install=$pkgname.install
+
+build() {
+ cd "$srcdir/${pkgname}-${pkgver}" || return 1
+
+ # patch to add LOGNAME environment variable
+ patch -p1 -i $srcdir/dcron-logname.patch || return 1
+
+ # by default, any member of group "users" can edit their own crontab
+ make \
+ PREFIX=/usr \
+ CRONTAB_GROUP=users \
+ CRONTABS=/var/spool/cron \
+ CRONSTAMPS=/var/spool/cronstamps \
+ || return 1
+ make DESTDIR="$pkgdir" install || return 1
+
+ # install standard configuration and scripts
+ install -d -m755 "$pkgdir/etc/cron."{hourly,daily,weekly,monthly} \
+ || return 1
+ install -D -m755 extra/run-cron "$pkgdir/usr/sbin/run-cron" || return 1
+ install -D -m0600 extra/root.crontab "$pkgdir/var/spool/cron/root" \
+ || return 1
+
+ # install Arch configuration and launch scripts
+ install -D -m755 "$srcdir/dcron.rc.d" "$pkgdir/etc/rc.d/crond" || return 1
+ install -D -m0644 "$srcdir/dcron.conf.d" "$pkgdir/etc/conf.d/crond" || return 1
+}
diff --git a/core/dcron/dcron-logname.patch b/core/dcron/dcron-logname.patch
new file mode 100644
index 000000000..c37c5f45f
--- /dev/null
+++ b/core/dcron/dcron-logname.patch
@@ -0,0 +1,25 @@
+diff -aur dcron-4.4/chuser.c dcron-4.4.logname/chuser.c
+--- dcron-4.4/chuser.c 2010-02-15 11:18:13.111967483 +0100
++++ dcron-4.4.logname/chuser.c 2010-02-15 11:18:29.615531204 +0100
+@@ -25,6 +25,7 @@
+ return(-1);
+ }
+ setenv("USER", pas->pw_name, 1);
++ setenv("LOGNAME", pas->pw_name, 1);
+ setenv("HOME", pas->pw_dir, 1);
+ setenv("SHELL", "/bin/sh", 1);
+
+diff -aur dcron-4.4/crontab.1 dcron-4.4.logname/crontab.1
+--- dcron-4.4/crontab.1 2010-02-15 11:18:13.111967483 +0100
++++ dcron-4.4.logname/crontab.1 2010-02-15 11:19:48.295707950 +0100
+@@ -57,8 +57,8 @@
+ .PP
+ Nor does it do any special environment handling.
+ A shell script is better-suited to doing that than a cron daemon.
+-This cron daemon sets up only three environment variables: USER,
+-HOME, and SHELL.
++This cron daemon sets up only four environment variables: USER,
++LOGNAME, HOME, and SHELL.
+ .PP
+ Our crontab format is roughly similar to that used by vixiecron.
+ Individual fields may contain a time, a time range, a time range
diff --git a/core/dcron/dcron.conf.d b/core/dcron/dcron.conf.d
new file mode 100644
index 000000000..763c71263
--- /dev/null
+++ b/core/dcron/dcron.conf.d
@@ -0,0 +1,4 @@
+#
+# Parameters to be passed to crond
+#
+CROND_ARGS="-S -l info"
diff --git a/core/dcron/dcron.install b/core/dcron/dcron.install
new file mode 100644
index 000000000..ba08b3af1
--- /dev/null
+++ b/core/dcron/dcron.install
@@ -0,0 +1,10 @@
+## arg 1: the new package version
+## arg 2: the old package version
+post_upgrade() {
+ if [ "`vercmp $2 4.0`" -lt 0 ]
+ then
+ echo "Restart crond, since you're upgrading to the dcron 4.x series."
+ fi
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/dcron/dcron.rc.d b/core/dcron/dcron.rc.d
new file mode 100644
index 000000000..b1a5770e6
--- /dev/null
+++ b/core/dcron/dcron.rc.d
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/crond
+
+PID=$(pidof -o %PPID /usr/sbin/crond)
+case $1 in
+start)
+ stat_busy "Starting Cron Daemon"
+
+ # defaults to using syslog, and sendmail-ing cron output to local user
+ # to mail output to remote address instead, add "-m user@host"
+ # to CROND_ARGS in /etc/conf.d/crond
+ if [[ -z $PID ]] && /usr/sbin/crond $CROND_ARGS; then
+
+ PID=$(pidof -o %PPID /usr/sbin/crond)
+ echo "$PID" > /var/run/crond.pid
+ add_daemon crond
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+stop)
+ stat_busy "Stopping Cron Daemon"
+ if [[ ! -z $PID ]] && kill "$PID" &>/dev/null; then
+ rm_daemon crond
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+restart)
+ $0 stop
+ $0 start
+ ;;
+
+*)
+ echo "Usage: $0 {start|stop|restart}" >&2
+ exit 1
+
+esac
diff --git a/core/dhcpcd/PKGBUILD b/core/dhcpcd/PKGBUILD
new file mode 100644
index 000000000..e4fb4b8cd
--- /dev/null
+++ b/core/dhcpcd/PKGBUILD
@@ -0,0 +1,49 @@
+# $Id: PKGBUILD 111279 2011-02-25 16:37:08Z ronald $
+# Maintainer: Ronald van Haren <ronald.archlinux.org>
+# Contributor: Tom Killian <tom.archlinux.org>
+# Contributor: Judd Vinet <jvinet.zeroflux.org>
+
+pkgname=dhcpcd
+pkgver=5.2.11
+pkgrel=1
+pkgdesc="RFC2131 compliant DHCP client daemon"
+url="http://roy.marples.name/dhcpcd/"
+arch=('i686' 'x86_64')
+license=('BSD')
+groups=('base')
+depends=('glibc' 'sh')
+backup=('etc/conf.d/dhcpcd' 'etc/dhcpcd.conf')
+options=('emptydirs') # We Need the Empty /var/lib/dhcpcd Directory
+source=("http://roy.marples.name/downloads/$pkgname/$pkgname-$pkgver.tar.bz2" \
+ 'dhcpcd.conf.d')
+sha1sums=('3b170b45af314f84008650bb7447320655969241'
+ 'b67b9ce6a2faaca75fea356966a16be2283b7db0')
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ # configure variables
+ ./configure --libexecdir=/usr/lib/dhcpcd --dbdir=/var/lib/dhcpcd
+
+ # Build
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+
+ # Create Binary Symlink
+ install -d ${pkgdir}/usr/sbin
+ ln -sf /sbin/dhcpcd ${pkgdir}/usr/sbin/dhcpcd
+
+ # Install Configuration File used in /etc/rc.d/network
+ install -D -m644 ../dhcpcd.conf.d $pkgdir/etc/conf.d/$pkgname
+
+ # Install License
+ install -d $pkgdir/usr/share/licenses/$pkgname
+ awk '{if(FNR<27)print $0}' ${srcdir}/${pkgname}-${pkgver}/configure.h \
+ >> ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+
+ # Set Options in /etc/dhcpcd.conf
+ echo noipv4ll >> ${pkgdir}/etc/dhcpcd.conf # Disable ip4vall
+}
diff --git a/core/dhcpcd/dhcpcd.conf.d b/core/dhcpcd/dhcpcd.conf.d
new file mode 100644
index 000000000..83c6f14ad
--- /dev/null
+++ b/core/dhcpcd/dhcpcd.conf.d
@@ -0,0 +1,6 @@
+#
+# Arguments to be passed to the DHCP client daemon
+#
+
+DHCPCD_ARGS="-q"
+
diff --git a/core/dialog/PKGBUILD b/core/dialog/PKGBUILD
new file mode 100644
index 000000000..b9f4f68ba
--- /dev/null
+++ b/core/dialog/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 113956 2011-03-10 22:08:22Z eric $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=dialog
+pkgver=1.1_20110302
+pkgrel=1
+pkgdesc="A tool to display dialog boxes from shell scripts"
+arch=('i686' 'x86_64')
+url="http://invisible-island.net/dialog/"
+license=('LGPL2.1')
+depends=('ncurses')
+source=(ftp://invisible-island.net/${pkgname}/${pkgname}-${pkgver/_/-}.tgz)
+md5sums=('2eaa82055b86006e205d2c3f74d9b800')
+sha1sums=('ba4e79abaf579e0d23f247ae65196437f8d8e031')
+
+build() {
+ cd "${srcdir}/$pkgname-${pkgver/_/-}"
+ ./configure --prefix=/usr --mandir=/usr/share/man \
+ --with-ncursesw --enable-nls
+ make
+}
+
+package() {
+ cd "${srcdir}/$pkgname-${pkgver/_/-}"
+ make DESTDIR="${pkgdir}" install install-lib
+}
diff --git a/core/diffutils/PKGBUILD b/core/diffutils/PKGBUILD
new file mode 100644
index 000000000..a5cec46b3
--- /dev/null
+++ b/core/diffutils/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 102649 2010-12-09 13:50:53Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=diffutils
+pkgver=3.0
+pkgrel=2
+pkgdesc="Utility programs used for creating patch files"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/diffutils"
+license=('GPL3')
+groups=('base')
+depends=('glibc' 'sh')
+install=diffutils.install
+source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz)
+md5sums=('7624eb7e6b53ea3ce38958a092d2216e')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/core/diffutils/diffutils.install b/core/diffutils/diffutils.install
new file mode 100644
index 000000000..3ebec2831
--- /dev/null
+++ b/core/diffutils/diffutils.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(diff.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/dmraid/PKGBUILD b/core/dmraid/PKGBUILD
new file mode 100644
index 000000000..4161a74b1
--- /dev/null
+++ b/core/dmraid/PKGBUILD
@@ -0,0 +1,35 @@
+# $Id: PKGBUILD 77425 2010-04-12 20:48:57Z thomas $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+#Contributor: Urs Wolfer <uwolfer @ fwo.ch>
+
+pkgname=dmraid
+pkgver=1.0.0.rc16+CVS
+pkgrel=2
+pkgdesc="Device mapper RAID interface"
+url="http://people.redhat.com/~heinzm/sw/dmraid/"
+depends=('device-mapper>=2.0.54')
+arch=('i686' 'x86_64')
+license=('GPL')
+source=(ftp://ftp.archlinux.org/other/dmraid/$pkgname-$pkgver.tar.bz2
+ #http://people.redhat.com/~heinzm/sw/dmraid/src/$pkgname-$pkgver.tar.bz2
+ dmraid_install
+ dmraid_hook)
+install=dmraid.install
+md5sums=('c0de87073de96b311d26ab0170b2a753'
+ 'd01908b414e1686c0f3233ff37de78a5'
+ '0a748b6e78b156f2f9dda45fc629651f')
+
+build() {
+ cd "$srcdir"/$pkgname/$pkgver
+
+ ./configure --enable-led --enable-intel_led
+ make || return 1
+ make DESTDIR="$pkgdir" mandir=/usr/share/man includedir=/usr/include install || return 1
+ mkdir -p "$pkgdir"/var/lock/dmraid
+ chmod 1777 "$pkgdir"/var/lock/
+ install -D -m644 "$srcdir"/dmraid_install "$pkgdir"/lib/initcpio/install/dmraid
+ install -D -m644 "$srcdir"/dmraid_hook "$pkgdir"/lib/initcpio/hooks/dmraid
+ # fix permissions
+ chmod 644 "$pkgdir"/lib/libdmraid.a
+ chmod 644 "$pkgdir"/usr/include/dmraid/*
+}
diff --git a/core/dmraid/dmraid.install b/core/dmraid/dmraid.install
new file mode 100644
index 000000000..64899e785
--- /dev/null
+++ b/core/dmraid/dmraid.install
@@ -0,0 +1,14 @@
+post_upgrade() {
+ if [ "$(vercmp $2 1.0.0.rc15)" -lt 0 ]; then
+ # important upgrade notice
+ echo ">>>"
+ echo ">>> IMPORTANT DMRAID UPGRADE NOTICE"
+ echo ">>> -------------------------------"
+ echo ">>> Version 1.0.0.rc15 and greater introduce a new name scheme:"
+ echo ">>> You need to add an additional 'p' in front of your number."
+ echo ">>> e.g. <yourname><number> --> <yourname>p<number>"
+ echo ">>> firsthd1 --> firsthdp1"
+ echo ">>> Please change your bootloader and fstab accordingly."
+ echo ">>>"
+ fi
+}
diff --git a/core/dmraid/dmraid_hook b/core/dmraid/dmraid_hook
new file mode 100644
index 000000000..d4e758c34
--- /dev/null
+++ b/core/dmraid/dmraid_hook
@@ -0,0 +1,18 @@
+# vim: set ft=sh:
+run_hook ()
+{
+ /sbin/modprobe -q dm-mod >/dev/null 2>&1
+ /sbin/modprobe -q dm-mirror >/dev/null 2>&1
+ if [ -e "/sys/class/misc/device-mapper" ]; then
+ if [ ! -e "/dev/mapper/control" ]; then
+ /bin/mknod "/dev/mapper/control" c $(cat /sys/class/misc/device-mapper/dev | sed 's|:| |')
+ fi
+ msg ":: Activating dmraid arrays..."
+ # prevent any event monitoring calls with -I
+ if [ "${quiet}" = "y" ]; then
+ /sbin/dmraid -ay -I -Z >/dev/null
+ else
+ /sbin/dmraid -ay -I -Z
+ fi
+ fi
+}
diff --git a/core/dmraid/dmraid_install b/core/dmraid/dmraid_install
new file mode 100644
index 000000000..a20960aed
--- /dev/null
+++ b/core/dmraid/dmraid_install
@@ -0,0 +1,20 @@
+# vim: set ft=sh:
+
+install ()
+{
+ MODULES=" dm-mod dm-mirror "
+ BINARIES="/sbin/dmraid /sbin/dmsetup"
+ FILES=""
+ SCRIPT="dmraid"
+ add_dir "/dev/mapper"
+ add_file "/lib/udev/rules.d/10-dm.rules"
+ add_file "/lib/udev/rules.d/13-dm-disk.rules"
+ add_file "/lib/udev/rules.d/95-dm-notify.rules"
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook loads the necessary modules for a dmraid root device.
+HELPEOF
+}
diff --git a/core/dnsutils/PKGBUILD b/core/dnsutils/PKGBUILD
new file mode 100644
index 000000000..345f04e7c
--- /dev/null
+++ b/core/dnsutils/PKGBUILD
@@ -0,0 +1,38 @@
+# $Id: PKGBUILD 112955 2011-03-08 00:16:14Z bisson $
+# Maintainer: kevin <kevin@archlinux.org>
+# Contributor: mario <mario_vazq@hotmail.com>
+
+pkgname=dnsutils
+
+# Use a period and not a hyphen before the patch level for proper versioning.
+pkgver=9.8.0
+_pkgver=9.8.0
+pkgrel=1
+
+pkgdesc='Various DNS utilities - dig host nslookup nsupdate'
+arch=('i686' 'x86_64')
+url='https://www.isc.org/software/bind'
+license=('custom:ISC')
+depends=('openssl' 'idnkit')
+replaces=('bind-tools' 'host')
+options=('!makeflags')
+source=("http://ftp.isc.org/isc/bind9/${_pkgver}/bind-${_pkgver}.tar.gz"
+ 'tools-only.patch')
+sha1sums=('33019694ef3119d9daa1e8ff5117a6688e188528'
+ 'ac88c89e25c26d73095a3dd85e1ca1070d184ded')
+
+build() {
+ cd "${srcdir}/bind-${_pkgver}"
+ patch -p1 < ../tools-only.patch
+ export STD_CDEFINES='-DDIG_SIGCHASE'
+ ./configure \
+ --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
+ --with-openssl=yes --with-idn=yes --disable-linux-caps
+ make
+}
+
+package() {
+ cd "${srcdir}/bind-${_pkgver}/bin"
+ make DESTDIR="${pkgdir}" install
+ install -Dm644 ../COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
diff --git a/core/dnsutils/tools-only.patch b/core/dnsutils/tools-only.patch
new file mode 100644
index 000000000..b46b71f60
--- /dev/null
+++ b/core/dnsutils/tools-only.patch
@@ -0,0 +1,25 @@
+diff -Naur bind-9.7.1-P2.orig/bin/Makefile.in bind-9.7.1-P2/bin/Makefile.in
+--- bind-9.7.1-P2.orig/bin/Makefile.in 2009-10-05 08:07:08.000000000 -0400
++++ bind-9.7.1-P2/bin/Makefile.in 2010-07-22 15:55:00.000000000 -0400
+@@ -19,8 +19,7 @@
+ VPATH = @srcdir@
+ top_srcdir = @top_srcdir@
+
+-SUBDIRS = named rndc dig dnssec tests tools nsupdate \
+- check confgen @PKCS11_TOOLS@
++SUBDIRS = dig nsupdate
+ TARGETS =
+
+ @BIND9_MAKE_RULES@
+diff -Naur bind-9.7.1-P2.orig/lib/Makefile.in bind-9.7.1-P2/lib/Makefile.in
+--- bind-9.7.1-P2.orig/lib/Makefile.in 2007-06-19 19:47:13.000000000 -0400
++++ bind-9.7.1-P2/lib/Makefile.in 2010-07-22 15:56:29.000000000 -0400
+@@ -23,7 +23,7 @@
+ # Attempt to disable parallel processing.
+ .NOTPARALLEL:
+ .NO_PARALLEL:
+-SUBDIRS = isc isccc dns isccfg bind9 lwres tests
++SUBDIRS = isc dns isccfg bind9 lwres
+ TARGETS =
+
+ @BIND9_MAKE_RULES@
diff --git a/core/e2fsprogs/MIT-LICENSE b/core/e2fsprogs/MIT-LICENSE
new file mode 100644
index 000000000..d849b28f2
--- /dev/null
+++ b/core/e2fsprogs/MIT-LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2003-2007 Theodore Ts'o <tytso@mit.edu>
+Copyright (c) 1997-2003 Yann Dirson <dirson@debian.org>
+Copyright (c) 2001 Alcove <http://www.alcove.com/>
+Copyright (c) 1997 Klee Dienes
+Copyright (c) 1995-1996 Michael Nonweiler <mrn20@cam.ac.uk>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/core/e2fsprogs/PKGBUILD b/core/e2fsprogs/PKGBUILD
new file mode 100644
index 000000000..09fa0f395
--- /dev/null
+++ b/core/e2fsprogs/PKGBUILD
@@ -0,0 +1,48 @@
+# $Id: PKGBUILD 104009 2010-12-25 10:42:37Z allan $
+# Maintainer: Ronald van Haren <ronald.archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=e2fsprogs
+pkgver=1.41.14
+pkgrel=1
+pkgdesc="Ext2/3/4 filesystem utilities"
+arch=('i686' 'x86_64')
+license=('GPL' 'LGPL' 'MIT')
+url="http://e2fsprogs.sourceforge.net"
+groups=('base')
+depends=('sh' 'util-linux-ng')
+makedepends=('bc')
+source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+ 'MIT-LICENSE')
+backup=('etc/mke2fs.conf')
+install=${pkgname}.install
+sha1sums=('24f9364fa3d4c0d7d00cb627b819d0e51055d6c5'
+ 'f4a0d5b0cdb980e3fedd6f5e7dde0b0ffb7bbdfb')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # Remove unnecessary init.d directory
+ sed -i '/init\.d/s|^|#|' misc/Makefile.in
+
+ ./configure --prefix=/usr --with-root-prefix="" --enable-elf-shlibs \
+ --disable-fsck --disable-uuidd \
+ --disable-libuuid --disable-libblkid
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install install-libs
+
+ sed -i -e 's/^AWK=.*/AWK=awk/' "${pkgdir}/usr/bin/compile_et"
+
+ # remove references to build directory
+ sed -i -e 's#^SS_DIR=.*#SS_DIR="/usr/share/ss"#' "${pkgdir}/usr/bin/mk_cmds"
+ sed -i -e 's#^ET_DIR=.*#ET_DIR="/usr/share/et"#' "${pkgdir}/usr/bin/compile_et"
+
+ # install MIT license
+ install -Dm644 "${srcdir}/MIT-LICENSE" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/MIT-LICENSE"
+}
diff --git a/core/e2fsprogs/e2fsprogs.install b/core/e2fsprogs/e2fsprogs.install
new file mode 100644
index 000000000..1a7fe20d7
--- /dev/null
+++ b/core/e2fsprogs/e2fsprogs.install
@@ -0,0 +1,20 @@
+infodir=usr/share/info
+filelist=(libext2fs.info.gz)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file $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
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/e2fsprogs/mke2fs.conf b/core/e2fsprogs/mke2fs.conf
new file mode 100644
index 000000000..92464e3b4
--- /dev/null
+++ b/core/e2fsprogs/mke2fs.conf
@@ -0,0 +1,26 @@
+[defaults]
+ base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
+ blocksize = 4096
+ inode_size = 128
+ inode_ratio = 16384
+
+[fs_types]
+ small = {
+ blocksize = 1024
+ inode_size = 128
+ inode_ratio = 4096
+ }
+ floppy = {
+ blocksize = 1024
+ inode_size = 128
+ inode_ratio = 8192
+ }
+ news = {
+ inode_ratio = 4096
+ }
+ largefile = {
+ inode_ratio = 1048576
+ }
+ largefile4 = {
+ inode_ratio = 4194304
+ }
diff --git a/core/ed/PKGBUILD b/core/ed/PKGBUILD
new file mode 100644
index 000000000..a644e33fa
--- /dev/null
+++ b/core/ed/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 108145 2011-01-30 11:04:13Z andyrtr $
+# Maintainer: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=ed
+pkgver=1.5
+pkgrel=2
+pkgdesc="A POSIX-compliant line editor"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.gnu.org/software/ed/ed.html"
+install=ed.install
+depends=('glibc' 'sh')
+options=('!emptydirs')
+source=(ftp://ftp.gnu.org/gnu/ed/${pkgname}-${pkgver}.tar.gz)
+md5sums=('e66c03d7e4c67b025d5b6093ec678267')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/ \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
+ make || return 1
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+
+ cd ${pkgdir}/usr/share/info
+ ln ed.info red.info
+}
diff --git a/core/ed/ed.install b/core/ed/ed.install
new file mode 100644
index 000000000..637807f96
--- /dev/null
+++ b/core/ed/ed.install
@@ -0,0 +1,22 @@
+infodir=/usr/share/info
+filelist=(ed.info red.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/elfutils/PKGBUILD b/core/elfutils/PKGBUILD
new file mode 100644
index 000000000..7aef0c8f6
--- /dev/null
+++ b/core/elfutils/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 114401 2011-03-13 10:05:11Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Andrej Gelenberg <andrej.gelenberg@udo.edu>
+
+pkgname=elfutils
+pkgver=0.152
+pkgrel=1
+pkgdesc="Collection of libraries and utilities for working with ELF object files and DWARF debugging information"
+arch=('i686' 'x86_64')
+url="https://fedorahosted.org/elfutils/"
+license=('GPL2')
+depends=('glibc')
+#optdepends=('zlib' 'xz' 'bzip2')
+provides=('libelf')
+replaces=('libelf')
+conflicts=('libelf')
+source=(https://fedorahosted.org/releases/e/l/elfutils/${pkgver}/elfutils-${pkgver}.tar.bz2)
+md5sums=('39739ed58a0fa1862eff8735f111fe5c')
+
+build()
+{
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr --program-prefix="eu-"
+ make
+ make check
+}
+
+package()
+{
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+}
diff --git a/core/eventlog/ChangeLog b/core/eventlog/ChangeLog
new file mode 100644
index 000000000..f2f386dfe
--- /dev/null
+++ b/core/eventlog/ChangeLog
@@ -0,0 +1,10 @@
+2010-07-10 Dan McGee <dan@archlinux.org>
+
+ * Updated PKGBUILD to be in line with standard style
+ * Upstream update
+
+2009-01-03 Eric Belanger <eric@archlinux.org>
+
+ * eventlog 0.2.9-1
+ * Upstream update
+ * Added ChangeLog
diff --git a/core/eventlog/PKGBUILD b/core/eventlog/PKGBUILD
new file mode 100644
index 000000000..36f657b40
--- /dev/null
+++ b/core/eventlog/PKGBUILD
@@ -0,0 +1,29 @@
+# $Id: PKGBUILD 85218 2010-07-10 21:39:54Z dan $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=eventlog
+pkgver=0.2.12
+pkgrel=1
+pkgdesc="A new API to format and send structured log messages"
+arch=('i686' 'x86_64')
+url="http://www.balabit.com/support/community/products/"
+license=('BSD')
+depends=('glibc')
+options=('!libtool')
+changelog=ChangeLog
+source=(http://www.balabit.com/downloads/files/eventlog/${pkgver%.*}/eventlog_${pkgver}.tar.gz)
+md5sums=('3d6ebda8a161d36cb40d09328f78786b')
+sha1sums=('3e35a634e7de029ab9d36995a085bfcb00ed6a4d')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+ install -D -m644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
diff --git a/core/expat/CVE-2009-3560.patch b/core/expat/CVE-2009-3560.patch
new file mode 100644
index 000000000..5fe9c36c8
--- /dev/null
+++ b/core/expat/CVE-2009-3560.patch
@@ -0,0 +1,13 @@
+diff -urNad trunk~/lib/xmlparse.c trunk/lib/xmlparse.c
+--- trunk~/lib/xmlparse.c 2007-05-08 04:25:35.000000000 +0200
++++ trunk/lib/xmlparse.c 2009-12-29 21:57:22.141732904 +0100
+@@ -3703,6 +3703,9 @@
+ return XML_ERROR_UNCLOSED_TOKEN;
+ case XML_TOK_PARTIAL_CHAR:
+ return XML_ERROR_PARTIAL_CHAR;
++ case -XML_TOK_PROLOG_S:
++ tok = -tok;
++ break;
+ case XML_TOK_NONE:
+ #ifdef XML_DTD
+ /* for internal PE NOT referenced between declarations */
diff --git a/core/expat/CVE-2009-3720.patch b/core/expat/CVE-2009-3720.patch
new file mode 100644
index 000000000..65d16431f
--- /dev/null
+++ b/core/expat/CVE-2009-3720.patch
@@ -0,0 +1,12 @@
+diff -urNad trunk~/lib/xmltok_impl.c trunk/lib/xmltok_impl.c
+--- trunk~/lib/xmltok_impl.c 2006-11-26 18:34:46.000000000 +0100
++++ trunk/lib/xmltok_impl.c 2009-10-22 21:42:41.000000000 +0200
+@@ -1744,7 +1744,7 @@
+ const char *end,
+ POSITION *pos)
+ {
+- while (ptr != end) {
++ while (ptr < end) {
+ switch (BYTE_TYPE(enc, ptr)) {
+ #define LEAD_CASE(n) \
+ case BT_LEAD ## n: \
diff --git a/core/expat/PKGBUILD b/core/expat/PKGBUILD
new file mode 100644
index 000000000..9daf035ad
--- /dev/null
+++ b/core/expat/PKGBUILD
@@ -0,0 +1,33 @@
+# $Id: PKGBUILD 102953 2010-12-13 13:44:48Z stephane $
+# Maintainer: dorphell <dorphell@archlinux.org>
+# Committer: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=expat
+pkgver=2.0.1
+pkgrel=6
+pkgdesc="An XML parser library"
+arch=('i686' 'x86_64')
+url="http://expat.sourceforge.net"
+license=('custom')
+depends=('glibc')
+options=('!libtool')
+source=(http://downloads.sourceforge.net/sourceforge/expat/${pkgname}-${pkgver}.tar.gz
+ CVE-2009-3560.patch
+ CVE-2009-3720.patch)
+md5sums=('ee8b492592568805593f81f8cdf2a04c'
+ '50603cac0f03aabc7087415251f592be'
+ 'f3eeb796f28945899216b815e5901996')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i $srcdir/CVE-2009-3560.patch
+ patch -Np1 -i $srcdir/CVE-2009-3720.patch
+ ./configure --prefix=/usr --mandir=/usr/share/man
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
+}
diff --git a/core/fakeroot/PKGBUILD b/core/fakeroot/PKGBUILD
new file mode 100644
index 000000000..c3962c2f8
--- /dev/null
+++ b/core/fakeroot/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 102182 2010-12-06 14:43:36Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Jochem Kossen <j.kossen@home.nl>
+
+pkgname=fakeroot
+pkgver=1.14.5
+pkgrel=1
+pkgdesc="Gives a fake root environment, useful for building packages as a non-privileged user"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://packages.debian.org/fakeroot"
+groups=('base-devel')
+install=fakeroot.install
+depends=('glibc' 'filesystem' 'grep' 'sed' 'sh')
+options=('!libtool')
+source=(http://ftp.debian.org/debian/pool/main/f/${pkgname}/${pkgname}_${pkgver}.orig.tar.bz2)
+md5sums=('659a1f3a36554abfc2a3eaad2fdc0604')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --libdir=/usr/lib/libfakeroot \
+ --disable-static --with-ipc=sysv
+ # --with-ipc=tcp is currently broken and no option on smp systems
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR=${pkgdir} install
+
+ install -dm755 ${pkgdir}/etc/ld.so.conf.d/
+ echo '/usr/lib/libfakeroot' > ${pkgdir}/etc/ld.so.conf.d/fakeroot.conf
+
+ # install README for sysv/tcp usage
+ install -Dm644 $srcdir/$pkgname-$pkgver/README $pkgdir/usr/share/doc/$pkgname/README
+}
diff --git a/core/fakeroot/fakeroot.install b/core/fakeroot/fakeroot.install
new file mode 100644
index 000000000..986c91b06
--- /dev/null
+++ b/core/fakeroot/fakeroot.install
@@ -0,0 +1,14 @@
+post_install() {
+ sbin/ldconfig -r .
+}
+
+post_upgrade() {
+ if [ "$(vercmp $2 1.14.4-2)" -lt 0 ]; then
+ sed -i -e '/\/usr\/lib\/libfakeroot/d' etc/ld.so.conf
+ fi
+ sbin/ldconfig -r .
+}
+
+pre_remove() {
+ sbin/ldconfig -r .
+}
diff --git a/core/file/PKGBUILD b/core/file/PKGBUILD
new file mode 100644
index 000000000..e81c14eb9
--- /dev/null
+++ b/core/file/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id: PKGBUILD 111169 2011-02-24 15:25:47Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=file
+pkgver=5.05
+pkgrel=2
+pkgdesc="File type identification utility"
+arch=('i686' 'x86_64')
+license=('custom')
+groups=('base')
+url="http://www.darwinsys.com/file/"
+depends=('glibc' 'zlib')
+options=('!libtool')
+source=(ftp://ftp.astron.com/pub/${pkgname}/${pkgname}-${pkgver}.tar.gz
+ file-5.05-zip64.patch
+ file-5.05-python-3.2.patch)
+md5sums=('0b429063710457be2bd17a18389cb018'
+ '385f020467debd98bd2d8df6143f93d0'
+ '3f5e147be5b9c36c74323a1317328538')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ sed -i 's#\$(datadir)/misc#\$(datadir)#' configure
+
+ # identify zip64 files
+ patch -Np1 -i ${srcdir}/file-5.05-zip64.patch
+
+ # identify python 3.2 files
+ patch -Np1 -i ../file-5.05-python-3.2.patch
+
+ ./configure --prefix=/usr --datadir=/usr/share/file
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR=${pkgdir} install
+ install -dm755 ${pkgdir}/usr/share/misc
+ ln -s ../file/magic.mgc ${pkgdir}/usr/share/misc
+
+ install -D -m644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
+}
diff --git a/core/file/file-5.05-python-3.2.patch b/core/file/file-5.05-python-3.2.patch
new file mode 100644
index 000000000..355eb08a6
--- /dev/null
+++ b/core/file/file-5.05-python-3.2.patch
@@ -0,0 +1,11 @@
+diff -Naur file-5.05.ori/magic/Magdir/python file-5.05/magic/Magdir/python
+--- file-5.05.ori/magic/Magdir/python 2010-12-31 10:15:28.000000000 -0800
++++ file-5.05/magic/Magdir/python 2011-02-24 07:07:36.030004467 -0800
+@@ -20,6 +20,7 @@
+ 0 belong 0x03f30d0a python 2.7 byte-compiled
+ 0 belong 0x3b0c0d0a python 3.0 byte-compiled
+ 0 belong 0x4f0c0d0a python 3.1 byte-compiled
++0 belong 0x6c0c0d0a python 3.2 byte-compiled
+
+ 0 search/1/w #!\ /usr/bin/python Python script text executable
+ !:mime text/x-python
diff --git a/core/file/file-5.05-zip64.patch b/core/file/file-5.05-zip64.patch
new file mode 100644
index 000000000..2c9aede5f
--- /dev/null
+++ b/core/file/file-5.05-zip64.patch
@@ -0,0 +1,11 @@
+diff -Naur file-5.05-old//magic/Magdir/archive file-5.05/magic/Magdir/archive
+--- file-5.05-old//magic/Magdir/archive 2011-01-08 06:24:25.000000000 +1000
++++ file-5.05/magic/Magdir/archive 2011-01-19 14:37:47.766673895 +1000
+@@ -688,6 +688,7 @@
+ >>4 byte 0x0b \b, at least v1.1 to extract
+ >>0x161 string WINZIP \b, WinZIP self-extracting
+ >>4 byte 0x14 \b, at least v2.0 to extract
++>>4 byte 0x2d \b, at least v3.0 to extract
+
+ # Zoo archiver
+ 20 lelong 0xfdc4a7dc Zoo archive data
diff --git a/core/findutils/PKGBUILD b/core/findutils/PKGBUILD
new file mode 100644
index 000000000..9eb4dcd00
--- /dev/null
+++ b/core/findutils/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 100218 2010-11-21 23:38:22Z stephane $
+# Maintainer:
+
+pkgname=findutils
+pkgver=4.4.2
+pkgrel=3
+pkgdesc="GNU utilities to locate files"
+arch=('i686' 'x86_64')
+license=('GPL3')
+groups=('base')
+depends=('glibc' 'sh')
+url="http://www.gnu.org/software/findutils"
+source=(ftp://ftp.gnu.org/pub/gnu/findutils/${pkgname}-${pkgver}.tar.gz)
+install=findutils.install
+sha1sums=('e8dd88fa2cc58abffd0bfc1eddab9020231bb024')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # Don't build or install locate because we use mlocate,
+ # which is a secure version of locate.
+ sed -i '/^SUBDIRS/s/locate//' Makefile.in
+
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR=$pkgdir install
+}
diff --git a/core/findutils/findutils.install b/core/findutils/findutils.install
new file mode 100644
index 000000000..e42d782e2
--- /dev/null
+++ b/core/findutils/findutils.install
@@ -0,0 +1,22 @@
+infodir=/usr/share/info
+filelist=(find-maint.info find.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/flex/PKGBUILD b/core/flex/PKGBUILD
new file mode 100644
index 000000000..039b11897
--- /dev/null
+++ b/core/flex/PKGBUILD
@@ -0,0 +1,55 @@
+# $Id: PKGBUILD 91170 2010-09-23 14:30:47Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=flex
+pkgver=2.5.35
+pkgrel=4
+pkgdesc="A tool for generating text-scanning programs"
+arch=('i686' 'x86_64')
+url="http://flex.sourceforge.net"
+license=('custom')
+groups=('base-devel')
+depends=('glibc' 'm4' 'sh')
+install=flex.install
+source=(http://downloads.sourceforge.net/sourceforge/flex/flex-$pkgver.tar.bz2
+ flex-2.5.35-gcc44.patch
+ flex-2.5.35-hardening.patch
+ flex-2.5.35-missing-prototypes.patch
+ flex-2.5.35-sign.patch
+ lex.sh)
+md5sums=('10714e50cea54dc7a227e3eddcd44d57'
+ 'e4444ef5c07db71a43280be74139bdea'
+ 'de952b3ed7cc074bc8c3e6ab73634048'
+ '6b83f56b1b654c6a321cdc530a3ec68d'
+ 'd87fd9e9762ba7e230d516bdcf1c8c6f'
+ 'f725259ec23a9e87ee29e2ef82eda9a5')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ patch -Np1 -i $srcdir/flex-2.5.35-gcc44.patch
+ patch -Np1 -i $srcdir/flex-2.5.35-hardening.patch
+ patch -Np1 -i $srcdir/flex-2.5.35-missing-prototypes.patch
+ patch -Np1 -i $srcdir/flex-2.5.35-sign.patch
+
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man --infodir=/usr/share/info
+ make
+ make check
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make prefix=$pkgdir/usr \
+ mandir=$pkgdir/usr/share/man \
+ infodir=$pkgdir/usr/share/info \
+ install
+ install -Dm755 $srcdir/lex.sh $pkgdir/usr/bin/lex
+
+ install -Dm644 COPYING \
+ $pkgdir/usr/share/licenses/$pkgname/license.txt
+
+}
+
diff --git a/core/flex/flex-2.5.35-gcc44.patch b/core/flex/flex-2.5.35-gcc44.patch
new file mode 100644
index 000000000..7929fc092
--- /dev/null
+++ b/core/flex/flex-2.5.35-gcc44.patch
@@ -0,0 +1,22 @@
+diff -urNp flex-2.5.35.orig/flex.skl flex-2.5.35/flex.skl
+--- flex-2.5.35.orig/flex.skl 2009-04-20 03:09:46.000000000 +0530
++++ flex-2.5.35/flex.skl 2009-04-20 07:46:58.000000000 +0530
+@@ -217,6 +217,7 @@ m4preproc_include(`flexint.h')
+ /* begin standard C++ headers. */
+ #include <iostream>
+ #include <errno.h>
++#include <cstdio>
+ #include <cstdlib>
+ #include <cstring>
+ /* end standard C++ headers. */
+diff -urNp flex-2.5.35.orig/skel.c flex-2.5.35/skel.c
+--- flex-2.5.35.orig/skel.c 2009-04-20 03:09:46.000000000 +0530
++++ flex-2.5.35/skel.c 2009-04-20 07:46:40.000000000 +0530
+@@ -284,6 +284,7 @@ const char *skel[] = {
+ "/* begin standard C++ headers. */",
+ "#include <iostream> ",
+ "#include <errno.h>",
++ "#include <cstdio>",
+ "#include <cstdlib>",
+ "#include <cstring>",
+ "/* end standard C++ headers. */",
diff --git a/core/flex/flex-2.5.35-hardening.patch b/core/flex/flex-2.5.35-hardening.patch
new file mode 100644
index 000000000..7d608ea23
--- /dev/null
+++ b/core/flex/flex-2.5.35-hardening.patch
@@ -0,0 +1,36 @@
+diff -u flex-2.5.35/scan.c flex-2.5.35/scan.c
+--- flex-2.5.35/scan.c
++++ flex-2.5.35/scan.c
+@@ -2096,7 +2096,7 @@
+ /* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+-#define ECHO fwrite( yytext, yyleng, 1, yyout )
++#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+ #endif
+
+ /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+diff -u flex-2.5.35/flex.skl flex-2.5.35/flex.skl
+--- flex-2.5.35/flex.skl
++++ flex-2.5.35/flex.skl
+@@ -1075,7 +1075,7 @@
+ /* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+-#define ECHO fwrite( yytext, yyleng, 1, yyout )
++#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+ %endif
+ %if-c++-only C++ definition
+ #define ECHO LexerOutput( yytext, yyleng )
+diff -u flex-2.5.35/skel.c flex-2.5.35/skel.c
+--- flex-2.5.35/skel.c
++++ flex-2.5.35/skel.c
+@@ -1142,7 +1142,7 @@
+ "/* This used to be an fputs(), but since the string might contain NUL's,",
+ " * we now use fwrite().",
+ " */",
+- "#define ECHO fwrite( yytext, yyleng, 1, yyout )",
++ "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)",
+ "%endif",
+ "%if-c++-only C++ definition",
+ "#define ECHO LexerOutput( yytext, yyleng )",
diff --git a/core/flex/flex-2.5.35-missing-prototypes.patch b/core/flex/flex-2.5.35-missing-prototypes.patch
new file mode 100644
index 000000000..5cde0660e
--- /dev/null
+++ b/core/flex/flex-2.5.35-missing-prototypes.patch
@@ -0,0 +1,53 @@
+diff -up flex-2.5.35/flex.skl\~ flex-2.5.35/flex.skl
+--- flex-2.5.35/flex.skl~ 2010-07-13 17:18:43.000000000 +0200
++++ flex-2.5.35/flex.skl 2010-07-13 17:23:49.000000000 +0200
+@@ -960,6 +960,22 @@ m4_ifdef( [[M4_YY_NO_SET_LINENO]],,
+ void yyset_lineno M4_YY_PARAMS( int line_number M4_YY_PROTO_LAST_ARG );
+ ]])
+
++m4_ifdef( [[M4_YY_REENTRANT]],
++[[
++m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,
++[[
++int yyget_column M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
++]])
++]])
++
++m4_ifdef( [[M4_YY_REENTRANT]],
++[[
++m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,
++[[
++void yyset_column M4_YY_PARAMS( int column_no M4_YY_PROTO_LAST_ARG );
++]])
++]])
++
+ %if-bison-bridge
+ m4_ifdef( [[M4_YY_NO_GET_LVAL]],,
+ [[
+
+Diff finished. Tue Jul 13 17:27:50 2010
+--- flex-2.5.35/skel.c~ 2010-07-14 13:15:42.000000000 +0200
++++ flex-2.5.35/skel.c 2010-07-14 13:16:05.000000000 +0200
+@@ -1027,6 +1027,22 @@
+ "void yyset_lineno M4_YY_PARAMS( int line_number M4_YY_PROTO_LAST_ARG );",
+ "]])",
+ "",
++ "m4_ifdef( [[M4_YY_REENTRANT]],",
++ "[[",
++ "m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,",
++ "[[",
++ "int yyget_column M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
++ "]])",
++ "]])",
++ "",
++ "m4_ifdef( [[M4_YY_REENTRANT]],",
++ "[[",
++ "m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,",
++ "[[",
++ "void yyset_column M4_YY_PARAMS( int column_no M4_YY_PROTO_LAST_ARG );",
++ "]])",
++ "]])",
++ "",
+ "%if-bison-bridge",
+ "m4_ifdef( [[M4_YY_NO_GET_LVAL]],,",
+ "[[",
diff --git a/core/flex/flex-2.5.35-sign.patch b/core/flex/flex-2.5.35-sign.patch
new file mode 100644
index 000000000..fbee18bde
--- /dev/null
+++ b/core/flex/flex-2.5.35-sign.patch
@@ -0,0 +1,11 @@
+--- flex-2.5.35/gen.c-orig 2008-04-30 22:51:08.000000000 +0200
++++ flex-2.5.35/gen.c 2008-04-30 22:51:14.000000000 +0200
+@@ -1890,7 +1890,7 @@
+ outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
+ outn ("\t\t{ \\");
+ outn ("\t\tint c = '*'; \\");
+- outn ("\t\tint n; \\");
++ outn ("\t\tunsigned n; \\");
+ outn ("\t\tfor ( n = 0; n < max_size && \\");
+ outn ("\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
+ outn ("\t\t\tbuf[n] = (char) c; \\");
diff --git a/core/flex/flex.install b/core/flex/flex.install
new file mode 100644
index 000000000..5b328c722
--- /dev/null
+++ b/core/flex/flex.install
@@ -0,0 +1,22 @@
+infodir=/usr/share/info
+filelist=(flex.info{,-1,-2})
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/flex/lex.sh b/core/flex/lex.sh
new file mode 100644
index 000000000..13e7de692
--- /dev/null
+++ b/core/flex/lex.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/flex -l "$@"
diff --git a/core/gawk/PKGBUILD b/core/gawk/PKGBUILD
new file mode 100644
index 000000000..81af6681c
--- /dev/null
+++ b/core/gawk/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 100064 2010-11-20 03:46:49Z allan $
+# Maintainer:
+# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
+
+pkgname=gawk
+pkgver=3.1.8
+pkgrel=2
+pkgdesc="Gnu version of awk"
+arch=(i686 x86_64)
+url="http://www.gnu.org/directory/GNU/gawk.html"
+license=('GPL')
+groups=('base')
+provides=('awk')
+install=gawk.install
+source=(ftp://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz)
+depends=('sh' 'glibc')
+md5sums=('35937a0f83f0efe7a8c2dee635624784')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR=${pkgdir} install
+ mv ${pkgdir}/usr/libexec ${pkgdir}/usr/lib
+ install -dm755 ${pkgdir}/bin
+ mv ${pkgdir}/usr/bin/gawk* ${pkgdir}/bin/
+ mv ${pkgdir}/usr/bin/awk ${pkgdir}/bin/
+ cd ${pkgdir}/usr/bin/
+ ln -sf /bin/gawk gawk
+}
diff --git a/core/gawk/gawk.install b/core/gawk/gawk.install
new file mode 100644
index 000000000..95973e40a
--- /dev/null
+++ b/core/gawk/gawk.install
@@ -0,0 +1,22 @@
+infodir=/usr/share/info
+filelist=(gawk.info.gz gawkinet.info.gz)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file $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
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/gcc/PKGBUILD b/core/gcc/PKGBUILD
new file mode 100644
index 000000000..a88cd0a4f
--- /dev/null
+++ b/core/gcc/PKGBUILD
@@ -0,0 +1,228 @@
+# $Id: PKGBUILD 107993 2011-01-28 20:01:16Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+
+# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
+# NOTE: libtool requires rebuilt with each new gcc version
+
+pkgname=('gcc' 'gcc-libs' 'gcc-fortran' 'gcc-objc' 'gcc-ada')
+pkgver=4.5.2
+pkgrel=6
+_snapshot=4.5-20110127
+_libstdcppmanver=4.5.2 # Note: check source directory name when updating this
+pkgdesc="The GNU Compiler Collection"
+arch=('i686' 'x86_64')
+license=('GPL' 'LGPL' 'custom')
+url="http://gcc.gnu.org"
+makedepends=('binutils>=2.21' 'libmpc' 'cloog-ppl>=0.15.9-2' 'elfutils' 'gcc-ada' 'dejagnu')
+options=('!libtool' '!emptydirs')
+source=(#ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-{core,g++,fortran,objc,ada,testsuite}-${pkgver}.tar.bz2
+ ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-{core,g++,fortran,objc,ada,testsuite}-${_snapshot}.tar.bz2
+ ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen/libstdc++-api-${_libstdcppmanver}.man.tar.bz2
+ gcc_pure64.patch
+ gcc-hash-style-both.patch)
+md5sums=('7dbdf06186dc98955221b2f7b987645b'
+ '4893036a98d8bedf44fe0741dfec6e1f'
+ 'c741c614e975c858cffb9e78b0b5124f'
+ 'b141fadc984cc0c1c0f15feb16db14e5'
+ '067672b640d0b912298791c1837606bc'
+ 'daffd2ba5917a263cdff5f38dcf8c323'
+ '2776eab5ebb7f9cc62dd2199a3a24382'
+ '4030ee1c08dd1e843c0225b772360e76'
+ '6fd395bacbd7b6e47c7b74854b478363')
+
+
+if [ -n "${_snapshot}" ]; then
+ _basedir="${srcdir}/gcc-${_snapshot}"
+else
+ _basedir="${srcdir}/gcc-${pkgver}"
+fi
+
+build() {
+ cd ${_basedir}
+
+ # "Add" ppl-0.11 compatibility
+ sed -i "/ppl_minor_version=/s#10#11#" configure
+
+ # Do not install libiberty
+ sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
+
+ # Do not run fixincludes
+ sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+
+ if [ "${CARCH}" = "x86_64" ]; then
+ patch -Np1 -i ${srcdir}/gcc_pure64.patch
+ fi
+ patch -Np0 -i ${srcdir}/gcc-hash-style-both.patch
+
+ echo ${pkgver} > gcc/BASE-VER
+
+ cd ${srcdir}
+ mkdir gcc-build && cd gcc-build
+ ${_basedir}/configure --prefix=/usr \
+ --enable-languages=c,c++,fortran,objc,obj-c++,ada \
+ --enable-shared --enable-threads=posix --enable-__cxa_atexit \
+ --enable-clocale=gnu --enable-gnu-unique-object \
+ --enable-lto --enable-plugin \
+ --enable-gold --with-plugin-ld=ld.gold \
+ --disable-multilib --disable-libstdcxx-pch \
+ --with-system-zlib --with-ppl \
+ --with-cloog --with-cloog-include=/usr/include/cloog-ppl \
+ --libdir=/usr/lib --libexecdir=/usr/lib \
+ --mandir=/usr/share/man --infodir=/usr/share/info
+ make
+
+ # increase stack size to prevent test failures
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827
+ ulimit -s 32768
+
+ # do not abort on error as some are "expected"
+ make -k check || true
+ ${_basedir}/contrib/test_summary
+}
+
+package_gcc-libs()
+{
+ pkgdesc="Runtime libraries shipped by GCC"
+ groups=('base')
+ depends=('glibc>=2.11.1-2')
+ install=gcc-libs.install
+
+ cd gcc-build
+ make -j1 -C $CHOST/libgcc DESTDIR=${pkgdir} install-shared
+ for lib in libmudflap libgomp libssp libstdc++-v3/src; do
+ make -j1 -C $CHOST/$lib DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES
+ done
+ make -j1 -C $CHOST/libstdc++-v3/po DESTDIR=${pkgdir} install
+ make -j1 -C $CHOST/libgomp DESTDIR=${pkgdir} install-info
+
+ make -j1 DESTDIR=${pkgdir} install-target-libgfortran
+
+ make -j1 DESTDIR=${pkgdir} install-target-libobjc
+ # I thought I said to only install the lib...
+ rm -rf ${pkgdir}/usr/lib/gcc/
+
+ # remove static libraries
+ find ${pkgdir} -name *.a -delete
+
+ # Install Runtime Library Exception
+ install -Dm644 ${_basedir}/COPYING.RUNTIME \
+ ${pkgdir}/usr/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION
+}
+
+package_gcc()
+{
+ pkgdesc="The GNU Compiler Collection - C and C++ frontends"
+ depends=('binutils>=2.20.1' 'libmpc>=0.8.1-2' 'cloog-ppl>=0.15.9-2' 'elfutils')
+ groups=('base-devel')
+ install=gcc.install
+
+ cd gcc-build
+
+ # much, much easier to install the lot and clean-up the mess
+ make -j1 DESTDIR=${pkgdir} install
+ rm $pkgdir/usr/bin/{*gfortran,gnat*}
+ rm $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/{ada{include,lib},finclude,include/objc}/*
+ rm $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/{cc1obj{,plus},f951,gnat1,libgfortranbegin.a}
+ rm $pkgdir/usr/lib/{*.so*,lib{gfortran,objc}.a}
+ rm $pkgdir/usr/share/info/{gfortran,gnat*,libgomp}.info
+ rm $pkgdir/usr/share/locale/{de,fr}/LC_MESSAGES/libstdc++.mo
+ rm $pkgdir/usr/share/man/man1/gfortran.1
+
+ # many packages require these symlinks
+ install -dm755 ${pkgdir}/lib
+ ln -sf /usr/bin/cpp ${pkgdir}/lib/cpp
+ ln -sf gcc ${pkgdir}/usr/bin/cc
+ ln -sf g++ ${pkgdir}/usr/bin/c++
+
+ # POSIX conformance launcher scripts for c89 and c99
+ cat > $pkgdir/usr/bin/c89 <<"EOF"
+#!/bin/sh
+fl="-std=c89"
+for opt; do
+ case "$opt" in
+ -ansi|-std=c89|-std=iso9899:1990) fl="";;
+ -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
+ exit 1;;
+ esac
+done
+exec gcc $fl ${1+"$@"}
+EOF
+
+ cat > $pkgdir/usr/bin/c99 <<"EOF"
+#!/bin/sh
+fl="-std=c99"
+for opt; do
+ case "$opt" in
+ -std=c99|-std=iso9899:1999) fl="";;
+ -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
+ exit 1;;
+ esac
+done
+exec gcc $fl ${1+"$@"}
+EOF
+
+ chmod 755 $pkgdir/usr/bin/c{8,9}9
+
+ # install the libstdc++ man pages
+ install -dm755 ${pkgdir}/usr/share/man/man3
+ install -m644 ${srcdir}/libstdc++-api-${_libstdcppmanver}.man/man3/* \
+ ${pkgdir}/usr/share/man/man3/
+
+ # Install Runtime Library Exception
+ install -Dm644 ${_basedir}/COPYING.RUNTIME \
+ ${pkgdir}/usr/share/licenses/gcc/RUNTIME.LIBRARY.EXCEPTION
+}
+
+package_gcc-fortran()
+{
+ pkgdesc="Fortran front-end for GCC"
+ depends=("gcc=$pkgver-$pkgrel")
+ install=gcc-fortran.install
+
+ cd gcc-build
+ make -j1 DESTDIR=$pkgdir install-target-libgfortran
+ make -j1 -C $CHOST/libgomp DESTDIR=$pkgdir install-nodist_fincludeHEADERS
+ make -j1 -C gcc DESTDIR=$pkgdir fortran.install-{common,man,info}
+ install -Dm755 gcc/f951 $pkgdir/usr/lib/gcc/$CHOST/$pkgver/f951
+
+ # remove libraries included in gcc-libs
+ rm -f ${pkgdir}/usr/lib/libgfortran.so*
+
+ # Install Runtime Library Exception
+ install -Dm644 ${_basedir}/COPYING.RUNTIME \
+ ${pkgdir}/usr/share/licenses/gcc-fortran/RUNTIME.LIBRARY.EXCEPTION
+}
+
+package_gcc-objc()
+{
+ pkgdesc="Objective-C front-end for GCC"
+ depends=("gcc=$pkgver-$pkgrel")
+
+ cd gcc-build
+ make -j1 DESTDIR=$pkgdir install-target-libobjc
+ install -dm755 $pkgdir/usr/lib/gcc/$CHOST/$pkgver/
+ install -m755 gcc/cc1obj{,plus} $pkgdir/usr/lib/gcc/$CHOST/$pkgver/
+
+ # remove libraries included in gcc-libs
+ rm -f ${pkgdir}/usr/lib/libobjc.so*
+
+ # Install Runtime Library Exception
+ install -Dm644 ${_basedir}/COPYING.RUNTIME \
+ ${pkgdir}/usr/share/licenses/gcc-objc/RUNTIME.LIBRARY.EXCEPTION
+}
+
+package_gcc-ada()
+{
+ pkgdesc="Ada front-end for GCC (GNAT)"
+ depends=("gcc=$pkgver-$pkgrel")
+ install=gcc-ada.install
+
+ cd gcc-build/gcc
+ make -j1 DESTDIR=$pkgdir ada.install-{common,info}
+ install -m755 gnat1 $pkgdir/usr/lib/gcc/$CHOST/$pkgver
+
+ # Install Runtime Library Exception
+ install -Dm644 ${_basedir}/COPYING.RUNTIME \
+ ${pkgdir}/usr/share/licenses/gcc-ada/RUNTIME.LIBRARY.EXCEPTION
+}
+
diff --git a/core/gcc/gcc-ada.install b/core/gcc/gcc-ada.install
new file mode 100644
index 000000000..81794685f
--- /dev/null
+++ b/core/gcc/gcc-ada.install
@@ -0,0 +1,22 @@
+infodir=usr/share/info
+filelist=(gnat-style.info gnat_rm.info gnat_ugn.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/gcc/gcc-fortran.install b/core/gcc/gcc-fortran.install
new file mode 100644
index 000000000..2aeab7123
--- /dev/null
+++ b/core/gcc/gcc-fortran.install
@@ -0,0 +1,18 @@
+infodir=usr/share/info
+file="gfortran.info"
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/gcc/gcc-hash-style-both.patch b/core/gcc/gcc-hash-style-both.patch
new file mode 100644
index 000000000..fbb210598
--- /dev/null
+++ b/core/gcc/gcc-hash-style-both.patch
@@ -0,0 +1,163 @@
+#! /bin/sh -e
+
+# DP: Link using --hash-style=both (alpha, amd64, ia64, i386, powerpc, ppc64, s390, sparc)
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+2006-07-11 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/linux.h (LINK_SPEC): Add --hash-style=both.
+ * config/i386/linux64.h (LINK_SPEC): Likewise.
+ * config/rs6000/sysv4.h (LINK_OS_LINUX_SPEC): Likewise.
+ * config/rs6000/linux64.h (LINK_OS_LINUX_SPEC32,
+ LINK_OS_LINUX_SPEC64): Likewise.
+ * config/s390/linux.h (LINK_SPEC): Likewise.
+ * config/ia64/linux.h (LINK_SPEC): Likewise.
+ * config/sparc/linux.h (LINK_SPEC): Likewise.
+ * config/sparc/linux64.h (LINK_SPEC, LINK_ARCH32_SPEC,
+ LINK_ARCH64_SPEC): Likewise.
+ * config/alpha/linux-elf.h (LINK_SPEC): Likewise.
+
+--- gcc/config/alpha/linux-elf.h.orig 2007-08-04 08:55:58.000000000 +0200
++++ gcc/config/alpha/linux-elf.h 2007-09-01 15:47:26.605865578 +0200
+@@ -39,7 +39,7 @@
+
+ #define ELF_DYNAMIC_LINKER LINUX_DYNAMIC_LINKER
+
+-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
++#define LINK_SPEC "-m elf64alpha --hash-style=both %{G*} %{relax:-relax} \
+ %{O*:-O3} %{!O*:-O1} \
+ %{shared:-shared} \
+ %{!shared: \
+--- gcc/config/s390/linux.h.orig 2007-08-04 08:55:59.000000000 +0200
++++ gcc/config/s390/linux.h 2007-09-01 15:47:26.605865578 +0200
+@@ -77,7 +77,7 @@
+
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
++ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --hash-style=both \
+ %{shared:-shared} \
+ %{!shared: \
+ %{static:-static} \
+--- gcc/config/sparc/linux.h.orig 2007-08-04 08:56:01.000000000 +0200
++++ gcc/config/sparc/linux.h 2007-09-01 15:47:26.605865578 +0200
+@@ -132,7 +132,7 @@
+
+
+ #undef LINK_SPEC
+-#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
++#define LINK_SPEC "-m elf32_sparc --hash-style=both -Y P,/usr/lib %{shared:-shared} \
+ %{!mno-relax:%{!r:-relax}} \
+ %{!shared: \
+ %{!ibcs: \
+--- gcc/config/sparc/linux64.h.orig 2007-08-04 08:56:01.000000000 +0200
++++ gcc/config/sparc/linux64.h 2007-09-01 15:47:26.605865578 +0200
+@@ -166,7 +166,7 @@
+ { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
+ { "link_arch", LINK_ARCH_SPEC },
+
+-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,%R/usr/lib %{shared:-shared} \
++#define LINK_ARCH32_SPEC "-m elf32_sparc --hash-style=both -Y P,%R/usr/lib %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+@@ -175,7 +175,7 @@
+ %{static:-static}}} \
+ "
+
+-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
++#define LINK_ARCH64_SPEC "-m elf64_sparc --hash-style=both -Y P,%R/usr/lib64 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+@@ -256,7 +256,7 @@
+ #else /* !SPARC_BI_ARCH */
+
+ #undef LINK_SPEC
+-#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
++#define LINK_SPEC "-m elf64_sparc --hash-style=both -Y P,%R/usr/lib64 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+--- gcc/config/i386/linux.h.orig 2007-08-04 08:56:07.000000000 +0200
++++ gcc/config/i386/linux.h 2007-09-01 15:47:26.605865578 +0200
+@@ -108,7 +108,7 @@
+ { "dynamic_linker", LINUX_DYNAMIC_LINKER }
+
+ #undef LINK_SPEC
+-#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
++#define LINK_SPEC "-m %(link_emulation) --hash-style=both %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+--- gcc/config/i386/linux64.h.orig 2007-08-04 08:56:07.000000000 +0200
++++ gcc/config/i386/linux64.h 2007-09-01 15:48:27.336781690 +0200
+@@ -65,7 +65,7 @@
+ #endif
+
+ #undef LINK_SPEC
+-#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} \
++#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} --hash-style=both \
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+--- gcc/config/ia64/linux.h.orig 2006-12-12 18:59:53.000000000 +0100
++++ gcc/config/ia64/linux.h 2007-09-01 15:47:26.605865578 +0200
+@@ -40,7 +40,7 @@
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
+
+ #undef LINK_SPEC
+-#define LINK_SPEC "\
++#define LINK_SPEC "--hash-style=both \
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+--- gcc/config/rs6000/sysv4.h.orig 2007-08-08 23:37:49.000000000 +0200
++++ gcc/config/rs6000/sysv4.h 2007-09-01 15:47:26.615865729 +0200
+@@ -901,7 +901,7 @@
+ #define LINUX_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
+
+-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
++#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=both %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}"
+
+--- gcc/config/rs6000/linux64.h.orig 2007-08-04 08:56:12.000000000 +0200
++++ gcc/config/rs6000/linux64.h 2007-09-01 15:47:26.615865729 +0200
+@@ -354,11 +354,11 @@
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
+
+
+-#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
++#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux --hash-style=both %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}}"
+
+-#define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
++#define LINK_OS_LINUX_SPEC64 "-m elf64ppc --hash-style=both %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}}"
+
diff --git a/core/gcc/gcc-libs.install b/core/gcc/gcc-libs.install
new file mode 100644
index 000000000..b5fbf9211
--- /dev/null
+++ b/core/gcc/gcc-libs.install
@@ -0,0 +1,14 @@
+infodir=usr/share/info
+file="libgomp.info"
+
+post_upgrade() {
+ [ -x usr/bin/install-info ] || return 0
+ install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/gcc/gcc.install b/core/gcc/gcc.install
new file mode 100644
index 000000000..a7a405288
--- /dev/null
+++ b/core/gcc/gcc.install
@@ -0,0 +1,22 @@
+infodir=usr/share/info
+filelist=(cpp.info cppinternals.info gcc.info gccinstall.info gccint.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/gcc/gcc_pure64.patch b/core/gcc/gcc_pure64.patch
new file mode 100644
index 000000000..8c0baf8e2
--- /dev/null
+++ b/core/gcc/gcc_pure64.patch
@@ -0,0 +1,26 @@
+diff -Naur gcc-4.2.0.orig/gcc/config/i386/linux64.h gcc-4.2.0/gcc/config/i386/linux64.h
+--- gcc-4.2.0.orig/gcc/config/i386/linux64.h 2007-05-16 19:21:19.000000000 -0400
++++ gcc-4.2.0/gcc/config/i386/linux64.h 2007-05-18 17:04:05.000000000 -0400
+@@ -49,8 +49,8 @@
+ When the -shared link option is used a final link is not being
+ done. */
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKER32 "/lib32/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux-x86-64.so.2"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
+diff -Naur gcc-4.2.0.orig/gcc/config/i386/t-linux64 gcc-4.2.0/gcc/config/i386/t-linux64
+--- gcc-4.2.0.orig/gcc/config/i386/t-linux64 2007-05-16 19:21:19.000000000 -0400
++++ gcc-4.2.0/gcc/config/i386/t-linux64 2007-05-18 17:04:36.000000000 -0400
+@@ -6,7 +6,7 @@
+
+ MULTILIB_OPTIONS = m64/m32
+ MULTILIB_DIRNAMES = 64 32
+-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
++MULTILIB_OSDIRNAMES = ../lib ../lib32
+
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
diff --git a/core/gdbm/PKGBUILD b/core/gdbm/PKGBUILD
new file mode 100644
index 000000000..e3c8a2449
--- /dev/null
+++ b/core/gdbm/PKGBUILD
@@ -0,0 +1,59 @@
+# $Id: PKGBUILD 105198 2011-01-07 13:58:42Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=gdbm
+pkgver=1.8.3
+pkgrel=8
+pkgdesc="GNU database library"
+url="http://www.gnu.org/software/gdbm/gdbm.html"
+license=('GPL')
+arch=('i686' 'x86_64')
+depends=('glibc' 'sh')
+source=(ftp://ftp.gnu.org/gnu/gdbm/${pkgname}-${pkgver}.tar.gz
+ gdbm-1.8.3-zeroheaders.patch
+ gdbm-1.8.3-fhs.patch)
+options=('!libtool' '!makeflags')
+install=gdbm.install
+md5sums=('1d1b1d5c0245b1c00aff92da751e9aa1'
+ 'a2ed344be9258775bd718074cf2e4ec6'
+ '66a7c235416c136dc89efc7d03352514')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # Prevent gdbm from storing uninitialized memory content
+ # to database files. This patch improves security, as the
+ # uninitialized memory might contain sensitive informations
+ # from other applications.
+ # https://bugzilla.redhat.com/show_bug.cgi?id=4457
+ # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208927
+ patch -Np1 -i ../gdbm-1.8.3-zeroheaders.patch
+
+ # Make gdbm buildable.
+ patch -Np1 -i ../gdbm-1.8.3-fhs.patch
+
+ libtoolize --force --copy
+ aclocal
+ autoconf
+
+ ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
+
+ # flock does not work on nfs, we use fcntl instead
+ # https://bugzilla.redhat.com/show_bug.cgi?id=477300
+ echo "/* We use fcntl locking (POSIX) instead of flock (BSD) */" >> autoconf.h
+ echo "#undef HAVE_FLOCK" >> autoconf.h
+
+ make prefix=/usr
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make prefix=$pkgdir/usr \
+ manprefix=$pkgdir/usr/share/man \
+ man3dir=$pkgdir/usr/share/man/man3 \
+ infodir=$pkgdir/usr/share/info \
+ install install-compat
+
+ ln -sf gdbm/gdbm.h $pkgdir/usr/include
+}
diff --git a/core/gdbm/gdbm-1.8.3-fhs.patch b/core/gdbm/gdbm-1.8.3-fhs.patch
new file mode 100644
index 000000000..58ce4de0b
--- /dev/null
+++ b/core/gdbm/gdbm-1.8.3-fhs.patch
@@ -0,0 +1,138 @@
+diff -up gdbm-1.8.3/Makefile.in.fhs gdbm-1.8.3/Makefile.in
+--- gdbm-1.8.3/Makefile.in.fhs 2002-10-08 18:09:12.000000000 +0200
++++ gdbm-1.8.3/Makefile.in 2010-03-10 15:41:01.516025096 +0100
+@@ -1,7 +1,7 @@
+ #### Start of system configuration section. ####
+
+ srcdir = @srcdir@
+-top_builddir = .
++top_builddir = @top_builddir@
+ VPATH = @srcdir@
+
+ CC = @CC@
+@@ -14,17 +14,13 @@ INSTALL = @INSTALL@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_DATA = @INSTALL_DATA@
+
+-# File ownership and group
+-BINOWN = bin
+-BINGRP = bin
+-
+ MAKEINFO = makeinfo
+ TEXI2DVI = texi2dvi
+
+-DEFS =
++DEFS = @DEFS@
+
+ # Where the system [n]dbm routines are...
+-LIBS = @LIBS@ -lc
++LIBS = @LIBS@
+
+ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+@@ -32,16 +28,17 @@ LDFLAGS = @LDFLAGS@
+ # Common prefix for installation directories
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+-binprefix = $(exec_prefix)
+-manprefix = $(prefix)
++datarootdir = @datarootdir@
+
+ # Directory in which to put libgdbm.a.
+ libdir = @libdir@
+ # The include directory for gdbm.h and dbm.h.
+ includedir = @includedir@
++pkgincludedir = $(includedir)/gdbm
+ # Info and man directories.
+ infodir = @infodir@
+-man3dir = @mandir@/man3
++mandir = @mandir@
++man3dir = $(mandir)/man3
+ manext = 3
+
+ #### End of system configuration section. ####
+@@ -57,7 +54,7 @@ manext = 3
+
+ SHELL = /bin/sh
+
+-PROGS = libgdbm.la testgdbm testdbm testndbm tndbm tdbm conv2gdbm
++PROGS = libgdbm.la testgdbm testdbm testndbm conv2gdbm
+
+ DBM_CF = dbminit.c delete.c fetch.c store.c seq.c close.c
+
+@@ -127,26 +124,17 @@ all: libgdbm.la libgdbm_compat.la
+ progs: $(PROGS)
+
+ install: libgdbm.la gdbm.h gdbm.info
+- $(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
+- $(INSTALL_ROOT)$(includedir) $(INSTALL_ROOT)$(man3dir) \
+- $(INSTALL_ROOT)$(infodir)
+- $(LIBTOOL) $(INSTALL) -c libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \
+- $(INSTALL_ROOT)$(includedir)/gdbm.h
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
+- $(INSTALL_ROOT)$(man3dir)/gdbm.3
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
+- $(INSTALL_ROOT)$(infodir)/gdbm.info
++ $(srcdir)/mkinstalldirs $(libdir) $(pkgincludedir) $(man3dir) $(infodir)
++ $(LIBTOOL) install install libgdbm.la $(libdir)/libgdbm.la
++ $(INSTALL_DATA) gdbm.h $(pkgincludedir)/gdbm.h
++ $(INSTALL_DATA) $(srcdir)/gdbm.3 $(man3dir)/gdbm.3
++ $(INSTALL_DATA) $(srcdir)/gdbm.info $(infodir)/gdbm.info
+
+ install-compat:
+- $(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
+- $(INSTALL_ROOT)$(includedir)
+- $(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
+- $(INSTALL_ROOT)$(libdir)/libgdbm_compat.la
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \
+- $(INSTALL_ROOT)$(includedir)/dbm.h
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \
+- $(INSTALL_ROOT)$(includedir)/ndbm.h
++ $(srcdir)/mkinstalldirs $(libdir) $(pkgincludedir)
++ $(LIBTOOL) install install libgdbm_compat.la $(libdir)/libgdbm_compat.la
++ $(INSTALL_DATA) $(srcdir)/dbm.h $(pkgincludedir)/dbm.h
++ $(INSTALL_DATA) $(srcdir)/ndbm.h $(pkgincludedir)/ndbm.h
+
+ #libgdbm.a: $(OBJS) gdbm.h
+ # rm -f libgdbm.a
+@@ -161,7 +149,7 @@ libgdbm.la: $(LOBJS) gdbm.h
+ libgdbm_compat.la: $(C_LOBJS) gdbm.h
+ rm -f libgdbm_compat.la
+ $(LIBTOOL) --mode=link $(CC) -o libgdbm_compat.la -rpath $(libdir) \
+- -version-info $(SHLIB_VER) $(C_LOBJS)
++ -version-info $(SHLIB_VER) $(C_LOBJS) -lgdbm
+
+ gdbm.h: gdbm.proto gdbmerrno.h gdbm.proto2
+ rm -f gdbm.h
+@@ -172,10 +160,10 @@ gdbm.h: gdbm.proto gdbmerrno.h gdbm.prot
+ chmod -w gdbm.h
+
+ testgdbm: testgdbm.o libgdbm.la @LIBOBJS@
+- $(LIBTOOL) $(CC) $(LDFLAGS) -o testgdbm testgdbm.o libgdbm.la @LIBOBJS@
++ $(LIBTOOL) link $(CC) $(LDFLAGS) -o testgdbm testgdbm.o libgdbm.la @LIBOBJS@
+
+ testdbm: testdbm.o libgdbm.la libgdbm_compat.la
+- $(LIBTOOL) $(CC) $(LDFLAGS) -o testdbm testdbm.o libgdbm.la libgdbm_compat.la
++ $(LIBTOOL) link $(CC) $(LDFLAGS) -o testdbm testdbm.o $(LIBS) libgdbm_compat.la
+
+ tdbm: testdbm.o
+ $(CC) $(LDFLAGS) -o tdbm testdbm.o $(LIBS)
+@@ -184,7 +172,7 @@ testndbm.o: testndbm.c
+ $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(DEFS) -DGNU $(srcdir)/testndbm.c
+
+ testndbm: testndbm.o libgdbm.la libgdbm_compat.la
+- $(LIBTOOL) $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm.la libgdbm_compat.la
++ $(LIBTOOL) link $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm_compat.la
+
+ tndbm.o: testndbm.c
+ cp $(srcdir)/testndbm.c ./tndbm.c
+@@ -195,7 +183,7 @@ tndbm: tndbm.o
+ $(CC) $(LDFLAGS) -o tndbm tndbm.o $(LIBS)
+
+ conv2gdbm: conv2gdbm.o libgdbm.la @LIBOBJS@
+- $(LIBTOOL) $(CC) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(LIBS) libgdbm.la @LIBOBJS@
++ $(LIBTOOL) link $(CC) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(LIBS) libgdbm_compat.la @LIBOBJS@
+
+ lintgdbm:
+ lint $(DEFS) $(LFLAGS) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) testgdbm.c
diff --git a/core/gdbm/gdbm-1.8.3-zeroheaders.patch b/core/gdbm/gdbm-1.8.3-zeroheaders.patch
new file mode 100644
index 000000000..088956aef
--- /dev/null
+++ b/core/gdbm/gdbm-1.8.3-zeroheaders.patch
@@ -0,0 +1,44 @@
+02_zero-headers.patch by Jeff Johnson <jbj@redhat.com> and Colin Watson <cjwatson@debian.org>
+
+diff -urNad a/falloc.c b/falloc.c
+--- a/falloc.c 2001-02-28 06:52:33.000000000 +0000
++++ b/falloc.c 2003-09-08 23:58:43.000000000 +0100
+@@ -272,7 +272,7 @@
+
+
+ /* Split the header block. */
+- temp = (avail_block *) malloc (av_size);
++ temp = (avail_block *) calloc (1, av_size);
+ if (temp == NULL) _gdbm_fatal (dbf, "malloc error");
+ /* Set the size to be correct AFTER the pop_avail_block. */
+ temp->size = dbf->header->avail.size;
+diff -urNad a/gdbmopen.c b/gdbmopen.c
+--- a/gdbmopen.c 2003-09-08 23:58:01.000000000 +0100
++++ b/gdbmopen.c 2003-09-08 23:58:43.000000000 +0100
+@@ -212,7 +212,7 @@
+ file_block_size = block_size;
+
+ /* Get space for the file header. */
+- dbf->header = (gdbm_file_header *) malloc (file_block_size);
++ dbf->header = (gdbm_file_header *) calloc (1, file_block_size);
+ if (dbf->header == NULL)
+ {
+ gdbm_close (dbf);
+@@ -256,7 +256,7 @@
+ (dbf->header->block_size - sizeof (hash_bucket))
+ / sizeof (bucket_element) + 1;
+ dbf->header->bucket_size = dbf->header->block_size;
+- dbf->bucket = (hash_bucket *) malloc (dbf->header->bucket_size);
++ dbf->bucket = (hash_bucket *) calloc (1, dbf->header->bucket_size);
+ if (dbf->bucket == NULL)
+ {
+ gdbm_close (dbf);
+@@ -420,7 +420,7 @@
+ for(index = 0; index < size; index++)
+ {
+ (dbf->bucket_cache[index]).ca_bucket
+- = (hash_bucket *) malloc (dbf->header->bucket_size);
++ = (hash_bucket *) calloc (1, dbf->header->bucket_size);
+ if ((dbf->bucket_cache[index]).ca_bucket == NULL)
+ {
+ gdbm_errno = GDBM_MALLOC_ERROR;
diff --git a/core/gdbm/gdbm.install b/core/gdbm/gdbm.install
new file mode 100644
index 000000000..2d1ce2c5a
--- /dev/null
+++ b/core/gdbm/gdbm.install
@@ -0,0 +1,21 @@
+infodir=/usr/share/info
+filelist=(gdbm.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ usr/bin/install-info $infodir/$file $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 $infodir/dir 2> /dev/null
+ done
+}
+
diff --git a/core/gen-init-cpio/Makefile b/core/gen-init-cpio/Makefile
new file mode 100644
index 000000000..1ebe76373
--- /dev/null
+++ b/core/gen-init-cpio/Makefile
@@ -0,0 +1,42 @@
+
+DESTDIR =
+PREFIX = /
+
+MKDIR = /bin/mkdir
+INSTALL = /bin/install -c -m 755
+
+CC = /usr/bin/gcc
+LD = /usr/bin/gcc
+
+CFLAGS += -Wall -Wstrict-prototypes -Wsign-compare -Wchar-subscripts \
+ -Wpointer-arith -Wcast-align -Wsign-compare
+
+#pretty print!
+E = @echo
+Q = @
+
+all: gen_init_cpio
+.PHONY: all
+.DEFAULT: all
+
+%.o: %.c
+ $(E) " compile " $@
+ $(Q) $(CC) -c $(CFLAGS) $< -o $@
+
+gen_init_cpio: gen_init_cpio.o
+ $(E) ">>build " $@
+ $(Q) $(LD) $(LDFLAGS) $@.o -o $@ $(LIB_OBJS)
+
+clean:
+ $(E) " clean "
+ $(Q) rm -f gen_init_cpio *.o
+.PHONY: clean
+
+install: all
+ $(MKDIR) -p $(DESTDIR)$(PREFIX)sbin/
+ $(INSTALL) gen_init_cpio $(DESTDIR)$(PREFIX)sbin/
+.PHONY: install
+
+uninstall:
+ rm $(DESTDIR)$(PREFIX)sbin/gen_init_cpio
+.PHONY: uninstall
diff --git a/core/gen-init-cpio/PKGBUILD b/core/gen-init-cpio/PKGBUILD
new file mode 100644
index 000000000..5551ae1b3
--- /dev/null
+++ b/core/gen-init-cpio/PKGBUILD
@@ -0,0 +1,26 @@
+# $Id: PKGBUILD 102143 2010-12-06 09:37:46Z allan $
+# Maintainer : Tobias Powalowski <tpowa@archlinux.org>
+
+pkgname=gen-init-cpio
+pkgver=2.6.36
+pkgrel=1
+pkgdesc="Program to compress initramfs images"
+arch=('i686' 'x86_64')
+license=('GPL2')
+url="http://www.kernel.org/"
+depends=('glibc')
+source=(Makefile
+ gen_init_cpio.c)
+md5sums=('8e3a142a522d65121c3bead41013be98'
+ 'c0c0844d9e2e2c1bfb948201dc7b4c97')
+
+build()
+{
+ cd $srcdir
+ make
+}
+
+package() {
+ cd $srcdir
+ make DESTDIR=$pkgdir install
+}
diff --git a/core/gen-init-cpio/gen_init_cpio.c b/core/gen-init-cpio/gen_init_cpio.c
new file mode 100644
index 000000000..b2b3c2d1c
--- /dev/null
+++ b/core/gen-init-cpio/gen_init_cpio.c
@@ -0,0 +1,595 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <ctype.h>
+#include <limits.h>
+
+/*
+ * Original work by Jeff Garzik
+ *
+ * External file lists, symlink, pipe and fifo support by Thayne Harbaugh
+ * Hard link support by Luciano Rocha
+ */
+
+#define xstr(s) #s
+#define str(s) xstr(s)
+
+static unsigned int offset;
+static unsigned int ino = 721;
+
+struct file_handler {
+ const char *type;
+ int (*handler)(const char *line);
+};
+
+static void push_string(const char *name)
+{
+ unsigned int name_len = strlen(name) + 1;
+
+ fputs(name, stdout);
+ putchar(0);
+ offset += name_len;
+}
+
+static void push_pad (void)
+{
+ while (offset & 3) {
+ putchar(0);
+ offset++;
+ }
+}
+
+static void push_rest(const char *name)
+{
+ unsigned int name_len = strlen(name) + 1;
+ unsigned int tmp_ofs;
+
+ fputs(name, stdout);
+ putchar(0);
+ offset += name_len;
+
+ tmp_ofs = name_len + 110;
+ while (tmp_ofs & 3) {
+ putchar(0);
+ offset++;
+ tmp_ofs++;
+ }
+}
+
+static void push_hdr(const char *s)
+{
+ fputs(s, stdout);
+ offset += 110;
+}
+
+static void cpio_trailer(void)
+{
+ char s[256];
+ const char name[] = "TRAILER!!!";
+
+ sprintf(s, "%s%08X%08X%08lX%08lX%08X%08lX"
+ "%08X%08X%08X%08X%08X%08X%08X",
+ "070701", /* magic */
+ 0, /* ino */
+ 0, /* mode */
+ (long) 0, /* uid */
+ (long) 0, /* gid */
+ 1, /* nlink */
+ (long) 0, /* mtime */
+ 0, /* filesize */
+ 0, /* major */
+ 0, /* minor */
+ 0, /* rmajor */
+ 0, /* rminor */
+ (unsigned)strlen(name)+1, /* namesize */
+ 0); /* chksum */
+ push_hdr(s);
+ push_rest(name);
+
+ while (offset % 512) {
+ putchar(0);
+ offset++;
+ }
+}
+
+static int cpio_mkslink(const char *name, const char *target,
+ unsigned int mode, uid_t uid, gid_t gid)
+{
+ char s[256];
+ time_t mtime = time(NULL);
+
+ sprintf(s,"%s%08X%08X%08lX%08lX%08X%08lX"
+ "%08X%08X%08X%08X%08X%08X%08X",
+ "070701", /* magic */
+ ino++, /* ino */
+ S_IFLNK | mode, /* mode */
+ (long) uid, /* uid */
+ (long) gid, /* gid */
+ 1, /* nlink */
+ (long) mtime, /* mtime */
+ (unsigned)strlen(target)+1, /* filesize */
+ 3, /* major */
+ 1, /* minor */
+ 0, /* rmajor */
+ 0, /* rminor */
+ (unsigned)strlen(name) + 1,/* namesize */
+ 0); /* chksum */
+ push_hdr(s);
+ push_string(name);
+ push_pad();
+ push_string(target);
+ push_pad();
+ return 0;
+}
+
+static int cpio_mkslink_line(const char *line)
+{
+ char name[PATH_MAX + 1];
+ char target[PATH_MAX + 1];
+ unsigned int mode;
+ int uid;
+ int gid;
+ int rc = -1;
+
+ if (5 != sscanf(line, "%" str(PATH_MAX) "s %" str(PATH_MAX) "s %o %d %d", name, target, &mode, &uid, &gid)) {
+ fprintf(stderr, "Unrecognized dir format '%s'", line);
+ goto fail;
+ }
+ rc = cpio_mkslink(name, target, mode, uid, gid);
+ fail:
+ return rc;
+}
+
+static int cpio_mkgeneric(const char *name, unsigned int mode,
+ uid_t uid, gid_t gid)
+{
+ char s[256];
+ time_t mtime = time(NULL);
+
+ sprintf(s,"%s%08X%08X%08lX%08lX%08X%08lX"
+ "%08X%08X%08X%08X%08X%08X%08X",
+ "070701", /* magic */
+ ino++, /* ino */
+ mode, /* mode */
+ (long) uid, /* uid */
+ (long) gid, /* gid */
+ 2, /* nlink */
+ (long) mtime, /* mtime */
+ 0, /* filesize */
+ 3, /* major */
+ 1, /* minor */
+ 0, /* rmajor */
+ 0, /* rminor */
+ (unsigned)strlen(name) + 1,/* namesize */
+ 0); /* chksum */
+ push_hdr(s);
+ push_rest(name);
+ return 0;
+}
+
+enum generic_types {
+ GT_DIR,
+ GT_PIPE,
+ GT_SOCK
+};
+
+struct generic_type {
+ const char *type;
+ mode_t mode;
+};
+
+static struct generic_type generic_type_table[] = {
+ [GT_DIR] = {
+ .type = "dir",
+ .mode = S_IFDIR
+ },
+ [GT_PIPE] = {
+ .type = "pipe",
+ .mode = S_IFIFO
+ },
+ [GT_SOCK] = {
+ .type = "sock",
+ .mode = S_IFSOCK
+ }
+};
+
+static int cpio_mkgeneric_line(const char *line, enum generic_types gt)
+{
+ char name[PATH_MAX + 1];
+ unsigned int mode;
+ int uid;
+ int gid;
+ int rc = -1;
+
+ if (4 != sscanf(line, "%" str(PATH_MAX) "s %o %d %d", name, &mode, &uid, &gid)) {
+ fprintf(stderr, "Unrecognized %s format '%s'",
+ line, generic_type_table[gt].type);
+ goto fail;
+ }
+ mode |= generic_type_table[gt].mode;
+ rc = cpio_mkgeneric(name, mode, uid, gid);
+ fail:
+ return rc;
+}
+
+static int cpio_mkdir_line(const char *line)
+{
+ return cpio_mkgeneric_line(line, GT_DIR);
+}
+
+static int cpio_mkpipe_line(const char *line)
+{
+ return cpio_mkgeneric_line(line, GT_PIPE);
+}
+
+static int cpio_mksock_line(const char *line)
+{
+ return cpio_mkgeneric_line(line, GT_SOCK);
+}
+
+static int cpio_mknod(const char *name, unsigned int mode,
+ uid_t uid, gid_t gid, char dev_type,
+ unsigned int maj, unsigned int min)
+{
+ char s[256];
+ time_t mtime = time(NULL);
+
+ if (dev_type == 'b')
+ mode |= S_IFBLK;
+ else
+ mode |= S_IFCHR;
+
+ sprintf(s,"%s%08X%08X%08lX%08lX%08X%08lX"
+ "%08X%08X%08X%08X%08X%08X%08X",
+ "070701", /* magic */
+ ino++, /* ino */
+ mode, /* mode */
+ (long) uid, /* uid */
+ (long) gid, /* gid */
+ 1, /* nlink */
+ (long) mtime, /* mtime */
+ 0, /* filesize */
+ 3, /* major */
+ 1, /* minor */
+ maj, /* rmajor */
+ min, /* rminor */
+ (unsigned)strlen(name) + 1,/* namesize */
+ 0); /* chksum */
+ push_hdr(s);
+ push_rest(name);
+ return 0;
+}
+
+static int cpio_mknod_line(const char *line)
+{
+ char name[PATH_MAX + 1];
+ unsigned int mode;
+ int uid;
+ int gid;
+ char dev_type;
+ unsigned int maj;
+ unsigned int min;
+ int rc = -1;
+
+ if (7 != sscanf(line, "%" str(PATH_MAX) "s %o %d %d %c %u %u",
+ name, &mode, &uid, &gid, &dev_type, &maj, &min)) {
+ fprintf(stderr, "Unrecognized nod format '%s'", line);
+ goto fail;
+ }
+ rc = cpio_mknod(name, mode, uid, gid, dev_type, maj, min);
+ fail:
+ return rc;
+}
+
+static int cpio_mkfile(const char *name, const char *location,
+ unsigned int mode, uid_t uid, gid_t gid,
+ unsigned int nlinks)
+{
+ char s[256];
+ char *filebuf = NULL;
+ struct stat buf;
+ long size;
+ int file = -1;
+ int retval;
+ int rc = -1;
+ int namesize;
+ int i;
+
+ mode |= S_IFREG;
+
+ retval = stat (location, &buf);
+ if (retval) {
+ fprintf (stderr, "File %s could not be located\n", location);
+ goto error;
+ }
+
+ file = open (location, O_RDONLY);
+ if (file < 0) {
+ fprintf (stderr, "File %s could not be opened for reading\n", location);
+ goto error;
+ }
+
+ filebuf = malloc(buf.st_size);
+ if (!filebuf) {
+ fprintf (stderr, "out of memory\n");
+ goto error;
+ }
+
+ retval = read (file, filebuf, buf.st_size);
+ if (retval < 0) {
+ fprintf (stderr, "Can not read %s file\n", location);
+ goto error;
+ }
+
+ size = 0;
+ for (i = 1; i <= nlinks; i++) {
+ /* data goes on last link */
+ if (i == nlinks) size = buf.st_size;
+
+ namesize = strlen(name) + 1;
+ sprintf(s,"%s%08X%08X%08lX%08lX%08X%08lX"
+ "%08lX%08X%08X%08X%08X%08X%08X",
+ "070701", /* magic */
+ ino, /* ino */
+ mode, /* mode */
+ (long) uid, /* uid */
+ (long) gid, /* gid */
+ nlinks, /* nlink */
+ (long) buf.st_mtime, /* mtime */
+ size, /* filesize */
+ 3, /* major */
+ 1, /* minor */
+ 0, /* rmajor */
+ 0, /* rminor */
+ namesize, /* namesize */
+ 0); /* chksum */
+ push_hdr(s);
+ push_string(name);
+ push_pad();
+
+ if (size) {
+ if (fwrite(filebuf, size, 1, stdout) != 1) {
+ fprintf(stderr, "writing filebuf failed\n");
+ goto error;
+ }
+ offset += size;
+ push_pad();
+ }
+
+ name += namesize;
+ }
+ ino++;
+ rc = 0;
+
+error:
+ if (filebuf) free(filebuf);
+ if (file >= 0) close(file);
+ return rc;
+}
+
+static char *cpio_replace_env(char *new_location)
+{
+ char expanded[PATH_MAX + 1];
+ char env_var[PATH_MAX + 1];
+ char *start;
+ char *end;
+
+ for (start = NULL; (start = strstr(new_location, "${")); ) {
+ end = strchr(start, '}');
+ if (start < end) {
+ *env_var = *expanded = '\0';
+ strncat(env_var, start + 2, end - start - 2);
+ strncat(expanded, new_location, start - new_location);
+ strncat(expanded, getenv(env_var), PATH_MAX);
+ strncat(expanded, end + 1, PATH_MAX);
+ strncpy(new_location, expanded, PATH_MAX);
+ } else
+ break;
+ }
+
+ return new_location;
+}
+
+
+static int cpio_mkfile_line(const char *line)
+{
+ char name[PATH_MAX + 1];
+ char *dname = NULL; /* malloc'ed buffer for hard links */
+ char location[PATH_MAX + 1];
+ unsigned int mode;
+ int uid;
+ int gid;
+ int nlinks = 1;
+ int end = 0, dname_len = 0;
+ int rc = -1;
+
+ if (5 > sscanf(line, "%" str(PATH_MAX) "s %" str(PATH_MAX)
+ "s %o %d %d %n",
+ name, location, &mode, &uid, &gid, &end)) {
+ fprintf(stderr, "Unrecognized file format '%s'", line);
+ goto fail;
+ }
+ if (end && isgraph(line[end])) {
+ int len;
+ int nend;
+
+ dname = malloc(strlen(line));
+ if (!dname) {
+ fprintf (stderr, "out of memory (%d)\n", dname_len);
+ goto fail;
+ }
+
+ dname_len = strlen(name) + 1;
+ memcpy(dname, name, dname_len);
+
+ do {
+ nend = 0;
+ if (sscanf(line + end, "%" str(PATH_MAX) "s %n",
+ name, &nend) < 1)
+ break;
+ len = strlen(name) + 1;
+ memcpy(dname + dname_len, name, len);
+ dname_len += len;
+ nlinks++;
+ end += nend;
+ } while (isgraph(line[end]));
+ } else {
+ dname = name;
+ }
+ rc = cpio_mkfile(dname, cpio_replace_env(location),
+ mode, uid, gid, nlinks);
+ fail:
+ if (dname_len) free(dname);
+ return rc;
+}
+
+static void usage(const char *prog)
+{
+ fprintf(stderr, "Usage:\n"
+ "\t%s <cpio_list>\n"
+ "\n"
+ "<cpio_list> is a file containing newline separated entries that\n"
+ "describe the files to be included in the initramfs archive:\n"
+ "\n"
+ "# a comment\n"
+ "file <name> <location> <mode> <uid> <gid> [<hard links>]\n"
+ "dir <name> <mode> <uid> <gid>\n"
+ "nod <name> <mode> <uid> <gid> <dev_type> <maj> <min>\n"
+ "slink <name> <target> <mode> <uid> <gid>\n"
+ "pipe <name> <mode> <uid> <gid>\n"
+ "sock <name> <mode> <uid> <gid>\n"
+ "\n"
+ "<name> name of the file/dir/nod/etc in the archive\n"
+ "<location> location of the file in the current filesystem\n"
+ " expands shell variables quoted with ${}\n"
+ "<target> link target\n"
+ "<mode> mode/permissions of the file\n"
+ "<uid> user id (0=root)\n"
+ "<gid> group id (0=root)\n"
+ "<dev_type> device type (b=block, c=character)\n"
+ "<maj> major number of nod\n"
+ "<min> minor number of nod\n"
+ "<hard links> space separated list of other links to file\n"
+ "\n"
+ "example:\n"
+ "# A simple initramfs\n"
+ "dir /dev 0755 0 0\n"
+ "nod /dev/console 0600 0 0 c 5 1\n"
+ "dir /root 0700 0 0\n"
+ "dir /sbin 0755 0 0\n"
+ "file /sbin/kinit /usr/src/klibc/kinit/kinit 0755 0 0\n",
+ prog);
+}
+
+struct file_handler file_handler_table[] = {
+ {
+ .type = "file",
+ .handler = cpio_mkfile_line,
+ }, {
+ .type = "nod",
+ .handler = cpio_mknod_line,
+ }, {
+ .type = "dir",
+ .handler = cpio_mkdir_line,
+ }, {
+ .type = "slink",
+ .handler = cpio_mkslink_line,
+ }, {
+ .type = "pipe",
+ .handler = cpio_mkpipe_line,
+ }, {
+ .type = "sock",
+ .handler = cpio_mksock_line,
+ }, {
+ .type = NULL,
+ .handler = NULL,
+ }
+};
+
+#define LINE_SIZE (2 * PATH_MAX + 50)
+
+int main (int argc, char *argv[])
+{
+ FILE *cpio_list;
+ char line[LINE_SIZE];
+ char *args, *type;
+ int ec = 0;
+ int line_nr = 0;
+
+ if (2 != argc) {
+ usage(argv[0]);
+ exit(1);
+ }
+
+ if (!strcmp(argv[1], "-"))
+ cpio_list = stdin;
+ else if (! (cpio_list = fopen(argv[1], "r"))) {
+ fprintf(stderr, "ERROR: unable to open '%s': %s\n\n",
+ argv[1], strerror(errno));
+ usage(argv[0]);
+ exit(1);
+ }
+
+ while (fgets(line, LINE_SIZE, cpio_list)) {
+ int type_idx;
+ size_t slen = strlen(line);
+
+ line_nr++;
+
+ if ('#' == *line) {
+ /* comment - skip to next line */
+ continue;
+ }
+
+ if (! (type = strtok(line, " \t"))) {
+ fprintf(stderr,
+ "ERROR: incorrect format, could not locate file type line %d: '%s'\n",
+ line_nr, line);
+ ec = -1;
+ break;
+ }
+
+ if ('\n' == *type) {
+ /* a blank line */
+ continue;
+ }
+
+ if (slen == strlen(type)) {
+ /* must be an empty line */
+ continue;
+ }
+
+ if (! (args = strtok(NULL, "\n"))) {
+ fprintf(stderr,
+ "ERROR: incorrect format, newline required line %d: '%s'\n",
+ line_nr, line);
+ ec = -1;
+ }
+
+ for (type_idx = 0; file_handler_table[type_idx].type; type_idx++) {
+ int rc;
+ if (! strcmp(line, file_handler_table[type_idx].type)) {
+ if ((rc = file_handler_table[type_idx].handler(args))) {
+ ec = rc;
+ fprintf(stderr, " line %d\n", line_nr);
+ }
+ break;
+ }
+ }
+
+ if (NULL == file_handler_table[type_idx].type) {
+ fprintf(stderr, "unknown file type line %d: '%s'\n",
+ line_nr, line);
+ }
+ }
+ if (ec == 0)
+ cpio_trailer();
+
+ exit(ec);
+}
diff --git a/core/gettext/PKGBUILD b/core/gettext/PKGBUILD
new file mode 100644
index 000000000..f00a1c31a
--- /dev/null
+++ b/core/gettext/PKGBUILD
@@ -0,0 +1,29 @@
+# $Id: PKGBUILD 112865 2011-03-07 11:27:12Z stephane $
+# Maintainer:
+
+pkgname=gettext
+pkgver=0.18.1.1
+pkgrel=3
+pkgdesc="GNU internationalization library"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/gettext/"
+license=('GPL')
+groups=('base')
+depends=('gcc-libs' 'acl' 'sh' 'glib2')
+optdepends=('cvs: for autopoint tool')
+options=(!libtool)
+install=gettext.install
+source=(ftp://ftp.gnu.org/pub/gnu/gettext/${pkgname}-${pkgver}.tar.gz)
+md5sums=('3dd55b952826d2b32f51308f2f91aa89')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ sed -i -e 's/libexpat.so.0/libexpat.so.1/' gettext-tools/src/x-glade.c
+ ./configure --prefix=/usr --enable-csharp
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/core/gettext/gettext.install b/core/gettext/gettext.install
new file mode 100644
index 000000000..0ff52942f
--- /dev/null
+++ b/core/gettext/gettext.install
@@ -0,0 +1,22 @@
+infodir=/usr/share/info
+filelist=(gettext.info.gz autosprintf.info.gz)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file $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
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/glib2/PKGBUILD b/core/glib2/PKGBUILD
new file mode 100644
index 000000000..f1738b76b
--- /dev/null
+++ b/core/glib2/PKGBUILD
@@ -0,0 +1,37 @@
+# $Id: PKGBUILD 99447 2010-11-14 19:35:34Z ibiru $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=glib2
+pkgver=2.26.1
+pkgrel=1
+pkgdesc="Common C routines used by GTK+ 2.4 and other libs"
+url="http://www.gtk.org/"
+arch=(i686 x86_64)
+license=('LGPL')
+depends=('pcre>=8.02')
+makedepends=('pkgconfig' 'python2')
+options=('!libtool' '!docs')
+source=(http://ftp.gnome.org/pub/GNOME/sources/glib/2.26/glib-${pkgver}.tar.bz2
+ glib2.sh
+ glib2.csh)
+sha256sums=('7a74ff12b6b9dee1f2d0e520b56b68b621920c4f4250bdf23468e515625c28d5'
+ '9456872cdedcc639fb679448d74b85b0facf81033e27157d2861b991823b5a2a'
+ '8d5626ffa361304ad3696493c0ef041d0ab10c857f6ef32116b3e2878ecf89e3')
+
+build() {
+ cd "${srcdir}/glib-${pkgver}"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --with-pcre=system \
+ --disable-fam
+ make
+ make DESTDIR="${pkgdir}" install
+
+ install -d "${pkgdir}/etc/profile.d"
+ install -m755 "${srcdir}/glib2.sh" "${pkgdir}/etc/profile.d/"
+ install -m755 "${srcdir}/glib2.csh" "${pkgdir}/etc/profile.d/"
+
+ for _i in "${pkgdir}/etc/bash_completion.d/"*; do
+ chmod -x "${_i}"
+ done
+}
diff --git a/core/glib2/glib2.csh b/core/glib2/glib2.csh
new file mode 100644
index 000000000..7aa3a2ffa
--- /dev/null
+++ b/core/glib2/glib2.csh
@@ -0,0 +1 @@
+setenv G_BROKEN_FILENAMES 1
diff --git a/core/glib2/glib2.sh b/core/glib2/glib2.sh
new file mode 100644
index 000000000..96a056e1e
--- /dev/null
+++ b/core/glib2/glib2.sh
@@ -0,0 +1 @@
+export G_BROKEN_FILENAMES=1
diff --git a/core/glibc/PKGBUILD b/core/glibc/PKGBUILD
new file mode 100644
index 000000000..6ae2db02f
--- /dev/null
+++ b/core/glibc/PKGBUILD
@@ -0,0 +1,164 @@
+# $Id: PKGBUILD 110236 2011-02-18 04:46:54Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+
+# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
+# NOTE: valgrind requires rebuilt with each new glibc version
+
+pkgname=glibc
+pkgver=2.13
+pkgrel=4
+_glibcdate=20110117
+pkgdesc="GNU C Library"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/libc"
+license=('GPL' 'LGPL')
+groups=('base')
+depends=('linux-api-headers>=2.6.37' 'tzdata')
+makedepends=('gcc>=4.4')
+backup=(etc/locale.gen
+ etc/nscd.conf)
+options=('!strip')
+install=glibc.install
+source=(ftp://ftp.archlinux.org/other/glibc/${pkgname}-${pkgver}_${_glibcdate}.tar.xz
+ glibc-2.10-dont-build-timezone.patch
+ glibc-2.10-bz4781.patch
+ glibc-__i686.patch
+ glibc-2.12.1-static-shared-getpagesize.patch
+ glibc-2.12.2-ignore-origin-of-privileged-program.patch
+ glibc-2.13-prelink.patch
+ nscd
+ locale.gen.txt
+ locale-gen)
+md5sums=('b7b17d9c6b5b71b5e5322e04ca63c190'
+ '4dadb9203b69a3210d53514bb46f41c3'
+ '0c5540efc51c0b93996c51b57a8540ae'
+ '40cd342e21f71f5e49e32622b25acc52'
+ 'a3ac6f318d680347bb6e2805d42b73b2'
+ 'b042647ea7d6f22ad319e12e796bd13e'
+ '24dfab6fd244f3773523412588ecc52c'
+ 'b587ee3a70c9b3713099295609afde49'
+ '07ac979b6ab5eeb778d55f041529d623'
+ '476e9113489f93b348b21e144b6a8fcf')
+
+mksource() {
+ git clone git://sourceware.org/git/glibc.git
+ pushd glibc
+ git checkout -b glibc-2.13-arch origin/release/2.13/master
+ popd
+ tar -cvJf glibc-${pkgver}_${_glibcdate}.tar.xz glibc/*
+}
+
+build() {
+ cd ${srcdir}/glibc
+
+ # timezone data is in separate package (tzdata)
+ patch -Np1 -i ${srcdir}/glibc-2.10-dont-build-timezone.patch
+
+ # http://sources.redhat.com/bugzilla/show_bug.cgi?id=4781
+ patch -Np1 -i ${srcdir}/glibc-2.10-bz4781.patch
+
+ # http://sources.redhat.com/bugzilla/show_bug.cgi?id=411
+ # http://sourceware.org/ml/libc-alpha/2009-07/msg00072.html
+ patch -Np1 -i ${srcdir}/glibc-__i686.patch
+
+ # http://sourceware.org/bugzilla/show_bug.cgi?id=11929
+ # using Fedora "fix" as patch in that bug report causes breakages...
+ patch -Np1 -i ${srcdir}/glibc-2.12.1-static-shared-getpagesize.patch
+
+ # http://www.exploit-db.com/exploits/15274/
+ # http://sourceware.org/git/?p=glibc.git;a=patch;h=d14e6b09 (only fedora branch...)
+ patch -Np1 -i ${srcdir}/glibc-2.12.2-ignore-origin-of-privileged-program.patch
+
+ # http://sourceware.org/bugzilla/show_bug.cgi?id=12489
+ # http://sourceware.org/git/?p=glibc.git;a=commit;h=25b3aada (only fedora branch...)
+ patch -Np1 -i ${srcdir}/glibc-2.13-prelink.patch
+
+ # http://sourceware.org/bugzilla/show_bug.cgi?id=12403
+ if [[ $CARCH == "x86_64" ]]; then
+ sed -i '/__ASSUME_PRIVATE_FUTEX/d' $srcdir/glibc/sysdeps/unix/sysv/linux/kernel-features.h
+ fi
+
+ install -dm755 ${pkgdir}/etc
+ touch ${pkgdir}/etc/ld.so.conf
+
+ cd ${srcdir}
+ mkdir glibc-build
+ cd glibc-build
+
+ if [[ ${CARCH} = "i686" ]]; then
+ # Hack to fix NPTL issues with Xen, only required on 32bit platforms
+ export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
+ fi
+
+ echo "slibdir=/lib" >> configparms
+
+ ${srcdir}/glibc/configure --prefix=/usr \
+ --libdir=/usr/lib --libexecdir=/usr/lib \
+ --with-headers=/usr/include \
+ --enable-add-ons=nptl,libidn \
+ --enable-kernel=2.6.27 \
+ --with-tls --with-__thread \
+ --enable-bind-now --without-gd \
+ --without-cvs --disable-profile \
+ --disable-multi-arch
+
+ make
+
+ # some errors are expected - manually check log files
+ make -k check || true
+}
+
+package() {
+ cd ${srcdir}/glibc-build
+ make install_root=${pkgdir} install
+
+ rm ${pkgdir}/etc/ld.so.{cache,conf}
+
+ install -dm755 ${pkgdir}/etc/rc.d
+ install -dm755 ${pkgdir}/usr/sbin
+ install -dm755 ${pkgdir}/usr/lib/locale
+ install -m644 ${srcdir}/glibc/nscd/nscd.conf ${pkgdir}/etc/nscd.conf
+ install -m755 ${srcdir}/nscd ${pkgdir}/etc/rc.d/nscd
+ install -m755 ${srcdir}/locale-gen ${pkgdir}/usr/sbin
+ install -m644 ${srcdir}/glibc/posix/gai.conf ${pkgdir}/etc/gai.conf
+
+ sed -i -e 's/^\tserver-user/#\tserver-user/' ${pkgdir}/etc/nscd.conf
+
+ # create /etc/locale.gen
+ install -m644 ${srcdir}/locale.gen.txt ${pkgdir}/etc/locale.gen
+ sed -i "s|/| |g" ${srcdir}/glibc/localedata/SUPPORTED
+ sed -i 's|\\| |g' ${srcdir}/glibc/localedata/SUPPORTED
+ sed -i "s|SUPPORTED-LOCALES=||" ${srcdir}/glibc/localedata/SUPPORTED
+ cat ${srcdir}/glibc/localedata/SUPPORTED >> ${pkgdir}/etc/locale.gen
+ sed -i "s|^|#|g" ${pkgdir}/etc/locale.gen
+
+ if [[ ${CARCH} = "x86_64" ]]; then
+ # fix for the linker
+ sed -i '/RTLDLIST/s%lib64%lib%' ${pkgdir}/usr/bin/ldd
+ # Comply with multilib binaries, they look for the linker in /lib64
+ mkdir ${pkgdir}/lib64
+ cd ${pkgdir}/lib64
+ ln -v -s ../lib/ld* .
+ fi
+
+ # manually strip files as stripping libpthread-*.so and libthread_db.so
+ # with the default $STRIP_SHARED breaks gdb and stripping ld-*.so breaks
+ # valgrind on x86_64
+
+ cd $pkgdir
+ strip $STRIP_BINARIES sbin/{ldconfig,sln} \
+ usr/bin/{gencat,getconf,getent,iconv,locale} \
+ usr/bin/{localedef,pcprofiledump,rpcgen,sprof} \
+ usr/lib/getconf/* \
+ usr/sbin/{iconvconfig,nscd,rpcinfo}
+ [[ $CARCH = "i686" ]] && strip $STRIP_BINARIES usr/bin/lddlibc4
+
+ strip $STRIP_STATIC usr/lib/*.a \
+ lib/{{ld,libpthread}-${pkgver},libthread_db-1.0}.so
+
+ strip $STRIP_SHARED lib/{libanl,libBrokenLocale,libc,libcidn,libcrypt}-${pkgver}.so \
+ lib/libnss_{compat,dns,files,hesiod,nis,nisplus}-${pkgver}.so \
+ lib/{libdl,libm,libnsl,libresolv,librt,libutil}-${pkgver}.so \
+ lib/{libmemusage,libpcprofile,libSegFault}.so \
+ usr/lib/{pt_chown,gconv/*.so}
+}
diff --git a/core/glibc/glibc-2.10-bz4781.patch b/core/glibc/glibc-2.10-bz4781.patch
new file mode 100644
index 000000000..cf1a97a18
--- /dev/null
+++ b/core/glibc/glibc-2.10-bz4781.patch
@@ -0,0 +1,42 @@
+diff -Naur glibc-old/sysdeps/unix/sysv/linux/i386/clone.S glibc/sysdeps/unix/sysv/linux/i386/clone.S
+--- glibc-old/sysdeps/unix/sysv/linux/i386/clone.S 2009-05-09 13:35:30.000000000 +1000
++++ glibc/sysdeps/unix/sysv/linux/i386/clone.S 2009-05-23 13:27:46.000000000 +1000
+@@ -120,9 +120,6 @@
+ ret
+
+ L(thread_start):
+- cfi_startproc;
+- /* Clearing frame pointer is insufficient, use CFI. */
+- cfi_undefined (eip);
+ /* Note: %esi is zero. */
+ movl %esi,%ebp /* terminate the stack frame */
+ #ifdef RESET_PID
+@@ -155,7 +152,6 @@
+ jmp L(haspid)
+ .previous
+ #endif
+- cfi_endproc;
+
+ cfi_startproc
+ PSEUDO_END (BP_SYM (__clone))
+diff -Naur glibc-old/sysdeps/unix/sysv/linux/x86_64/clone.S glibc/sysdeps/unix/sysv/linux/x86_64/clone.S
+--- glibc-old/sysdeps/unix/sysv/linux/x86_64/clone.S 2009-05-09 13:35:30.000000000 +1000
++++ glibc/sysdeps/unix/sysv/linux/x86_64/clone.S 2009-05-23 13:27:46.000000000 +1000
+@@ -89,9 +89,6 @@
+ ret
+
+ L(thread_start):
+- cfi_startproc;
+- /* Clearing frame pointer is insufficient, use CFI. */
+- cfi_undefined (rip);
+ /* Clear the frame pointer. The ABI suggests this be done, to mark
+ the outermost frame obviously. */
+ xorl %ebp, %ebp
+@@ -116,7 +113,6 @@
+ /* Call exit with return value from function call. */
+ movq %rax, %rdi
+ call HIDDEN_JUMPTARGET (_exit)
+- cfi_endproc;
+
+ cfi_startproc;
+ PSEUDO_END (BP_SYM (__clone))
diff --git a/core/glibc/glibc-2.10-dont-build-timezone.patch b/core/glibc/glibc-2.10-dont-build-timezone.patch
new file mode 100644
index 000000000..d3abeff17
--- /dev/null
+++ b/core/glibc/glibc-2.10-dont-build-timezone.patch
@@ -0,0 +1,13 @@
+timezone data has been split into the package sys-libs/timezone-data
+
+--- glibc-2.4/Makeconfig
++++ glibc-2.4/Makeconfig
+@@ -931,7 +931,7 @@
+ stdlib stdio-common libio malloc string wcsmbs time dirent \
+ grp pwd posix io termios resource misc socket sysvipc gmon \
+ gnulib iconv iconvdata wctype manual shadow gshadow po argp \
+- crypt nss localedata timezone rt conform debug \
++ crypt nss localedata rt conform debug \
+ $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
+
+ ifndef avoid-generated
diff --git a/core/glibc/glibc-2.12.1-static-shared-getpagesize.patch b/core/glibc/glibc-2.12.1-static-shared-getpagesize.patch
new file mode 100644
index 000000000..e84754279
--- /dev/null
+++ b/core/glibc/glibc-2.12.1-static-shared-getpagesize.patch
@@ -0,0 +1,11 @@
+--- glibc-2.12-192-g7c08a05/sysdeps/unix/sysv/linux/getpagesize.c
++++ glibc-2.12.90-17/sysdeps/unix/sysv/linux/getpagesize.c
+@@ -28,7 +28,7 @@
+ int
+ __getpagesize ()
+ {
+-#ifdef __ASSUME_AT_PAGESIZE
++#if 0 && defined __ASSUME_AT_PAGESIZE
+ assert (GLRO(dl_pagesize) != 0);
+ return GLRO(dl_pagesize);
+ #else
diff --git a/core/glibc/glibc-2.12.2-ignore-origin-of-privileged-program.patch b/core/glibc/glibc-2.12.2-ignore-origin-of-privileged-program.patch
new file mode 100644
index 000000000..ce089b49c
--- /dev/null
+++ b/core/glibc/glibc-2.12.2-ignore-origin-of-privileged-program.patch
@@ -0,0 +1,26 @@
+From d14e6b09d60d52cc12f0396c3106b14e1bd0fe8f Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@redhat.com>
+Date: Thu, 9 Dec 2010 15:00:59 +0100
+Subject: [PATCH 1/1] Ignore origin of privileged program
+
+---
+ ChangeLog | 5 +++++
+ elf/dl-object.c | 3 +++
+ 2 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/elf/dl-object.c b/elf/dl-object.c
+index 22a1635..7674d49 100644
+--- a/elf/dl-object.c
++++ b/elf/dl-object.c
+@@ -214,6 +214,9 @@ _dl_new_object (char *realname, const char *libname, int type,
+ out:
+ new->l_origin = origin;
+ }
++ else if (INTUSE(__libc_enable_secure) && type == lt_executable)
++ /* The origin of a privileged program cannot be trusted. */
++ new->l_origin = (char *) -1;
+
+ return new;
+ }
+--
+1.7.2
diff --git a/core/glibc/glibc-2.13-prelink.patch b/core/glibc/glibc-2.13-prelink.patch
new file mode 100644
index 000000000..bef7998a8
--- /dev/null
+++ b/core/glibc/glibc-2.13-prelink.patch
@@ -0,0 +1,26 @@
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 9a560b3..201c9cf 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2168,6 +2168,10 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+ we need it in the memory handling later. */
+ GLRO(dl_initial_searchlist) = *GL(dl_ns)[LM_ID_BASE]._ns_main_searchlist;
+
++ /* Remember the last search directory added at startup, now that
++ malloc will no longer be the one from dl-minimal.c. */
++ GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
++
+ if (prelinked)
+ {
+ if (main_map->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL)
+@@ -2288,10 +2292,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+ lossage);
+ }
+
+- /* Remember the last search directory added at startup, now that
+- malloc will no longer be the one from dl-minimal.c. */
+- GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
+-
+ if (! prelinked && rtld_multiple_ref)
+ {
+ /* There was an explicit ref to the dynamic linker as a shared lib.
diff --git a/core/glibc/glibc-__i686.patch b/core/glibc/glibc-__i686.patch
new file mode 100644
index 000000000..28d5dd424
--- /dev/null
+++ b/core/glibc/glibc-__i686.patch
@@ -0,0 +1,13 @@
+diff -Naur glibc-old//sysdeps/i386/Makefile glibc//sysdeps/i386/Makefile
+--- glibc-old//sysdeps/i386/Makefile 2010-03-18 11:52:30.000000000 +1000
++++ glibc//sysdeps/i386/Makefile 2010-04-16 15:05:50.000000000 +1000
+@@ -1,6 +1,7 @@
+ # The mpn functions need a #define for asm syntax flavor.
+-# Every i386 port in use uses gas syntax (I think).
+-asm-CPPFLAGS += -DGAS_SYNTAX
++# Every i386 port in use uses gas syntax (I think). Don't replace
++# __i686 in __i686.get_pc_thunk.bx.
++asm-CPPFLAGS += -DGAS_SYNTAX -U __i686
+
+ # The i386 `long double' is a distinct type we support.
+ long-double-fcts = yes
diff --git a/core/glibc/glibc.install b/core/glibc/glibc.install
new file mode 100644
index 000000000..7f85ade96
--- /dev/null
+++ b/core/glibc/glibc.install
@@ -0,0 +1,20 @@
+infodir=usr/share/info
+filelist=(libc.info{,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11})
+
+post_upgrade() {
+ sbin/ldconfig -r .
+ [ -x sbin/init ] && sbin/init u
+ usr/sbin/locale-gen
+
+ [ -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
+}
+
+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/core/glibc/locale-gen b/core/glibc/locale-gen
new file mode 100755
index 000000000..5aff344c4
--- /dev/null
+++ b/core/glibc/locale-gen
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+LOCALEGEN=/etc/locale.gen
+LOCALES=/usr/share/i18n/locales
+if [ -n "$POSIXLY_CORRECT" ]; then
+ unset POSIXLY_CORRECT
+fi
+
+
+[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0;
+
+# Remove all old locale dir and locale-archive before generating new
+# locale data.
+rm -rf /usr/lib/locale/* || true
+
+umask 022
+
+is_entry_ok() {
+ if [ -n "$locale" -a -n "$charset" ] ; then
+ true
+ else
+ echo "error: Bad entry '$locale $charset'"
+ false
+ fi
+}
+
+echo "Generating locales..."
+while read locale charset; do \
+ case $locale in \#*) continue;; "") continue;; esac; \
+ is_entry_ok || continue
+ echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \
+ echo -n ".$charset"; \
+ echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
+ echo -n '...'; \
+ if [ -f $LOCALES/$locale ]; then input=$locale; else \
+ input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \
+ localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias $locale; \
+ echo ' done'; \
+done < $LOCALEGEN
+echo "Generation complete."
diff --git a/core/glibc/locale.gen.txt b/core/glibc/locale.gen.txt
new file mode 100644
index 000000000..ccdd81734
--- /dev/null
+++ b/core/glibc/locale.gen.txt
@@ -0,0 +1,23 @@
+# Configuration file for locale-gen
+#
+# lists of locales that are to be generated by the locale-gen command.
+#
+# Each line is of the form:
+#
+# <locale> <charset>
+#
+# where <locale> is one of the locales given in /usr/share/i18n/locales
+# and <charset> is one of the character sets listed in /usr/share/i18n/charmaps
+#
+# Examples:
+# en_US ISO-8859-1
+# en_US.UTF-8 UTF-8
+# de_DE ISO-8859-1
+# de_DE@euro ISO-8859-15
+#
+# The locale-gen command will generate all the locales,
+# placing them in /usr/lib/locale.
+#
+# A list of supported locales is included in this file.
+# Uncomment the ones you need.
+#
diff --git a/core/glibc/nscd b/core/glibc/nscd
new file mode 100755
index 000000000..8b14f2a3f
--- /dev/null
+++ b/core/glibc/nscd
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/nscd`
+case "$1" in
+ start)
+ stat_busy "Starting nscd"
+ # create necessary directories if they don't already exist
+ mkdir -p /var/run/nscd /var/db/nscd 2>/dev/null
+ # remove stale files
+ rm -f /var/db/nscd/* /var/run/nscd/* 2>/dev/null
+ [ -z "$PID" ] && /usr/sbin/nscd
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon nscd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping nscd"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon nscd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/gmp/PKGBUILD b/core/gmp/PKGBUILD
new file mode 100644
index 000000000..234f18ad8
--- /dev/null
+++ b/core/gmp/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 105599 2011-01-10 18:34:30Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=gmp
+pkgver=5.0.1
+pkgrel=2
+pkgdesc="A free library for arbitrary precision arithmetic"
+arch=('i686' 'x86_64')
+url="http://gmplib.org/"
+depends=('gcc-libs' 'sh')
+license=('LGPL3')
+options=(!libtool)
+install=gmp.install
+source=(ftp://ftp.gnu.org/gnu/gmp/gmp-${pkgver}.tar.bz2)
+md5sums=('6bac6df75c192a13419dfd71d19240a7')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ [ "${CARCH}" = "i686" ] && export ABI="32"
+ ./configure --build=${CHOST} \
+ --prefix=/usr --infodir=/usr/share/info \
+ --enable-cxx
+ make
+ make check
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/core/gmp/gmp.install b/core/gmp/gmp.install
new file mode 100644
index 000000000..1c31ab365
--- /dev/null
+++ b/core/gmp/gmp.install
@@ -0,0 +1,20 @@
+info_dir=/usr/share/info
+info_files=(gmp.info gmp.info-1 gmp.info-2)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for f in ${info_files[@]}; do
+ install-info ${info_dir}/$f.gz ${info_dir}/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ for f in ${info_files[@]}; do
+ install-info --delete ${info_dir}/$f.gz ${info_dir}/dir 2> /dev/null
+ done
+}
diff --git a/core/gpm/PKGBUILD b/core/gpm/PKGBUILD
new file mode 100644
index 000000000..f0284fc2e
--- /dev/null
+++ b/core/gpm/PKGBUILD
@@ -0,0 +1,39 @@
+# $Id: PKGBUILD 100083 2010-11-20 08:19:49Z eric $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+
+pkgname=gpm
+pkgver=1.20.6
+pkgrel=6
+pkgdesc="A mouse server for the console and xterm"
+arch=('i686' 'x86_64')
+url="http://www.nico.schottelius.org/software/gpm/"
+license=('GPL')
+depends=('ncurses' 'bash')
+backup=('etc/conf.d/gpm')
+options=('!makeflags')
+install=gpm.install
+source=(http://www.nico.schottelius.org/software/gpm/archives/${pkgname}-${pkgver}.tar.bz2 \
+ gpm gpm.conf.d gpm.sh)
+md5sums=('6b534da16dc1b28ba828dea89e520f6f' '945ecde0836687e05c13ea837092ea6c'\
+ 'f436a1277571f2ae8bfa9bf2ef32f7a5' 'e391fe4599ce102615f9cd449c380d41')
+sha1sums=('f3bb9272878b7934968381c8b25edab359114150' '19e1feb1493373512a77801699df012d186336ea'\
+ '4c31cb7dd51cee4d16d3f7a8956e6d87fac1ad86' '88fe5ff10916c68a87abc8418a56eb0073f69fa9')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --sysconfdir=/etc
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ install -D -m755 ../gpm "${pkgdir}/etc/rc.d/gpm"
+ install -D -m644 ../gpm.conf.d "${pkgdir}/etc/conf.d/gpm"
+ install -D -m755 ../gpm.sh "${pkgdir}/etc/profile.d/gpm.sh"
+
+# library fixes
+ cd "${pkgdir}/usr/lib/"
+ ln -s libgpm.so.2.* libgpm.so
+ chmod 755 "${pkgdir}"/usr/lib/libgpm.so.*
+}
diff --git a/core/gpm/gpm b/core/gpm/gpm
new file mode 100755
index 000000000..7b5213dd7
--- /dev/null
+++ b/core/gpm/gpm
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# source application-specific settings
+GPM_ARGS=
+[ -f /etc/conf.d/gpm ] && . /etc/conf.d/gpm
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof -o %PPID /usr/sbin/gpm)
+case "$1" in
+ start)
+ stat_busy "Starting GPM Daemon"
+ [ -z "$PID" ] && /usr/sbin/gpm ${GPM_ARGS}
+ PID=$(pidof -o %PPID /usr/sbin/gpm)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ add_daemon gpm
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping GPM Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon gpm
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/gpm/gpm.conf.d b/core/gpm/gpm.conf.d
new file mode 100644
index 000000000..ab43bb7eb
--- /dev/null
+++ b/core/gpm/gpm.conf.d
@@ -0,0 +1,4 @@
+#
+# Parameters to be passed to gpm
+#
+GPM_ARGS="-m /dev/input/mice -t imps2"
diff --git a/core/gpm/gpm.install b/core/gpm/gpm.install
new file mode 100644
index 000000000..2a1519a6c
--- /dev/null
+++ b/core/gpm/gpm.install
@@ -0,0 +1,16 @@
+infodir=/usr/share/info
+file=gpm.info.gz
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ install-info $infodir/$file $infodir/dir 2> /dev/null
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+}
diff --git a/core/gpm/gpm.sh b/core/gpm/gpm.sh
new file mode 100755
index 000000000..af35a5f33
--- /dev/null
+++ b/core/gpm/gpm.sh
@@ -0,0 +1,3 @@
+case $( /usr/bin/tty ) in
+ /dev/tty[0-9]*) [ -n "$(pgrep gpm)" ] && /usr/bin/disable-paste ;;
+esac
diff --git a/core/grep/PKGBUILD b/core/grep/PKGBUILD
new file mode 100644
index 000000000..a2c47a73c
--- /dev/null
+++ b/core/grep/PKGBUILD
@@ -0,0 +1,29 @@
+# $Id: PKGBUILD 91020 2010-09-21 03:26:36Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=grep
+pkgver=2.7
+pkgrel=1
+pkgdesc="A string search utility"
+arch=('i686' 'x86_64')
+license=('GPL3')
+url="http://www.gnu.org/software/grep/grep.html"
+groups=('base')
+depends=('glibc' 'pcre' 'sh')
+makedepends=('texinfo')
+install=${pkgname}.install
+source=(ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz)
+md5sums=('6dd9931a52501519d7779a27cf953326')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr --bindir=/bin --without-included-regex
+ make
+ make check
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+}
diff --git a/core/grep/grep.install b/core/grep/grep.install
new file mode 100644
index 000000000..ba97d8994
--- /dev/null
+++ b/core/grep/grep.install
@@ -0,0 +1,21 @@
+infodir=/usr/share/info
+filelist=(grep.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
diff --git a/core/groff/PKGBUILD b/core/groff/PKGBUILD
new file mode 100644
index 000000000..73e68b3a6
--- /dev/null
+++ b/core/groff/PKGBUILD
@@ -0,0 +1,43 @@
+# $Id: PKGBUILD 104541 2011-01-03 22:33:16Z tpowa $
+# Maintainer: judd <jvinet@zeroflux.org>
+pkgname=groff
+pkgver=1.21
+pkgrel=1
+pkgdesc="GNU troff text-formatting system"
+arch=(i686 x86_64)
+url="http://www.gnu.org/software/groff/groff.html"
+license=('GPL')
+depends=('perl' 'gcc-libs' 'texinfo')
+makedepends=('netpbm' 'psutils' 'ghostscript')
+optdepends=('netpbm: for use together with man -H command interaction in browsers'
+ 'psutils: for use together with man -H command interaction in browsers')
+source=(ftp://ftp.gnu.org/gnu/groff/groff-$pkgver.tar.gz
+ site.tmac)
+options=('!makeflags')
+install=groff.install
+md5sums=('8b8cd29385b97616a0f0d96d0951c5bf'
+ 'a1fedafd7863b37968d32ad9ae1d8c13')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ ./configure --prefix=/usr --without-x
+ mkdir -p $pkgdir/usr
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make prefix=$pkgdir/usr install
+ cd $pkgdir/usr/bin
+ # needed for xman
+ ln -s eqn geqn
+ ln -s tbl gtbl
+ ln -s soelim zsoelim
+ rm -rf $pkgdir/usr/lib/groff/site-tmac
+ # Fix some issues when encoding to utf8 man pages
+ # The output chars don't match keyboard chars...
+ cat $srcdir/site.tmac >> \
+ $pkgdir/usr/share/groff/site-tmac/man.local
+ cat $srcdir/site.tmac >> \
+ $pkgdir/usr/share/groff/site-tmac/mdoc.local
+}
diff --git a/core/groff/groff.install b/core/groff/groff.install
new file mode 100644
index 000000000..6807e4bef
--- /dev/null
+++ b/core/groff/groff.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(groff.info groff.info-1 groff.info-2 groff.info-3)
+
+post_install() {
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ for file in ${filelist[@]}; do
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/groff/site.tmac b/core/groff/site.tmac
new file mode 100644
index 000000000..8ef1040ca
--- /dev/null
+++ b/core/groff/site.tmac
@@ -0,0 +1,16 @@
+.
+.if n \{\
+. \" Character translations for non-keyboard
+. \" characters - to make them searchable
+. if '\*[.T]'utf8' \{\
+. char \- \N'45'
+. char - \N'45'
+. char ' \N'39'
+. char \' \N'39'
+. \}
+.
+. \" Shut off SGR by default (groff colors)
+. \" Require GROFF_SGR envvar defined to turn it on
+. if '\V[GROFF_SGR]'' \
+. output x X tty: sgr 0
+.\}
diff --git a/core/gzip/PKGBUILD b/core/gzip/PKGBUILD
new file mode 100644
index 000000000..135dafaa6
--- /dev/null
+++ b/core/gzip/PKGBUILD
@@ -0,0 +1,39 @@
+# $Id: PKGBUILD 100035 2010-11-20 01:15:49Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=gzip
+pkgver=1.4
+pkgrel=2
+pkgdesc="GNU compression utility"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/gzip/"
+license=('GPL3')
+groups=('base')
+depends=('glibc' 'bash')
+makedepends=('patch')
+install=gzip.install
+source=(ftp://ftp.gnu.org/pub/gnu/gzip/gzip-$pkgver.tar.gz)
+md5sums=('e381b8506210c794278f5527cba0e765')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # By default Gzip uses assembly code. While this may preform better,
+ # it is not position independent. The DEFS environment variable is
+ # set to use only C code.
+ export DEFS="NO_ASM"
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make prefix=${pkgdir}/usr install
+
+ install -dm755 ${pkgdir}/bin
+ mv ${pkgdir}/usr/bin/{gunzip,gzip,uncompress,zcat} ${pkgdir}/bin/
+ cd $pkgdir/bin
+ ln -sf ${pkgname} compress
+}
diff --git a/core/gzip/gzip.install b/core/gzip/gzip.install
new file mode 100644
index 000000000..636f91011
--- /dev/null
+++ b/core/gzip/gzip.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(gzip.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/core/hdparm/PKGBUILD b/core/hdparm/PKGBUILD
new file mode 100644
index 000000000..680cf51c9
--- /dev/null
+++ b/core/hdparm/PKGBUILD
@@ -0,0 +1,42 @@
+# $Id: PKGBUILD 111559 2011-02-27 18:01:17Z tpowa $
+# Maintainer: Paul Mattal <paul@archlinux.org>
+
+pkgname=hdparm
+pkgver=9.37
+pkgrel=1
+pkgdesc="A shell utility for manipulating Linux IDE drive/driver parameters"
+arch=(i686 x86_64)
+depends=('glibc')
+optdepends=('sh: required by idectl and ultrabayd')
+source=(http://downloads.sourceforge.net/sourceforge/hdparm/${pkgname}-${pkgver}.tar.gz
+ wiper.sh.2_6.max-ranges.patch)
+license=('BSD')
+url="http://sourceforge.net/projects/hdparm/"
+optdepends=('bash: for wiper.sh script')
+options=('emptydirs')
+md5sums=('0bb94ddd1bedd5c02b1ca62f1caaf6de'
+ '74e368f384166a7710b447573cda120a')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ # Fix Range input/output error when wiping Intel G2 and OCZ drives
+ patch -Np1 -i $srcdir/wiper.sh.2_6.max-ranges.patch
+
+ # build
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ # install
+ mkdir -p ${pkgdir}/{usr,sbin}
+ make DESTDIR=${pkgdir} install
+ install -m755 contrib/idectl ${pkgdir}/sbin
+ install -m755 contrib/ultrabayd ${pkgdir}/sbin
+
+ install -D -m 0644 $srcdir/$pkgname-$pkgver/wiper/README.txt $pkgdir/usr/share/doc/wiper/README.txt
+ install -D -m 0755 $srcdir/$pkgname-$pkgver/wiper/wiper.sh $pkgdir/usr/sbin/wiper.sh
+
+ #install license file
+ install -D -m 644 LICENSE.TXT $pkgdir/usr/share/licenses/hdparm/LICENSE.TXT
+}
diff --git a/core/hdparm/wiper.sh.2_6.max-ranges.patch b/core/hdparm/wiper.sh.2_6.max-ranges.patch
new file mode 100644
index 000000000..c55f7b149
--- /dev/null
+++ b/core/hdparm/wiper.sh.2_6.max-ranges.patch
@@ -0,0 +1,84 @@
+--- hdparm-9.28/wiper/wiper.sh.orig 2010-03-09 06:17:37.000000000 -0800
+--- hdparm-9.28/wiper/wiper.sh 2010-05-15 03:08:02.182856971 -0700
+@@ -29,7 +29,7 @@
+ function usage_error(){
+ echo >&2
+ echo "Linux tune-up (TRIM) utility for SATA SSDs"
+- echo "Usage: $0 [--verbose] [--commit] <mount_point|block_device>" >&2
++ echo "Usage: $0 [--max-ranges <num>] [--verbose] [--commit] <mount_point|block_device>" >&2
+ echo " Eg: $0 /dev/sda1" >&2
+ echo >&2
+ exit 1
+@@ -44,6 +44,7 @@
+
+ export verbose=0
+ commit=""
++max_ranges=-1
+ destroy_me=""
+ argc=$#
+ arg=""
+@@ -51,6 +52,10 @@
+ commit=yes
+ elif [ "$1" = "--verbose" ]; then
+ verbose=$((verbose + 1))
++ elif [ "$1" = "--max-ranges" -a $argc -gt 1 ]; then
++ max_ranges=$2
++ argc=$((argc - 1))
++ shift
+ elif [ "$1" = "" ]; then
+ usage_error
+ else
+@@ -499,6 +550,18 @@
+ fi
+ fi
+
++## Different SSD's have a different maximum number of ranges they'll accept
++## in a single TRIM command.
++if [ $max_ranges -le 0 ] ; then
++ model=`$HDPARM -I $rawdev | $GAWK '/Model Number/ { print $NF }'`
++ case "$model" in
++ SSDSA[12]*) max_ranges=512 ;; # Intel X18-M/X25-M
++ OCZ-VERTEX2) max_ranges=64 ;; # OCZ Vertex2
++ *) max_ranges=65535
++ esac
++fi
++[ $verbose -gt 0 ] && echo "max-ranges = $max_ranges"
++
+ ## All ready. Now let the user know exactly what we intend to do:
+ ##
+ mountstatus="$fstype non-mounted"
+@@ -608,7 +671,7 @@
+ nsectors += count;
+ while (count > 0) {
+ this_count = (count > 65535) ? 65535 : count
+- printf "%u:%u ", lba, this_count
++ printf "%u:%u \n", lba, this_count
+ if (verbose > 1)
+ printf "%u:%u ", lba, this_count > "/dev/stderr"
+ lba += this_count
+@@ -695,6 +758,22 @@
+ -v verbose="$verbose" \
+ -v xfs_blksects="$xfs_blksects" \
+ -v xfs_agoffsets="$xfs_agoffsets" \
+- "$GAWKPROG" | $TRIM
++ "$GAWKPROG" | (
++ i=0
++ while read range ; do
++ ranges=$ranges" "$range
++ ((i++))
++ if [ $i -ge $max_ranges ] ; then
++ [ $verbose -gt 0 ] && echo -e "Trim ranges:"$ranges"\n"
++ echo $ranges | $TRIM
++ ranges=""
++ i=0
++ fi
++ done
++ if [ $i -gt 0 ] ; then
++ [ $verbose -gt 0 ] && echo -e "Trim ranges:"$ranges"\n"
++ echo $ranges | $TRIM
++ fi
++ )
+
+ do_cleanup $?
+
+
diff --git a/core/heimdal/001_all_heimdal-no_libedit.patch b/core/heimdal/001_all_heimdal-no_libedit.patch
new file mode 100644
index 000000000..a551bdce1
--- /dev/null
+++ b/core/heimdal/001_all_heimdal-no_libedit.patch
@@ -0,0 +1,10 @@
+--- cf/krb-readline.m4 2005-06-16 18:28:32.000000000 +0200
++++ cf/krb-readline.m4 2005-06-27 23:17:06.000000000 +0200
+@@ -6,7 +6,6 @@
+ dnl el_init
+
+ AC_DEFUN([KRB_READLINE],[
+-AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
+ if test "$ac_cv_func_el_init" = yes ; then
+ AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
diff --git a/core/heimdal/002_all_heimal-fPIC.patch b/core/heimdal/002_all_heimal-fPIC.patch
new file mode 100644
index 000000000..c67dbae76
--- /dev/null
+++ b/core/heimdal/002_all_heimal-fPIC.patch
@@ -0,0 +1,12 @@
+--- lib/editline/Makefile.am 2005-06-16 18:28:44.000000000 +0200
++++ lib/editline/Makefile.am 2005-06-27 23:21:02.000000000 +0200
+@@ -41,6 +41,9 @@
+
+ EXTRA_DIST = $(man_MANS)
+
++$(libeditline_la_OBJECTS): %.lo: %.c
++ $(LTCOMPILE) -fPIC -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
++
+ snprintf.c:
+ $(LN_S) $(srcdir)/../roken/snprintf.c .
+ strdup.c:
diff --git a/core/heimdal/003_all_heimdal-rxapps.patch b/core/heimdal/003_all_heimdal-rxapps.patch
new file mode 100644
index 000000000..40fc05f08
--- /dev/null
+++ b/core/heimdal/003_all_heimdal-rxapps.patch
@@ -0,0 +1,22 @@
+--- appl/kx/rxtelnet.in 2005-06-16 18:29:10.000000000 +0200
++++ appl/kx/rxtelnet.in 2005-06-27 23:21:34.000000000 +0200
+@@ -2,7 +2,7 @@
+ # $Id: rxtelnet.in,v 1.31 2004/03/07 17:22:06 lha Exp $
+ #
+ usage="Usage: $0 [-l username] [-k] [-fF] [-t args_to_telnet] [-x args_to_xterm] [-K args_to_kx] [-w term_emulator] [-b telnet_binary] [-n] [-v] [-h | --help] [--version] host [port]"
+-binary=telnet
++binary=ktelnet
+ term=
+ kx_args=-P
+ while true
+--- appl/kx/rxterm.in 2005-06-16 18:29:10.000000000 +0200
++++ appl/kx/rxterm.in 2005-06-27 23:21:55.000000000 +0200
+@@ -2,7 +2,7 @@
+ # $Id: rxterm.in,v 1.23 2002/03/18 17:37:34 joda Exp $
+ #
+ usage="Usage: $0 [-l username] [-k] [-f] [-r rsh_args] [-x xterm_args] [-K kx_args] [-w term_emulator] [-b rsh_binary][-v] [-h | --help] [--version] host"
+-binary=rsh
++binary=krsh
+ term=xterm
+ while true
+ do
diff --git a/core/heimdal/005_all_heimdal-suid_fix.patch b/core/heimdal/005_all_heimdal-suid_fix.patch
new file mode 100644
index 000000000..35a9ed9f6
--- /dev/null
+++ b/core/heimdal/005_all_heimdal-suid_fix.patch
@@ -0,0 +1,20 @@
+--- appl/su/Makefile.am 2005-06-16 18:27:46.000000000 +0200
++++ appl/su/Makefile.am 2005-06-27 23:25:21.000000000 +0200
+@@ -7,6 +7,7 @@
+ bin_PROGRAMS = su
+ bin_SUIDS = su
+ su_SOURCES = su.c supaths.h
++su_LDFLAGS = -Wl,-z,now
+ man_MANS = su.1
+
+ LDADD = $(LIB_kafs) \
+--- appl/otp/Makefile.am 2005-06-16 18:28:46.000000000 +0200
++++ appl/otp/Makefile.am 2005-06-27 23:25:40.000000000 +0200
+@@ -8,6 +8,7 @@
+ bin_SUIDS = otp
+ otp_SOURCES = otp.c otp_locl.h
+ otpprint_SOURCES = otpprint.c otp_locl.h
++otp_LDFLAGS = -Wl,-z,now
+
+ man_MANS = otp.1 otpprint.1
+
diff --git a/core/heimdal/012_all_heimdal-berkdb.patch b/core/heimdal/012_all_heimdal-berkdb.patch
new file mode 100644
index 000000000..46762c220
--- /dev/null
+++ b/core/heimdal/012_all_heimdal-berkdb.patch
@@ -0,0 +1,124 @@
+Binary files heimdal-0.7-old/cf/.find-func-no-libs2.m4.swp and heimdal-0.7/cf/.find-func-no-libs2.m4.swp differ
+Index: heimdal/cf/db.m4
+===================================================================
+--- heimdal.orig/cf/db.m4
++++ heimdal/cf/db.m4
+@@ -18,24 +18,13 @@ db_type=unknown
+
+ if test "$enable_berkeley_db" != no; then
+
+- AC_CHECK_HEADERS([ \
+- db4/db.h \
+- db3/db.h \
+- db.h \
+- db_185.h \
+- ])
++ AC_CHECK_HEADERS([db.h])
+
+ dnl db_create is used by db3 and db4
+
+- AC_FIND_FUNC_NO_LIBS(db_create, db4 db3 db, [
++ AC_FIND_FUNC_NO_LIBS(db_create, db, [
+ #include <stdio.h>
+- #ifdef HAVE_DB4_DB_H
+- #include <db4/db.h>
+- #elif defined(HAVE_DB3_DB_H)
+- #include <db3/db.h>
+- #else
+ #include <db.h>
+- #endif
+ ],[NULL, NULL, 0])
+
+ if test "$ac_cv_func_db_create" = "yes"; then
+@@ -50,17 +39,9 @@ dnl db_create is used by db3 and db4
+
+ dnl dbopen is used by db1/db2
+
+- AC_FIND_FUNC_NO_LIBS(dbopen, db2 db, [
++ AC_FIND_FUNC_NO_LIBS(dbopen, db, [
+ #include <stdio.h>
+- #if defined(HAVE_DB2_DB_H)
+- #include <db2/db.h>
+- #elif defined(HAVE_DB_185_H)
+- #include <db_185.h>
+- #elif defined(HAVE_DB_H)
+ #include <db.h>
+- #else
+- #error no db.h
+- #endif
+ ],[NULL, 0, 0, 0, NULL])
+
+ if test "$ac_cv_func_dbopen" = "yes"; then
+Index: heimdal/lib/hdb/db.c
+===================================================================
+--- heimdal.orig/lib/hdb/db.c
++++ heimdal/lib/hdb/db.c
+@@ -37,11 +37,7 @@ RCSID("$Id: db.c 20215 2007-02-09 21:59:
+
+ #if HAVE_DB1
+
+-#if defined(HAVE_DB_185_H)
+-#include <db_185.h>
+-#elif defined(HAVE_DB_H)
+ #include <db.h>
+-#endif
+
+ static krb5_error_code
+ DB_close(krb5_context context, HDB *db)
+Index: heimdal/lib/hdb/db3.c
+===================================================================
+--- heimdal.orig/lib/hdb/db3.c
++++ heimdal/lib/hdb/db3.c
+@@ -37,13 +37,7 @@ RCSID("$Id: db3.c 21610 2007-07-17 07:10
+
+ #if HAVE_DB3
+
+-#ifdef HAVE_DB4_DB_H
+-#include <db4/db.h>
+-#elif defined(HAVE_DB3_DB_H)
+-#include <db3/db.h>
+-#else
+ #include <db.h>
+-#endif
+
+ static krb5_error_code
+ DB_close(krb5_context context, HDB *db)
+Index: heimdal/lib/roken/getcap.c
+===================================================================
+--- heimdal.orig/lib/roken/getcap.c
++++ heimdal/lib/roken/getcap.c
+@@ -38,11 +38,13 @@
+ #include "roken.h"
+ RCSID("$Id: getcap.c 16561 2006-01-13 14:25:32Z lha $");
+
++#if defined(HAVE_DBOPEN) && defined(HAVE_DB_H)
++#define USE_DB
++#endif
++
+ #include <sys/types.h>
+ #include <ctype.h>
+-#if defined(HAVE_DB_185_H)
+-#include <db_185.h>
+-#elif defined(HAVE_DB_H)
++#ifdef USE_DB
+ #include <db.h>
+ #endif
+ #include <errno.h>
+Index: heimdal/lib/roken/ndbm_wrap.c
+===================================================================
+--- heimdal.orig/lib/roken/ndbm_wrap.c
++++ heimdal/lib/roken/ndbm_wrap.c
+@@ -37,13 +37,7 @@ RCSID("$Id: ndbm_wrap.c 21634 2007-07-17
+ #endif
+
+ #include "ndbm_wrap.h"
+-#if defined(HAVE_DB4_DB_H)
+-#include <db4/db.h>
+-#elif defined(HAVE_DB3_DB_H)
+-#include <db3/db.h>
+-#else
+ #include <db.h>
+-#endif
+
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/core/heimdal/013_all_heimdal-pthread-lib.patch b/core/heimdal/013_all_heimdal-pthread-lib.patch
new file mode 100644
index 000000000..19f879407
--- /dev/null
+++ b/core/heimdal/013_all_heimdal-pthread-lib.patch
@@ -0,0 +1,11 @@
+--- heimdal-0.7.1/cf/pthreads.m4.old 2005-09-09 12:12:28.000000000 +0000
++++ heimdal-0.7.1/cf/pthreads.m4 2005-09-17 22:23:23.000000000 +0000
+@@ -32,7 +32,7 @@
+ 2.*)
+ native_pthread_support=yes
+ PTHREADS_CFLAGS=-pthread
+- PTHREADS_LIBS=-pthread
++ PTHREADS_LIBS=-lpthread
+ ;;
+ esac
+ ;;
diff --git a/core/heimdal/014_all_heimdal-path.patch b/core/heimdal/014_all_heimdal-path.patch
new file mode 100644
index 000000000..36a86f1f9
--- /dev/null
+++ b/core/heimdal/014_all_heimdal-path.patch
@@ -0,0 +1,50 @@
+--- appl/rcp/rcp.c.old 2006-05-03 13:31:59.398493625 +0200
++++ appl/rcp/rcp.c 2006-05-03 13:32:04.494485981 +0200
+@@ -34,7 +34,7 @@
+ #include "rcp_locl.h"
+ #include <getarg.h>
+
+-#define RSH_PROGRAM "rsh"
++#define RSH_PROGRAM "krsh"
+
+ struct passwd *pwd;
+ uid_t userid;
+--- appl/rcp/rcp_locl.h.old 2006-05-03 02:30:31.602025409 +0200
++++ appl/rcp/rcp_locl.h 2006-05-03 02:30:35.886018983 +0200
+@@ -64,4 +64,4 @@
+ #define _PATH_CP "/bin/cp"
+ #endif
+ #undef _PATH_RSH
+-#define _PATH_RSH BINDIR "/rsh"
++#define _PATH_RSH BINDIR "/krsh"
+--- appl/telnet/telnetd/telnetd.h.old 2006-05-03 02:23:14.582680939 +0200
++++ appl/telnet/telnetd/telnetd.h 2006-05-03 02:23:23.746667193 +0200
+@@ -192,7 +192,7 @@
+ #endif
+
+ #undef _PATH_LOGIN
+-#define _PATH_LOGIN BINDIR "/login"
++#define _PATH_LOGIN BINDIR "/klogin"
+
+ /* fallbacks */
+
+--- appl/login/shadow.c.old 2006-05-05 06:31:29.517138115 +0200
++++ appl/login/shadow.c 2006-05-05 06:32:26.433052741 +0200
+@@ -38,7 +38,7 @@
+ #ifdef HAVE_SHADOW_H
+
+ #ifndef _PATH_CHPASS
+-#define _PATH_CHPASS "/usr/bin/passwd"
++#define _PATH_CHPASS "/usr/bin/kpasswd"
+ #endif
+
+ static int
+@@ -52,7 +52,7 @@
+ printf("fork /bin/passwd");
+ exit(1);
+ case 0:
+- execlp(_PATH_CHPASS, "passwd", who->pw_name, (char *) 0);
++ execlp(_PATH_CHPASS, "kpasswd", who->pw_name, (char *) 0);
+ exit(1);
+ default:
+ waitpid(pid, &status, 0);
diff --git a/core/heimdal/PKGBUILD b/core/heimdal/PKGBUILD
new file mode 100644
index 000000000..55f7acf34
--- /dev/null
+++ b/core/heimdal/PKGBUILD
@@ -0,0 +1,113 @@
+# $Id: PKGBUILD 101969 2010-12-03 09:59:28Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Jan de Groot <jgc@archlinux.org>
+
+#
+### Attention: remove old pkg before building - it links against itself! ###
+#
+
+pkgname=heimdal
+pkgver=1.3.3
+pkgrel=4
+pkgdesc="Implementation of Kerberos V5 libraries"
+arch=('i686' 'x86_64')
+url="http://www.h5l.org/"
+license=('custom')
+depends=('db' 'openssl' 'sqlite3' 'e2fsprogs' 'libldap')
+backup=(etc/krb5.conf)
+options=('!libtool' '!emptydirs')
+install=heimdal.install
+source=(http://www.h5l.org/dist/src/${pkgname}-${pkgver}.tar.gz
+ 001_all_heimdal-no_libedit.patch
+ 002_all_heimal-fPIC.patch
+ 003_all_heimdal-rxapps.patch
+ 005_all_heimdal-suid_fix.patch
+ 012_all_heimdal-berkdb.patch
+ 013_all_heimdal-pthread-lib.patch
+ 014_all_heimdal-path.patch
+ heimdal-kdc.rc
+ kadmind.rc
+ kpasswd.rc)
+md5sums=('963c09f1b14c41660be70b55fae9f163'
+ '98e28f11f906c967aac22d6184102c9e'
+ '6d5571bdedba2e2423b90bccdbac2c0a'
+ '2feec3924ee5230b54175b4d4000c872'
+ '45aeb207f360f9f4e9e0fabc8bfeecbc'
+ '56f5d10d0ec40f2fda82ef144ffac1e0'
+ '1b8665b771c4eb6b56ea8582c96e56e3'
+ '8208ae8c0b6ff5ab4f64af1693e9e396'
+ 'e59650992b9541a30dfce727a194f6e0'
+ '1f2f86a67bbfddb7af581d35fdca9627'
+ 'f8f1eca95b9d3f2b4ebf2417b71b81cf')
+
+build() {
+ cd ${srcdir}/heimdal-${pkgver}
+ patch -Np0 -i ${srcdir}/001_all_heimdal-no_libedit.patch
+ patch -Np0 -i ${srcdir}/002_all_heimal-fPIC.patch
+ patch -Np0 -i ${srcdir}/003_all_heimdal-rxapps.patch
+ patch -Np0 -i ${srcdir}/005_all_heimdal-suid_fix.patch
+ patch -Np1 -i ${srcdir}/012_all_heimdal-berkdb.patch
+ patch -Np1 -i ${srcdir}/013_all_heimdal-pthread-lib.patch
+ patch -Np0 -i ${srcdir}/014_all_heimdal-path.patch
+
+ sed -i -e 's|var/heimdal|var/lib/heimdal|g' configure.in \
+ doc/setup.texi doc/heimdal.info kadmin/kadmind.8 kdc/kdc.8 \
+ lib/hdb/hdb.h lib/krb5/krb5.conf.5 lib/krb5/krb5.conf.cat5
+
+ sed -i 's|$(LIB_NDBM)|$(LIB_NDBM) $(LIB_db_create)|' lib/otp/Makefile.am
+
+ libtoolize --force
+ aclocal -I cf
+ autoconf
+ automake
+
+ ./configure --prefix=/usr --enable-shared=yes --without-x \
+ --sysconfdir=/etc --mandir=/usr/share/man \
+ --datadir=/var/lib/heimdal \
+ --localstatedir=/var/lib/heimdal \
+ --with-openssl=/usr \
+ --with-readline-lib=/usr/lib \
+ --with-readline-include=/usr/include/readline \
+ --with-sqlite3-lib=/usr/lib \
+ --with-sqlite3-include=/usr/include \
+ --with-openldap=/usr \
+ --libexecdir=/usr/sbin
+
+ make
+}
+
+package() {
+ cd ${srcdir}/heimdal-${pkgver}
+ make DESTDIR=${pkgdir} install
+
+ # Rename daemons and their manpages
+ for i in telnetd ftpd rshd; do
+ mv ${pkgdir}/usr/share/man/man8/{,k}${i}.8
+ mv ${pkgdir}/usr/sbin/{,k}${i}
+ done
+
+ # Rename clients and their manpages
+ for i in rcp rsh telnet ftp su login; do
+ if [ -f ${pkgdir}/usr/share/man/man1/${i}.1 ]; then
+ mv ${pkgdir}/usr/share/man/man1/{,k}${i}.1
+ fi
+ mv ${pkgdir}/usr/bin/{,k}${i}
+ done
+ rm -rf ${pkgdir}/usr/share/man/cat{1,3,5,8}
+
+ # Arch could be a KDC too
+ install -d ${pkgdir}/etc/rc.d
+ install -m644 ${srcdir}/heimdal-${pkgver}/krb5.conf ${pkgdir}/etc/
+ for i in heimdal-kdc kadmind kpasswd; do
+ install -m755 ${srcdir}/${i}.rc ${pkgdir}/etc/rc.d/${i}
+ done
+
+ # Remove conflicts
+ rm ${pkgdir}/usr/share/man/man5/ftpusers.5* # man-pages
+ rm ${pkgdir}/usr/share/man/man3/{DES,DH,EVP,OpenSSL,RAND,RSA}* # openssl (a bit overzealous...)
+ rm ${pkgdir}/usr/share/man/man3/os.3* # erlang
+
+ # Install the license
+ install -Dm644 ${srcdir}/${pkgname}-${pkgver}/LICENSE \
+ ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
diff --git a/core/heimdal/heimdal-kdc.rc b/core/heimdal/heimdal-kdc.rc
new file mode 100644
index 000000000..b2a3b5fcf
--- /dev/null
+++ b/core/heimdal/heimdal-kdc.rc
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# general config
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/kdc`
+case "$1" in
+ start)
+ stat_busy "Starting heimdal kdc"
+ if [ -z "$PID" ]; then
+ /usr/sbin/kdc --detach
+ fi
+ if [ ! -z "$PID" -o $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon heimdal-kdc
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping heimdal kdc"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon heimdal-kdc
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+ ;;
+esac
+exit 0
diff --git a/core/heimdal/heimdal.install b/core/heimdal/heimdal.install
new file mode 100644
index 000000000..b4fd19000
--- /dev/null
+++ b/core/heimdal/heimdal.install
@@ -0,0 +1,20 @@
+infodir=usr/share/info
+filelist=(heimdal hx509)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file.info.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
+ install-info --delete $infodir/$file.info.gz $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/heimdal/kadmind.rc b/core/heimdal/kadmind.rc
new file mode 100644
index 000000000..0f3b8c7c4
--- /dev/null
+++ b/core/heimdal/kadmind.rc
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# general config
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/kadmind`
+case "$1" in
+ start)
+ stat_busy "Starting heimdal admin server"
+ if [ -z "$PID" ]; then
+ /usr/sbin/kadmind &
+ fi
+ if [ ! -z "$PID" -o $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon kadmind
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping heimdal admin server"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon kadmind
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+ ;;
+esac
+exit 0
diff --git a/core/heimdal/kpasswd.rc b/core/heimdal/kpasswd.rc
new file mode 100644
index 000000000..3697322b9
--- /dev/null
+++ b/core/heimdal/kpasswd.rc
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# general config
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/kpasswdd`
+case "$1" in
+ start)
+ stat_busy "Starting heimdal kpasswdd"
+ if [ -z "$PID" ]; then
+ /usr/sbin/kpasswdd &
+ fi
+ if [ ! -z "$PID" -o $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon kpasswd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping heimdal kpasswdd"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon kpasswd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+ ;;
+esac
+exit 0
diff --git a/core/heirloom-mailx/PKGBUILD b/core/heirloom-mailx/PKGBUILD
new file mode 100644
index 000000000..028d593a3
--- /dev/null
+++ b/core/heirloom-mailx/PKGBUILD
@@ -0,0 +1,64 @@
+# $Id: PKGBUILD 113975 2011-03-11 00:21:09Z stephane $
+# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
+# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Andreas Wagner <Andreas dot Wagner at em dot uni-frankfurt dot de>
+
+pkgname=heirloom-mailx
+pkgver=12.5
+pkgrel=1
+pkgdesc="A commandline utility for sending and receiving email"
+arch=('i686' 'x86_64')
+url="http://heirloom.sourceforge.net/mailx.html"
+license=('custom')
+groups=('base')
+depends=('openssl')
+optdepends=('smtp-forwarder: for sending mail')
+replaces=('mailx' 'mailx-heirloom')
+provides=('mailx' 'mailx-heirloom')
+conflicts=('mailx' 'mailx-heirloom')
+backup=(etc/mail.rc)
+source=(ftp://ftp.archlinux.org/other/${pkgname}/${pkgname}-${pkgver}.tar.xz)
+sha1sums=('1998dd6168a68400e533712ae7163c72b6a7c056')
+options=('!makeflags') # Does not build with MAKEFLAGS=-jX, X>1
+
+# source PKGBUILD && mksource
+mksource() {
+ export CVSROOT=:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail
+ D=nail
+ [ -d "${D}" ] && cvs up "${D}" || cvs co "${D}"
+
+ _dirname=${pkgname}-${pkgver}
+ mv $D ${_dirname}
+ tar -cJv --exclude=CVS -f ${_dirname}.tar.xz ${dirname}
+ rm -r ${_dirname}
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ sed -i 's|/etc/nail.rc|/etc/mail.rc|g' mailx.1
+
+ # For Linux and BSD, this should be set.
+ echo "set bsdcompat" >> nail.rc
+
+ sed -i "s/pg/less/" cmd1.c
+
+ echo PREFIX=/usr \
+ MAILRC=/etc/mail.rc \
+ SENDMAIL=/usr/sbin/sendmail \
+ MAILSPOOL=/var/spool/mail \
+ UCBINSTALL=/bin/install > makeflags
+
+ make `cat makeflags` IPv6=-DHAVE_IPv6_FUNCS
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" `cat makeflags` install
+
+ # For compatibility with the old mailx program
+ ln -sf mailx "${pkgdir}"/usr/bin/mail
+ ln -sf mailx.1.gz "${pkgdir}"/usr/share/man/man1/mail.1.gz
+
+ install -D -m0644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+}
diff --git a/core/idnkit/PKGBUILD b/core/idnkit/PKGBUILD
new file mode 100644
index 000000000..3dd1e0833
--- /dev/null
+++ b/core/idnkit/PKGBUILD
@@ -0,0 +1,32 @@
+# Contributor: Igor Nemilentsev <trezorg@gmail.com>
+# Maintainer: Gaetan Bisson <bisson@archlinux.org>
+
+pkgname=idnkit
+pkgver=1.0
+pkgrel=1
+pkgdesc='Provides functionalities about Internationalized Domain Name processing'
+arch=('i686' 'x86_64')
+url='http://www.nic.ad.jp/ja/idn/idnkit/download/'
+license=('custom:BSD')
+options=('!makeflags' '!libtool')
+source=("http://www.nic.ad.jp/ja/idn/idnkit/download/sources/idnkit-${pkgver}-src.tar.gz")
+sha1sums=('7d843ffcf9843b7af02079e5a160520f28c75048')
+
+backup=('etc/idnalias.conf' 'etc/idn.conf')
+
+build() {
+ cd "${srcdir}/idnkit-${pkgver}-src"
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/share/man \
+ --enable-static=no
+ make
+}
+
+package() {
+ cd "${srcdir}/idnkit-${pkgver}-src"
+ make DESTDIR="${pkgdir}" install
+ install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
diff --git a/core/ifenslave/PKGBUILD b/core/ifenslave/PKGBUILD
new file mode 100644
index 000000000..516eba638
--- /dev/null
+++ b/core/ifenslave/PKGBUILD
@@ -0,0 +1,29 @@
+# $Id: PKGBUILD 108480 2011-01-31 14:27:02Z dan $
+# Maintainer:
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=ifenslave
+pkgver=1.1.0
+pkgrel=6
+pkgdesc="Utility for bonding ethernet interfaces"
+arch=('i686' 'x86_64')
+url="http://www.linuxfoundation.org/en/Net:Bonding"
+license=('GPL2')
+depends=('glibc')
+makedepends=('linux-api-headers')
+backup=('etc/conf.d/bonding')
+source=(ifenslave.c::'http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/networking/ifenslave.c;h=2bac96'
+ bonding.conf.d)
+md5sums=('41a23dc9ac3522ac2af23396ba70bcc4'
+ '397fccbf574d5082c7a3c8d3793dc000')
+
+build() {
+ cd $srcdir
+ gcc -Wall -Wstrict-prototypes $CFLAGS $LDFLAGS ifenslave.c -o ifenslave
+}
+
+package() {
+ cd $srcdir
+ install -Dm755 ifenslave $pkgdir/sbin/ifenslave
+ install -Dm644 bonding.conf.d $pkgdir/etc/conf.d/bonding
+}
diff --git a/core/ifenslave/bonding.conf.d b/core/ifenslave/bonding.conf.d
new file mode 100644
index 000000000..3092c5e95
--- /dev/null
+++ b/core/ifenslave/bonding.conf.d
@@ -0,0 +1,12 @@
+#
+# Settings for ethernet bonding
+#
+# For each bond interface declared in INTERFACES (in rc.conf), declare
+# a bond_${IF} variable that contains the real ethernet interfaces that
+# should be bonded to the bond interface with the ifenslave utility.
+# Then list the bond interface name in the BOND_INTERFACES array.
+#
+
+#bond_bond0="eth0 eth1"
+#BOND_INTERFACES=(bond0)
+
diff --git a/core/inetutils/PKGBUILD b/core/inetutils/PKGBUILD
new file mode 100644
index 000000000..4e8debe7d
--- /dev/null
+++ b/core/inetutils/PKGBUILD
@@ -0,0 +1,62 @@
+# $Id: PKGBUILD 102693 2010-12-09 22:50:13Z eric $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+
+pkgname=inetutils
+pkgver=1.8
+pkgrel=2
+pkgdesc="A collection of common network programs"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/inetutils/"
+license=('GPL')
+depends=('readline' 'ncurses' 'pam' 'tcp_wrappers')
+provides=('netkit-ftp' 'netkit-rsh' 'netkit-telnet' 'netkit-ntalk')
+conflicts=('netkit-ftp' 'netkit-rsh' 'netkit-telnet' 'netkit-ntalk')
+replaces=('netkit-ftp' 'netkit-rsh' 'netkit-telnet' 'netkit-ntalk')
+backup=('etc/conf.d/ftpd' 'etc/xinetd.d/telnet' 'etc/xinetd.d/talk' \
+ 'etc/xinetd.d/rexec' 'etc/xinetd.d/rlogin' 'etc/xinetd.d/rsh')
+options=('!emptydirs')
+install=inetutils.install
+source=(http://ftp.gnu.org/gnu/inetutils/${pkgname}-${pkgver}.tar.gz \
+ ftpd.rc ftpd.conf telnet.xinetd talk.xinetd rexec.xinetd rlogin.xinetd rsh.xinetd)
+md5sums=('ad8fdcdf1797b9ca258264a6b04e48fd' 'c167200f6faeb64659e69ced2a9d672a'\
+ 'e6e6e5990a2e8159a276fef8fbf54c04' '8596208d119045543c5fb644e1d713d5'\
+ '2c3655985cf122591d71d031af84ff90' 'c490ea36751ac5f1d61d2c014959a3d1'\
+ 'c25d8382a994de84d9c6962d804f689b' 'c3aa508a9d1293a787341108cd49c1b7')
+sha1sums=('598445859b511f73681e4d74a41d65cd6ae0f83e' '84dc802b5e57b5e04c847572225a3b9612017155'\
+ '68a590083b45997dfdb80e666b2de762f494ba74' 'bfad98a4a62f1fff8779f076c6019ed07f9111af'\
+ '27d99b910eec0fc26bd79ccc2c1de26608330298' '87aa4f38ebee9dac5dcaa04cbc3f2f0906bec605'\
+ '81f10b3b688e3952f793b35bcef63b5bf257a92b' '81f4a8da823cf0bb14284fc71ee6108849691eda')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --libexec=/usr/sbin --localstatedir=/var \
+ --mandir=/usr/share/man --infodir=/usr/share/info \
+ --with-wrap --with-pam \
+ --enable-ftp --enable-ftpd \
+ --enable-telnet --enable-telnetd \
+ --enable-talk --enable-talkd \
+ --enable-rlogin --enable-rlogind \
+ --enable-rsh --enable-rshd \
+ --enable-rexec --enable-rexecd \
+ --enable-rcp \
+ --disable-tftp --disable-tftpd \
+ --disable-ping --disable-ping6 \
+ --disable-logger --disable-syslogd \
+ --disable-inetd --disable-whois \
+ --disable-uucpd --disable-hostname \
+ --disable-ifconfig --disable-traceroute
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ install -D -m755 "${srcdir}/ftpd.rc" "${pkgdir}/etc/rc.d/ftpd"
+ install -D -m644 "${srcdir}/ftpd.conf" "${pkgdir}/etc/conf.d/ftpd"
+ install -D -m644 "${srcdir}/telnet.xinetd" "${pkgdir}/etc/xinetd.d/telnet"
+ install -D -m644 "${srcdir}/talk.xinetd" "${pkgdir}/etc/xinetd.d/talk"
+ install -D -m644 "${srcdir}/rexec.xinetd" "${pkgdir}/etc/xinetd.d/rexec"
+ install -D -m644 "${srcdir}/rlogin.xinetd" "${pkgdir}/etc/xinetd.d/rlogin"
+ install -D -m644 "${srcdir}/rsh.xinetd" "${pkgdir}/etc/xinetd.d/rsh"
+}
diff --git a/core/inetutils/ftpd.conf b/core/inetutils/ftpd.conf
new file mode 100644
index 000000000..f660f0035
--- /dev/null
+++ b/core/inetutils/ftpd.conf
@@ -0,0 +1,4 @@
+#
+# Parameters to be passed to ftpd
+#
+FTPD_ARGS=""
diff --git a/core/inetutils/ftpd.rc b/core/inetutils/ftpd.rc
new file mode 100644
index 000000000..3d0d34421
--- /dev/null
+++ b/core/inetutils/ftpd.rc
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/ftpd
+
+PID=$(pidof -o %PPID /usr/sbin/ftpd)
+case "$1" in
+ start)
+ stat_busy "Starting ftpd"
+ [ -z "$PID" ] && /usr/sbin/ftpd -D $FTPD_ARGS
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon ftpd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping ftpd"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon ftpd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/inetutils/inetutils.install b/core/inetutils/inetutils.install
new file mode 100644
index 000000000..b338fa498
--- /dev/null
+++ b/core/inetutils/inetutils.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(inetutils.info.gz)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file $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
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/inetutils/rexec.xinetd b/core/inetutils/rexec.xinetd
new file mode 100644
index 000000000..4659e4745
--- /dev/null
+++ b/core/inetutils/rexec.xinetd
@@ -0,0 +1,10 @@
+service exec
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/rexecd
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/core/inetutils/rlogin.xinetd b/core/inetutils/rlogin.xinetd
new file mode 100644
index 000000000..5c72f86df
--- /dev/null
+++ b/core/inetutils/rlogin.xinetd
@@ -0,0 +1,10 @@
+service login
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/rlogind
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/core/inetutils/rsh.xinetd b/core/inetutils/rsh.xinetd
new file mode 100644
index 000000000..a13738c31
--- /dev/null
+++ b/core/inetutils/rsh.xinetd
@@ -0,0 +1,10 @@
+service shell
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/rshd
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/core/inetutils/talk.xinetd b/core/inetutils/talk.xinetd
new file mode 100644
index 000000000..6abef359c
--- /dev/null
+++ b/core/inetutils/talk.xinetd
@@ -0,0 +1,10 @@
+service ntalk
+{
+ flags = REUSE
+ socket_type = dgram
+ wait = yes
+ user = root
+ server = /usr/sbin/talkd
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/core/inetutils/telnet.xinetd b/core/inetutils/telnet.xinetd
new file mode 100644
index 000000000..bd3a5e4b1
--- /dev/null
+++ b/core/inetutils/telnet.xinetd
@@ -0,0 +1,10 @@
+service telnet
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/telnetd
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/core/iproute2/PKGBUILD b/core/iproute2/PKGBUILD
new file mode 100644
index 000000000..fa31f11ed
--- /dev/null
+++ b/core/iproute2/PKGBUILD
@@ -0,0 +1,43 @@
+# $Id: PKGBUILD 107230 2011-01-22 18:51:34Z ronald $
+# Maintainer: Ronald van Haren <ronald.archlinux.org>
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=iproute2
+pkgver=2.6.37
+pkgrel=1
+pkgdesc="IP Routing Utilities"
+arch=('i686' 'x86_64')
+license=('GPL2')
+url="http://www.linux-foundation.org/en/Net:Iproute2"
+depends=('linux-atm' 'perl')
+provides=('iproute')
+conflicts=('iproute')
+replaces=('iproute')
+options=('!makeflags')
+backup=('etc/iproute2/ematch_map' 'etc/iproute2/rt_dsfield' 'etc/iproute2/rt_protos' \
+ 'etc/iproute2/rt_realms' 'etc/iproute2/rt_scopes' 'etc/iproute2/rt_tables')
+source=(http://devresources.linux-foundation.org/dev/iproute2/download/iproute2-${pkgver}.tar.bz2
+ 'iproute2-fhs.patch')
+sha1sums=('7852fb66fb745dc3c1fabee24d7d8ff017c48d36'
+ '2416b11252364d7a6c742eabb4a6924a75637a46')
+
+build() {
+ cd $srcdir/iproute2-${pkgver}
+
+ # set correct fhs structure
+ patch -Np1 -i ${srcdir}/iproute2-fhs.patch
+
+ ./configure
+
+ make
+}
+
+package() {
+ cd $srcdir/iproute2-${pkgver}
+
+ make DESTDIR=$pkgdir install
+
+ # libnetlink isn't installed, install it FS#19385
+ install -Dm644 include/libnetlink.h ${pkgdir}/usr/include/libnetlink.h
+ install -Dm644 lib/libnetlink.a ${pkgdir}/usr/lib/libnetlink.a
+}
diff --git a/core/iproute2/iproute2-fhs.patch b/core/iproute2/iproute2-fhs.patch
new file mode 100644
index 000000000..2608414db
--- /dev/null
+++ b/core/iproute2/iproute2-fhs.patch
@@ -0,0 +1,84 @@
+diff -Naur iproute2.old/Makefile iproute2-2.6.29/Makefile
+--- iproute2.old/Makefile 2009-11-11 22:05:21.251407668 +0100
++++ iproute2-2.6.29/Makefile 2009-11-11 22:07:09.891833516 +0100
+@@ -1,11 +1,12 @@
+ DESTDIR=/usr/
+ ROOTDIR=$(DESTDIR)
+ LIBDIR=/usr/lib/
+-SBINDIR=/sbin
++SBINDIR=/usr/sbin
+ CONFDIR=/etc/iproute2
+-DOCDIR=/share/doc/iproute2
+-MANDIR=/share/man
++DOCDIR=/usr/share/doc/iproute2
++MANDIR=/usr/share/man
+ ARPDDIR=/var/lib/arpd
++SHAREDIR=/usr/share
+
+ # Path to db_185.h include
+ DBM_INCLUDE:=$(ROOTDIR)/usr/include
+diff -Naur iproute2.old/tc/tc_util.c iproute2-2.6.29/tc/tc_util.c
+--- iproute2.old/tc/tc_util.c 2009-11-11 22:05:21.298076943 +0100
++++ iproute2-2.6.29/tc/tc_util.c 2009-11-11 22:09:32.865152646 +0100
+@@ -24,8 +24,8 @@
+ #include "utils.h"
+ #include "tc_util.h"
+
+-#ifndef LIBDIR
+-#define LIBDIR "/usr/lib/"
++#ifndef SHAREDIR
++#define SHAREDIR "/usr/share"
+ #endif
+
+ const char *get_tc_lib(void)
+@@ -34,7 +34,7 @@
+
+ lib_dir = getenv("TC_LIB_DIR");
+ if (!lib_dir)
+- lib_dir = LIBDIR "/tc/";
++ lib_dir = SHAREDIR "/tc/";
+
+ return lib_dir;
+ }
+diff -Naur iproute2.old/netem/Makefile iproute2-2.6.35/netem/Makefile
+--- iproute2.old/netem/Makefile 2010-08-06 11:30:48.640940183 +0200
++++ iproute2-2.6.35/netem/Makefile 2010-08-06 11:32:34.210908892 +0200
+@@ -20,9 +20,9 @@
+ $(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm
+
+ install: all
+- mkdir -p $(DESTDIR)$(LIBDIR)/tc
++ mkdir -p $(DESTDIR)$(SHAREDIR)/tc
+ for i in $(DISTDATA); \
+- do install -m 644 $$i $(DESTDIR)$(LIBDIR)/tc; \
++ do install -m 644 $$i $(DESTDIR)$(SHAREDIR)/tc; \
+ done
+
+ clean:
+diff -Naur iproute2.old/tc/Makefile iproute2-2.6.35/tc/Makefile
+--- iproute2.old/tc/Makefile 2010-08-06 11:48:35.607472252 +0200
++++ iproute2-2.6.35/tc/Makefile 2010-08-06 11:49:36.977473380 +0200
+@@ -99,18 +99,11 @@
+ $(AR) rcs $@ $(TCLIB)
+
+ install: all
+- mkdir -p $(MODDESTDIR)
+- install -m 0755 tc $(DESTDIR)$(SBINDIR)
+- for i in $(TCSO); \
+- do install -m 755 $$i $(MODDESTDIR); \
+- done
+- if [ ! -f $(MODDESTDIR)/m_ipt.so ]; then \
+- if [ -f $(MODDESTDIR)/m_xt.so ]; \
+- then ln -s m_xt.so $(MODDESTDIR)/m_ipt.so ; \
+- elif [ -f $(MODDESTDIR)/m_xt_old.so ]; \
+- then ln -s m_xt_old.so $(MODDESTDIR)/m_ipt.so ; \
+- fi; \
+- fi
++ mkdir -p $(DESTDIR)$(LIBDIR)/tc
++ install -m 0755 tc $(DESTDIR)$(SBINDIR)
++ for i in $(TCSO); \
++ do install -m 755 $$i $(DESTDIR)$(LIBDIR)/tc; \
++ done
+
+ clean:
+ rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.yacc.h; \
diff --git a/core/iptables/PKGBUILD b/core/iptables/PKGBUILD
new file mode 100644
index 000000000..c2b812f85
--- /dev/null
+++ b/core/iptables/PKGBUILD
@@ -0,0 +1,53 @@
+# $Id: PKGBUILD 102057 2010-12-04 09:52:03Z allan $
+# Maintainer: Ronald van Haren <ronald.archlinux.org>
+# Contributor: Thomas Baechler <thomas@archlinux.org>
+
+pkgname=iptables
+pkgver=1.4.10
+pkgrel=1
+pkgdesc="A Linux kernel packet control tool"
+arch=('i686' 'x86_64')
+license=('GPL2')
+url="http://www.netfilter.org/"
+depends=('glibc' 'bash')
+options=('!libtool')
+source=(http://www.iptables.org/projects/iptables/files/${pkgname}-${pkgver}.tar.bz2
+ iptables
+ ip6tables
+ empty.rules
+ simple_firewall.rules
+ iptables.conf.d)
+backup=(etc/conf.d/iptables)
+sha1sums=('8190b8c9714a3eec825317e8ac1deeb3d11c6d29'
+ 'd7540316581bb66c5594885882a14ba394e95098'
+ '70d70113e3a23f0fe99404c5536507a887a4ca5c'
+ '83b3363878e3660ce23b2ad325b53cbd6c796ecf'
+ '9907f9e815592837abc7fa3264a401567b7606ab'
+ '1c52444ffbecc09f56bb325db49e924dd32f9213')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ # http://bugs.archlinux.org/task/17046
+ sed -i '87 i libxt_RATEEST.so: libxt_RATEEST.oo' extensions/GNUmakefile.in
+ sed -i '88 i \\t${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -lm -shared ${LDFLAGS} -o $@ $<;\n' extensions/GNUmakefile.in
+
+ ./configure --prefix=/usr --with-kernel=usr/src/linux-$(uname -r) \
+ --libexecdir=/usr/lib/iptables --sysconfdir=/etc \
+ --with-xtlibdir=/usr/lib/iptables \
+ --enable-devel --enable-libipq
+
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ make DESTDIR=${pkgdir} install
+
+ install -D -m755 ../iptables ${pkgdir}/etc/rc.d/iptables
+ install -D -m755 ../ip6tables ${pkgdir}/etc/rc.d/ip6tables
+ install -D -m644 ../empty.rules ${pkgdir}/etc/iptables/empty.rules
+ install -D -m644 ../simple_firewall.rules ${pkgdir}/etc/iptables/simple_firewall.rules
+ install -D -m644 ../iptables.conf.d ${pkgdir}/etc/conf.d/iptables
+}
diff --git a/core/iptables/empty.rules b/core/iptables/empty.rules
new file mode 100644
index 000000000..e24e1aa30
--- /dev/null
+++ b/core/iptables/empty.rules
@@ -0,0 +1,6 @@
+# Empty iptables rule file
+*filter
+:INPUT ACCEPT [0:0]
+:FORWARD ACCEPT [0:0]
+:OUTPUT ACCEPT [0:0]
+COMMIT
diff --git a/core/iptables/ip6tables b/core/iptables/ip6tables
new file mode 100755
index 000000000..1733db281
--- /dev/null
+++ b/core/iptables/ip6tables
@@ -0,0 +1,97 @@
+#!/bin/bash
+
+# source application-specific settings
+[ -f /etc/conf.d/iptables ] && . /etc/conf.d/iptables
+
+# Set defaults if settings are missing
+[ -z "$IP6TABLES" ] && IP6TABLES=/usr/sbin/ip6tables
+[ -z "$IP6TABLES_CONF" ] && IP6TABLES_CONF=/etc/iptables/ip6tables.rules
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ if [ ! -f $IP6TABLES_CONF ]; then
+ echo "Cannot load iptables rules: $IP6TABLES_CONF is missing!" >&2
+ exit 1
+ fi
+ stat_busy "Starting IP6 Tables"
+ if [ "$IPTABLES_FORWARD" = "1" ]; then
+ echo 1 >/proc/sys/net/ipv6/conf/default/forwarding
+ echo 1 >/proc/sys/net/ipv6/conf/all/forwarding
+ fi
+ if ck_daemon ip6tables; then
+ /usr/sbin/ip6tables-restore < $IP6TABLES_CONF
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon ip6tables
+ stat_done
+ fi
+ else
+ stat_fail
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping IP6 Tables"
+ echo 0 >/proc/sys/net/ipv6/conf/all/forwarding
+ echo 0 >/proc/sys/net/ipv6/conf/default/forwarding
+ if ! ck_daemon ip6tables; then
+ fail=0
+ for table in $(cat /proc/net/ip6_tables_names); do
+ $IP6TABLES -t $table -F &>/dev/null && \
+ $IP6TABLES -t $table -X &>/dev/null && \
+ $IP6TABLES -t $table -Z &>/dev/null
+ [ $? -gt 0 ] && fail=1
+ done
+ if [ $fail -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon ip6tables
+ # reset policies
+ for table in filter mangle raw; do
+ if grep -qw $table /proc/net/ip6_tables_names; then
+ $IP6TABLES -t $table -P OUTPUT ACCEPT
+ fi
+ done
+ for table in filter mangle; do
+ if grep -qw $table /proc/net/ip6_tables_names; then
+ $IP6TABLES -t $table -P INPUT ACCEPT
+ $IP6TABLES -t $table -P FORWARD ACCEPT
+ fi
+ done
+ for table in mangle raw; do
+ if grep -qw $table /proc/net/ip6_tables_names; then
+ $IP6TABLES -t $table -P PREROUTING ACCEPT
+ fi
+ done
+ for table in mangle; do
+ if grep -qw $table /proc/net/ip6_tables_names; then
+ $IP6TABLES -t $table -P POSTROUTING ACCEPT
+ fi
+ done
+ stat_done
+ fi
+ else
+ stat_fail
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ save)
+ stat_busy "Saving IP6 Tables"
+ /usr/sbin/ip6tables-save >$IP6TABLES_CONF
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart|save}"
+esac
+exit 0
diff --git a/core/iptables/iptables b/core/iptables/iptables
new file mode 100755
index 000000000..50c13d5c1
--- /dev/null
+++ b/core/iptables/iptables
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+# source application-specific settings
+[ -f /etc/conf.d/iptables ] && . /etc/conf.d/iptables
+
+# Set defaults if settings are missing
+[ -z "$IPTABLES" ] && IPTABLES=/usr/sbin/iptables
+[ -z "$IPTABLES_CONF" ] && IPTABLES_CONF=/etc/iptables/iptables.rules
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ if [ ! -f $IPTABLES_CONF ]; then
+ echo "Cannot load iptables rules: $IPTABLES_CONF is missing!" >&2
+ exit 1
+ fi
+ stat_busy "Starting IP Tables"
+ if [ "$IPTABLES_FORWARD" = "1" ]; then
+ echo 1 >/proc/sys/net/ipv4/ip_forward
+ fi
+ if ck_daemon iptables; then
+ /usr/sbin/iptables-restore < $IPTABLES_CONF
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon iptables
+ stat_done
+ fi
+ else
+ stat_fail
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping IP Tables"
+ echo 0 >/proc/sys/net/ipv4/ip_forward
+ if ! ck_daemon iptables; then
+ fail=0
+ for table in $(cat /proc/net/ip_tables_names); do
+ $IPTABLES -t $table -F &>/dev/null && \
+ $IPTABLES -t $table -X &>/dev/null && \
+ $IPTABLES -t $table -Z &>/dev/null
+ [ $? -gt 0 ] && fail=1
+ done
+ if [ $fail -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon iptables
+ # reset policies
+ for table in filter nat mangle raw; do
+ if grep -qw $table /proc/net/ip_tables_names; then
+ $IPTABLES -t $table -P OUTPUT ACCEPT
+ fi
+ done
+ for table in filter mangle; do
+ if grep -qw $table /proc/net/ip_tables_names; then
+ $IPTABLES -t $table -P INPUT ACCEPT
+ $IPTABLES -t $table -P FORWARD ACCEPT
+ fi
+ done
+ for table in nat mangle raw; do
+ if grep -qw $table /proc/net/ip_tables_names; then
+ $IPTABLES -t $table -P PREROUTING ACCEPT
+ fi
+ done
+ for table in nat mangle; do
+ if grep -qw $table /proc/net/ip_tables_names; then
+ $IPTABLES -t $table -P POSTROUTING ACCEPT
+ fi
+ done
+ stat_done
+ fi
+ else
+ stat_fail
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ save)
+ stat_busy "Saving IP Tables"
+ /usr/sbin/iptables-save >$IPTABLES_CONF
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart|save}"
+esac
+exit 0
diff --git a/core/iptables/iptables.conf.d b/core/iptables/iptables.conf.d
new file mode 100644
index 000000000..07bc11aa1
--- /dev/null
+++ b/core/iptables/iptables.conf.d
@@ -0,0 +1,8 @@
+# Configuration for iptables rules
+
+IPTABLES=/usr/sbin/iptables
+IP6TABLES=/usr/sbin/ip6tables
+
+IPTABLES_CONF=/etc/iptables/iptables.rules
+IP6TABLES_CONF=/etc/iptables/ip6tables.rules
+IPTABLES_FORWARD=0 # enable IP forwarding?
diff --git a/core/iptables/simple_firewall.rules b/core/iptables/simple_firewall.rules
new file mode 100644
index 000000000..e1604cc36
--- /dev/null
+++ b/core/iptables/simple_firewall.rules
@@ -0,0 +1,11 @@
+*filter
+:INPUT DROP [0:0]
+:FORWARD DROP [0:0]
+:OUTPUT ACCEPT [0:0]
+-A INPUT -p icmp -j ACCEPT
+-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
+-A INPUT -i lo -j ACCEPT
+-A INPUT -p tcp -j REJECT --reject-with tcp-reset
+-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
+-A INPUT -j REJECT --reject-with icmp-proto-unreachable
+COMMIT
diff --git a/core/iputils/PKGBUILD b/core/iputils/PKGBUILD
new file mode 100644
index 000000000..4de06deed
--- /dev/null
+++ b/core/iputils/PKGBUILD
@@ -0,0 +1,65 @@
+# $Id: PKGBUILD 107536 2011-01-26 17:38:04Z stephane $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Aaron Griffin <aaron@archlinux.org>
+
+pkgname=iputils
+pkgver=20101006
+_traceroutever=1.4a12
+pkgrel=1
+pkgdesc="IP Configuration Utilities (and Ping)"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.linuxfoundation.org/en/Net:Iputils"
+groups=('base')
+depends=('glibc' 'openssl' 'sysfsutils')
+conflicts=('netkit-base' 'arping' 'netkit-tftpd' 'traceroute')
+replaces=('netkit-base' 'traceroute')
+source=(http://www.skbuff.net/${pkgname}/${pkgname}-s${pkgver}.tar.bz2
+ ftp://ftp.ee.lbl.gov/traceroute-${_traceroutever}.tar.gz
+ 'permission-fix.patch'
+ 'iputils-s20101006-manpages.patch')
+options=('!makeflags')
+md5sums=('a36c25e9ec17e48be514dc0485e7376c'
+ '964d599ef696efccdeebe7721cd4828d'
+ '66109966cad06e425bb12a78bab85b70'
+ 'd02dffac6f16e841921a9fc73bd2d3bd')
+
+build() {
+ #build iptuils
+ cd "${srcdir}/${pkgname}-s${pkgver}"
+
+ # Doc fails to build (see FS#20251)
+ # As a temporary workaround, we use these man pages from Fedora & LFS
+ patch -Np1 -i ../iputils-s20101006-manpages.patch
+ make
+
+ # build traceroute
+ # this is combined in this package because it's awkward as a separate package
+ cd "${srcdir}/traceroute-${_traceroutever}"
+ patch -Np1 -i ../permission-fix.patch
+ ./configure --prefix=/usr \
+ --sbindir=/bin \
+ --mandir=/usr/share/man
+ make CFLAGS="${CFLAGS} -Ilinux-include/"
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-s${pkgver}"
+ for i in arping clockdiff rarpd rdisc tftpd tracepath tracepath6; do
+ install -D -m755 $i "${pkgdir}/usr/sbin/$i"
+ done
+ for i in ping ping6 traceroute6; do
+ install -D -m4755 $i "${pkgdir}/bin/$i"
+ done
+
+ install -dm755 "${pkgdir}/usr/share/man/man8"
+ install -m644 doc/{arping,clockdiff,ping,rarpd,rdisc,tftpd,tracepath,traceroute6}.8 \
+ "${pkgdir}/usr/share/man/man8/"
+
+ cd "${pkgdir}/usr/share/man/man8"
+ ln -sf ping.8.gz ping6.8.gz
+ ln -sf tracepath.8.gz tracepath6.8.gz
+
+ cd "${srcdir}/traceroute-${_traceroutever}"
+ make DESTDIR="${pkgdir}" install install-man
+}
diff --git a/core/iputils/iputils-s20101006-manpages.patch b/core/iputils/iputils-s20101006-manpages.patch
new file mode 100644
index 000000000..764d0d36d
--- /dev/null
+++ b/core/iputils/iputils-s20101006-manpages.patch
@@ -0,0 +1,1044 @@
+--- /dev/null 2011-01-26 09:02:28.396666668 -0500
++++ iputils-s20101006/doc/arping.8 2011-01-19 04:10:18.000000000 -0500
+@@ -0,0 +1,110 @@
++.\" This manpage has been automatically generated by docbook2man
++.\" from a DocBook document. This tool can be found at:
++.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
++.\" Please send any bug reports, improvements, comments, patches,
++.\" etc. to Steve Cheng <steve@ggi-project.org>.
++.TH "ARPING" "8" "19 January 2011" "iputils-101006" "System Manager's Manual: iputils"
++.SH NAME
++arping \- send ARP REQUEST to a neighbour host
++.SH SYNOPSIS
++
++\fBarping\fR [ \fB-AbDfhqUV\fR] [ \fB-c \fIcount\fB\fR] [ \fB-w \fIdeadline\fB\fR] [ \fB-s \fIsource\fB\fR] \fB-I \fIinterface\fB\fR \fB\fIdestination\fB\fR
++
++.SH "DESCRIPTION"
++.PP
++Ping \fIdestination\fR on device \fIinterface\fR by ARP packets,
++using source address \fIsource\fR.
++.SH "OPTIONS"
++.TP
++\fB-A\fR
++The same as \fB-U\fR, but ARP REPLY packets used instead
++of ARP REQUEST.
++.TP
++\fB-b\fR
++Send only MAC level broadcasts. Normally \fBarping\fR starts
++from sending broadcast, and switch to unicast after reply received.
++.TP
++\fB-c \fIcount\fB\fR
++Stop after sending \fIcount\fR ARP REQUEST
++packets. With
++\fIdeadline\fR
++option, \fBarping\fR waits for
++\fIcount\fR ARP REPLY packets, until the timeout expires.
++.TP
++\fB-D\fR
++Duplicate address detection mode (DAD). See
++RFC2131, 4.4.1.
++Returns 0, if DAD succeeded i.e. no replies are received
++.TP
++\fB-f\fR
++Finish after the first reply confirming that target is alive.
++.TP
++\fB-I \fIinterface\fB\fR
++Name of network device where to send ARP REQUEST packets. This option
++is required.
++.TP
++\fB-h\fR
++Print help page and exit.
++.TP
++\fB-q\fR
++Quiet output. Nothing is displayed.
++.TP
++\fB-s \fIsource\fB\fR
++IP source address to use in ARP packets.
++If this option is absent, source address is:
++.RS
++.TP 0.2i
++\(bu
++In DAD mode (with option \fB-D\fR) set to 0.0.0.0.
++.TP 0.2i
++\(bu
++In Unsolicited ARP mode (with options \fB-U\fR or \fB-A\fR)
++set to \fIdestination\fR.
++.TP 0.2i
++\(bu
++Otherwise, it is calculated from routing tables.
++.RE
++.TP
++\fB-U\fR
++Unsolicited ARP mode to update neighbours' ARP caches.
++No replies are expected.
++.TP
++\fB-V\fR
++Print version of the program and exit.
++.TP
++\fB-w \fIdeadline\fB\fR
++Specify a timeout, in seconds, before
++\fBarping\fR
++exits regardless of how many
++packets have been sent or received. In this case
++\fBarping\fR
++does not stop after
++\fIcount\fR
++packet are sent, it waits either for
++\fIdeadline\fR
++expire or until
++\fIcount\fR
++probes are answered.
++.SH "SEE ALSO"
++.PP
++\fBping\fR(8),
++\fBclockdiff\fR(8),
++\fBtracepath\fR(8).
++.SH "AUTHOR"
++.PP
++\fBarping\fR was written by
++Alexey Kuznetsov
++<kuznet@ms2.inr.ac.ru>.
++It is now maintained by
++YOSHIFUJI Hideaki
++<yoshfuji@skbuff.net>.
++.SH "SECURITY"
++.PP
++\fBarping\fR requires CAP_NET_RAWIO capability
++to be executed. It is not recommended to be used as set-uid root,
++because it allows user to modify ARP caches of neighbour hosts.
++.SH "AVAILABILITY"
++.PP
++\fBarping\fR is part of \fIiputils\fR package
++and the latest versions are available in source form at
++http://www.skbuff.net/iputils/iputils-current.tar.bz2.
+--- /dev/null 2011-01-26 09:02:28.396666668 -0500
++++ iputils-s20101006/doc/clockdiff.8 2011-01-19 04:10:19.000000000 -0500
+@@ -0,0 +1,81 @@
++.\" This manpage has been automatically generated by docbook2man
++.\" from a DocBook document. This tool can be found at:
++.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
++.\" Please send any bug reports, improvements, comments, patches,
++.\" etc. to Steve Cheng <steve@ggi-project.org>.
++.TH "CLOCKDIFF" "8" "19 January 2011" "iputils-101006" "System Manager's Manual: iputils"
++.SH NAME
++clockdiff \- measure clock difference between hosts
++.SH SYNOPSIS
++
++\fBclockdiff\fR [ \fB-o\fR] [ \fB-o1\fR] \fB\fIdestination\fB\fR
++
++.SH "DESCRIPTION"
++.PP
++\fBclockdiff\fR Measures clock difference between us and
++\fIdestination\fR with 1 msec resolution using ICMP TIMESTAMP
++[2]
++packets or, optionally, IP TIMESTAMP option
++[3]
++option added to ICMP ECHO.
++[1]
++.SH "OPTIONS"
++.TP
++\fB-o\fR
++Use IP TIMESTAMP with ICMP ECHO instead of ICMP TIMESTAMP
++messages. It is useful with some destinations, which do not support
++ICMP TIMESTAMP (f.e. Solaris <2.4).
++.TP
++\fB-o1\fR
++Slightly different form of \fB-o\fR, namely it uses three-term
++IP TIMESTAMP with prespecified hop addresses instead of four term one.
++What flavor works better depends on target host. Particularly,
++\fB-o\fR is better for Linux.
++.SH "WARNINGS"
++.TP 0.2i
++\(bu
++Some nodes (Cisco) use non-standard timestamps, which is allowed
++by RFC, but makes timestamps mostly useless.
++.TP 0.2i
++\(bu
++Some nodes generate messed timestamps (Solaris>2.4), when
++run \fBxntpd\fR. Seems, its IP stack uses a corrupted clock source,
++which is synchronized to time-of-day clock periodically and jumps
++randomly making timestamps mostly useless. Good news is that you can
++use NTP in this case, which is even better.
++.TP 0.2i
++\(bu
++\fBclockdiff\fR shows difference in time modulo 24 days.
++.SH "SEE ALSO"
++.PP
++\fBping\fR(8),
++\fBarping\fR(8),
++\fBtracepath\fR(8).
++.SH "REFERENCES"
++.PP
++[1] ICMP ECHO,
++RFC0792, page 14.
++.PP
++[2] ICMP TIMESTAMP,
++RFC0792, page 16.
++.PP
++[3] IP TIMESTAMP option,
++RFC0791, 3.1, page 16.
++.SH "AUTHOR"
++.PP
++\fBclockdiff\fR was compiled by
++Alexey Kuznetsov
++<kuznet@ms2.inr.ac.ru>. It was based on code borrowed
++from BSD \fBtimed\fR daemon.
++It is now maintained by
++YOSHIFUJI Hideaki
++<yoshfuji@skbuff.net>.
++.SH "SECURITY"
++.PP
++\fBclockdiff\fR requires CAP_NET_RAWIO capability
++to be executed. It is safe to be used as set-uid root.
++.SH "AVAILABILITY"
++.PP
++\fBclockdiff\fR is part of \fIiputils\fR package
++and the latest versions are available in source form at
++http://www.skbuff.net/iputils/iputils-current.tar.bz2.
+--- /dev/null 2011-01-26 09:02:28.396666668 -0500
++++ iputils-s20101006/doc/ping.8 2011-01-19 04:10:19.000000000 -0500
+@@ -0,0 +1,408 @@
++.\" This manpage has been automatically generated by docbook2man
++.\" from a DocBook document. This tool can be found at:
++.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
++.\" Please send any bug reports, improvements, comments, patches,
++.\" etc. to Steve Cheng <steve@ggi-project.org>.
++.TH "PING" "8" "19 January 2011" "iputils-101006" "System Manager's Manual: iputils"
++.SH NAME
++ping, ping6 \- send ICMP ECHO_REQUEST to network hosts
++.SH SYNOPSIS
++
++\fBping\fR [ \fB-LRUbdfnqrvVaAB\fR] [ \fB-c \fIcount\fB\fR] [ \fB-m \fImark\fB\fR] [ \fB-i \fIinterval\fB\fR] [ \fB-l \fIpreload\fB\fR] [ \fB-p \fIpattern\fB\fR] [ \fB-s \fIpacketsize\fB\fR] [ \fB-t \fIttl\fB\fR] [ \fB-w \fIdeadline\fB\fR] [ \fB-F \fIflowlabel\fB\fR] [ \fB-I \fIinterface\fB\fR] [ \fB-M \fIhint\fB\fR] [ \fB-N \fInioption\fB\fR] [ \fB-Q \fItos\fB\fR] [ \fB-S \fIsndbuf\fB\fR] [ \fB-T \fItimestamp option\fB\fR] [ \fB-W \fItimeout\fB\fR] [ \fB\fIhop\fB\fR\fI ...\fR] \fB\fIdestination\fB\fR
++
++.SH "DESCRIPTION"
++.PP
++\fBping\fR uses the ICMP protocol's mandatory ECHO_REQUEST
++datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway.
++ECHO_REQUEST datagrams (``pings'') have an IP and ICMP
++header, followed by a struct timeval and then an arbitrary
++number of ``pad'' bytes used to fill out the packet.
++.PP
++\fBping6\fR can also send Node Information Queries (RFC4620).
++.SH "OPTIONS"
++.TP
++\fB-a\fR
++Audible ping.
++.TP
++\fB-A\fR
++Adaptive ping. Interpacket interval adapts to round-trip time, so that
++effectively not more than one (or more, if preload is set) unanswered probes
++present in the network. Minimal interval is 200msec for not super-user.
++On networks with low rtt this mode is essentially equivalent to flood mode.
++.TP
++\fB-b\fR
++Allow pinging a broadcast address.
++.TP
++\fB-B\fR
++Do not allow \fBping\fR to change source address of probes.
++The address is bound to one selected when \fBping\fR starts.
++.TP
++\fB-m \fImark\fB\fR
++use \fImark\fR to tag the packets going out. This is useful
++for variety of reasons within the kernel such as using policy
++routing to select specific outbound processing.
++.TP
++\fB-c \fIcount\fB\fR
++Stop after sending \fIcount\fR ECHO_REQUEST
++packets. With
++\fIdeadline\fR
++option, \fBping\fR waits for
++\fIcount\fR ECHO_REPLY packets, until the timeout expires.
++.TP
++\fB-d\fR
++Set the SO_DEBUG option on the socket being used.
++Essentially, this socket option is not used by Linux kernel.
++.TP
++\fB-F \fIflow label\fB\fR
++Allocate and set 20 bit flow label on echo request packets.
++(Only \fBping6\fR). If value is zero, kernel allocates random flow label.
++.TP
++\fB-f\fR
++Flood ping. For every ECHO_REQUEST sent a period ``.'' is printed,
++while for ever ECHO_REPLY received a backspace is printed.
++This provides a rapid display of how many packets are being dropped.
++If interval is not given, it sets interval to zero and
++outputs packets as fast as they come back or one hundred times per second,
++whichever is more.
++Only the super-user may use this option with zero interval.
++.TP
++\fB-i \fIinterval\fB\fR
++Wait \fIinterval\fR seconds between sending each packet.
++The default is to wait for one second between each packet normally,
++or not to wait in flood mode. Only super-user may set interval
++to values less 0.2 seconds.
++.TP
++\fB-I \fIinterface address\fB\fR
++Set source address to specified interface address. Argument
++may be numeric IP address or name of device. When pinging IPv6
++link-local address this option is required.
++.TP
++\fB-l \fIpreload\fB\fR
++If \fIpreload\fR is specified,
++\fBping\fR sends that many packets not waiting for reply.
++Only the super-user may select preload more than 3.
++.TP
++\fB-L\fR
++Suppress loopback of multicast packets. This flag only applies if the ping
++destination is a multicast address.
++.TP
++\fB-N \fInioption\fB\fR
++Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request.
++.RS
++.TP
++\fBname\fR
++Queries for Node Names.
++.RE
++.RS
++.TP
++\fBipv6\fR
++Queries for IPv6 Addresses. There are several IPv6 specific flags.
++.RS
++.TP
++\fBipv6-global\fR
++Request IPv6 global-scope addresses.
++.RE
++.RS
++.TP
++\fBipv6-sitelocal\fR
++Request IPv6 site-local addresses.
++.RE
++.RS
++.TP
++\fBipv6-linklocal\fR
++Request IPv6 link-local addresses.
++.RE
++.RS
++.TP
++\fBipv6-all\fR
++Request IPv6 addresses on other interfaces.
++.RE
++.RE
++.RS
++.TP
++\fBipv4\fR
++Queries for IPv4 Addresses. There is one IPv4 specific flag.
++.RS
++.TP
++\fBipv4-all\fR
++Request IPv4 addresses on other interfaces.
++.RE
++.RE
++.RS
++.TP
++\fBsubject-ipv6=\fIipv6addr\fB\fR
++IPv6 subject address.
++.RE
++.RS
++.TP
++\fBsubject-ipv4=\fIipv4addr\fB\fR
++IPv4 subject address.
++.RE
++.RS
++.TP
++\fBsubject-name=\fInodename\fB\fR
++Subject name. If it contains more than one dot,
++fully-qualified domain name is assumed.
++.RE
++.RS
++.TP
++\fBsubject-fqdn=\fInodename\fB\fR
++Subject name. Fully-qualified domain name is
++always assumed.
++.RE
++.TP
++\fB-n\fR
++Numeric output only.
++No attempt will be made to lookup symbolic names for host addresses.
++.TP
++\fB-p \fIpattern\fB\fR
++You may specify up to 16 ``pad'' bytes to fill out the packet you send.
++This is useful for diagnosing data-dependent problems in a network.
++For example, \fB-p ff\fR will cause the sent packet
++to be filled with all ones.
++.TP
++\fB-D\fR
++Print timestamp (unix time + microseconds as in gettimeofday) before
++each line.
++.TP
++\fB-Q \fItos\fB\fR
++Set Quality of Service -related bits in ICMP datagrams.
++\fItos\fR can be either decimal or hex number.
++Traditionally (RFC1349), these have been interpreted as: 0 for reserved
++(currently being redefined as congestion control), 1-4 for Type of Service
++and 5-7 for Precedence.
++Possible settings for Type of Service are: minimal cost: 0x02,
++reliability: 0x04, throughput: 0x08, low delay: 0x10. Multiple TOS bits
++should not be set simultaneously. Possible settings for
++special Precedence range from priority (0x20) to net control (0xe0). You
++must be root (CAP_NET_ADMIN capability) to use Critical or
++higher precedence value. You cannot set
++bit 0x01 (reserved) unless ECN has been enabled in the kernel.
++In RFC2474, these fields has been redefined as 8-bit Differentiated
++Services (DS), consisting of: bits 0-1 of separate data (ECN will be used,
++here), and bits 2-7 of Differentiated Services Codepoint (DSCP).
++.TP
++\fB-q\fR
++Quiet output.
++Nothing is displayed except the summary lines at startup time and
++when finished.
++.TP
++\fB-R\fR
++Record route.
++Includes the RECORD_ROUTE option in the ECHO_REQUEST
++packet and displays the route buffer on returned packets.
++Note that the IP header is only large enough for nine such routes.
++Many hosts ignore or discard this option.
++.TP
++\fB-r\fR
++Bypass the normal routing tables and send directly to a host on an attached
++interface.
++If the host is not on a directly-attached network, an error is returned.
++This option can be used to ping a local host through an interface
++that has no route through it provided the option \fB-I\fR is also
++used.
++.TP
++\fB-s \fIpacketsize\fB\fR
++Specifies the number of data bytes to be sent.
++The default is 56, which translates into 64 ICMP
++data bytes when combined with the 8 bytes of ICMP header data.
++.TP
++\fB-S \fIsndbuf\fB\fR
++Set socket sndbuf. If not specified, it is selected to buffer
++not more than one packet.
++.TP
++\fB-t \fIttl\fB\fR
++Set the IP Time to Live.
++.TP
++\fB-T \fItimestamp option\fB\fR
++Set special IP timestamp options.
++\fItimestamp option\fR may be either
++\fItsonly\fR (only timestamps),
++\fItsandaddr\fR (timestamps and addresses) or
++\fItsprespec host1 [host2 [host3 [host4]]]\fR
++(timestamp prespecified hops).
++.TP
++\fB-M \fIhint\fB\fR
++Select Path MTU Discovery strategy.
++\fIhint\fR may be either \fIdo\fR
++(prohibit fragmentation, even local one),
++\fIwant\fR (do PMTU discovery, fragment locally when packet size
++is large), or \fIdont\fR (do not set DF flag).
++.TP
++\fB-U\fR
++Print full user-to-user latency (the old behaviour). Normally
++\fBping\fR
++prints network round trip time, which can be different
++f.e. due to DNS failures.
++.TP
++\fB-v\fR
++Verbose output.
++.TP
++\fB-V\fR
++Show version and exit.
++.TP
++\fB-w \fIdeadline\fB\fR
++Specify a timeout, in seconds, before
++\fBping\fR
++exits regardless of how many
++packets have been sent or received. In this case
++\fBping\fR
++does not stop after
++\fIcount\fR
++packet are sent, it waits either for
++\fIdeadline\fR
++expire or until
++\fIcount\fR
++probes are answered or for some error notification from network.
++.TP
++\fB-W \fItimeout\fB\fR
++Time to wait for a response, in seconds. The option affects only timeout
++in absense of any responses, otherwise \fBping\fR waits for two RTTs.
++.PP
++When using \fBping\fR for fault isolation, it should first be run
++on the local host, to verify that the local network interface is up
++and running. Then, hosts and gateways further and further away should be
++``pinged''. Round-trip times and packet loss statistics are computed.
++If duplicate packets are received, they are not included in the packet
++loss calculation, although the round trip time of these packets is used
++in calculating the minimum/average/maximum round-trip time numbers.
++When the specified number of packets have been sent (and received) or
++if the program is terminated with a
++SIGINT, a brief summary is displayed. Shorter current statistics
++can be obtained without termination of process with signal
++SIGQUIT.
++.PP
++If \fBping\fR does not receive any reply packets at all it will
++exit with code 1. If a packet
++\fIcount\fR
++and
++\fIdeadline\fR
++are both specified, and fewer than
++\fIcount\fR
++packets are received by the time the
++\fIdeadline\fR
++has arrived, it will also exit with code 1.
++On other error it exits with code 2. Otherwise it exits with code 0. This
++makes it possible to use the exit code to see if a host is alive or
++not.
++.PP
++This program is intended for use in network testing, measurement and
++management.
++Because of the load it can impose on the network, it is unwise to use
++\fBping\fR during normal operations or from automated scripts.
++.SH "ICMP PACKET DETAILS"
++.PP
++An IP header without options is 20 bytes.
++An ICMP ECHO_REQUEST packet contains an additional 8 bytes worth
++of ICMP header followed by an arbitrary amount of data.
++When a \fIpacketsize\fR is given, this indicated the size of this
++extra piece of data (the default is 56). Thus the amount of data received
++inside of an IP packet of type ICMP ECHO_REPLY will always be 8 bytes
++more than the requested data space (the ICMP header).
++.PP
++If the data space is at least of size of struct timeval
++\fBping\fR uses the beginning bytes of this space to include
++a timestamp which it uses in the computation of round trip times.
++If the data space is shorter, no round trip times are given.
++.SH "DUPLICATE AND DAMAGED PACKETS"
++.PP
++\fBping\fR will report duplicate and damaged packets.
++Duplicate packets should never occur, and seem to be caused by
++inappropriate link-level retransmissions.
++Duplicates may occur in many situations and are rarely (if ever) a
++good sign, although the presence of low levels of duplicates may not
++always be cause for alarm.
++.PP
++Damaged packets are obviously serious cause for alarm and often
++indicate broken hardware somewhere in the
++\fBping\fR packet's path (in the network or in the hosts).
++.SH "TRYING DIFFERENT DATA PATTERNS"
++.PP
++The (inter)network layer should never treat packets differently depending
++on the data contained in the data portion.
++Unfortunately, data-dependent problems have been known to sneak into
++networks and remain undetected for long periods of time.
++In many cases the particular pattern that will have problems is something
++that doesn't have sufficient ``transitions'', such as all ones or all
++zeros, or a pattern right at the edge, such as almost all zeros.
++It isn't necessarily enough to specify a data pattern of all zeros (for
++example) on the command line because the pattern that is of interest is
++at the data link level, and the relationship between what you type and
++what the controllers transmit can be complicated.
++.PP
++This means that if you have a data-dependent problem you will probably
++have to do a lot of testing to find it.
++If you are lucky, you may manage to find a file that either can't be sent
++across your network or that takes much longer to transfer than other
++similar length files.
++You can then examine this file for repeated patterns that you can test
++using the \fB-p\fR option of \fBping\fR.
++.SH "TTL DETAILS"
++.PP
++The TTL value of an IP packet represents the maximum number of IP routers
++that the packet can go through before being thrown away.
++In current practice you can expect each router in the Internet to decrement
++the TTL field by exactly one.
++.PP
++The TCP/IP specification states that the TTL field for TCP
++packets should be set to 60, but many systems use smaller values
++(4.3 BSD uses 30, 4.2 used 15).
++.PP
++The maximum possible value of this field is 255, and most Unix systems set
++the TTL field of ICMP ECHO_REQUEST packets to 255.
++This is why you will find you can ``ping'' some hosts, but not reach them
++with
++\fBtelnet\fR(1)
++or
++\fBftp\fR(1).
++.PP
++In normal operation ping prints the ttl value from the packet it receives.
++When a remote system receives a ping packet, it can do one of three things
++with the TTL field in its response:
++.TP 0.2i
++\(bu
++Not change it; this is what Berkeley Unix systems did before the
++4.3BSD Tahoe release. In this case the TTL value in the received packet
++will be 255 minus the number of routers in the round-trip path.
++.TP 0.2i
++\(bu
++Set it to 255; this is what current Berkeley Unix systems do.
++In this case the TTL value in the received packet will be 255 minus the
++number of routers in the path \fBfrom\fR
++the remote system \fBto\fR the \fBping\fRing host.
++.TP 0.2i
++\(bu
++Set it to some other value. Some machines use the same value for
++ICMP packets that they use for TCP packets, for example either 30 or 60.
++Others may use completely wild values.
++.SH "BUGS"
++.TP 0.2i
++\(bu
++Many Hosts and Gateways ignore the RECORD_ROUTE option.
++.TP 0.2i
++\(bu
++The maximum IP header length is too small for options like
++RECORD_ROUTE to be completely useful.
++There's not much that that can be done about this, however.
++.TP 0.2i
++\(bu
++Flood pinging is not recommended in general, and flood pinging the
++broadcast address should only be done under very controlled conditions.
++.SH "SEE ALSO"
++.PP
++\fBnetstat\fR(1),
++\fBifconfig\fR(8).
++.SH "HISTORY"
++.PP
++The \fBping\fR command appeared in 4.3BSD.
++.PP
++The version described here is its descendant specific to Linux.
++.SH "SECURITY"
++.PP
++\fBping\fR requires CAP_NET_RAWIO capability
++to be executed. It may be used as set-uid root.
++.SH "AVAILABILITY"
++.PP
++\fBping\fR is part of \fIiputils\fR package
++and the latest versions are available in source form at
++http://www.skbuff.net/iputils/iputils-current.tar.bz2.
+--- /dev/null 2011-01-26 09:02:28.396666668 -0500
++++ iputils-s20101006/doc/rdisc.8 2011-01-19 04:10:20.000000000 -0500
+@@ -0,0 +1,110 @@
++.\" This manpage has been automatically generated by docbook2man
++.\" from a DocBook document. This tool can be found at:
++.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
++.\" Please send any bug reports, improvements, comments, patches,
++.\" etc. to Steve Cheng <steve@ggi-project.org>.
++.TH "RDISC" "8" "19 January 2011" "iputils-101006" "System Manager's Manual: iputils"
++.SH NAME
++rdisc \- network router discovery daemon
++.SH SYNOPSIS
++
++\fBrdisc\fR [ \fB-abdfstvV\fR] [ \fB\fIsend_address\fB\fR] [ \fB\fIreceive_address\fB\fR]
++
++.SH "DESCRIPTION"
++.PP
++\fBrdisc\fR implements client side of the ICMP router discover protocol.
++\fBrdisc\fR is invoked at boot time to populate the network
++routing tables with default routes.
++.PP
++\fBrdisc\fR listens on the ALL_HOSTS (224.0.0.1) multicast address
++(or \fIreceive_address\fR provided it is given)
++for ROUTER_ADVERTISE messages from routers. The received
++messages are handled by first ignoring those listed router addresses
++with which the host does not share a network. Among the remaining addresses
++the ones with the highest preference are selected as default routers
++and a default route is entered in the kernel routing table
++for each one of them.
++.PP
++Optionally, \fBrdisc\fR can avoid waiting for routers to announce
++themselves by sending out a few ROUTER_SOLICITATION messages
++to the ALL_ROUTERS (224.0.0.2) multicast address
++(or \fIsend_address\fR provided it is given)
++when it is started.
++.PP
++A timer is associated with each router address and the address will
++no longer be considered for inclusion in the the routing tables if the
++timer expires before a new
++\fBadvertise\fR message is received from the router.
++The address will also be excluded from consideration if the host receives an
++\fBadvertise\fR
++message with the preference being maximally negative.
++.PP
++Server side of router discovery protocol is supported by Cisco IOS
++and by any more or less complete UNIX routing daemon, f.e \fBgated\fR.
++.SH "OPTIONS"
++.TP
++\fB-a\fR
++Accept all routers independently of the preference they have in their
++\fBadvertise\fR messages.
++Normally \fBrdisc\fR only accepts (and enters in the kernel routing
++tables) the router or routers with the highest preference.
++.TP
++\fB-b\fR
++Opposite to \fB-a\fR, i.e. install only router with the best
++preference value. It is default behaviour.
++.TP
++\fB-d\fR
++Send debugging messages to syslog.
++.TP
++\fB-f\fR
++Run \fBrdisc\fR forever even if no routers are found.
++Normally \fBrdisc\fR gives up if it has not received any
++\fBadvertise\fR message after after soliciting three times,
++in which case it exits with a non-zero exit code.
++If \fB-f\fR is not specified in the first form then
++\fB-s\fR must be specified.
++.TP
++\fB-s\fR
++Send three \fBsolicitation\fR messages initially to quickly discover
++the routers when the system is booted.
++When \fB-s\fR is specified \fBrdisc\fR
++exits with a non-zero exit code if it can not find any routers.
++This can be overridden with the \fB-f\fR option.
++.TP
++\fB-t\fR
++Test mode. Do not go to background.
++.TP
++\fB-v\fR
++Be verbose i.e. send lots of debugging messages to syslog.
++.TP
++\fB-V\fR
++Print version and exit.
++.SH "HISTORY"
++.PP
++This program was developed by Sun Microsystems (see copyright
++notice in source file). It was ported to Linux by
++Alexey Kuznetsov
++<kuznet@ms2.inr.ac.ru>.
++It is now maintained by
++YOSHIFUJI Hideaki
++<yoshfuji@skbuff.net>.
++.SH "SEE ALSO"
++.PP
++\fBicmp\fR(7),
++\fBinet\fR(7),
++\fBping\fR(8).
++.SH "REFERENCES"
++.PP
++Deering, S.E.,ed "ICMP Router Discovery Messages",
++RFC1256, Network Information Center, SRI International,
++Menlo Park, Calif., September 1991.
++.SH "SECURITY"
++.PP
++\fBrdisc\fR requires CAP_NET_RAWIO to listen
++and send ICMP messages and capability CAP_NET_ADMIN
++to update routing tables.
++.SH "AVAILABILITY"
++.PP
++\fBrdisc\fR is part of \fIiputils\fR package
++and the latest versions are available in source form at
++http://www.skbuff.net/iputils/iputils-current.tar.bz2.
+--- /dev/null 2011-01-26 09:02:28.396666668 -0500
++++ iputils-s20101006/doc/tracepath.8 2011-01-19 04:10:20.000000000 -0500
+@@ -0,0 +1,97 @@
++.\" This manpage has been automatically generated by docbook2man
++.\" from a DocBook document. This tool can be found at:
++.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
++.\" Please send any bug reports, improvements, comments, patches,
++.\" etc. to Steve Cheng <steve@ggi-project.org>.
++.TH "TRACEPATH" "8" "19 January 2011" "iputils-101006" "System Manager's Manual: iputils"
++.SH NAME
++tracepath, tracepath6 \- traces path to a network host discovering MTU along this path
++.SH SYNOPSIS
++
++\fBtracepath\fR [ \fB-n\fR] [ \fB-b\fR] [ \fB-l \fIpktlen\fB\fR] \fB\fIdestination\fB\fR [ \fB\fIport\fB\fR]
++
++.SH "DESCRIPTION"
++.PP
++It traces path to \fIdestination\fR discovering MTU along this path.
++It uses UDP port \fIport\fR or some random port.
++It is similar to \fBtraceroute\fR, only does not require superuser
++privileges and has no fancy options.
++.PP
++\fBtracepath6\fR is good replacement for \fBtraceroute6\fR
++and classic example of application of Linux error queues.
++The situation with IPv4 is worse, because commercial
++IP routers do not return enough information in icmp error messages.
++Probably, it will change, when they will be updated.
++For now it uses Van Jacobson's trick, sweeping a range
++of UDP ports to maintain trace history.
++.SH "OPTIONS"
++.TP
++\fB-n\fR
++Print primarily IP addresses numerically.
++.TP
++\fB-b\fR
++Print both of host names and IP addresses.
++.TP
++\fB-l\fR
++Sets the initial packet length to \fIpktlen\fR instead of
++65536 for \fBtracepath\fR or 128000 for \fBtracepath6\fR.
++.SH "OUTPUT"
++.PP
++
++.nf
++root@mops:~ # tracepath6 3ffe:2400:0:109::2
++ 1?: [LOCALHOST] pmtu 1500
++ 1: dust.inr.ac.ru 0.411ms
++ 2: dust.inr.ac.ru asymm 1 0.390ms pmtu 1480
++ 2: 3ffe:2400:0:109::2 463.514ms reached
++ Resume: pmtu 1480 hops 2 back 2
++.fi
++.PP
++The first column shows TTL of the probe, followed by colon.
++Usually value of TTL is obtained from reply from network,
++but sometimes reply does not contain necessary information and
++we have to guess it. In this case the number is followed by ?.
++.PP
++The second column shows the network hop, which replied to the probe.
++It is either address of router or word [LOCALHOST], if
++the probe was not sent to the network.
++.PP
++The rest of line shows miscellaneous information about path to
++the correspinding hetwork hop. As rule it contains value of RTT.
++Additionally, it can show Path MTU, when it changes.
++If the path is asymmetric
++or the probe finishes before it reach prescribed hop, difference
++between number of hops in forward and backward direction is shown
++following keyword async. This information is not reliable.
++F.e. the third line shows asymmetry of 1, it is because the first probe
++with TTL of 2 was rejected at the first hop due to Path MTU Discovery.
++.PP
++The last line summarizes information about all the path to the destination,
++it shows detected Path MTU, amount of hops to the destination and our
++guess about amount of hops from the destination to us, which can be
++different when the path is asymmetric.
++.SH "SEE ALSO"
++.PP
++\fBtraceroute\fR(8),
++\fBtraceroute6\fR(8),
++\fBping\fR(8).
++.SH "AUTHOR"
++.PP
++\fBtracepath\fR was written by
++Alexey Kuznetsov
++<kuznet@ms2.inr.ac.ru>.
++.SH "SECURITY"
++.PP
++No security issues.
++.PP
++This lapidary deserves to be elaborated.
++\fBtracepath\fR is not a privileged program, unlike
++\fBtraceroute\fR, \fBping\fR and other beasts of this kind.
++\fBtracepath\fR may be executed by everyone who has some access
++to network, enough to send UDP datagrams to investigated destination
++using given port.
++.SH "AVAILABILITY"
++.PP
++\fBtracepath\fR is part of \fIiputils\fR package
++and the latest versions are available in source form at
++http://www.skbuff.net/iputils/iputils-current.tar.bz2.
+diff -Naur /dev/null iputils-s20101006/doc/rarpd.8
+--- /dev/null 2011-01-26 09:02:28.396666668 -0500
++++ iputils-s20101006/doc/rarpd.8 2011-01-08 20:09:51.270811811 -0500
+@@ -0,0 +1,84 @@
++.\" This manpage has been automatically generated by docbook2man
++.\" from a DocBook document. This tool can be found at:
++.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
++.\" Please send any bug reports, improvements, comments, patches,
++.\" etc. to Steve Cheng <steve@ggi-project.org>.
++.TH "RARPD" "8" "08 January 2011" "iputils-101006" "System Manager's Manual: iputils"
++.SH NAME
++rarpd \- answer RARP REQUESTs
++.SH SYNOPSIS
++
++\fBarping\fR [\fB-aAvde\fR] [\fB-b \fIbootdir\fB\fR] [\fB\fIinterface\fB\fR]
++
++.SH "DESCRIPTION"
++.PP
++Listens
++RARP
++requests from clients. Provided MAC address of client
++is found in \fI/etc/ethers\fR database and
++obtained host name is resolvable to an IP address appropriate
++for attached network, \fBrarpd\fR answers to client with RARPD
++reply carrying an IP address.
++.PP
++To allow multiple boot servers on the network \fBrarpd\fR
++optionally checks for presence Sun-like bootable image in TFTP directory.
++It should have form \fBHexadecimal_IP.ARCH\fR, f.e. to load
++sparc 193.233.7.98 \fIC1E90762.SUN4M\fR is linked to
++an image appropriate for SUM4M in directory \fI/etc/tftpboot\fR.
++.SH "WARNING"
++.PP
++This facility is deeply obsoleted by
++BOOTP
++and later
++DHCP protocols.
++However, some clients really still need this to boot.
++.SH "OPTIONS"
++.TP
++\fB-a\fR
++Listen on all the interfaces. Currently it is an internal
++option, its function is overridden with \fIinterface\fR
++argument. It should not be used.
++.TP
++\fB-A\fR
++Listen not only RARP but also ARP messages, some rare clients
++use ARP by some unknown reason.
++.TP
++\fB-v\fR
++Be verbose.
++.TP
++\fB-d\fR
++Debug mode. Do not go to background.
++.TP
++\fB-e\fR
++Do not check for presence of a boot image, reply if MAC address
++resolves to a valid IP address using \fI/etc/ethers\fR
++database and DNS.
++.TP
++\fB-b \fIbootdir\fB\fR
++TFTP boot directory. Default is \fI/etc/tftpboot\fR
++.SH "SEE ALSO"
++.PP
++\fBarping\fR(8),
++\fBtftpd\fR(8).
++.SH "AUTHOR"
++.PP
++\fBrarpd\fR was written by
++Alexey Kuznetsov
++<kuznet@ms2.inr.ac.ru>.
++It is now maintained by
++YOSHIFUJI Hideaki
++<yoshfuji@skbuff.net>.
++.SH "SECURITY"
++.PP
++\fBrarpd\fR requires CAP_NET_RAWIO capability
++to listen and send RARP and ARP packets. It also needs CAP_NET_ADMIN
++to give to kernel hint for ARP resolution; this is not strictly required,
++but some (most of, to be more exact) clients are so badly broken that
++are not able to answer ARP before they are finally booted. This is
++not wonderful taking into account that clients using RARPD in 2002
++are all unsupported relic creatures of 90's and even earlier.
++.SH "AVAILABILITY"
++.PP
++\fBrarpd\fR is part of \fIiputils\fR package
++and the latest versions are available in source form at
++http://www.skbuff.net/iputils/iputils-current.tar.bz2.
+diff -Naur /dev/null iputils-s20101006/doc/tftpd.8
+--- /dev/null 2011-01-26 09:02:28.396666668 -0500
++++ iputils-s20101006/doc/tftpd.8 2011-01-08 20:09:51.723407498 -0500
+@@ -0,0 +1,85 @@
++.\" This manpage has been automatically generated by docbook2man
++.\" from a DocBook document. This tool can be found at:
++.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
++.\" Please send any bug reports, improvements, comments, patches,
++.\" etc. to Steve Cheng <steve@ggi-project.org>.
++.TH "TFTPD" "8" "08 January 2011" "iputils-101006" "System Manager's Manual: iputils"
++.SH NAME
++tftpd \- Trivial File Transfer Protocol server
++.SH SYNOPSIS
++
++\fBtftpd\fR \fB\fIdirectory\fB\fR
++
++.SH "DESCRIPTION"
++.PP
++\fBtftpd\fR is a server which supports the DARPA
++Trivial File Transfer Protocol
++(RFC1350).
++The TFTP server is started
++by \fBinetd\fR(8).
++.PP
++\fIdirectory\fR is required argument; if it is not given
++\fBtftpd\fR aborts. This path is prepended to any file name requested
++via TFTP protocol, effectively chrooting \fBtftpd\fR to this directory.
++File names are validated not to escape out of this directory, however
++administrator may configure such escape using symbolic links.
++.PP
++It is in difference of variants of \fBtftpd\fR usually distributed
++with unix-like systems, which take a list of directories and match
++file names to start from one of given prefixes or to some random
++default, when no arguments were given. There are two reasons not to
++behave in this way: first, it is inconvenient, clients are not expected
++to know something about layout of filesystem on server host.
++And second, TFTP protocol is not a tool for browsing of server's filesystem,
++it is just an agent allowing to boot dumb clients.
++.PP
++In the case when \fBtftpd\fR is used together with
++\fBrarpd\fR(8),
++tftp directories in these services should coincide and it is expected
++that each client booted via TFTP has boot image corresponding
++its IP address with an architecture suffix following Sun Microsystems
++conventions. See
++\fBrarpd\fR(8)
++for more details.
++.SH "SECURITY"
++.PP
++TFTP protocol does not provide any authentication.
++Due to this capital flaw \fBtftpd\fR is not able to restrict
++access to files and will allow only publically readable
++files to be accessed. Files may be written only if they already
++exist and are publically writable.
++.PP
++Impact is evident, directory exported via TFTP \fBmust not\fR
++contain sensitive information of any kind, everyone is allowed
++to read it as soon as a client is allowed. Boot images do not contain
++such information as rule, however you should think twice before
++publishing f.e. Cisco IOS config files via TFTP, they contain
++\fBunencrypted\fR passwords and may contain some information
++about the network, which you were not going to make public.
++.PP
++The \fBtftpd\fR server should be executed by \fBinetd\fR
++with dropped root privileges, namely with a user ID giving minimal
++access to files published in tftp directory. If it is executed
++as superuser occasionally, \fBtftpd\fR drops its UID and GID
++to 65534, which is most likely not the thing which you expect.
++However, this is not very essential; remember, only files accessible
++for everyone can be read or written via TFTP.
++.SH "SEE ALSO"
++.PP
++\fBrarpd\fR(8),
++\fBtftp\fR(1),
++\fBinetd\fR(8).
++.SH "HISTORY"
++.PP
++The \fBtftpd\fR command appeared in 4.2BSD. The source in iputils
++is cleaned up both syntactically (ANSIized) and semantically (UDP socket IO).
++.PP
++It is distributed with iputils mostly as good demo of an interesting feature
++(MSG_CONFIRM) allowing to boot long images by dumb clients
++not answering ARP requests until they are finally booted.
++However, this is full functional and can be used in production.
++.SH "AVAILABILITY"
++.PP
++\fBtftpd\fR is part of \fIiputils\fR package
++and the latest versions are available in source form at
++http://www.skbuff.net/iputils/iputils-current.tar.bz2.
+diff -Naur /dev/null iputils-s20101006/doc/traceroute6.8
+--- /dev/null 1969-12-31 19:00:00.000000000 -0500
++++ iputils-s20101006/doc/traceroute6.8 2011-01-08 20:09:52.114781859 -0500
+@@ -0,0 +1,42 @@
++.\" This manpage has been automatically generated by docbook2man
++.\" from a DocBook document. This tool can be found at:
++.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
++.\" Please send any bug reports, improvements, comments, patches,
++.\" etc. to Steve Cheng <steve@ggi-project.org>.
++.TH "TRACEROUTE6" "8" "08 January 2011" "iputils-101006" "System Manager's Manual: iputils"
++.SH NAME
++traceroute6 \- traces path to a network host
++.SH SYNOPSIS
++
++\fBtraceroute6\fR [\fB-dnrvV\fR] [\fB-i \fIinterface\fB\fR] [\fB-m \fImax_ttl\fB\fR] [\fB-p \fIport\fB\fR] [\fB-q \fImax_probes\fB\fR] [\fB-s \fIsource\fB\fR] [\fB-w \fIwait time\fB\fR] \fB\fIdestination\fB\fR [\fB\fIsize\fB\fR]
++
++.SH "DESCRIPTION"
++.PP
++Description can be found in
++\fBtraceroute\fR(8),
++all the references to IP replaced to IPv6. It is needless to copy
++the description from there.
++.SH "SEE ALSO"
++.PP
++\fBtraceroute\fR(8),
++\fBtracepath\fR(8),
++\fBping\fR(8).
++.SH "HISTORY"
++.PP
++This program has long history. Author of \fBtraceroute\fR
++is Van Jacobson and it first appeared in 1988. This clone is
++based on a port of \fBtraceroute\fR to IPv6 published
++in NRL IPv6 distribution in 1996. In turn, it was ported
++to Linux by Pedro Roque. After this it was kept in sync by
++Alexey Kuznetsov
++<kuznet@ms2.inr.ac.ru>. And eventually entered
++\fBiputils\fR package.
++.SH "SECURITY"
++.PP
++\fBtracepath6\fR requires CAP_NET_RAWIO capability
++to be executed. It is safe to be used as set-uid root.
++.SH "AVAILABILITY"
++.PP
++\fBtraceroute6\fR is part of \fIiputils\fR package
++and the latest versions are available in source form at
++http://www.skbuff.net/iputils/iputils-current.tar.bz2.
diff --git a/core/iputils/permission-fix.patch b/core/iputils/permission-fix.patch
new file mode 100644
index 000000000..c47636f84
--- /dev/null
+++ b/core/iputils/permission-fix.patch
@@ -0,0 +1,15 @@
+--- traceroute-1.4a12/Makefile.in.old 2000-11-23 21:05:29.000000000 +0100
++++ traceroute-1.4a12/Makefile.in 2008-09-27 20:04:30.000000000 +0200
+@@ -90,10 +90,10 @@
+ sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
+
+ install: force
+- $(INSTALL) -m 4555 -o root -g bin traceroute $(DESTDIR)$(BINDEST)
++ $(INSTALL) -m 4555 -o root -g root traceroute $(DESTDIR)$(BINDEST)
+
+ install-man: force
+- $(INSTALL) -m 444 -o bin -g bin traceroute.8 $(DESTDIR)$(MANDEST)/man8
++ $(INSTALL) -m 644 -o root -g root traceroute.8 $(DESTDIR)$(MANDEST)/man8
+
+ lint: $(GENSRC) force
+ lint -hbxn $(SRC) | \
diff --git a/core/isdn4k-utils/PKGBUILD b/core/isdn4k-utils/PKGBUILD
new file mode 100644
index 000000000..3db35097e
--- /dev/null
+++ b/core/isdn4k-utils/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 102060 2010-12-04 10:48:14Z allan $
+# Contributor: Dennis "Gyroplast" Herbrich <dennis@archlinux.org>
+# Maintainer: dorphell <dorphell@archlinux.org>
+
+pkgname=isdn4k-utils
+pkgver=3.2p1
+pkgrel=6
+pkgdesc="User space administration programs and tools for ISDN"
+arch=('i686' 'x86_64')
+url="http://www.isdn4linux.de/"
+license=('GPL')
+depends=('ncurses')
+backup=(etc/isdn/{callerid.conf,isdn.conf,rate.conf,isdnlog.isdnctrl0.options})
+options=('!makeflags')
+source=(ftp://ftp.isdn4linux.de/pub/isdn4linux/utils/${pkgname}.v${pkgver}.tar.bz2
+ isdn4k-utils-3.2p1-build.patch
+ config)
+md5sums=('d347afa462e46eccfd1284aebae227b6'
+ '7f056ddac093c77d8be4e076d0e9421c'
+ '3429894039f33c114fef5ef9f866920e')
+
+build() {
+ cd $srcdir/$pkgname
+ patch -Np1 -i $srcdir/isdn4k-utils-3.2p1-build.patch
+ cp $srcdir/config ./.config
+ make subconfig
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname
+ install -dm755 $pkgdir/sbin
+ make DESTDIR=$pkgdir install
+}
diff --git a/core/isdn4k-utils/config b/core/isdn4k-utils/config
new file mode 100644
index 000000000..fe0810209
--- /dev/null
+++ b/core/isdn4k-utils/config
@@ -0,0 +1,100 @@
+#
+# Automatically generated by make menuconfig: don't edit
+#
+
+#
+# Code maturity level options
+#
+# CONFIG_EXPERIMENTAL is not set
+
+#
+# General configuration
+#
+# CONFIG_BUILDX11 is not set
+CONFIG_KERNELDIR='/usr/src/linux'
+CONFIG_BINDIR='/usr/bin'
+CONFIG_SBINDIR='/sbin'
+CONFIG_MANDIR='/usr/share/man'
+CONFIG_RUNDIR='/var/run'
+CONFIG_LOCKDIR='/var/lock'
+CONFIG_LOCKFILE='LCK..'
+CONFIG_I4LCONFDIR='/etc/isdn'
+CONFIG_CONFFILE='isdn.conf'
+CONFIG_CALLERIDFILE='callerid.conf'
+CONFIG_USERCONFFILE='~/.isdn'
+CONFIG_COUNTRYCODE='49'
+CONFIG_AREACODE=''
+CONFIG_COUNTRY_PREFIX='+'
+CONFIG_AREA_PREFIX='0'
+CONFIG_DATADIR='/usr/lib/isdn'
+
+#
+# Runtime configuration tools
+#
+CONFIG_ISDNCTRL=y
+CONFIG_ISDNCTRL_CONF=y
+# CONFIG_ISDNCTRL_TIMRU is not set
+# CONFIG_IPROFD is not set
+# CONFIG_DIVERTCTRL is not set
+
+#
+# Card configuration tools
+#
+CONFIG_HISAXCTRL=y
+CONFIG_ICNCTRL=y
+# CONFIG_ICNCTRL_DEBUG is not set
+CONFIG_PCBITCTL=y
+# CONFIG_AVMCAPICTRL is not set
+# CONFIG_EICONCTRL is not set
+
+#
+# Tools for monitoring activity
+#
+CONFIG_IMON=y
+CONFIG_IMONTTY=y
+CONFIG_ISDNLOG=y
+
+#
+# Options for isdnlog package
+#
+CONFIG_ISDNLOG_SERV_PORT=20011
+CONFIG_ISDNLOG_USERFILE='isdnlog.users'
+CONFIG_ISDNLOG_CHARGEFILE='charge.dat'
+CONFIG_ISDNLOG_LOGFILE='/var/log/isdn.log'
+CONFIG_ISDNLOG_RELOADCMD='reload'
+CONFIG_ISDNLOG_STOPCMD='stop'
+CONFIG_ISDNLOG_REBOOTCMD='/sbin/reboot'
+CONFIG_ISDNLOG_OLDI4LCONFDIR='/etc/isdnlog'
+CONFIG_ISDNLOG_OLDI4LCONFFILE='isdnlog.conf'
+# CONFIG_ISDNLOG_POSTGRES is not set
+# CONFIG_ISDNLOG_MYSQLDB is not set
+# CONFIG_ISDNLOG_ORACLE is not set
+CONFIG_ISDN_LOG_DE=y
+CONFIG_ISDN_LOG_CC_DE=y
+CONFIG_ISDN_LOG_DEST_DE=y
+CONFIG_ISDN_LOG_DEST_AT=y
+CONFIG_ISDN_LOG_DEST_NL=y
+CONFIG_ISDN_LOG_DEST_CH=y
+CONFIG_IPPPSTATS=y
+# CONFIG_XISDNLOAD is not set
+# CONFIG_XMONISDN is not set
+
+#
+# Applications
+#
+# CONFIG_VBOX is not set
+CONFIG_IPPPD=y
+
+#
+# Options for ipppd
+#
+# CONFIG_IPPPD_MSCHAP is not set
+# CONFIG_IPPPD_RADIUS is not set
+# CONFIG_RADIUS_WTMP_LOGGING is not set
+RADIUS_CLIENT_CONFIG_FILE=''
+
+#
+# Documentation
+#
+CONFIG_GENMAN=y
+# CONFIG_FAQ is not set
diff --git a/core/isdn4k-utils/isdn4k-utils-3.2p1-build.patch b/core/isdn4k-utils/isdn4k-utils-3.2p1-build.patch
new file mode 100644
index 000000000..63239fcad
--- /dev/null
+++ b/core/isdn4k-utils/isdn4k-utils-3.2p1-build.patch
@@ -0,0 +1,2028 @@
+diff -Naur isdn4k-utils-orig//eicon/eiconctrl.c isdn4k-utils/eicon/eiconctrl.c
+--- isdn4k-utils-orig//eicon/eiconctrl.c 2001-06-22 02:34:45.000000000 +1000
++++ isdn4k-utils/eicon/eiconctrl.c 2010-12-04 20:44:11.093338893 +1000
+@@ -1970,7 +1970,7 @@
+ val = strtol(p, &q, 16);
+ p = q;
+ val = strtol(p, &q, 16);
+- (unsigned short) *buffer = (unsigned short) val;
++ *buffer = (unsigned short) val;
+ pos = 2;
+ while ((p != q) && (*q != 0)) {
+ p = q;
+diff -Naur isdn4k-utils-orig//hisax/hisaxctrl.c isdn4k-utils/hisax/hisaxctrl.c
+--- isdn4k-utils-orig//hisax/hisaxctrl.c 2000-06-30 19:37:38.000000000 +1000
++++ isdn4k-utils/hisax/hisaxctrl.c 2010-12-04 20:44:11.093338893 +1000
+@@ -43,7 +43,8 @@
+ fprintf(stderr, "cannot open file %s\n", fname);
+ exit(-1);
+ }
+- p = (int *) buffer = (unsigned char *) malloc(MAX_SIZE+4);
++ buffer = (unsigned char *) malloc(MAX_SIZE+4);
++ p = (int *) buffer;
+ if (!buffer) {
+ fprintf(stderr, "cannot get %d byte memory\n", MAX_SIZE+4);
+ exit(-1);
+diff -Naur isdn4k-utils-orig//hisax/Makefile.in isdn4k-utils/hisax/Makefile.in
+--- isdn4k-utils-orig//hisax/Makefile.in 2002-07-20 05:03:51.000000000 +1000
++++ isdn4k-utils/hisax/Makefile.in 2010-12-04 20:44:03.726672225 +1000
+@@ -30,7 +30,7 @@
+ #.SUFFIXES:
+ #.SUFFIXES: .c .o
+
+-%.8: %.man
++%.8: %.man.in
+ cp $< $@
+
+ all: $(PROGRAMS) $(MANPAGES)
+diff -Naur isdn4k-utils-orig//ipppd/main.c isdn4k-utils/ipppd/main.c
+--- isdn4k-utils-orig//ipppd/main.c 2002-07-18 10:06:21.000000000 +1000
++++ isdn4k-utils/ipppd/main.c 2010-12-04 20:44:11.093338893 +1000
+@@ -1041,9 +1041,14 @@
+ static char line[256]; /* line to be logged accumulated here */
+ static char *linep;
+
++#ifdef __STDC__
++static void pr_log(void *arg, char *fmt, ...);
++#else /* __STDC__ */
++static void pr_log(arg, fmt, va_alist);
++#endif
++
+ void log_packet(u_char *p,int len,char *prefix,int linkunit)
+ {
+- static void pr_log __P((void *, char *, ...));
+
+ int i, n;
+ u_short proto;
+diff -Naur isdn4k-utils-orig//ipppd/options.c isdn4k-utils/ipppd/options.c
+--- isdn4k-utils-orig//ipppd/options.c 2002-07-06 10:34:08.000000000 +1000
++++ isdn4k-utils/ipppd/options.c 2010-12-04 20:43:57.890005560 +1000
+@@ -479,26 +479,24 @@
+ #define IMPLEMENTATION ""
+ #endif
+
+-static char *usage_string = "\
+-ipppd version %s patch level %d%s\n\
+-Usage: %s [ options ], where options are:\n\
+-\t<device> Communicate over the named device\n\
++static char *usage_string = "ipppd version %s patch level %d%s\n"
++"Usage: %s [ options ], where options are:\n"
++"\t<device> Communicate over the named device\n"
+ #ifdef INCLUDE_OBSOLETE_FEATURES
+-\tcrtscts Use hardware RTS/CTS flow control\n\
+-\t<speed> Set the baud rate to <speed>\n\
+-\tmodem Use modem control lines\n\
++"\tcrtscts Use hardware RTS/CTS flow control\n"
++"\t<speed> Set the baud rate to <speed>\n"
++"\tmodem Use modem control lines\n"
+ #endif
+-\t<loc>:<rem> Set the local and/or remote interface IP\n\
+-\t\taddresses. (you also may use the option 'useifip' to get IPs).\n\
+-\tasyncmap <n> Set the desired async map to hex <n>\n\
+-\tauth Require authentication from peer\n\
+-\tconnect <p> Invoke shell command <p> to set up the serial line\n\
+-\tdefaultroute Add default route through interface\n\
+-\tfile <f> Take options from file <f>\n\
+-\tmru <n> Set MRU value to <n> for negotiation\n\
+-\tnetmask <n> Set interface netmask to <n>\n\
+-See ipppd(8) for more options.\n\
+-";
++"\t<loc>:<rem> Set the local and/or remote interface IP\n"
++"\t\t\taddresses. (you also may use the option 'useifip' to get IPs).\n"
++"\tasyncmap <n> Set the desired async map to hex <n>\n"
++"\tauth Require authentication from peer\n"
++"\tconnect <p> Invoke shell command <p> to set up the serial line\n"
++"\tdefaultroute Add default route through interface\n"
++"\tfile <f> Take options from file <f>\n"
++"\tmru <n> Set MRU value to <n> for negotiation\n"
++"\tnetmask <n> Set interface netmask to <n>\n"
++"See ipppd(8) for more options.\n";
+
+ static char *current_option; /* the name of the option being parsed */
+
+diff -Naur isdn4k-utils-orig//isdnlog/isdnlog/isdnlog.h isdn4k-utils/isdnlog/isdnlog/isdnlog.h
+--- isdn4k-utils-orig//isdnlog/isdnlog/isdnlog.h 2001-06-22 02:34:56.000000000 +1000
++++ isdn4k-utils/isdnlog/isdnlog/isdnlog.h 2010-12-04 20:44:03.780005559 +1000
+@@ -460,7 +460,7 @@
+
+ _EXTERN void dotrace(void);
+ _EXTERN int morectrl(int card);
+-_EXTERN void moreinfo(void);
++extern void moreinfo(void);
+ _EXTERN void morekbd(void);
+ _EXTERN void processcint(void);
+ _EXTERN void processflow(void);
+diff -Naur isdn4k-utils-orig//isdnlog/isdnlog/processor.c isdn4k-utils/isdnlog/isdnlog/processor.c
+--- isdn4k-utils-orig//isdnlog/isdnlog/processor.c 2002-04-02 04:06:10.000000000 +1000
++++ isdn4k-utils/isdnlog/isdnlog/processor.c 2010-12-04 20:44:03.783338893 +1000
+@@ -5293,7 +5293,7 @@
+ tei = BROADCAST; /* Wenn nach einer tei-Zeile keine hex:-Zeile kommt, tei ungueltig machen! */
+
+ if ((type == SETUP) && !replay) { /* fetch additional info from "/dev/isdninfo" */
+- static void moreinfo(); /* soviel zu Objektorientiertem Denken ;-) */
++ /*static void moreinfo(); */ /* soviel zu Objektorientiertem Denken ;-) */
+ moreinfo();
+ } /* if */
+
+diff -Naur isdn4k-utils-orig//isdnlog/Makefile.in isdn4k-utils/isdnlog/Makefile.in
+--- isdn4k-utils-orig//isdnlog/Makefile.in 2002-07-20 05:03:55.000000000 +1000
++++ isdn4k-utils/isdnlog/Makefile.in 2010-12-04 20:44:03.730005560 +1000
+@@ -1842,9 +1842,6 @@
+ $(INSTALL_DATA) $$f $(DESTDIR)$(DATADIR); \
+ echo Installing $(DESTDIR)$(DATADIR)/$$f; \
+ done
+- @(grep isdnlog $(SERVICEFILE) >/dev/null) || \
+- (echo "";echo "";echo "Add a line to the file $(SERVICEFILE)" ;echo "";echo ""; \
+- echo "isdnlog $(SERV_PORT)/tcp isdnlog" >> $(SERVICEFILE))
+
+ install-strip:
+ $(MAKE) INSTALL_BIN='$(INSTALL_BIN) -s' \
+diff -Naur isdn4k-utils-orig//isdnlog/tools/cdb/cdbmake.c isdn4k-utils/isdnlog/tools/cdb/cdbmake.c
+--- isdn4k-utils-orig//isdnlog/tools/cdb/cdbmake.c 2002-02-22 21:10:25.000000000 +1000
++++ isdn4k-utils/isdnlog/tools/cdb/cdbmake.c 2010-12-04 20:44:03.786672226 +1000
+@@ -3,8 +3,6 @@
+ #include "freecdbmake.h"
+ #include <unistd.h>
+
+-extern char *malloc();
+-
+ void diesys(why) char *why; { perror(why); exit(111); }
+
+ void writeerror() { diesys("cdbmake: fatal: unable to write"); }
+diff -Naur isdn4k-utils-orig//isdnlog/tools/isdnrate.c isdn4k-utils/isdnlog/tools/isdnrate.c
+--- isdn4k-utils-orig//isdnlog/tools/isdnrate.c 2001-06-22 02:34:56.000000000 +1000
++++ isdn4k-utils/isdnlog/tools/isdnrate.c 2010-12-04 20:44:11.096672226 +1000
+@@ -304,7 +304,7 @@
+
+ static void print_header(void);
+
+-static char *myname, *myshortname;
++char *myname, *myshortname;
+ static char options[] = "ab:d:f:h:l:op:st:v::x:CD::G:HLNP:O:S:TUVX::Z";
+ static char usage[] = "%s: usage: %s [ -%s ] Destination ...\n";
+
+@@ -313,7 +313,7 @@
+ static int usestat = 0;
+ static int duration = LCR_DURATION;
+ static time_t start;
+-static int day, month, year, hour, min, sec;
++int day, month, year, hour, min, sec;
+ static char ignore[MAXPROVIDER];
+ static char *fromarea = 0;
+ static char wanted_day;
+diff -Naur isdn4k-utils-orig//isdnlog/tools/isdnrate.c.orig isdn4k-utils/isdnlog/tools/isdnrate.c.orig
+--- isdn4k-utils-orig//isdnlog/tools/isdnrate.c.orig 1970-01-01 10:00:00.000000000 +1000
++++ isdn4k-utils/isdnlog/tools/isdnrate.c.orig 2001-06-22 02:34:56.000000000 +1000
+@@ -0,0 +1,1806 @@
++/* $Id: isdnrate.c,v 1.38 2001/03/01 14:59:16 paul Exp $
++
++ * ISDN accounting for isdn4linux. (rate evaluation)
++ *
++ * Copyright 1995 .. 2000 by Andreas Kool (akool@isdn4linux.de)
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ * $Log: isdnrate.c,v $
++ * Revision 1.38 2001/03/01 14:59:16 paul
++ * Various patches to fix errors when using the newest glibc,
++ * replaced use of insecure tempnam() function
++ * and to remove warnings etc.
++ *
++ * Revision 1.37 2000/07/17 16:34:23 akool
++ * isdnlog-4.32
++ * - added new Prefixes 0160 (D1) and 0162 (D2) to "country-de.dat"
++ * - corrected all german mobil phone numbers (many thank's to
++ * Tobias Becker <i4l-projects@talypso.de> for the tool "fix_rates.pl")
++ * - isdnlog/tools/rate.c ... New R:-tag
++ * - isdnlog/tools/isdnrate.c ... print warnings from getRate if verbose
++ * - isdnlog/tools/rate-files.man ... New R:-tag
++ * - isdnlog/tools/NEWS ... New R:-tag
++ * - isdnlog/README ... New R:-tag
++ * - isdnlog/samples/rtest.dat ... example rate-file for testing R:
++ *
++ * Revision 1.36 2000/03/09 18:50:03 akool
++ * isdnlog-4.16
++ * - isdnlog/samples/isdn.conf.no ... changed VBN
++ * - isdnlog/isdnlog/isdnlog.c .. ciInterval
++ * - isdnlog/isdnlog/processor.c .. ciInterval
++ * - isdnlog/tools/tools.h .. ciInterval, abclcr conf option
++ * - isdnlog/tools/isdnconf.c .. ciInterval, abclcr conf option
++ * - isdnlog/tools/isdnrate.c .. removed a warning
++ * - isdnlog/NEWS ... updated
++ * - isdnlog/README ... updated
++ * - isdnlog/isdnlog/isdnlog.8.in ... updated
++ * - isdnlog/isdnlog/isdnlog.5.in ... updated
++ * - isdnlog/samples/provider ... NEW
++ *
++ * ==> Please run a make clean, and be sure to read isdnlog/NEWS for changes
++ * ==> and new features.
++ *
++ * Revision 1.35 2000/03/06 07:03:21 akool
++ * isdnlog-4.15
++ * - isdnlog/tools/tools.h ... moved one_call, sum_calls to isdnrep.h
++ * ==> DO A 'make clean' PLEASE
++ * - isdnlog/tools/telnum.c ... fixed a small typo
++ * - isdnlog/isdnrep/rep_main.c ... incl. dest.h
++ * - isdnlog/isdnrep/isdnrep.c ... fixed %l, %L
++ * - isdnlog/isdnrep/isdnrep.h ... struct one_call, sum_calls are now here
++ *
++ * Support for Norway added. Many thanks to Tore Ferner <torfer@pvv.org>
++ * - isdnlog/rate-no.dat ... NEW
++ * - isdnlog/holiday-no.dat ... NEW
++ * - isdnlog/samples/isdn.conf.no ... NEW
++ * - isdnlog/samples/rate.conf.no ... NEW
++ *
++ * Revision 1.34 2000/02/28 19:53:56 akool
++ * isdnlog-4.14
++ * - Patch from Roland Rosenfeld <roland@spinnaker.de> fix for isdnrep
++ * - isdnlog/tools/rate.c ... epnum
++ * - isdnlog/tools/rate-at.c ... new rates
++ * - isdnlog/rate-at.dat
++ * - isdnlog/tools/rate-files.man ... %.3f
++ * - doc/Configure.help ... unknown cc
++ * - isdnlog/configure.in ... unknown cc
++ * - isdnlog/.Config.in ... unknown cc
++ * - isdnlog/Makefile.in ... unknown cc
++ * - isdnlog/tools/dest/Makefile.in ... LANG => DEST_LANG
++ * - isdnlog/samples/rate.conf.pl ... NEW
++ * - isdnlog/samples/isdn.conf.pl ... NEW
++ * - isdnlog/rate-pl.dat ... NEW
++ * - isdnlog/tools/isdnrate.c ... fixed -P pid_dir, restarts on HUP now
++ * - isdnlog/tools/isdnrate.man ... SIGHUP documented
++ *
++ * Revision 1.33 2000/02/12 16:40:24 akool
++ * isdnlog-4.11
++ * - isdnlog/Makefile.in ... sep install-targets, installs samples, no isdnconf
++ * - isdnlog/samples/rate.conf.{lu,nl} ... NEW
++ * - isdnlog/samples/isdn.conf.lu ... chg provider
++ * - isdnlog/samples/stop ... chg \d,\d => \d.\d
++ * - isdnlog/samples/isdnlog.isdnctrl0.options ... NEW
++ * - isdnlog/samples/isdnlog.users ... NEW
++ * - isdnlog/country-de.dat ... _DEMF again
++ * - isdnlog/isdnlog/processor.c ... LCR
++ * - isdnlog/tools/isdnrate.c ... fmt of s
++ *
++ * Old config is not installed anymore, to acomplish this do
++ *
++ * make install-old-conf
++ * make install
++ *
++ * A running isdnlog is now HUP-ed not KILL-ed
++ *
++ * Revision 1.32 2000/02/03 18:24:51 akool
++ * isdnlog-4.08
++ * isdnlog/tools/rate.c ... LCR patch again
++ * isdnlog/tools/isdnrate.c ... LCR patch again
++ * isdnbill enhanced/fixed
++ * DTAG AktivPlus fixed
++ *
++ * Revision 1.31 1999/12/31 13:57:20 akool
++ * isdnlog-4.00 (Millenium-Edition)
++ * - Oracle support added by Jan Bolt (Jan.Bolt@t-online.de)
++ * - resolved *any* warnings against rate-de.dat
++ * - Many new rates
++ * - CREDITS file added
++ *
++ * Revision 1.30 1999/12/24 14:17:05 akool
++ * isdnlog-3.81
++ * - isdnlog/tools/NEWS
++ * - isdnlog/tools/telrate/info.html.in ... bugfix
++ * - isdnlog/tools/telrate/telrate.cgi.in ... new Service query
++ * - isdnlog/tools/telrate/Makefile.in ... moved tmp below telrate
++ * - isdnlog/samples/rate.conf.at ... fixed
++ * - isdnlog/tools/rate-at.c ... some changes
++ * - isdnlog/rate-at.dat ... ditto
++ * - isdnlog/tools/Makefile ... added path to pp_rate
++ * - isdnlog/tools/rate.{c,h} ... getServiceNames, Date-Range in T:-Tag
++ * - isdnlog/tools/isdnrate.c ... fixed sorting of services, -X52 rets service names
++ * - isdnlog/tools/rate-files.man ... Date-Range in T:-Tag, moved from doc
++ * - isdnlog/tools/isdnrate.man ... moved from doc
++ * - doc/Makefile.in ... moved man's from doc to tools
++ * - isdnlog/Makefile.in ... man's, install isdn.conf.5
++ * - isdnlog/configure{,.in} ... sed, awk for man's
++ * - isdnlog/tools/zone/Makefile.in ... dataclean
++ * - isdnlog/tools/dest/Makefile.in ... dataclean
++ * - isdnlog/isdnlog/isdnlog.8.in ... upd
++ * - isdnlog/isdnlog/isdn.conf.5.in ... upd
++ *
++ * Revision 1.29 1999/12/17 22:51:55 akool
++ * isdnlog-3.79
++ * - isdnlog/isdnrep/isdnrep.{c,h} ... error -handling, print_msg
++ * - isdnlog/isdnrep/rep_main.c
++ * - isdnlog/isdnrep/isdnrep.1.in
++ * - isdnlog/tools/rate.c ... dupl entry in rate.conf
++ * - isdnlog/tools/NEWS
++ * - isdnlog/tools/isdnrate.c
++ * - isdnlog/tools/dest/configure{,.in}
++ * - isdnlog/tools/zone/configure{,.in}
++ *
++ * Revision 1.28 1999/12/16 23:08:28 akool
++ * isdnlog-3.78
++ * - isdnlog/tools/isdnrate.c ... new sOcket option
++ * - isdnlog/tools/NEWS ... new sOcket option
++ * - doc/isdnrate.man ... ditto
++ * - isdnlog/tools/telrate/config.in ... ditto
++ * - isdnlog/tools/telrate/telrate.cgi.in ... ditto
++ * - isdnlog/tools/telrate/README-telrate ditto
++ *
++ * Revision 1.27 1999/12/02 19:28:02 akool
++ * isdnlog-3.73
++ * - isdnlog/tools/telrate/telrate.cgi.in faster
++ * - doc/isdnrate.man ... -P
++ * - isdnlog/tools/isdnrate.c ... -P
++ * - isdnlog/tools/NEWS ... -P
++ * - isdnlog/tools/rate-at.c ... 194040
++ * - isdnlog/rate-at.dat
++ * - isdnlog/tools/rate.c ... SIGSEGV
++ *
++ * Revision 1.26 1999/12/01 21:47:25 akool
++ * isdnlog-3.72
++ * - new rates for 01051
++ * - next version of isdnbill
++ *
++ * - isdnlog/tools/telnum.c ... cleanup
++ * - isdnlog/tools/isdnrate.c ... -s Service
++ * - isdnlog/tools/rate.{c,h} ... -s
++ * - isdnlog/tools/NEWS ... -s
++ * - doc/isdnrate.man .. updated -o, -s
++ * - doc/rate-files.man ... updated
++ * - isdnlog/tools/dest/README.makedest ... updt.
++ * - isdnlog/isdnlog/isdnlog.8.in .. updt.
++ *
++ * Telrate
++ * - isdnlog/tools/telrate/README-telrate
++ * - isdnlog/tools/telrate/config.in NEW
++ * - isdnlog/tools/telrate/configure NEW
++ * - isdnlog/tools/telrate/Makefile.in NEW
++ * - isdnlog/tools/telrate/index.html.in was index.html
++ * - isdnlog/tools/telrate/info.html.in was info.html
++ * - isdnlog/tools/telrate/telrate.cgi.in was telrate.cgi
++ * - isdnlog/tools/telrate/leo.sample NEW sample config
++ * - isdnlog/tools/telrate/alex.sample NEW sample config
++ *
++ * Revision 1.25 1999/11/08 21:09:41 akool
++ * isdnlog-3.65
++ * - added "B:" Tag to "rate-xx.dat"
++ *
++ * Revision 1.24 1999/11/07 13:29:28 akool
++ * isdnlog-3.64
++ * - new "Sonderrufnummern" handling
++ *
++ * Revision 1.22 1999/10/26 18:17:14 akool
++ * isdnlog-3.62
++ * - many new rates
++ * - next try to fix "Sonderrufnummern"
++ *
++ * isdnlog-3.58
++ * - big cleanup ( > 1.3 Mb removed!)
++ * - v0.02 of destination support - better, but not perfect
++ * (does't work with gcc-2.7.2.3 yet - use egcs!)
++ *
++ * Revision 1.21 1999/10/25 18:30:03 akool
++ * isdnlog-3.57
++ * WARNING: Experimental version!
++ * Please use isdnlog-3.56 for production systems!
++ *
++ * Revision 1.20 1999/09/19 14:16:27 akool
++ * isdnlog-3.53
++ *
++ * Revision 1.19 1999/09/16 20:27:21 akool
++ * isdnlog-3.52
++ *
++ * Revision 1.18 1999/09/13 09:09:44 akool
++ * isdnlog-3.51
++ * - changed getProvider() to not return NULL on unknown providers
++ * many thanks to Matthias Eder <mateder@netway.at>
++ * - corrected zone-processing when doing a internal -> world call
++ *
++ * Revision 1.17 1999/09/09 11:21:05 akool
++ * isdnlog-3.49
++ *
++ * Revision 1.16 1999/08/04 23:06:52 akool
++ * Better codeall for .at
++ *
++ * Revision 1.15 1999/07/31 09:25:36 akool
++ * getRate() speedup
++ *
++ * Revision 1.14 1999/07/26 16:28:41 akool
++ * getRate() speedup from Leo
++ *
++ * Revision 1.13 1999/07/25 15:57:46 akool
++ * isdnlog-3.43
++ * added "telnum" module
++ *
++ * Revision 1.12 1999/07/24 08:45:17 akool
++ * isdnlog-3.42
++ * rate-de.dat 1.02-Germany [18-Jul-1999 10:44:21]
++ * better Support for Ackermann Euracom
++ * WEB-Interface for isdnrate
++ * many small fixes
++ *
++ * Revision 1.11 1999/07/15 16:42:04 akool
++ * small enhancement's and fixes
++ *
++ * Revision 1.10 1999/07/07 19:44:07 akool
++ * patches from Michael and Leo
++ *
++ * Revision 1.9 1999/07/04 20:47:05 akool
++ * rate-de.dat V:1.02-Germany [04-Jul-1999 22:56:37]
++ *
++ * Revision 1.8 1999/07/03 10:24:14 akool
++ * fixed Makefile
++ *
++ * Revision 1.7 1999/07/02 19:18:00 akool
++ * rate-de.dat V:1.02-Germany [02-Jul-1999 21:27:20]
++ *
++ * Revision 1.6 1999/07/02 18:20:50 akool
++ * rate-de.dat V:1.02-Germany [02-Jul-1999 20:29:21]
++ * country-de.dat V:1.02-Germany [02-Jul-1999 19:13:54]
++ *
++ * Revision 1.5 1999/07/01 20:40:07 akool
++ * isdnrate optimized
++ *
++ * Revision 1.4 1999/06/30 20:53:28 akool
++ * added "-t" option to "isdnrate"
++ *
++ * Revision 1.3 1999/06/30 17:17:37 akool
++ * isdnlog Version 3.39
++ *
++ * Revision 1.2 1999/06/29 20:11:25 akool
++ * now compiles with ndbm
++ * (many thanks to Nima <nima_ghasseminejad@public.uni-hamburg.de>)
++ *
++ * Revision 1.1 1999/06/28 19:16:33 akool
++ * isdnlog Version 3.38
++ * - new utility "isdnrate" started
++ *
++ */
++
++#include "isdnlog.h"
++#include "tools/zone.h"
++#include <unistd.h>
++#include "dest.h"
++
++#define WIDTH 19
++#define _MAXLAST 20 /* the real max */
++#define MAXLAST ((best>=_MAXLAST||best<=2)?5:best)
++
++
++static void print_header(void);
++
++static char *myname, *myshortname;
++static char options[] = "ab:d:f:h:l:op:st:v::x:CD::G:HLNP:O:S:TUVX::Z";
++static char usage[] = "%s: usage: %s [ -%s ] Destination ...\n";
++
++static int header = 0, best = MAXPROVIDER, table = 0, explain = 0;
++int verbose = 0;
++static int usestat = 0;
++static int duration = LCR_DURATION;
++static time_t start;
++static int day, month, year, hour, min, sec;
++static char ignore[MAXPROVIDER];
++static char *fromarea = 0;
++static char wanted_day;
++static int list = 0;
++static char *comment;
++static char **providers = 0; /* incl these */
++static int n_providers = 0;
++static int business = 0;
++static char **xproviders = 0; /* excl these */
++static int nx_providers = 0;
++static int xbusiness = 0;
++static int all = 0;
++static int booked = 0;
++static int service = 0;
++
++#define SOCKNAME "/tmp/isdnrate"
++static int is_daemon = 0;
++static int is_client = 0;
++static int we_are_daemon = 0;
++static int takt = 99999;
++static char sortby;
++static int need_dest;
++static int h_param = 0;
++static int lcr = 0;
++static TELNUM srcnum, destnum;
++static char *pid_dir = 0;
++static char *pid_file = 0;
++static char *socket_file = 0;
++static char **hup_argv; /* args to restart with */
++
++typedef struct {
++ int prefix;
++ double rate;
++ char *name;
++ char *explain;
++} SORT;
++
++typedef struct {
++ int weight;
++ int index;
++} SORT2;
++
++static SORT sort[MAXPROVIDER];
++
++#undef MAXPROVIDER
++#define MAXPROVIDER getNProvider()
++
++#undef BUFSIZ /* sorry but 8192 is too much for me */
++#define BUFSIZ 256
++
++int print_msg(int Level, const char *fmt,...)
++{
++ auto va_list ap;
++ auto char String[BUFSIZ * 3];
++
++ if ((Level > PRT_ERR && !verbose) || (Level > PRT_WARN && verbose < 2))
++ return (1);
++
++ va_start(ap, fmt);
++ (void) vsnprintf(String, BUFSIZ * 3, fmt, ap);
++ va_end(ap);
++
++ fprintf(stderr, "%s", String);
++
++ return (0);
++} /* print_msg */
++
++
++static void init()
++{
++ auto char *version, **message;
++
++ if (readconfig(myshortname) < 0)
++ exit(1);
++
++ if (verbose)
++ message = &version;
++ else
++ message = NULL;
++
++ initHoliday(holifile, message);
++
++ if (verbose && *version)
++ print_msg(PRT_V, "%s\n", version);
++ initDest(destfile, message);
++ if (verbose && *version)
++ print_msg(PRT_V, "%s\n", version);
++
++ initRate(rateconf, ratefile, zonefile, message);
++
++ if (verbose && *version)
++ print_msg(PRT_V, "%s\n", version);
++
++} /* init */
++
++#if 0
++static void deinit(void)
++{
++ exitRate();
++ exitDest();
++ exitHoliday();
++}
++#endif
++
++/* calc a day/time W | E | H */
++static void get_day(char d)
++{
++ struct tm *tm;
++ bitfield mask;
++ int what = 0;
++
++ tm = localtime(&start); /* now */
++ switch (d) {
++ case 'W': /* we need a normal weekday, so we take
++ today and inc. day if today is
++ holiday */
++ what = WORKDAY;
++ if (!h_param)
++ hour = 10;
++ break;
++ case 'N':
++ what = WORKDAY;
++ if (!h_param)
++ hour = 23;
++ break;
++ case 'E':
++ what = SUNDAY;
++ if (!h_param)
++ hour = 10;
++ break;
++ }
++ mask = 1 << what;
++ while (isDay(tm, mask, 0) != what) {
++ tm->tm_mday++;
++ }
++ min = sec = 0;
++ day = tm->tm_mday;
++ month = tm->tm_mon + 1;
++ year = tm->tm_year + 1900;
++}
++
++static void post_init()
++{
++
++ clearNum(&srcnum);
++ if (fromarea) {
++ Strncpy(srcnum.area, fromarea, TN_MAX_AREA_LEN);
++ free(fromarea);
++ fromarea = 0;
++ }
++ initNum(&srcnum);
++
++ if (wanted_day)
++ get_day(wanted_day);
++} /* post_init */
++
++static int opts(int argc, char *argv[])
++{
++ register int c;
++ register char *p;
++ int x;
++
++ h_param = 0;
++
++ optind = 0; /* make it repeatable */
++ need_dest = 1;
++ while ((c = getopt(argc, argv, options)) != EOF) {
++ switch (c) {
++ case 'a': /* all rates old/newer */
++ all++;
++ break;
++ case 'b':
++ best = strtol(optarg, NIL, 0);
++ break;
++
++/* case 'c': country */
++ break;
++
++ case 'd':
++ for (p = optarg; *p && isspace(*p); p++) ;
++ if (isdigit(*p)) {
++ wanted_day = '\0';
++ day = atoi(optarg);
++ if ((p = strchr(optarg, '.'))) {
++ month = atoi(p + 1);
++ if ((p = strchr(p + 1, '.'))) {
++ year = atoi(p + 1);
++ if (year < 50)
++ year += 2000;
++ else if (year < 100)
++ year += 1900;
++ }
++ }
++ } /* isdigit */
++ else {
++ wanted_day = *p;
++ }
++ break;
++
++ case 'f':
++ if (optarg) { /* from */
++ for (p = optarg; (isspace(*p) || *p == '0') && *p; p++) ;
++ fromarea = strdup(p);
++ }
++ break;
++
++ case 'h':
++ hour = atoi(optarg);
++ h_param++;
++ sec = 0;
++ if ((p = strchr(optarg + 1, ':'))) {
++ min = atoi(p + 1);
++ if ((p = strchr(p + 1, ':')))
++ sec = atoi(p + 1);
++ }
++ else
++ min = 0;
++ break;
++
++ case 'l':
++ duration = strtol(optarg, NIL, 0); /* l wie lt */
++ break;
++
++ case 'o': /* booked only */
++ booked++;
++ break;
++
++ case 's': /* service */
++ service++;
++ break;
++
++ case 't':
++ x = strtol(optarg, NIL, 0);
++ if (x > 0)
++ takt = x;
++ break;
++
++ case 'x': /* eXclude Poviders */
++ {
++ char *arg = strdup(optarg);
++
++ p = strtok(arg, ",");
++ while (p) {
++ if (*p == 'B') { /* Business Provider */
++ xbusiness = 1;
++ p = strtok(0, ",");
++ continue;
++ }
++ xproviders = realloc(xproviders, (nx_providers + 1) * sizeof(char *));
++
++ xproviders[nx_providers] = strdup(p);
++ p = strtok(0, ",");
++ nx_providers++;
++ }
++ free(arg);
++ }
++ break;
++
++ case 'p': /* Providers ... */
++ {
++ char *arg = strdup(optarg);
++
++ p = strtok(arg, ",");
++ while (p) {
++ if (*p == 'B') { /* Business Provider */
++ business = 1;
++ p = strtok(0, ",");
++ continue;
++ }
++ providers = realloc(providers, (n_providers + 1) * sizeof(char *));
++
++ providers[n_providers] = strdup(p);
++ p = strtok(0, ",");
++ n_providers++;
++ }
++ free(arg);
++ }
++ break;
++
++ case 'v':
++ verbose++;
++ if (optarg && (x = atoi(optarg)))
++ verbose = x;
++ break;
++/* Uppercase options are for output format */
++
++ case 'C':
++ is_client = 1;
++ break;
++
++ case 'D':
++ is_daemon = 1;
++ need_dest = 0;
++ if (optarg) {
++ x = atoi(optarg);
++ is_daemon = x;
++ if (we_are_daemon && x == 3) {
++ kill(getppid(), SIGTERM);
++ exit(EXIT_SUCCESS);
++ }
++ }
++ break;
++
++ case 'G':
++ explain = atoi(optarg);
++ break;
++ case 'H':
++ header++;
++ break;
++ case 'L':
++ list++;
++ explain = 9;
++ break;
++ case 'N':
++ explain = 55;
++ break;
++ case 'P':
++ pid_dir = strdup(optarg);
++ break;
++ case 'O':
++ free(socket_file);
++ socket_file = strdup(optarg);
++ break;
++ case 'S':
++ sortby = *optarg;
++ break;
++ case 'T':
++ table++;
++ break;
++/* Fixme: check/warn illegal kombinations of options */
++ case 'U':
++ usestat++;
++ break;
++
++ case 'V':
++ print_version(myshortname);
++ exit(0);
++
++ case 'X':
++ if (explain == 0) {
++ explain++;
++ if (optarg && isdigit(*optarg) && (x = atoi(optarg))) {
++ explain = x;
++ if (x == 50 || x == 51 || x == 52)
++ need_dest = 0;
++ }
++ else if (optarg) {
++ comment = strdup(optarg);
++ explain = 8;
++ need_dest = 0;
++ }
++ break;
++ }
++ /* fallthrough */
++ case '?':
++ print_msg(PRT_A, usage, myshortname, myshortname, options);
++ break;
++
++ case 'Z':
++ lcr++;
++ break;
++ } /* switch */
++ } /* while */
++ if (is_client && is_daemon != 3 && is_daemon) {
++ is_daemon = 0;
++ print_msg(PRT_V, "Conflicting options, -D disabled\n");
++ }
++ if (list && table) {
++ table = 0;
++ print_msg(PRT_V, "Conflicting options, -T disabled\n");
++ }
++ if (usestat && !table)
++ print_msg(PRT_V, "Conflicting options, -U ignored\n");
++ if ((list || table) && explain >= 10) {
++ list = table = 0;
++ print_msg(PRT_V, "Conflicting options, -T, -L disabled\n");
++ }
++ if (best < 1) {
++ best = MAXPROVIDER;
++ print_msg(PRT_V, "Illegal options, -b ignored\n");
++ }
++ if ((explain == 50 || explain == 51 || explain == 52) && header) {
++ print_msg(PRT_V, "Conflicting options, -H ignored\n");
++ }
++ if (explain >= 10 && service) {
++ print_msg(PRT_V, "Conflicting options, -s ignored\n");
++ service = 0;
++ }
++ if (argc > optind)
++ return (optind);
++ else
++ return (0);
++} /* opts */
++
++
++static int (*compare_func) (const void *s1, const void *s2);
++static int compare(const void *s1, const void *s2)
++{
++ return (((SORT *) s1)->rate > ((SORT *) s2)->rate);
++} /* compare */
++static int compare_vbn(const void *s1, const void *s2)
++{
++ return (((SORT *) s1)->prefix > ((SORT *) s2)->prefix);
++}
++static int compare_name(const void *s1, const void *s2)
++{
++ return strcasecmp(((SORT *) s1)->name, ((SORT *) s2)->name);
++}
++
++static int compare2(const void *s1, const void *s2)
++{
++ return (((SORT2 *) s1)->weight < ((SORT2 *) s2)->weight);
++} /* compare2 */
++
++char *short_explainRate(RATE * Rate)
++{
++
++ static char buffer[BUFSIZ];
++ char *p = buffer;
++
++ if (service && Rate->dst[1] && *Rate->dst[1])
++ p += sprintf(p, "%s, ", Rate->dst[1]);
++
++ if (Rate->Zone && *Rate->Zone)
++ p += sprintf(p, "%s", Rate->Zone);
++ else
++ p += sprintf(p, "Zone %d", Rate->zone);
++
++ if (!Rate->domestic && Rate->Country && *Rate->Country)
++ p += sprintf(p, " (%s)", Rate->Country);
++
++ if (Rate->Day && *Rate->Day)
++ p += sprintf(p, ", %s", Rate->Day);
++
++ if (Rate->Hour && *Rate->Hour)
++ p += sprintf(p, ", %s", Rate->Hour);
++
++ return buffer;
++}
++
++static char *printrate(RATE * Rate)
++{
++ static char message[BUFSIZ];
++
++ if (Rate->Basic > 0)
++ sprintf(message, "%s + %s/%.1fs = %s + %s/Min (%s)",
++ printRate(Rate->Basic),
++ printRate(Rate->Price),
++ Rate->Duration,
++ printRate(Rate->Basic),
++ printRate(60 * Rate->Price / Rate->Duration),
++ short_explainRate(Rate));
++ else
++ sprintf(message, "%s/%.1fs = %s/Min (%s)",
++ printRate(Rate->Price),
++ Rate->Duration,
++ printRate(60 * Rate->Price / Rate->Duration),
++ short_explainRate(Rate));
++
++ return (message);
++} /* printrate */
++
++
++static void buildtime()
++{
++ auto struct tm tm;
++
++ tm.tm_sec = sec;
++ tm.tm_min = min;
++ tm.tm_hour = hour;
++ tm.tm_mday = day;
++ tm.tm_mon = month - 1;
++ tm.tm_year = year - 1900; /* ja, ja, ich weiá ;-) */
++ tm.tm_isdst = -1;
++
++ start = mktime(&tm);
++} /* buildtime */
++
++
++static void splittime()
++{
++ auto struct tm *tm;
++
++ tm = localtime(&start);
++ sec = tm->tm_sec;
++ min = tm->tm_min;
++ hour = tm->tm_hour;
++ day = tm->tm_mday;
++ month = tm->tm_mon + 1;
++ year = tm->tm_year + 1900;
++} /* splittime */
++
++static char *Provider(int prefix)
++{
++ register char *p, *p1;
++ register int l;
++ static char s[BUFSIZ];
++ char prov[TN_MAX_PROVIDER_LEN];
++
++ if (prefix == UNKNOWN)
++ return ("?");
++
++ p = getProvider(prefix);
++
++ l = max(WIDTH, strlen(p)) - strlen(p);
++
++ p1 = prefix2provider_variant(prefix, prov);
++
++ l += (8 - strlen(p1));
++
++ sprintf(s, "%s:%s%*s", p1, p, l, "");
++
++ return (s);
++} /* Provider */
++
++static char *takt_str(RATE * Rate)
++{
++ static char s[BUFSIZ];
++
++ if (floor(Rate->Rhythm[0]) == Rate->Rhythm[0])
++ sprintf(s, "%.0f/", Rate->Rhythm[0]);
++ else
++ sprintf(s, "%.3f/", Rate->Rhythm[0]);
++ if (floor(Rate->Rhythm[1]) == Rate->Rhythm[1])
++ sprintf(s + strlen(s), "%.0f", Rate->Rhythm[1]);
++ else
++ sprintf(s + strlen(s), "%.3f", Rate->Rhythm[1]);
++ return s;
++}
++
++static inline char *P_EMPTY(char *s)
++{
++ char *p = s;
++
++ return p ? p : "";
++}
++
++#define DEL ';'
++static int compute(char *num)
++{
++ register int i, n = 0;
++ register int low = 0, high = MAXPROVIDER - 1;
++ auto RATE Rate;
++ auto char s[BUFSIZ];
++ struct tm *tm;
++ char prov[TN_MAX_PROVIDER_LEN];
++ int first = 1;
++ static char BUSINESS[] = "Business"; /* in C:GT:Tag */
++
++ if (destnum.nprovider != UNKNOWN) {
++ low = high = destnum.nprovider;
++ } /* if */
++ compare_func = compare;
++ switch (sortby) {
++ case 'v':
++ compare_func = compare_vbn;
++ break;
++ case 'n':
++ compare_func = compare_name;
++ break;
++ }
++
++ buildtime();
++ if (explain == 98 || explain == 97) { /* Minutenpreis fuer
++ diese Woche */
++ tm = localtime(&start);
++ tm->tm_hour = 0;
++ tm->tm_min = 1;
++ tm->tm_sec = 0;
++ start = mktime(tm);
++ if (explain == 98) {
++ while (tm->tm_wday) { /* find last monday */
++ start -= (60 * 60 * 24);
++ tm = localtime(&start);
++ } /* while */
++ start += (60 * 60 * 24);
++ }
++ }
++ if (service) {
++ num = getServiceNum(num);
++ if (!num || !*num) {
++ return 0;
++ }
++ }
++ do {
++ for (i = low; i <= high; i++) {
++ int found, p;
++ char *t;
++
++ if (ignore[i]) /* Fixme: */
++ continue;
++ if (booked && !isProviderBooked(i))
++ continue;
++ if (!all && !isProviderValid(i, start))
++ continue;
++ t = getProvider(i);
++ if (!t || t[strlen(t) - 1] == '?') /* UNKNOWN Provider */
++ continue;
++
++ t = getComment(i, "GT"); /* get Geb. Text comment */
++ if (business) { /* only business wanted */
++ if (t == 0)
++ continue;
++ else if (strstr(t, BUSINESS) == 0)
++ continue;
++ }
++ if (xbusiness) { /* no business wanted */
++ if (t && strstr(t, BUSINESS) > 0)
++ continue;
++ }
++ found = 0;
++ if (n_providers) {
++ for (p = 0; p < n_providers; p++)
++ if (pnum2prefix_variant(providers[p], start) == i) {
++ found = 1;
++ break;
++ }
++ if (!found)
++ continue;
++ }
++ if (nx_providers) {
++ for (p = 0; p < nx_providers; p++)
++ if (pnum2prefix_variant(xproviders[p], start) == i) {
++ found = 1;
++ break;
++ }
++ if (found)
++ continue;
++ }
++ clearRate(&Rate);
++ Rate.src[0] = srcnum.country;
++ Rate.src[1] = srcnum.area;
++ Rate.src[2] = "";
++
++ destnum.nprovider = i;
++ Strncpy(destnum.provider, getProvider(i), TN_MAX_PROVIDER_LEN);
++ if (normalizeNumber(num, &destnum, TN_ALL) == UNKNOWN) {
++ continue;
++ }
++
++ Rate.dst[0] = destnum.country;
++ Rate.dst[1] = destnum.area;
++ Rate.dst[2] = destnum.msn;
++ /* Rate.Service = "Internet by call"; */
++
++ Rate.prefix = i;
++
++ Rate.start = start;
++ Rate.now = start + duration - 1;
++ if (explain == 99) {
++ int j;
++ double oldCharge = -1.0;
++
++ if (first && header)
++ print_header();
++ first = 0;
++ printf("@ %s\n", prefix2provider_variant(Rate.prefix, prov));
++ Rate.now = start + 1;
++ for (j = 1; j < duration; j++) {
++ if (!getRate(&Rate, NULL) && (Rate.Price != 99.99)) {
++ if (Rate.Charge != oldCharge || j == duration - 1) {
++ printf("%d %.4f\n", j, Rate.Charge);
++ oldCharge = Rate.Charge;
++ }
++ }
++ else
++ break;
++ Rate.now++;
++ }
++ if (Rate.Duration <= takt)
++ printf("@----- %s %s\n", currency, Rate.Provider);
++ }
++ if (explain == 98 || explain == 97) { /* Minutenpreis fuer
++ diese Woche/Tag */
++ int j;
++
++ if (first && header)
++ print_header();
++ first = 0;
++ printf("@ %s\n", prefix2provider_variant(Rate.prefix, prov));
++ for (j = 0; j < (explain == 98 ? 7 * 24 : 24); j++) {
++ if (!getRate(&Rate, NULL) && (Rate.Price != 99.99)) {
++ printf("%d %.4f\n", j, Rate.Charge);
++ }
++ else
++ break;
++ Rate.now += 3600;
++ Rate.start += 3600;
++ }
++ if (Rate.Duration <= takt)
++ printf("@----- %s %s\n", currency, Rate.Provider);
++ }
++ else if (explain == 50 || explain == 51) {
++ int fi = 1;
++
++ while (getZoneRate(&Rate, explain - 50, fi) == 0) {
++ double cpm = Rate.Duration > 0 ? 60 * Rate.Price / Rate.Duration : 99.99;
++
++ if (Rate.Price == 0)
++ cpm = Rate.Basic;
++
++ fi = 0;
++ if (Rate.Price != 99.99)
++ printf("%s%c%s%c%s%c%.2f%c%.2f%c%s\n", prefix2provider(Rate.prefix, prov), DEL,
++ Rate.Provider, DEL, currency, DEL, Rate.Charge, DEL, cpm, DEL,
++ P_EMPTY(Rate.Country));
++ free(Rate.Country);
++ }
++ }
++ else {
++ /* kludge to suppress "impossible" Rates */
++ char **message, *msg;
++ if(verbose)
++ message = &msg;
++ else
++ message = NULL;
++ if (!getRate(&Rate, message) && (Rate.Price != 99.99)) {
++ if (!(Rate.Duration <= takt))
++ continue;
++ sort[n].prefix = Rate.prefix;
++ sort[n].rate = Rate.Charge;
++ sort[n].name = Rate.Provider;
++ switch (explain) {
++ case 1:
++ if (service)
++ sprintf(s, " (%s, %s)", P_EMPTY(Rate.dst[1]), Rate.Zone);
++ else
++ sprintf(s, " (%s)", Rate.Zone);
++ sort[n].explain = strdup(s);
++ break;
++ case 2:
++ sprintf(s, " (%s)", printrate(&Rate));
++ sort[n].explain = strdup(s);
++ break;
++ case 8:
++ sort[n].explain = strdup(P_EMPTY(getComment(i, comment)));
++ break;
++ case 9: /* used by list */
++ {
++ double cpm = Rate.Duration > 0 ? 60 * Rate.Price / Rate.Duration : 99.99;
++
++ if (Rate.Price == 0)
++ cpm = Rate.Basic;
++
++ sprintf(s, "%s%c"
++ "%s%c%s%c%s%c%s%c"
++ "%s%c"
++ "%.3f%c%.4f%c%.4f%c%.2f%c%.3f%c"
++ "%s%c%.2f",
++ prefix2provider_variant(Rate.prefix, prov), DEL,
++ Rate.Provider, DEL, P_EMPTY(Rate.Zone), DEL, P_EMPTY(Rate.Day), DEL, P_EMPTY(Rate.Hour), DEL,
++ currency, DEL, /* Fixme: global or per
++ Provider?? wg. EURO */
++ Rate.Charge, DEL, Rate.Basic, DEL, Rate.Price, DEL, Rate.Duration, DEL, cpm, DEL,
++ takt_str(&Rate), DEL, Rate.Sales);
++ sort[n].explain = strdup(s);
++ }
++ break;
++ default:
++ sort[n].explain = strdup("");
++ break;
++ }
++
++ n++;
++ } /* if */
++ else if(verbose && *msg)
++ print_msg(PRT_V, "%s\n", msg);
++
++ } /* else 99 */
++ } /* for i */
++ if (service)
++ num = getServiceNum(0); /* get next service num */
++ else
++ num = 0;
++ } while (num && *num);
++ if (explain < 10) {
++ qsort((void *) sort, n, sizeof(SORT), compare_func);
++ if (lcr && n) {
++ RATE Cheap;
++ int res = getLeastCost(&Rate, &Cheap, booked, -1);
++
++ if (res != UNKNOWN) {
++ sort[n].prefix = Cheap.prefix;
++ sort[n].rate = Cheap.Charge;
++ sort[n].name = Cheap.Provider;
++ sprintf(s, "(Cheapest: %s %s %s %s)", Cheap.dst[0], Cheap.dst[1], Cheap.dst[2], P_EMPTY(Cheap.Zone));
++ sort[n].explain = strdup(s);
++ n++;
++ } /* res */
++ } /* lcr */
++ } /* explain */
++ return (n);
++} /* compute */
++
++static void print_header(void)
++{
++ printf("Eine %d Sekunden lange Verbindung von %s nach %s kostet am %s\n",
++ duration, formatNumber("%F", &srcnum), formatNumber("%F", &destnum),
++ ctime(&start));
++}
++
++static void printList(int n)
++{
++ int i;
++
++ if (header)
++ print_header();
++ if (n > best)
++ n = best;
++
++ for (i = 0; i < n; i++)
++ printf("%s\n", sort[i].explain);
++}
++
++static void result(int n)
++{
++
++ register int i;
++
++ if (header)
++ print_header();
++
++ if (n > best)
++ n = best;
++ for (i = 0; i < n; i++)
++ printf("%s %s %8.3f %s\n",
++ Provider(sort[i].prefix), currency, sort[i].rate, sort[i].explain);
++} /* result */
++
++
++static void purge(int n)
++{
++ register int i;
++
++ for (i = 0; i < n; i++)
++ if (sort[i].explain)
++ free(sort[i].explain);
++} /* purge */
++
++/*
++ Werktag
++ Wochenende
++ Ortszone
++ Regionalzone
++ Fernzone
++ Handy
++ Internet
++ 0..23 Uhr
++ */
++
++#define STARTHOUR 8
++
++static void printTable(char *num)
++{
++ register int n, d, i, h, lasthour;
++ auto struct tm *tm;
++ auto SORT last[_MAXLAST];
++ auto int used[MAXPROVIDER];
++ auto int hours[MAXPROVIDER];
++ auto int weight[MAXPROVIDER];
++ auto int useds = 0, maxhour;
++ auto SORT2 wsort[MAXPROVIDER];
++ static int firsttime = 1;
++ int first;
++ int prefix;
++
++ memset(used, 0, sizeof(used));
++ memset(hours, 0, sizeof(hours));
++ memset(weight, 0, sizeof(weight));
++
++ for (d = 0; d < 3; d++) { /* Werktag, Samstag, Sonntag */
++ last[0].prefix = UNKNOWN;
++ lasthour = UNKNOWN;
++
++ buildtime();
++ tm = localtime(&start);
++
++ if (!d) { /* first time */
++ while (tm->tm_wday != 5) { /* find next Friday */
++ start += (60 * 60 * 24);
++ tm = localtime(&start);
++ } /* while */
++ }
++ else /* erst Samstag, dann */
++ start += (60 * 60 * 24); /* Sonntag */
++
++ splittime();
++ buildtime();
++
++ hour = STARTHOUR;
++ min = 0;
++
++ first = 1;
++
++ while (1) {
++ destnum.nprovider = UNKNOWN;
++ if (provider2prefix(num, &prefix)) /* set provider if it is in number */
++ normalizeNumber(num, &destnum, TN_PROVIDER);
++ n = compute(num);
++
++ if (header && first && d == 0 && firsttime)
++ print_header();
++
++ if (header && first) {
++ switch (d) {
++ case 0 : printf("\nWerktag:\n"); break;
++ case 1 : printf("\nSamstag:\n"); break;
++ case 2 : printf("\nSonntag:\n"); break;
++ } /* switch */
++
++ first = 0;
++ } /* if */
++
++ if (last[0].prefix == UNKNOWN) {
++ for (i = 0; i < min(n, MAXLAST); i++) {
++ if (sort[i].prefix) {
++ last[i].prefix = sort[i].prefix;
++ last[i].rate = sort[i].rate;
++ last[i].explain = strdup(sort[i].explain);
++ } /* if */
++ } /* for */
++ } /* if */
++
++ if (lasthour == UNKNOWN)
++ lasthour = hour;
++
++ if (sort[0].prefix != last[0].prefix) {
++ for (i = 0; i < min(n, MAXLAST); i++) {
++
++ if (!i)
++ printf(" %02d:00 .. %02d:59 %s = %s %s%s\n",
++ lasthour, hour - 1, Provider(last[i].prefix),
++ currency,
++ double2str(last[i].rate, 5, 3, DEB),
++ last[i].explain);
++ else
++ printf(" %s = %s %s%s\n",
++ Provider(last[i].prefix),
++ currency,
++ double2str(last[i].rate, 5, 3, DEB),
++ last[i].explain);
++ } /* for */
++
++ used[last[0].prefix]++;
++
++ if (lasthour >= hour)
++ h = ((24 - lasthour) + hour);
++ else
++ h = hour - lasthour;
++
++ hours[last[0].prefix] += h;
++
++ if ((lasthour > 8) && (lasthour < 21))
++ h *= 2;
++
++ weight[last[0].prefix] += h * (d ? 1 : 5);
++
++ for (i = 0; i < min(n, MAXLAST); i++) {
++ last[i].prefix = sort[i].prefix;
++ last[i].rate = sort[i].rate;
++ last[i].explain = strdup(sort[i].explain);
++ } /* for */
++
++ lasthour = hour;
++ } /* if */
++
++ purge(n);
++
++ hour++;
++
++ if (hour == 24)
++ hour = 0;
++ else if (hour == STARTHOUR)
++ break;
++ } /* while */
++
++ for (i = 0; i < min(n, MAXLAST); i++) {
++
++ if (!i) {
++ if ((lasthour == STARTHOUR) && (hour == STARTHOUR))
++ printf(" immer %s = %s %s%s\n",
++ Provider(last[i].prefix),
++ currency,
++ double2str(last[i].rate, 5, 3, DEB),
++ last[i].explain);
++ else
++ printf(" %02d:00 .. %02d:59 %s = %s %s%s\n",
++ lasthour, hour - 1, Provider(last[i].prefix),
++ currency,
++ double2str(last[i].rate, 5, 3, DEB),
++ last[i].explain);
++ }
++ else
++ printf(" %s = %s %s%s\n",
++ Provider(last[i].prefix),
++ currency,
++ double2str(last[i].rate, 5, 3, DEB),
++ last[i].explain);
++ } /* for */
++
++ used[last[0].prefix]++;
++
++ if (lasthour >= hour)
++ h = ((24 - lasthour) + hour);
++ else
++ h = hour - lasthour;
++
++ hours[last[0].prefix] += h;
++
++ if ((lasthour > 8) && (lasthour < 21))
++ h *= 2;
++
++ weight[last[0].prefix] += h * (d ? 1 : 5);
++
++ } /* for */
++
++ if (usestat) {
++ printf("\nProvider(s) used:\n");
++
++ maxhour = 9999999;
++ useds = 0;
++
++ for (i = 0; i < MAXPROVIDER; i++)
++ if (used[i]) {
++ printf("%s %d times, %d hours, weight = %d\n",
++ Provider(i), used[i], hours[i], weight[i]);
++
++ wsort[useds].weight = weight[i];
++ wsort[useds].index = i;
++
++ useds++;
++
++ if (hours[i] < maxhour)
++ maxhour = hours[i];
++ } /* if */
++
++ if ((best < MAXPROVIDER) && (best < useds)) {
++ printf("Retrying with only %d provider(s), eliminating %d provider(s)\n", best, useds - best);
++
++ qsort((void *) wsort, useds, sizeof(SORT2), compare2);
++
++ for (i = 0; i < useds; i++) {
++ printf("%s %d times, %d hours, weight = %d\n",
++ Provider(wsort[i].index), used[wsort[i].index], hours[wsort[i].index], weight[wsort[i].index]);
++
++ if (i == best - 1)
++ printf("\n");
++
++ if (i >= best - 1)
++ ignore[wsort[i].index]++;
++ } /* for */
++
++ if (firsttime)
++ printTable(num);
++
++ firsttime = 0;
++
++ } /* if */
++ } /* if */
++} /* printTable */
++
++
++static void clean_up()
++{
++ if (providers)
++ free(providers);
++ providers = 0;
++ fromarea = 0;
++ table = list = header = explain = 0;
++ usestat = 0;
++ duration = LCR_DURATION;
++ wanted_day = '\0';
++ takt = 99999;
++ if (comment)
++ free(comment);
++ comment = 0;
++ sortby = 0;
++ need_dest = 1;
++}
++
++static char * sub_sp(char *p)
++{
++ char *o = p;
++ int allupper=1;
++ for (; *p; p++)
++ if(!isupper(*p) && *p != '_' && !isdigit(*p)) { /* e.g. _DEMD1 */
++ allupper = 0;
++ break;
++ }
++ if (!allupper)
++ for (p = o; *p; p++)
++ if(*p == '_')
++ *p = ' ';
++ return o;
++}
++static void doit(int i, int argc, char *argv[])
++{
++ int n;
++ int prefix;
++ char *num;
++
++ post_init();
++ memset(ignore, 0, sizeof(ignore));
++ if (!need_dest && i == 0) {
++ i = 0;
++ argc = 1;
++ argv[0] = "2345";
++ }
++ while (i < argc) {
++ num = sub_sp(argv[i]);
++ if (explain == 55) {
++ if (n_providers) {
++ destnum.nprovider = pnum2prefix_variant(providers[0], 0);
++ Strncpy(destnum.provider, getProvider(destnum.nprovider), TN_MAX_PROVIDER_LEN);
++ normalizeNumber(num, &destnum, TN_NO_PROVIDER);
++ }
++ else
++ normalizeNumber(num, &destnum, TN_ALL);
++ printf("%s => %s \n", num, formatNumber("%l - %p", &destnum));
++ i++;
++ continue;
++ }
++ else if (explain == 52) { // enum Servce names
++
++ int first = 1;
++ char *p;
++
++ do {
++ p = getServiceNames(first);
++ if (p)
++ printf("%s\n", p);
++ first = 0;
++ }
++ while (p);
++ return;
++ }
++ destnum.nprovider = UNKNOWN;
++ if (provider2prefix(num, &prefix)) /* set provider if it is in
++ number */
++ normalizeNumber(num, &destnum, TN_PROVIDER);
++ if (table)
++ printTable(num);
++ else {
++ n = compute(num);
++ if (list)
++ printList(n);
++ else if (explain < 10)
++ result(n);
++ purge(n);
++ }
++ i++;
++ } /* while */
++ clean_up();
++}
++
++static void err(char *s)
++{
++ print_msg(PRT_A, "%s - '%s'\n", s, strerror(errno));
++ if (is_daemon == 2)
++ kill(getppid(), SIGTERM);
++ exit(2);
++}
++
++static int handle_client(int fd)
++{
++ char buffer[BUFSIZ];
++ int argc, n, i;
++ char **argv;
++ char *p;
++
++ if ((n = read(fd, buffer, BUFSIZ)) < 0)
++ err("Read");
++ if (n) {
++ argv = calloc(sizeof(char *), 20);
++
++ buffer[n] = '\0';
++ if (verbose)
++ fprintf(stderr, "got '%s'\n", buffer);
++ argc = 0;
++ argv[argc++] = strdup(myname);
++ p = strtok(buffer, "\t\n ");
++ while (p) {
++ argv[argc++] = strdup(p);
++ p = strtok(0, "\t\n ");
++ if (argc >= 20)
++ break;
++ }
++ time(&start); /* set time of call */
++ splittime(); /* date time my be overridden by opts */
++ we_are_daemon = 1;
++ if ((i = opts(argc, argv)) || need_dest == 0) {
++ if (shutdown(fd, 0) < 0) /* no read any more */
++ err("shutdown");
++ if (dup2(fd, STDOUT_FILENO) < 0) /* stdout to sock */
++ err("dup");
++ doit(i, argc, argv);
++ fflush(stdout);
++ fclose(stdout);
++ }
++ for (i = 0; i < argc; i++)
++ free(argv[i]);
++ free(argv);
++ }
++ return n == 0 ? -1 : 0;
++}
++
++void catch_sig(int sig)
++{
++ print_msg(PRT_A, "Signal %d\n", sig);
++ unlink(socket_file);
++ if (pid_dir)
++ unlink(pid_file);
++ err("Sig");
++}
++
++static void del_sock(void)
++{
++ if (getppid() > 0) {
++ unlink(socket_file);
++ if (pid_dir)
++ unlink(pid_file);
++ }
++}
++
++static volatile sig_atomic_t stopped = 0;
++static volatile sig_atomic_t reinit = 0;
++
++static void catch_term(int sig)
++{
++ stopped = 1;
++}
++
++static void catch_hup(int sig)
++{
++ print_msg(PRT_A, "Signal %d restarting %s\n", sig, myname);
++ del_sock();
++ execvp(myname, hup_argv);
++ print_msg(PRT_A, "- failed\n");
++}
++
++static void do_reinit(void)
++{
++ /* deinit(), init() doesn't */
++ reinit=0;
++}
++
++/* thank's to Jochen Erwied for this: */
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; })) \
++
++#endif
++
++static void setup_daemon()
++{
++ int sock;
++ struct sockaddr_un sa;
++ struct sockaddr_in client;
++ fd_set active_fd_set, read_fd_set;
++ char *sock_name = socket_file;
++ socklen_t size;
++ struct stat stat_buf;
++ int i;
++ pid_t pid;
++ char pidname[] = "isdnrate.pid";
++ FILE *fp;
++
++ if (verbose)
++ fprintf(stderr, "Setup sockets\n");
++ signal(SIGTERM, catch_term);
++ signal(SIGINT, catch_sig);
++ signal(SIGHUP, catch_hup);
++
++ if (is_daemon == 2) { /* go background */
++
++ fprintf(stderr, "Going background\n");
++ verbose = 0;
++ pid = fork();
++ if (pid < 0)
++ err("Going bg failed");
++ else if (pid > 0) {
++ exit(EXIT_SUCCESS);
++ }
++ }
++ if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
++ err("Can't open socket");
++ sa.sun_family = AF_UNIX;
++ strcpy(sa.sun_path, sock_name);
++ size = offsetof(struct sockaddr_un, sun_path) + strlen(sa.sun_path) + 1;
++
++ if (bind(sock, (struct sockaddr *) &sa, size) < 0)
++ err("Can't bind sock");
++
++ stat(sock_name, &stat_buf);
++ chmod(sock_name, stat_buf.st_mode | S_IWOTH | S_IWGRP);
++/* should better have perm wwwrun.nogroup */
++
++ if (listen(sock, SOMAXCONN) < 0)
++ err("Can't listen");
++ if (pid_dir) {
++ pid_file = malloc(strlen(pid_dir) + strlen(pidname) + 2);
++ strcpy(pid_file, pid_dir);
++ if (pid_file[strlen(pid_file) - 1] != '/')
++ strcat(pid_file, "/");
++ strcat(pid_file, pidname);
++ if ((fp = fopen(pid_file, "w")) == 0)
++ fprintf(stderr, "Can't write %s\n", pid_file);
++ else {
++ fprintf(fp, "%d\n", getpid());
++ fclose(fp);
++ }
++ }
++ atexit(del_sock);
++ FD_ZERO(&active_fd_set);
++ FD_SET(sock, &active_fd_set);
++ while (!stopped) {
++ if (reinit)
++ do_reinit();
++ read_fd_set = active_fd_set;
++ if (TEMP_FAILURE_RETRY(select(FD_SETSIZE, &read_fd_set, 0, 0, 0)) < 0)
++ err("select");
++ for (i = 0; i < FD_SETSIZE; i++)
++ if (FD_ISSET(i, &read_fd_set)) {
++ if (i == sock) { /* request on orig */
++ int new;
++
++ size = sizeof(client);
++ if ((new = accept(sock, (struct sockaddr *) &client, &size)) < 0)
++ err("accept");
++ if (verbose)
++ fprintf(stderr, "Accepted %d\n", new);
++ FD_SET(new, &active_fd_set);
++ }
++ else { /* already connected */
++ pid_t pid;
++ int status;
++
++ if (verbose)
++ fprintf(stderr, "Handle client %d\n", i);
++ pid = fork();
++ if (pid == 0) {
++ handle_client(i);
++ _exit(EXIT_SUCCESS);
++ }
++ else if (pid < 0)
++ err("fork");
++ else {
++ if (waitpid(pid, &status, 0) != pid)
++ err("waitpid");
++ close(i);
++ FD_CLR(i, &active_fd_set);
++ }
++ } /* if i */
++ } /* if ISSET */
++ } /* while */
++ del_sock();
++ exit(EXIT_SUCCESS);
++}
++
++static int connect_2_daemon(int argc, char *argv[])
++{
++ int sock;
++ struct sockaddr_un sa;
++ char *sock_name = socket_file;
++ size_t size;
++ int i, c, len;
++ char *p, *q, buffer[BUFSIZ];
++
++ if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
++ err("Can't open socket");
++ sa.sun_family = AF_UNIX;
++ strcpy(sa.sun_path, sock_name);
++ size = offsetof(struct sockaddr_un, sun_path) + strlen(sa.sun_path) + 1;
++
++ if (connect(sock, (struct sockaddr *) &sa, size) < 0)
++ err("Can't connect sock");
++ p = buffer;
++ optind = 0; /* reinit */
++ len = 0;
++ while ((c = getopt(argc, argv, options)) != EOF && len < BUFSIZ - 10) {
++ switch (c) {
++ case '?':
++ case 'C':
++ break;
++ case 'D':
++ if (optarg && atoi(optarg) == 3) ; /* goon, kill a running
++ daemon */
++ else
++ break;
++ default:
++ *p++ = '-';
++ *p++ = c;
++ len += 3;
++ if (optarg)
++ for (q = optarg; *q && len < BUFSIZ - 10; len++)
++ *p++ = *q++;
++ *p++ = ' ';
++ break;
++ }
++ }
++ for (i = optind; i < argc; i++) {
++ for (q = argv[i]; *q && len < BUFSIZ - 10; len++)
++ *p++ = *q++;
++ *p++ = ' ';
++ len++;
++ }
++ *--p = '\x0';
++ i = write(sock, buffer, strlen(buffer) + 1);
++ if (i < 0)
++ err("Write sock");
++ while ((i = read(sock, buffer, BUFSIZ)) > 0)
++ write(1, buffer, i);
++ close(sock);
++ return EXIT_SUCCESS;
++}
++
++
++int main(int argc, char *argv[], char *envp[])
++{
++ register int i;
++ sigset_t unblock_set;
++
++ myname = argv[0];
++ myshortname = basename(myname);
++
++ time(&start);
++ splittime();
++ socket_file = strdup(SOCKNAME);
++ /* borrowed from isdnlog.c, thanks */
++ hup_argv = argv;
++ sigemptyset(&unblock_set);
++ sigaddset(&unblock_set, SIGHUP);
++ sigprocmask(SIG_UNBLOCK, &unblock_set, NULL);
++
++ if ((i = opts(argc, argv)) || need_dest == 0) {
++ if (is_client)
++ exit(connect_2_daemon(argc, argv));
++ else
++ init();
++ if (is_daemon) {
++ clean_up();
++ setup_daemon();
++ }
++ else
++ doit(i, argc, argv);
++ }
++ else {
++ print_msg(PRT_A, usage, myshortname, myshortname, options);
++ print_msg(PRT_A, "\n");
++ print_msg(PRT_A, "\t-a \tall=show old and newer rates (default actual only)\n", MAXPROVIDER);
++ print_msg(PRT_A, "\t-b best\tshow only the first <best> provider(s) (default %d)\n", MAXPROVIDER);
++ print_msg(PRT_A, "\t-d d[.m[.y]] | {W|N|E}\tstart date of call (default now)\n");
++ print_msg(PRT_A, "\t-f areacode\tyou are calling from <areacode>\n");
++ print_msg(PRT_A, "\t-h h[:m[:s]]\tstart time of call (default now)\n");
++ print_msg(PRT_A, "\t-l duration\tduration of call in seconds (default %d seconds)\n", LCR_DURATION);
++ print_msg(PRT_A, "\t-o \t show only booked providers\n");
++ print_msg(PRT_A, "\t-p prov|B[,prov...]\t show only these providers\n");
++ print_msg(PRT_A, "\t-s \t consider 'Destination' as a service name\n");
++ print_msg(PRT_A, "\t-t takt\t\tshow providers if chargeduration<=takt\n");
++ print_msg(PRT_A, "\t-v [level]\tverbose\n");
++ print_msg(PRT_A, "\t-x prov|B[,prov...]\t exclude these providers\n");
++
++ print_msg(PRT_A, "\tOutput and run options\n");
++ print_msg(PRT_A, "\t-C\trun as client, connecting to a running daemon\n");
++ print_msg(PRT_A, "\t-CD3\tkill a running daemon\n");
++ print_msg(PRT_A, "\t-D\trun as daemon\n");
++ print_msg(PRT_A, "\t-D2\trun as daemon & go background\n");
++ print_msg(PRT_A, "\t-G which\tshow raw data\n");
++ print_msg(PRT_A, "\t-H\tshow a header\n");
++ print_msg(PRT_A, "\t-L\tshow a detailed list\n");
++ print_msg(PRT_A, "\t-O sOcket-path\twrite socket to this file (def:tmp/isdnrate)\n");
++ print_msg(PRT_A, "\t-P pid-dir\twrite own PID to pid-dir/isdnrate.pid\n");
++ print_msg(PRT_A, "\t-N\tparse the given telefon numbers\n");
++ print_msg(PRT_A, "\t-S[v|n]\tsort by v=VBN, n=Name, default=Charge\n");
++ print_msg(PRT_A, "\t-T\tshow a table of day/night week/weekend\n");
++ print_msg(PRT_A, "\t-U\tshow usage stats for table\n");
++ print_msg(PRT_A, "\t-V\tshow version info\n");
++ print_msg(PRT_A, "\t-X\texplain each rate\n");
++ print_msg(PRT_A, "\t-X2\texplain more\n");
++ print_msg(PRT_A, "\t-X comment\tprint <comment> from C:tag\n");
++ print_msg(PRT_A, "\t-Z show entry from getLeastCost\n");
++ print_msg(PRT_A, "\n\te.g.\t%s -b5 -f30 -TH -t1 Zaire\n", myshortname);
++ } /* else */
++/* deinit(); Fixme: this SIGSEGVs in exitHoliday */
++ return (0);
++} /* isdnrate */
+diff -Naur isdn4k-utils-orig//isdnlog/tools/rate.c isdn4k-utils/isdnlog/tools/rate.c
+--- isdn4k-utils-orig//isdnlog/tools/rate.c 2002-07-06 09:22:33.000000000 +1000
++++ isdn4k-utils/isdnlog/tools/rate.c 2010-12-04 20:44:03.786672226 +1000
+@@ -1773,6 +1773,7 @@
+ number=realloc(number, numbers*sizeof(int));
+ number[numbers-1]=i;
+ skip:
++ ;
+ }
+
+ while (isblank(*s)) s++;
+@@ -2344,6 +2345,7 @@
+ }
+ return UNKNOWN;
+ done:
++ ;
+ }
+ }
+ }
+diff -Naur isdn4k-utils-orig//lib/libtools.c isdn4k-utils/lib/libtools.c
+--- isdn4k-utils-orig//lib/libtools.c 1999-11-04 02:13:36.000000000 +1000
++++ isdn4k-utils/lib/libtools.c 2010-12-04 20:44:03.786672226 +1000
+@@ -711,6 +711,7 @@
+ case 'r': _mode |= R_OK;
+ break;
+ default :
++ ;
+ }
+ }
+
+diff -Naur isdn4k-utils-orig//Makefile isdn4k-utils/Makefile
+--- isdn4k-utils-orig//Makefile 2002-07-20 05:03:49.000000000 +1000
++++ isdn4k-utils/Makefile 2010-12-04 20:43:57.890005560 +1000
+@@ -132,12 +132,6 @@
+
+ install: rootperm
+ set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i install; done
+- @if [ -c $(DESTDIR)/dev/isdnctrl0 ] && ls -l $(DESTDIR)/dev/isdnctrl0 | egrep "[[:space:]]45,[[:space:]]+64[[:space:]]" > /dev/null; \
+- then \
+- /bin/echo -e '(some) ISDN devices already exist, not creating them.\nUse scripts/makedev.sh manually if necessary.'; \
+- else \
+- sh scripts/makedev.sh $(DESTDIR) ; \
+- fi
+
+ uninstall: rootperm
+ set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i uninstall; done
diff --git a/core/iw/PKGBUILD b/core/iw/PKGBUILD
new file mode 100644
index 000000000..67cc374ca
--- /dev/null
+++ b/core/iw/PKGBUILD
@@ -0,0 +1,24 @@
+# $Id: PKGBUILD 111467 2011-02-27 10:05:15Z thomas $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgname=iw
+pkgver=0.9.22
+pkgrel=1
+pkgdesc="nl80211 based CLI configuration utility for wireless devices"
+arch=("i686" "x86_64")
+url="http://wireless.kernel.org/en/users/Documentation/iw"
+license=("GPL")
+depends=("libnl")
+makedepends=("kernel-headers")
+source=(http://wireless.kernel.org/download/$pkgname/$pkgname-$pkgver.tar.bz2)
+sha256sums=('138ce4dc827d8b0af55fe1c444e749b985c1540d791b27922aad880d12908bb1')
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+}
diff --git a/core/jfsutils/PKGBUILD b/core/jfsutils/PKGBUILD
new file mode 100644
index 000000000..1d99ac5d3
--- /dev/null
+++ b/core/jfsutils/PKGBUILD
@@ -0,0 +1,25 @@
+# $Id: PKGBUILD 100375 2010-11-23 01:27:06Z stephane $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+pkgname=jfsutils
+pkgver=1.1.14
+pkgrel=2
+pkgdesc="JFS filesystem utilities"
+arch=(i686 x86_64)
+url="http://jfs.sourceforge.net"
+license=('GPL')
+groups=('base')
+depends=('util-linux-ng')
+source=(http://jfs.sourceforge.net/project/pub/${pkgname}-${pkgver}.tar.gz)
+md5sums=('05150840987176d5e8438066b80add1a')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --sbindir=/sbin
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR=${pkgdir} install
+}
+
diff --git a/core/kbd/PKGBUILD b/core/kbd/PKGBUILD
new file mode 100644
index 000000000..c3be3a65b
--- /dev/null
+++ b/core/kbd/PKGBUILD
@@ -0,0 +1,37 @@
+# $Id: PKGBUILD 82650 2010-06-15 05:16:19Z allan $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+
+pkgname=kbd
+pkgver=1.15.2
+pkgrel=1
+pkgdesc="Keytable files and keyboard utilities"
+arch=('i686' 'x86_64')
+url="ftp://ftp.altlinux.org/pub/people/legion/kbd/"
+license=('GPL')
+depends=('glibc')
+source=(ftp://ftp.altlinux.org/pub/people/legion/kbd/${pkgname}-${pkgver}.tar.gz)
+md5sums=('77d0b51454522bc6c170bbdc6e31202a')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ # rename keymap files with the same names
+ # this is needed because when only name of keymap is specified
+ # loadkeys loads the first keymap it can find, which is bad (see FS#13837)
+ # this should be removed when upstream adopts the change
+ mv data/keymaps/i386/qwertz/cz{,-qwertz}.map
+ mv data/keymaps/i386/olpc/es{,-olpc}.map
+ mv data/keymaps/i386/olpc/pt{,-olpc}.map
+ mv data/keymaps/i386/dvorak/no{,-dvorak}.map
+ mv data/keymaps/i386/fgGIod/trf{,-fgGIod}.map
+
+ ./configure --prefix=/usr --datadir=/usr/share/kbd --mandir=/usr/share/man
+ make KEYCODES_PROGS=yes RESIZECONS_PROGS=yes || return 1
+ make KEYCODES_PROGS=yes RESIZECONS_PROGS=yes DESTDIR=${pkgdir} install
+
+ # this is needed because initscripts call /bin/loadkeys
+ # remove this when next versions of kbd
+ # and initscripts with /usr/bin/loadkeys usage will be released
+ mkdir ${pkgdir}/bin
+ ln -s /usr/bin/loadkeys ${pkgdir}/bin/loadkeys
+}
diff --git a/core/less/PKGBUILD b/core/less/PKGBUILD
new file mode 100644
index 000000000..c84d7d787
--- /dev/null
+++ b/core/less/PKGBUILD
@@ -0,0 +1,30 @@
+# $Id: PKGBUILD 100030 2010-11-20 00:42:11Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=less
+pkgver=436
+pkgrel=2
+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=('817bf051953ad2dea825a1cdf460caa4')
+
+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/core/less/zless b/core/less/zless
new file mode 100644
index 000000000..93d560bc5
--- /dev/null
+++ b/core/less/zless
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+: ${PAGER=less}
+export PAGER
+
+PATH="/usr/bin:$PATH"
+export PATH
+
+exec zmore ${1+"$@"}
diff --git a/core/libarchive/PKGBUILD b/core/libarchive/PKGBUILD
new file mode 100644
index 000000000..e01ef2861
--- /dev/null
+++ b/core/libarchive/PKGBUILD
@@ -0,0 +1,35 @@
+# $Id: PKGBUILD 96831 2010-10-25 06:09:56Z pierre $
+# Maintainer: Dan McGee <dan@archlinux.org>
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+pkgname=libarchive
+pkgver=2.8.4
+pkgrel=2
+pkgdesc="library that can create and read several streaming archive formats"
+arch=('i686' 'x86_64')
+url="http://libarchive.googlecode.com/"
+license=('BSD')
+depends=('zlib' 'bzip2' 'xz>=5.0.0' 'acl' 'openssl>=1.0.0' 'expat')
+source=("http://libarchive.googlecode.com/files/libarchive-${pkgver}.tar.gz")
+md5sums=('83b237a542f27969a8d68ac217dc3796')
+sha256sums=('86cffa3eaa28d3116f5d0b20284026c3762cf4a2b52b9844df2b494d4a89f688')
+
+# pacman.static build fails unless we keep the libtool files (or unless we link
+# the missing symbols inside the libarchive .a static lib, but that is dirty)
+options=('libtool')
+
+# keep an upgrade path for older installations
+PKGEXT='.pkg.tar.gz'
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ ./configure --prefix=/usr --without-xml2
+
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install
+
+ install -D -m644 COPYING $pkgdir/usr/share/licenses/libarchive/COPYING
+}
diff --git a/core/libcap/PKGBUILD b/core/libcap/PKGBUILD
new file mode 100644
index 000000000..4a30e4009
--- /dev/null
+++ b/core/libcap/PKGBUILD
@@ -0,0 +1,26 @@
+#$Id: PKGBUILD 107283 2011-01-23 06:26:22Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Hugo Doria <hugo@archlinux.org>
+
+pkgname=libcap
+pkgver=2.20
+pkgrel=1
+pkgdesc="POSIX 1003.1e capabilities"
+arch=('i686' 'x86_64')
+url="http://www.kernel.org/pub/linux/libs/security/linux-privs/"
+license=('GPL')
+depends=('glibc' 'attr')
+source=(http://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${pkgname}-${pkgver}.tar.gz)
+md5sums=('8ce6905851ffdde287d00d8269775ade')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make prefix=/usr DESTDIR=${pkgdir} LIBDIR=${pkgdir}/lib RAISE_SETFCAP=no install
+ rm ${pkgdir}/lib/*.a
+ chmod 755 ${pkgdir}/lib/libcap.so.${pkgver}
+}
diff --git a/core/libedit/PKGBUILD b/core/libedit/PKGBUILD
new file mode 100644
index 000000000..fb9152883
--- /dev/null
+++ b/core/libedit/PKGBUILD
@@ -0,0 +1,29 @@
+# $Id: PKGBUILD 112952 2011-03-07 23:45:40Z bisson $
+# Maintainer: Vesa Kaihlavirta <vesa@archlinux.org>
+# Contributor: Roman Cheplyaka <roma@ro-che.info>
+
+pkgname=libedit
+pkgver=20110227_3.0
+pkgrel=1
+pkgdesc='Command line editor library providing generic line editing, history, and tokenization functions'
+arch=('i686' 'x86_64')
+url='http://www.thrysoee.dk/editline/'
+license=('BSD')
+depends=('ncurses')
+source=("http://www.thrysoee.dk/editline/libedit-${pkgver/_/-}.tar.gz")
+sha1sums=('afe84b9e16fc903d5a3eceda90013d7ad03db794')
+options=('!libtool')
+
+build() {
+ cd "${srcdir}/$pkgname-${pkgver/_/-}"
+ ./configure --prefix=/usr --enable-widec --enable-static=no
+ make
+}
+
+package() {
+ cd "${srcdir}/$pkgname-${pkgver/_/-}"
+ make prefix="$pkgdir"/usr install
+
+ cp "$pkgdir"/usr/share/man/man3/editline.3 "$pkgdir"/usr/share/man/man3/el.3
+ install -D -m0644 COPYING "$pkgdir"/usr/share/licenses/libedit/LICENSE
+}
diff --git a/core/libevent/PKGBUILD b/core/libevent/PKGBUILD
new file mode 100644
index 000000000..61c39c3a7
--- /dev/null
+++ b/core/libevent/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 109275 2011-02-07 15:11:49Z ibiru $
+# Maintainer:
+# Contributor: Judd <jvinet@zeroflux.org>
+
+pkgname=libevent
+pkgver=2.0.10
+pkgrel=1
+pkgdesc="An event notification library"
+license=('GPL2')
+arch=('i686' 'x86_64')
+url="http://www.monkey.org/~provos/libevent/"
+depends=('openssl')
+source=("http://www.monkey.org/~provos/libevent-$pkgver-stable.tar.gz")
+options=('!libtool')
+md5sums=('a37401d26cbbf28185211d582741a3d4')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}-stable"
+ sed -i 's#python#python2#' event_rpcgen.py
+ ./configure --prefix=/usr --sysconfdir=/etc
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}-stable"
+ make DESTDIR=${pkgdir} install
+}
diff --git a/core/libfetch/Makefile b/core/libfetch/Makefile
new file mode 100644
index 000000000..53bcee9c4
--- /dev/null
+++ b/core/libfetch/Makefile
@@ -0,0 +1,89 @@
+prefix = /usr
+DESTDIR =
+DEBUG = false
+FETCH_WITH_INET6 = true
+FETCH_WITH_OPENSSL = true
+
+WARNINGS = -Wall -Wstrict-prototypes -Wsign-compare -Wchar-subscripts \
+ -Wpointer-arith -Wcast-align
+CFLAGS = -O2 -pipe -I. -fPIC $(WARNINGS) \
+ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES
+
+CFLAGS += -DFTP_COMBINE_CWDS -DNETBSD
+
+ifeq ($(strip $(FETCH_WITH_INET6)), true)
+CFLAGS+= -DINET6
+endif
+
+ifeq ($(strip $(FETCH_WITH_OPENSSL)), true)
+CFLAGS+= -DWITH_SSL
+LDFLAGS= -lssl -lcrypto
+endif
+
+ifeq ($(strip $(DEBUG)), true)
+CFLAGS += -g -DDEBUG
+else
+CFLAGS += -UDEBUG
+endif
+
+CC = gcc
+LD = gcc
+AR = ar
+RANLIB = ranlib
+INSTALL = install -c -D
+
+OBJS= fetch.o common.o ftp.o http.o file.o
+INCS= fetch.h common.h
+GEN = ftperr.h httperr.h
+MAN = libdownload.3
+
+#pretty print!
+E = @/bin/echo
+Q = @
+
+all: libfetch.so libfetch.a
+.PHONY: all
+
+%.o: %.c $(INCS) $(GEN)
+ $(E) " compile " $@
+ $(Q) $(CC) $(CFLAGS) -c $<
+
+ftperr.h: ftp.errors Makefile errlist.sh
+ $(E) " generate " $@
+ $(Q) ./errlist.sh ftp_errlist FTP ftp.errors > $@
+
+httperr.h: http.errors Makefile errlist.sh
+ $(E) " generate " $@
+ $(Q) ./errlist.sh http_errlist HTTP http.errors > $@
+
+libfetch.so: $(GEN) $(INCS) $(OBJS)
+ $(E) " build " $@
+ $(Q) rm -f $@
+ $(Q) $(LD) $(LDFLAGS) *.o -shared -o $@
+ $(E) " built with: " $(CFLAGS)
+
+libfetch.a: $(GEN) $(INCS) $(OBJS)
+ $(E) " build " $@
+ $(Q) rm -f $@
+ $(Q) $(AR) rcs $@ *.o
+ $(Q) $(RANLIB) $@
+ $(E) " built with: " $(CFLAGS)
+
+clean:
+ $(E) " clean "
+ $(Q) rm -f libfetch.so libfetch.a *.o $(GEN)
+.PHONY: clean
+
+install: all
+ $(Q) $(INSTALL) -m 755 libfetch.so $(DESTDIR)$(prefix)/lib/libfetch.so
+ $(Q) $(INSTALL) -m 644 libfetch.a $(DESTDIR)$(prefix)/lib/libfetch.a
+ $(Q) $(INSTALL) -m 644 fetch.h $(DESTDIR)$(prefix)/include/fetch.h
+ $(Q) $(INSTALL) -m 644 fetch.3 $(DESTDIR)$(prefix)/share/man/man3/fetch.3
+.PHONY: install
+
+uninstall:
+ $(Q) rm -f $(DESTDIR)$(prefix)/lib/libfetch.so
+ $(Q) rm -f $(DESTDIR)$(prefix)/lib/libfetch.a
+ $(Q) rm -f $(DESTDIR)$(prefix)/include/fetch.h
+ $(Q) rm -f $(DESTDIR)$(prefix)/share/man/man3/fetch.3
+.PHONY: uninstall
diff --git a/core/libfetch/PKGBUILD b/core/libfetch/PKGBUILD
new file mode 100644
index 000000000..641e7d42c
--- /dev/null
+++ b/core/libfetch/PKGBUILD
@@ -0,0 +1,46 @@
+# $Id$
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+# Contributor: Xavier Chantry <shiningxc@gmail.com>
+
+pkgname=libfetch
+pkgver=2.33
+pkgrel=1
+pkgdesc="URL based download library"
+arch=('i686' 'x86_64')
+license=('BSD')
+depends=('openssl>=1.0.0')
+url="http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/net/libfetch/"
+source=(Makefile
+ ftp://ftp.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz)
+md5sums=('5167d18db7660228e75290fc7d25fe56'
+ 'a176b94f7f30344ef8a71c047ca2136b')
+
+# keep an upgrade path for older installations
+PKGEXT='.pkg.tar.gz'
+
+# source PKGBUILD && mksource
+mksource() {
+ export CVSROOT=:pserver:anoncvs@anoncvs.NetBSD.org:/cvsroot
+ D=pkgsrc/net/libfetch
+ [ -d "$D" ] && cvs up "$D" || cvs co "$D"
+ pushd "$D"
+ dirname=$(sed -n 's/DISTNAME=.*\(libfetch-.*$\)/\1/p' Makefile)
+ cp -r files $dirname
+ tar -czv --exclude=CVS -f ../../../$dirname.tar.gz $dirname
+ rm -r $dirname
+ popd
+}
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ cp $srcdir/Makefile .
+ make || return 1
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install
+ licdir=$pkgdir/usr/share/licenses/libfetch/
+ mkdir -p $licdir
+ sed -n -e '/Copyright (c)/,/SUCH DAMAGE\./p' common.c | cut -c '4-' > $licdir/LICENSE
+}
diff --git a/core/libgcrypt/PKGBUILD b/core/libgcrypt/PKGBUILD
new file mode 100644
index 000000000..c26270001
--- /dev/null
+++ b/core/libgcrypt/PKGBUILD
@@ -0,0 +1,33 @@
+# $Id: PKGBUILD 85547 2010-07-15 21:16:57Z andyrtr $
+# Maintainer: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=libgcrypt
+pkgver=1.4.6
+pkgrel=1
+pkgdesc="a general purpose crypto library based on the code used"
+arch=(i686 x86_64)
+url="http://www.gnupg.org"
+license=('LGPL')
+depends=('libgpg-error>=1.7')
+options=(!libtool)
+source=(ftp://ftp.gnupg.org/gcrypt/${pkgname}/${pkgname}-${pkgver}.tar.bz2
+ #ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/libgcrypt/${pkgname}-${pkgver}.tar.bz2
+)
+md5sums=('dbf99425a4fe9217c84ce3a35d938634')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ # keep static library for , needed for cryptsetup
+ ./configure --prefix=/usr --disable-padlock-support
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+
+ # Move dynamic libraries to /lib
+ install -d -m755 "${pkgdir}"/lib/ || return 1
+ mv "${pkgdir}"/usr/lib/libgcrypt.so* "${pkgdir}"/lib/ || return 1
+ ln -sf /lib/libgcrypt.so "${pkgdir}"/usr/lib/libgcrypt.so || return 1
+}
diff --git a/core/libgcrypt/libgcrypt.install b/core/libgcrypt/libgcrypt.install
new file mode 100644
index 000000000..81547f57f
--- /dev/null
+++ b/core/libgcrypt/libgcrypt.install
@@ -0,0 +1,22 @@
+infodir=/usr/share/info
+filelist=(gcrypt.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file $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
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/libgpg-error/PKGBUILD b/core/libgpg-error/PKGBUILD
new file mode 100644
index 000000000..ed2a30da9
--- /dev/null
+++ b/core/libgpg-error/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 87301 2010-08-12 05:22:29Z andyrtr $
+# Maintainer: judd <jvinet@zeroflux.org>
+
+pkgname=libgpg-error
+pkgver=1.9
+pkgrel=2
+pkgdesc="Support library for libgcrypt"
+arch=(i686 x86_64)
+url="http://www.gnupg.org"
+license=('LGPL')
+depends=('glibc' 'sh')
+options=(!libtool)
+source=(ftp://ftp.gnupg.org/gcrypt/libgpg-error/${pkgname}-${pkgver}.tar.bz2)
+ #ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/libgpg-error/${pkgname}-${pkgver}.tar.bz2)
+md5sums=('521b98aa9395e7eaf0ef2236233a0796')
+
+
+build() {
+ cd "${srcdir}"/${pkgname}-${pkgver}
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}"/${pkgname}-${pkgver}
+ make DESTDIR="${pkgdir}/" install
+
+ # Move dynamic libraries to /lib
+ install -d -m755 "${pkgdir}"/lib/
+ mv "${pkgdir}"/usr/lib/libgpg-error.so* "${pkgdir}"/lib/
+ ln -sf /lib/libgpg-error.so "${pkgdir}"/usr/lib/libgpg-error.so
+}
diff --git a/core/libgssglue/PKGBUILD b/core/libgssglue/PKGBUILD
new file mode 100644
index 000000000..85ed0d2e0
--- /dev/null
+++ b/core/libgssglue/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 102146 2010-12-06 09:49:56Z allan $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+
+pkgname=libgssglue
+pkgver=0.1
+pkgrel=3
+pkgdesc="Exports a gssapi interface which calls other random gssapi libraries"
+arch=('i686' 'x86_64')
+url="http://www.citi.umich.edu/projects/nfsv4/linux/"
+license=('BSD')
+depends=('glibc')
+makedepends=('pkgconfig' 'autoconf')
+backup=(etc/gssapi_mech.conf)
+options=('!libtool')
+source=(http://www.citi.umich.edu/projects/nfsv4/linux/$pkgname/$pkgname-$pkgver.tar.gz
+ gssapi_mech.conf)
+md5sums=('ce1b4c758e6de01b712d154c5c97e540'
+ '234b9cca75a33af98eda3f1683756879')
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make DESTDIR="$pkgdir/" install
+
+ # Configuration
+ install -Dm644 "$srcdir"/gssapi_mech.conf "$pkgdir/"etc/gssapi_mech.conf
+ # install license
+ install -Dm644 COPYING "$pkgdir"/usr/share/licenses/libgssglue/COPYING
+}
diff --git a/core/libgssglue/gssapi_mech.conf b/core/libgssglue/gssapi_mech.conf
new file mode 100644
index 000000000..f71aca08e
--- /dev/null
+++ b/core/libgssglue/gssapi_mech.conf
@@ -0,0 +1,22 @@
+# Example /etc/gssapi_mech.conf file
+#
+# GSSAPI Mechanism Definitions
+#
+# This configuration file determines which GSS-API mechanisms
+# the gssd code should use
+#
+# NOTE:
+# The initiaiization function "mechglue_internal_krb5_init"
+# is used for the MIT krb5 gssapi mechanism. This special
+# function name indicates that an internal function should
+# be used to determine the entry points for the MIT gssapi
+# mechanism funtions.
+#
+# library initialization function
+# ================================ ==========================
+# The MIT K5 gssapi library, use special function for initialization.
+#/usr/lib/libgssapi_krb5.so mechglue_internal_krb5_init
+/usr/lib/libgssapi.so mechglue_internal_krb5_init
+#
+# The SPKM3 gssapi library function. Use the function spkm3_gss_initialize.
+# /usr/local/gss_mechs/spkm/spkm3/libgssapi_spkm3.so spkm3_gss_initialize
diff --git a/core/libldap/PKGBUILD b/core/libldap/PKGBUILD
new file mode 100644
index 000000000..1461603b5
--- /dev/null
+++ b/core/libldap/PKGBUILD
@@ -0,0 +1,78 @@
+# $Id: PKGBUILD 109954 2011-02-14 13:17:18Z andrea $
+# Maintainer:
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=libldap
+pkgver=2.4.24
+pkgrel=1
+pkgdesc="Lightweight Directory Access Protocol (LDAP) client libraries"
+arch=('i686' 'x86_64')
+license=('custom')
+url="http://www.openldap.org/"
+backup=(etc/openldap/ldap.conf)
+depends=('libsasl' 'openssl')
+makedepends=('tcp_wrappers' 'groff')
+options=('!libtool')
+source=("ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-${pkgver}.tgz"
+ 'ntlm.patch')
+md5sums=('116fe1e23a7b67686d5e62274367e6c0'
+ 'dfa9eb6f2fd9d0a3dab0e1860923489e')
+
+build() {
+ cd ${srcdir}/openldap-${pkgver}
+
+ patch -Np1 -i ${srcdir}/ntlm.patch
+
+ ./configure --prefix=/usr \
+ --libexecdir=/usr/sbin \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var/lib/openldap \
+ --enable-crypt \
+ --enable-dynamic \
+ --with-threads \
+ --enable-wrappers \
+ --enable-spasswd \
+ --with-cyrus-sasl \
+ --disable-bdb \
+ --disable-hdb
+
+ cd include
+ make
+
+ cd ../libraries
+ make depend
+ make
+
+ cd ../doc/man/man3
+ make
+
+ cd ../man5
+ make
+}
+
+package() {
+ cd ${srcdir}/openldap-${pkgver}
+
+ cd include
+ make DESTDIR=${pkgdir} install
+
+ cd ../libraries
+ make DESTDIR=${pkgdir} install
+
+ cd ../doc/man/man3
+ make DESTDIR=${pkgdir} install
+
+ cd ../man5
+ install -Dm644 ldap.conf.5.tmp \
+ ${pkgdir}/usr/share/man/man5/ldap.conf.5
+
+ # get rid of duplicate default conf files
+ rm ${pkgdir}/etc/openldap/*.default
+
+ ln -sf liblber.so ${pkgdir}/usr/lib/liblber.so.2
+ ln -sf libldap.so ${pkgdir}/usr/lib/libldap.so.2
+
+ install -Dm644 ${srcdir}/openldap-${pkgver}/LICENSE \
+ ${pkgdir}/usr/share/licenses/$pkgname/LICENSE
+}
diff --git a/core/libldap/ntlm.patch b/core/libldap/ntlm.patch
new file mode 100644
index 000000000..a4fe4d45a
--- /dev/null
+++ b/core/libldap/ntlm.patch
@@ -0,0 +1,230 @@
+Patch from evolution-exchange (2.10.3). The ldap_ntlm_bind function is
+actually called by evolution-data-server, checked at version 1.12.2.
+Without this patch, the Exchange addressbook integration uses simple binds
+with cleartext passwords.
+
+Russ checked with openldap-software for upstream's opinion on this patch
+on 2007-12-21. Upstream had never received it as a patch submission and
+given that it's apparently only for older Exchange servers that can't do
+SASL and DIGEST-MD5, it's not very appealing.
+
+Bug#457374 filed against evolution-data-server asking if this support is
+still required on 2007-12-21.
+
+Index: trunk/include/ldap.h
+===================================================================
+--- trunk.orig/include/ldap.h
++++ trunk/include/ldap.h
+@@ -2461,5 +2461,25 @@
+ LDAPControl **ctrls,
+ LDAPDerefRes **drp ));
+
++/*
++ * hacks for NTLM
++ */
++#define LDAP_AUTH_NTLM_REQUEST ((ber_tag_t) 0x8aU)
++#define LDAP_AUTH_NTLM_RESPONSE ((ber_tag_t) 0x8bU)
++LDAP_F( int )
++ldap_ntlm_bind LDAP_P((
++ LDAP *ld,
++ LDAP_CONST char *dn,
++ ber_tag_t tag,
++ struct berval *cred,
++ LDAPControl **sctrls,
++ LDAPControl **cctrls,
++ int *msgidp ));
++LDAP_F( int )
++ldap_parse_ntlm_bind_result LDAP_P((
++ LDAP *ld,
++ LDAPMessage *res,
++ struct berval *challenge));
++
+ LDAP_END_DECL
+ #endif /* _LDAP_H */
+Index: trunk/libraries/libldap/ntlm.c
+===================================================================
+--- /dev/null
++++ trunk/libraries/libldap/ntlm.c
+@@ -0,0 +1,138 @@
++/* $OpenLDAP: pkg/ldap/libraries/libldap/ntlm.c,v 1.1.4.10 2002/01/04 20:38:21 kurt Exp $ */
++/*
++ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
++ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
++ */
++
++/* Mostly copied from sasl.c */
++
++#include "portable.h"
++
++#include <stdlib.h>
++#include <stdio.h>
++
++#include <ac/socket.h>
++#include <ac/string.h>
++#include <ac/time.h>
++#include <ac/errno.h>
++
++#include "ldap-int.h"
++
++int
++ldap_ntlm_bind(
++ LDAP *ld,
++ LDAP_CONST char *dn,
++ ber_tag_t tag,
++ struct berval *cred,
++ LDAPControl **sctrls,
++ LDAPControl **cctrls,
++ int *msgidp )
++{
++ BerElement *ber;
++ int rc;
++ ber_int_t id;
++
++ Debug( LDAP_DEBUG_TRACE, "ldap_ntlm_bind\n", 0, 0, 0 );
++
++ assert( ld != NULL );
++ assert( LDAP_VALID( ld ) );
++ assert( msgidp != NULL );
++
++ if( msgidp == NULL ) {
++ ld->ld_errno = LDAP_PARAM_ERROR;
++ return ld->ld_errno;
++ }
++
++ /* create a message to send */
++ if ( (ber = ldap_alloc_ber_with_options( ld )) == NULL ) {
++ ld->ld_errno = LDAP_NO_MEMORY;
++ return ld->ld_errno;
++ }
++
++ assert( LBER_VALID( ber ) );
++
++ LDAP_NEXT_MSGID( ld, id );
++ rc = ber_printf( ber, "{it{istON}" /*}*/,
++ id, LDAP_REQ_BIND,
++ ld->ld_version, dn, tag,
++ cred );
++
++ /* Put Server Controls */
++ if( ldap_int_put_controls( ld, sctrls, ber ) != LDAP_SUCCESS ) {
++ ber_free( ber, 1 );
++ return ld->ld_errno;
++ }
++
++ if ( ber_printf( ber, /*{*/ "N}" ) == -1 ) {
++ ld->ld_errno = LDAP_ENCODING_ERROR;
++ ber_free( ber, 1 );
++ return ld->ld_errno;
++ }
++
++ /* send the message */
++ *msgidp = ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber, id );
++
++ if(*msgidp < 0)
++ return ld->ld_errno;
++
++ return LDAP_SUCCESS;
++}
++
++int
++ldap_parse_ntlm_bind_result(
++ LDAP *ld,
++ LDAPMessage *res,
++ struct berval *challenge)
++{
++ ber_int_t errcode;
++ ber_tag_t tag;
++ BerElement *ber;
++ ber_len_t len;
++
++ Debug( LDAP_DEBUG_TRACE, "ldap_parse_ntlm_bind_result\n", 0, 0, 0 );
++
++ assert( ld != NULL );
++ assert( LDAP_VALID( ld ) );
++ assert( res != NULL );
++
++ if ( ld == NULL || res == NULL ) {
++ return LDAP_PARAM_ERROR;
++ }
++
++ if( res->lm_msgtype != LDAP_RES_BIND ) {
++ ld->ld_errno = LDAP_PARAM_ERROR;
++ return ld->ld_errno;
++ }
++
++ if ( ld->ld_error ) {
++ LDAP_FREE( ld->ld_error );
++ ld->ld_error = NULL;
++ }
++ if ( ld->ld_matched ) {
++ LDAP_FREE( ld->ld_matched );
++ ld->ld_matched = NULL;
++ }
++
++ /* parse results */
++
++ ber = ber_dup( res->lm_ber );
++
++ if( ber == NULL ) {
++ ld->ld_errno = LDAP_NO_MEMORY;
++ return ld->ld_errno;
++ }
++
++ tag = ber_scanf( ber, "{ioa" /*}*/,
++ &errcode, challenge, &ld->ld_error );
++ ber_free( ber, 0 );
++
++ if( tag == LBER_ERROR ) {
++ ld->ld_errno = LDAP_DECODING_ERROR;
++ return ld->ld_errno;
++ }
++
++ ld->ld_errno = errcode;
++
++ return( ld->ld_errno );
++}
++
+Index: trunk/libraries/libldap/Makefile.in
+===================================================================
+--- trunk.orig/libraries/libldap/Makefile.in
++++ trunk/libraries/libldap/Makefile.in
+@@ -27,7 +27,7 @@
+ init.c options.c print.c string.c util-int.c schema.c \
+ charray.c os-local.c dnssrv.c utf-8.c utf-8-conv.c \
+ tls2.c tls_o.c tls_g.c tls_m.c \
+- turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c \
++ turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c ntlm.c \
+ assertion.c deref.c
+
+ OBJS = bind.lo open.lo result.lo error.lo compare.lo search.lo \
+@@ -40,7 +40,7 @@
+ init.lo options.lo print.lo string.lo util-int.lo schema.lo \
+ charray.lo os-local.lo dnssrv.lo utf-8.lo utf-8-conv.lo \
+ tls2.lo tls_o.lo tls_g.lo tls_m.lo \
+- turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo \
++ turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo ntlm.lo \
+ assertion.lo deref.lo
+
+ LDAP_INCDIR= ../../include
+Index: trunk/libraries/libldap_r/Makefile.in
+===================================================================
+--- trunk.orig/libraries/libldap_r/Makefile.in
++++ trunk/libraries/libldap_r/Makefile.in
+@@ -29,7 +29,7 @@
+ init.c options.c print.c string.c util-int.c schema.c \
+ charray.c os-local.c dnssrv.c utf-8.c utf-8-conv.c \
+ tls2.c tls_o.c tls_g.c tls_m.c \
+- turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c \
++ turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c ntlm.c \
+ assertion.c deref.c
+ SRCS = threads.c rdwr.c rmutex.c tpool.c rq.c \
+ thr_posix.c thr_cthreads.c thr_thr.c thr_lwp.c thr_nt.c \
+@@ -47,7 +47,7 @@
+ init.lo options.lo print.lo string.lo util-int.lo schema.lo \
+ charray.lo os-local.lo dnssrv.lo utf-8.lo utf-8-conv.lo \
+ tls2.lo tls_o.lo tls_g.lo tls_m.lo \
+- turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo \
++ turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo ntlm.lo \
+ assertion.lo deref.lo
+
+ LDAP_INCDIR= ../../include
diff --git a/core/libmpc/PKGBUILD b/core/libmpc/PKGBUILD
new file mode 100644
index 000000000..f06279f85
--- /dev/null
+++ b/core/libmpc/PKGBUILD
@@ -0,0 +1,35 @@
+# $Id: PKGBUILD 111157 2011-02-24 12:31:09Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+
+pkgname=libmpc
+pkgver=0.9
+pkgrel=1
+pkgdesc="Library for the arithmetic of complex numbers with arbitrarily high precision"
+arch=('i686' 'x86_64')
+url="http://www.multiprecision.org/"
+license=('LGPL')
+depends=('mpfr>=3.0.0')
+options=('!libtool')
+install=libmpc.install
+source=(http://www.multiprecision.org/mpc/download/mpc-${pkgver/_/-}.tar.gz
+ libmpc-0.9-configure_cflags_egrep_issue.patch)
+md5sums=('0d6acab8d214bd7d1fbbc593e83dd00d'
+ '35d5bb02dc6c1153e581b7c34a738a08')
+
+build() {
+ cd "${srcdir}/mpc-${pkgver}"
+
+ # http://lists.gforge.inria.fr/pipermail/mpc-discuss/2011-February/000805.html
+ patch -Np1 -i $srcdir/libmpc-0.9-configure_cflags_egrep_issue.patch
+ autoreconf
+
+ ./configure --prefix=/usr
+ make
+ make check
+}
+
+package() {
+ cd "${srcdir}/mpc-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ mv ${pkgdir}/usr/share/info/{mpc,libmpc}.info
+}
diff --git a/core/libmpc/libmpc-0.9-configure_cflags_egrep_issue.patch b/core/libmpc/libmpc-0.9-configure_cflags_egrep_issue.patch
new file mode 100644
index 000000000..3bf324728
--- /dev/null
+++ b/core/libmpc/libmpc-0.9-configure_cflags_egrep_issue.patch
@@ -0,0 +1,63 @@
+--- trunk/configure.ac 2011/02/21 12:18:31 932
++++ trunk/configure.ac 2011/02/21 16:41:09 936
+@@ -33,7 +33,7 @@
+ AC_CANONICAL_HOST
+ AC_CONFIG_MACRO_DIR([m4])
+
+-dnl Extra arguments to configure
++# Extra arguments to configure
+ AC_ARG_WITH([mpfr_include],
+ [AC_HELP_STRING([--with-mpfr-include=DIR],
+ [MPFR include directory])],
+@@ -85,18 +85,19 @@
+ )
+
+
+-dnl Setup CC and CFLAGS
++# Setup CC and CFLAGS
++AC_PROG_CC
++AC_LANG(C)
+
+-dnl Check for user specification of CC or CFLAGS
++# Set up LibTool
++AC_PROG_LIBTOOL
++
++# Check for user specification of CC or CFLAGS
+ if test -n "$CFLAGS" || test -n "$CC" ; then
+ user_redefine_cc=yes
+ fi
+
+-# Check for programs
+-AC_PROG_CC
+-AC_LANG(C)
+-
+-dnl Check GMP Header
++# Check GMP Header
+ AC_MSG_CHECKING(for gmp.h)
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #include "gmp.h"
+@@ -105,22 +106,19 @@
+ AC_MSG_ERROR([gmp.h can't be found, or is unusable.])
+ ])
+
+-dnl Check for GMP CFLAGS in gmp.h
++# Check for GMP CFLAGS in gmp.h
+ if test -z "$user_redefine_cc" ; then
+ MPC_GMP_CC_CFLAGS
+ fi
+
+
+-dnl Configs for Windows DLLs
++# Configs for Windows DLLs
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ MPC_WINDOWS
+ esac
+
+
+-dnl Finally set up LibTool
+-AC_PROG_LIBTOOL
+-
+ # Checks for header files.
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS([complex.h locale.h inttypes.h stdint.h limits.h unistd.h sys/time.h])
diff --git a/core/libmpc/libmpc.install b/core/libmpc/libmpc.install
new file mode 100644
index 000000000..b0718c745
--- /dev/null
+++ b/core/libmpc/libmpc.install
@@ -0,0 +1,20 @@
+infodir=usr/share/info
+filelist=(libmpc.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/libnl/PKGBUILD b/core/libnl/PKGBUILD
new file mode 100644
index 000000000..2c835283b
--- /dev/null
+++ b/core/libnl/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 77938 2010-04-19 05:37:53Z allan $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+# Contributor: William Rea <sillywilly@gmail.com>
+
+pkgname=libnl
+pkgver=1.1
+pkgrel=2
+pkgdesc="Library for applications dealing with netlink sockets"
+arch=('i686' 'x86_64')
+url="http://www.infradead.org/~tgr/libnl/"
+license=('GPL')
+depends=('glibc')
+source=(ftp://ftp.archlinux.org/other/libnl/${pkgname}-${pkgver}.tar.gz
+ fix-compilation.patch)
+md5sums=('ae970ccd9144e132b68664f98e7ceeb1'
+ 'e1f5e82c8aa1b3ad025c7b588178de1e')
+
+build() {
+ cd ${srcdir}/libnl-${pkgver}
+ patch -Np1 -i ${srcdir}/fix-compilation.patch || return 1
+ ./configure --prefix=/usr || return 1
+ make || return 1
+}
+
+package() {
+ cd ${srcdir}/libnl-${pkgver}
+ make DESTDIR=${pkgdir} install || return 1
+}
diff --git a/core/libnl/fix-compilation.patch b/core/libnl/fix-compilation.patch
new file mode 100644
index 000000000..891562a39
--- /dev/null
+++ b/core/libnl/fix-compilation.patch
@@ -0,0 +1,10 @@
+--- libnl-1.1.orig/include/netlink-local.h 2008-01-14 16:48:45.000000000 +0100
++++ libnl-1.1/include/netlink-local.h 2009-06-26 11:15:33.186011844 +0200
+@@ -26,6 +26,7 @@
+ #include <sys/socket.h>
+ #include <inttypes.h>
+ #include <assert.h>
++#include <limits.h>
+
+ #include <arpa/inet.h>
+ #include <netdb.h>
diff --git a/core/libpcap/PKGBUILD b/core/libpcap/PKGBUILD
new file mode 100644
index 000000000..845ff13bf
--- /dev/null
+++ b/core/libpcap/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 103439 2010-12-19 15:40:24Z andyrtr $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgname=libpcap
+pkgver=1.1.1
+pkgrel=2
+pkgdesc="A system-independent interface for user-level packet capture"
+arch=('i686' 'x86_64')
+url="http://www.tcpdump.org/"
+license=('BSD')
+depends=('glibc' 'libnl' 'sh')
+makedepends=('flex')
+source=(http://www.tcpdump.org/release/libpcap-${pkgver}.tar.gz)
+sha256sums=('508cca15547e55d1318498b838456a21770c450beb2dc7d7d4a96d90816e5a85')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr --enable-ipv6
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ install -d -m755 ${pkgdir}/usr/bin
+ make DESTDIR=${pkgdir} install
+ # remove static library
+ rm -rf ${pkgdir}/usr/lib/libpcap.a
+
+ # backwards compatibility, programs often look for net/bpf.h
+ mkdir -p ${pkgdir}/usr/include/net
+ cd ${pkgdir}/usr/include/net
+ ln -s ../pcap-bpf.h bpf.h
+
+ #install the license
+ install -D -m644 ${srcdir}/$pkgname-$pkgver/LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE
+}
diff --git a/core/librpcsecgss/PKGBUILD b/core/librpcsecgss/PKGBUILD
new file mode 100644
index 000000000..56cfae7cf
--- /dev/null
+++ b/core/librpcsecgss/PKGBUILD
@@ -0,0 +1,38 @@
+# $Id: PKGBUILD 109603 2011-02-11 00:48:10Z stephane $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Andrew Krawchyk <krawch_a@denison.edu>, Marco Lima <cipparello gmail com>
+
+pkgname=librpcsecgss
+pkgver=0.19
+pkgrel=4
+pkgdesc="Library for RPCSECGSS support"
+arch=('i686' 'x86_64')
+url="http://www.citi.umich.edu/projects/nfsv4/linux/"
+license=('GPL')
+depends=('glibc' 'heimdal')
+makedepends=('pkg-config' 'autoconf')
+options=('!libtool')
+source=("http://www.citi.umich.edu/projects/nfsv4/linux/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+ librpcsecgss-0.18-heimdal.patch)
+md5sums=('b45ed565bdc3099023aa35830ec92997'
+ '0cfe088551d5776f5bc08c1741a34346')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # Patch from gentoo for heimdal compatibility Bug #231395
+ # http://bugs.gentoo.org/show_bug.cgi?id=231395
+ patch -Np1 -i $srcdir/librpcsecgss-0.18-heimdal.patch
+
+ rm -f config.guess config.sub ltmain.sh
+ autoreconf -i
+
+ GSSAPI_CFLAGS='-I/usr/include/gssapi' \
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="$pkgdir/" install
+}
diff --git a/core/librpcsecgss/librpcsecgss-0.18-heimdal.patch b/core/librpcsecgss/librpcsecgss-0.18-heimdal.patch
new file mode 100644
index 000000000..deb039123
--- /dev/null
+++ b/core/librpcsecgss/librpcsecgss-0.18-heimdal.patch
@@ -0,0 +1,33 @@
+diff -NaurwB librpcsecgss-0.18.orig/configure.in librpcsecgss-0.18/configure.in
+--- librpcsecgss-0.18.orig/configure.in 2008-04-09 00:05:40.000000000 +0200
++++ librpcsecgss-0.18/configure.in 2008-06-12 19:05:51.000000000 +0200
+@@ -12,10 +12,15 @@
+ AC_PROG_RANLIB
+
+ # Checks for libraries.
+-PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1], [],
++PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1],
++ [echo GSSGLUE found; GSSAPI_IMPLEMENTATION=libgssglue],
++ [PKG_CHECK_MODULES([GSSGLUE], [heimdal-gssapi],
++ [echo HEIMDAL found; GSSAPI_IMPLEMENTATION=heimdal-gssapi],
+ [AC_MSG_ERROR([Unable to locate information required to use libgssglue.
+ If you have pkgconfig installed, you might try setting environment
+- variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])])
++ variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])])])
++
++AC_SUBST([GSSAPI_IMPLEMENTATION])
+
+ # Checks for header files.
+ AC_HEADER_STDC
+diff -NaurwB librpcsecgss-0.18.orig/librpcsecgss.pc.in librpcsecgss-0.18/librpcsecgss.pc.in
+--- librpcsecgss-0.18.orig/librpcsecgss.pc.in 2007-09-06 17:39:04.000000000 +0200
++++ librpcsecgss-0.18/librpcsecgss.pc.in 2008-06-12 19:06:40.000000000 +0200
+@@ -5,7 +5,7 @@
+
+ Name: librpcsecgss
+ Description: Library that implements rpcsec_gss interface.
+-Requires: libgssglue
++Requires: @GSSAPI_IMPLEMENTATION@
+ Version: @PACKAGE_VERSION@
+ Libs: -L@libdir@ -lrpcsecgss
+ Cflags: -I@includedir@/rpcsecgss
diff --git a/core/libsasl/PKGBUILD b/core/libsasl/PKGBUILD
new file mode 100644
index 000000000..e5ba8e935
--- /dev/null
+++ b/core/libsasl/PKGBUILD
@@ -0,0 +1,54 @@
+# $Id: PKGBUILD 96213 2010-10-19 11:41:43Z allan $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=libsasl
+pkgver=2.1.23
+pkgrel=5
+pkgdesc="Cyrus Simple Authentication Service Layer (SASL) library"
+arch=('i686' 'x86_64')
+url="http://cyrusimap.web.cmu.edu/downloads.html#sasl"
+license=('custom')
+depends=('db>=4.8')
+optdepends=('cyrus-sasl: saslauthd'
+ 'cyrus-sasl-plugins: authentication plugins other than sasldb')
+source=(ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-${pkgver}.tar.gz
+ cyrus-sasl-2.1.19-checkpw.c.patch
+ cyrus-sasl-db.patch)
+options=('!makeflags')
+md5sums=('2eb0e48106f0e9cd8001e654f267ecbc'
+ 'e27ddff076342e7a3041c4759817d04b'
+ '0658201497aad359c0d66b0ab8032859')
+
+build() {
+ cd "${srcdir}/cyrus-sasl-${pkgver}"
+ patch -Np0 -i ${srcdir}/cyrus-sasl-2.1.19-checkpw.c.patch
+ patch -Np1 -i ${srcdir}/cyrus-sasl-db.patch
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --disable-anon \
+ --disable-cram \
+ --disable-digest \
+ --disable-gssapi \
+ --enable-login \
+ --disable-otp \
+ --enable-plain \
+ --mandir=/usr/share/man
+ for dir in include lib sasldb plugins utils; do
+ pushd ${dir}
+ make
+ popd
+ done
+}
+
+package() {
+ cd "${srcdir}/cyrus-sasl-${pkgver}"
+ for dir in include lib sasldb plugins utils; do
+ pushd ${dir} || return 1
+ make DESTDIR="${pkgdir}" install
+ popd
+ done
+
+ # install license
+ install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
+}
diff --git a/core/libsasl/cyrus-sasl-2.1.19-checkpw.c.patch b/core/libsasl/cyrus-sasl-2.1.19-checkpw.c.patch
new file mode 100644
index 000000000..f7bf44b79
--- /dev/null
+++ b/core/libsasl/cyrus-sasl-2.1.19-checkpw.c.patch
@@ -0,0 +1,170 @@
+diff -ur ../cyrus-sasl-2.1.19.orig/lib/Makefile.in ./lib/Makefile.in
+--- ../cyrus-sasl-2.1.19.orig/lib/Makefile.in 2004-07-02 21:40:15.000000000 +0200
++++ ./lib/Makefile.in 2004-09-07 13:21:22.746680576 +0200
+@@ -120,7 +120,7 @@
+ JAVA_TRUE = @JAVA_TRUE@
+ LDFLAGS = @LDFLAGS@
+ LIBOBJS = @LIBOBJS@
+-LIBS = @LIBS@
++LIBS = -lcrypt @LIBS@
+ LIBTOOL = @LIBTOOL@
+ LIB_CRYPT = @LIB_CRYPT@
+ LIB_DES = @LIB_DES@
+diff -ur ../cyrus-sasl-2.1.19.orig/lib/checkpw.c ./lib/checkpw.c
+--- ../cyrus-sasl-2.1.19.orig/lib/checkpw.c 2004-03-17 14:58:13.000000000 +0100
++++ ./lib/checkpw.c 2004-09-07 13:21:12.645916147 +0200
+@@ -94,6 +94,23 @@
+ # endif
+ #endif
+
++/******************************
++ * crypt(3) patch start *
++ ******************************/
++char *crypt(const char *key, const char *salt);
++
++/* cleartext password formats */
++#define PASSWORD_FORMAT_CLEARTEXT 1
++#define PASSWORD_FORMAT_CRYPT 2
++#define PASSWORD_FORMAT_CRYPTTRAD 3
++#define PASSWORD_SALT_BUF_LEN 22
++
++/* weeds out crypt(3) password's salt */
++int _sasl_get_salt (char *dest, char *src, int format);
++
++/******************************
++ * crypt(3) patch stop *
++ ******************************/
+
+ /* we store the following secret to check plaintext passwords:
+ *
+@@ -143,7 +160,51 @@
+ "*cmusaslsecretPLAIN",
+ NULL };
+ struct propval auxprop_values[3];
+-
++
++ /******************************
++ * crypt(3) patch start *
++ * for password format check *
++ ******************************/
++ sasl_getopt_t *getopt;
++ void *context;
++ const char *p = NULL;
++ /**
++ * MD5: 12 char salt
++ * BLOWFISH: 16 char salt
++ */
++ char salt[PASSWORD_SALT_BUF_LEN];
++ int password_format;
++
++ /* get password format from auxprop configuration */
++ if (_sasl_getcallback(conn, SASL_CB_GETOPT, &getopt, &context) == SASL_OK) {
++ getopt(context, NULL, "password_format", &p, NULL);
++ }
++
++ /* set password format */
++ if (p) {
++ /*
++ memset(pass_format_str, '\0', PASSWORD_FORMAT_STR_LEN);
++ strncpy(pass_format_str, p, (PASSWORD_FORMAT_STR_LEN - 1));
++ */
++ /* modern, modular crypt(3) */
++ if (strncmp(p, "crypt", 11) == 0)
++ password_format = PASSWORD_FORMAT_CRYPT;
++ /* traditional crypt(3) */
++ else if (strncmp(p, "crypt_trad", 11) == 0)
++ password_format = PASSWORD_FORMAT_CRYPTTRAD;
++ /* cleartext password */
++ else
++ password_format = PASSWORD_FORMAT_CLEARTEXT;
++ } else {
++ /* cleartext password */
++ password_format = PASSWORD_FORMAT_CLEARTEXT;
++ }
++
++ /******************************
++ * crypt(3) patch stop *
++ * for password format check *
++ ******************************/
++
+ if (!conn || !userstr)
+ return SASL_BADPARAM;
+
+@@ -180,14 +241,31 @@
+ goto done;
+ }
+
+- /* At the point this has been called, the username has been canonified
+- * and we've done the auxprop lookup. This should be easy. */
+- if(auxprop_values[0].name
+- && auxprop_values[0].values
+- && auxprop_values[0].values[0]
+- && !strcmp(auxprop_values[0].values[0], passwd)) {
+- /* We have a plaintext version and it matched! */
+- return SASL_OK;
++
++ /******************************
++ * crypt(3) patch start *
++ ******************************/
++
++ /* get salt */
++ _sasl_get_salt(salt, (char *) auxprop_values[0].values[0], password_format);
++
++ /* crypt(3)-ed password? */
++ if (password_format != PASSWORD_FORMAT_CLEARTEXT) {
++ /* compare password */
++ if (auxprop_values[0].name && auxprop_values[0].values && auxprop_values[0].values[0] && strcmp(crypt(passwd, salt), auxprop_values[0].values[0]) == 0)
++ return SASL_OK;
++ else
++ ret = SASL_BADAUTH;
++ }
++ else if (password_format == PASSWORD_FORMAT_CLEARTEXT) {
++ /* compare passwords */
++ if (auxprop_values[0].name && auxprop_values[0].values && auxprop_values[0].values[0] && strcmp(auxprop_values[0].values[0], passwd) == 0)
++ return SASL_OK;
++ else
++ ret = SASL_BADAUTH;
++ /******************************
++ * crypt(3) patch stop *
++ ******************************/
+ } else if(auxprop_values[1].name
+ && auxprop_values[1].values
+ && auxprop_values[1].values[0]) {
+@@ -975,3 +1053,37 @@
+ #endif
+ { NULL, NULL }
+ };
++
++/* weeds out crypt(3) password's salt */
++int _sasl_get_salt (char *dest, char *src, int format) {
++ int num; /* how many characters is salt long? */
++ switch (format) {
++ case PASSWORD_FORMAT_CRYPT:
++ /* md5 crypt */
++ if (src[1] == '1')
++ num = 12;
++ /* blowfish crypt */
++ else if (src[1] == '2')
++ num = (src[1] == '2' && src[2] == 'a') ? 17 : 16;
++ /* traditional crypt */
++ else
++ num = 2;
++ break;
++
++ case PASSWORD_FORMAT_CRYPTTRAD:
++ num = 2;
++ break;
++
++ default:
++ return 1;
++ }
++
++ /* destroy destination */
++ memset(dest, '\0', (num + 1));
++
++ /* copy salt to destination */
++ strncpy(dest, src, num);
++
++ return 1;
++}
++
diff --git a/core/libsasl/cyrus-sasl-db.patch b/core/libsasl/cyrus-sasl-db.patch
new file mode 100644
index 000000000..08758ab85
--- /dev/null
+++ b/core/libsasl/cyrus-sasl-db.patch
@@ -0,0 +1,34 @@
+diff -urN aaa/cyrus-sasl-2.1.22/cmulocal/berkdb.m4 cyrus-sasl-2.1.22/cmulocal/berkdb.m4
+--- aaa/cyrus-sasl-2.1.22/cmulocal/berkdb.m4 2005-04-26 21:14:07.000000000 +0200
++++ cyrus-sasl-2.1.22/cmulocal/berkdb.m4 2006-10-02 20:36:17.137852392 +0200
+@@ -213,7 +213,7 @@
+ fi
+
+ saved_LIBS=$LIBS
+- for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
++ for dbname in db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
+ do
+ LIBS="$saved_LIBS -l$dbname"
+ AC_TRY_LINK([#include <db.h>],
+--- cyrus-sasl-2.1.23/sasldb/db_berkeley.c.orig 2009-04-28 17:09:18.000000000 +0200
++++ cyrus-sasl-2.1.23/sasldb/db_berkeley.c 2010-05-18 21:02:20.418940098 +0200
+@@ -100,7 +100,7 @@
+ ret = db_create(mbdb, NULL, 0);
+ if (ret == 0 && *mbdb != NULL)
+ {
+-#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
++#if (DB_VERSION_MAJOR > 4) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
+ ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, flags, 0660);
+ #else
+ ret = (*mbdb)->open(*mbdb, path, NULL, DB_HASH, flags, 0660);
+--- cyrus-sasl-2.1.23/utils/dbconverter-2.c.orig 2003-02-13 20:56:17.000000000 +0100
++++ cyrus-sasl-2.1.23/utils/dbconverter-2.c 2010-05-18 21:11:09.982932556 +0200
+@@ -214,7 +214,7 @@
+ ret = db_create(mbdb, NULL, 0);
+ if (ret == 0 && *mbdb != NULL)
+ {
+-#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
++#if (DB_VERSION_MAJOR > 4) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
+ ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, DB_CREATE, 0664);
+ #else
+ ret = (*mbdb)->open(*mbdb, path, NULL, DB_HASH, DB_CREATE, 0664);
diff --git a/core/libtirpc/PKGBUILD b/core/libtirpc/PKGBUILD
new file mode 100644
index 000000000..952640dcb
--- /dev/null
+++ b/core/libtirpc/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 97756 2010-11-01 19:49:14Z tpowa $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+pkgname=libtirpc
+pkgver=0.2.1
+pkgrel=2
+pkgdesc="Transport Independent RPC library (SunRPC replacement)"
+arch=(i686 x86_64)
+depends=('glibc' 'libgssglue' 'heimdal')
+url="http://libtirpc.sourceforge.net/"
+license=('GPL2')
+source=(http://downloads.sourceforge.net/sourceforge/libtirpc/$pkgname-$pkgver.tar.bz2
+ libtirpc-0.2.1-fortify.patch)
+backup=('etc/netconfig')
+options=(!libtool)
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ # fix http://bugs.gentoo.org/293593
+ # https://bugs.archlinux.org/task/20082
+ patch -Np1 -i ../libtirpc-0.2.1-fortify.patch
+ ./configure --prefix=/usr --enable-gss
+ make || return 1
+ make DESTDIR=$pkgdir install || return 1
+ # install netconfig
+ install -D -m644 doc/etc_netconfig $pkgdir/etc/netconfig
+}
+md5sums=('d77eb15f464bf9d6e66259eaf78b2a4e'
+ '2e5c067f1651469dfbbdc91d3c9c60e8')
diff --git a/core/libtirpc/libtirpc-0.2.1-fortify.patch b/core/libtirpc/libtirpc-0.2.1-fortify.patch
new file mode 100644
index 000000000..7375bf83e
--- /dev/null
+++ b/core/libtirpc/libtirpc-0.2.1-fortify.patch
@@ -0,0 +1,18 @@
+Index: libtirpc-0.2.1/src/getrpcport.c
+===================================================================
+--- libtirpc-0.2.1.orig/src/getrpcport.c
++++ libtirpc-0.2.1/src/getrpcport.c
+@@ -54,11 +54,11 @@ getrpcport(host, prognum, versnum, proto
+
+ if ((hp = gethostbyname(host)) == NULL)
+ return (0);
++ if (hp->h_length != sizeof(addr.sin_addr.s_addr))
++ return (0);
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_port = 0;
+- if (hp->h_length > sizeof(addr))
+- hp->h_length = sizeof(addr);
+ memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
+ /* Inconsistent interfaces need casts! :-( */
+ return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,
diff --git a/core/libtool/PKGBUILD b/core/libtool/PKGBUILD
new file mode 100644
index 000000000..1ce394098
--- /dev/null
+++ b/core/libtool/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 103285 2010-12-17 05:56:05Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+# NOTE: requires rebuilt with each new gcc version
+
+pkgname=libtool
+pkgver=2.4
+pkgrel=2
+pkgdesc="A generic library support script"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/libtool"
+license=('GPL')
+depends=('sh' 'tar' 'texinfo')
+groups=('base-devel')
+options=('!libtool')
+install=libtool.install
+source=(ftp://ftp.gnu.org/pub/gnu/libtool/${pkgname}-${pkgver}.tar.xz)
+md5sums=('4e6144439d95d7332dc50ace6dd24c55')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr
+ make
+ make check
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+}
diff --git a/core/libtool/libtool.install b/core/libtool/libtool.install
new file mode 100644
index 000000000..424c8cb88
--- /dev/null
+++ b/core/libtool/libtool.install
@@ -0,0 +1,22 @@
+infodir=/usr/share/info
+filelist=(libtool.info libtool.info-1 libtool.info-2)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/libusb-compat/PKGBUILD b/core/libusb-compat/PKGBUILD
new file mode 100644
index 000000000..b2b16ced6
--- /dev/null
+++ b/core/libusb-compat/PKGBUILD
@@ -0,0 +1,26 @@
+# $Id: PKGBUILD 101197 2010-11-28 15:10:38Z tpowa $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: arjan <arjan@archlinux.org>
+
+pkgname=libusb-compat
+pkgver=0.1.3
+pkgrel=1
+pkgdesc="Library to enable user space application programs to communicate with USB devices"
+arch=('i686' 'x86_64')
+depends=('libusb' 'sh')
+url="http://libusb.sourceforge.net/"
+license=('LGPL')
+source=(http://downloads.sourceforge.net/libusb/libusb-compat-0.1/$pkgname-$pkgver/${pkgname}-${pkgver}.tar.bz2)
+options=('!libtool')
+md5sums=('570ac2ea085b80d1f74ddc7c6a93c0eb')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+}
diff --git a/core/libusb/PKGBUILD b/core/libusb/PKGBUILD
new file mode 100644
index 000000000..947361b3d
--- /dev/null
+++ b/core/libusb/PKGBUILD
@@ -0,0 +1,25 @@
+# $Id: PKGBUILD 101194 2010-11-28 15:05:41Z tpowa $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+pkgname=libusb
+pkgver=1.0.8
+pkgrel=1
+depends=('glibc')
+pkgdesc="Library to enable user space application programs to communicate with USB devices."
+arch=(i686 x86_64)
+url="http://libusb.sourceforge.net/"
+license=('LGPL')
+source=(http://downloads.sourceforge.net/libusb/libusb-${pkgver}.tar.bz2)
+options=(!libtool)
+replaces=(libusb1)
+md5sums=('37d34e6eaa69a4b645a19ff4ca63ceef')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr
+ make
+}
+
+package () {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/core/lilo/PKGBUILD b/core/lilo/PKGBUILD
new file mode 100644
index 000000000..c2de0f4ed
--- /dev/null
+++ b/core/lilo/PKGBUILD
@@ -0,0 +1,40 @@
+# $Id: PKGBUILD 101453 2010-11-29 09:41:45Z andrea $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=lilo
+pkgver=23.1
+pkgrel=2
+pkgdesc="A bootloader for Linux"
+arch=('i686' 'x86_64')
+url="https://alioth.debian.org/projects/lilo/"
+license=('BSD')
+# While lilo should stay in the base category,
+# it usually makes no sense if it is installed
+# with pacman -S base, therefore, don't add
+# the base group here.
+#groups=('base')
+backup=('etc/lilo.conf')
+depends=('device-mapper' 'coreutils')
+makedepends=('bin86' 'sharutils')
+optdepends=('perl: to use keytab-lilo')
+install=lilo.install
+options=('!makeflags')
+source=("http://lilo.alioth.debian.org/ftp/upstream/sources/${pkgname}-${pkgver}.tar.gz"
+ 'lilo.conf')
+md5sums=('36139c1b8f4dc835fc7775e59ee4b20c'
+ 'a3a4c90bead3f9b8672bd384ff9f8db1')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ export LC_ALL=C
+ make all
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ install -D -m644 "${srcdir}/lilo.conf" "${pkgdir}/etc/lilo.conf"
+ install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
diff --git a/core/lilo/lilo.conf b/core/lilo/lilo.conf
new file mode 100644
index 000000000..0e31e77a5
--- /dev/null
+++ b/core/lilo/lilo.conf
@@ -0,0 +1,28 @@
+#
+# /etc/lilo.conf
+#
+
+boot=/dev/hda
+# This line often fixes L40 errors on bootup
+# disk=/dev/hda bios=0x80
+
+default=arch
+timeout=50
+lba32
+prompt
+
+image=/boot/vmlinuz26
+ label=arch
+ root=/dev/hda3
+ initrd=/boot/kernel26.img
+ read-only
+
+image=/boot/vmlinuz26
+ label=arch-fallback
+ root=/dev/hda3
+ initrd=/boot/kernel26-fallback.img
+ read-only
+
+#other=/dev/hda1
+# label=dos
+
diff --git a/core/lilo/lilo.install b/core/lilo/lilo.install
new file mode 100644
index 000000000..7375fddf8
--- /dev/null
+++ b/core/lilo/lilo.install
@@ -0,0 +1,5 @@
+post_upgrade() {
+ echo
+ echo "If you use the LILO bootloader, you should run 'lilo' after upgrading."
+ echo
+}
diff --git a/core/links/PKGBUILD b/core/links/PKGBUILD
new file mode 100644
index 000000000..aca8da456
--- /dev/null
+++ b/core/links/PKGBUILD
@@ -0,0 +1,47 @@
+# $Id: PKGBUILD 102993 2010-12-13 20:58:28Z eric $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+
+pkgname=links
+pkgver=2.3pre1
+pkgrel=1
+pkgdesc="A text WWW browser, similar to Lynx"
+arch=('i686' 'x86_64')
+url="http://links.twibright.com/"
+license=('GPL')
+depends=('bzip2' 'zlib' 'openssl' 'gpm')
+makedepends=('libtiff' 'libpng' 'libxt')
+optdepends=('libx11: for using xlinks' 'libtiff: for using xlinks' 'libpng: for using xlinks')
+provides=('links-g')
+conflicts=('links-g')
+replaces=('links-g')
+source=(http://links.twibright.com/download/${pkgname}-${pkgver}.tar.bz2 links.desktop)
+md5sums=('76cff0c716cd2a710abb078f859cfe9b' '7c47b15aaef51f1de129ff3a2afb7eac')
+sha1sums=('6d420a5c4514b45ee245fd3933d2a8cfa6eae76d' 'f600e27c2a71184444f7dd07a10230aa44463a02')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ (cd intl; ./gen-intl; ./synclang)
+ ./configure --prefix=/usr --mandir=/usr/share/man --enable-javascript \
+ --enable-graphics --with-x --with-fb
+ make
+ mv links xlinks
+
+ ./configure --prefix=/usr --mandir=/usr/share/man --enable-javascript \
+ --disable-graphics --without-x --without-fb
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ install -m755 xlinks "${pkgdir}/usr/bin/xlinks"
+ ln -s links.1.gz "${pkgdir}/usr/share/man/man1/xlinks.1.gz"
+
+ install -D -m644 "${srcdir}/links.desktop" "${pkgdir}/usr/share/applications/links.desktop"
+ install -d "${pkgdir}/usr/share/pixmaps"
+ install -m644 links_16x16_1.xpm links_16x16_2.xpm links_32x32.xpm "${pkgdir}/usr/share/pixmaps/"
+
+ install -d "${pkgdir}/usr/share/doc/links/calibration"
+ install -m644 doc/links_cal/* "${pkgdir}/usr/share/doc/links/calibration/"
+}
diff --git a/core/links/links.desktop b/core/links/links.desktop
new file mode 100644
index 000000000..9d6338a5b
--- /dev/null
+++ b/core/links/links.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=Links
+Exec=xlinks -g
+Icon=links_32x32.xpm
+Type=Application
+Terminal=false
+Categories=Network;WebBrowser;
diff --git a/core/linux-api-headers/PKGBUILD b/core/linux-api-headers/PKGBUILD
new file mode 100644
index 000000000..27dfd88f7
--- /dev/null
+++ b/core/linux-api-headers/PKGBUILD
@@ -0,0 +1,38 @@
+# $Id: PKGBUILD 106756 2011-01-19 00:34:07Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+
+# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
+
+pkgname=linux-api-headers
+pkgver=2.6.37
+_basever=2.6.37
+pkgrel=1
+pkgdesc="Kernel headers sanitized for use in userspace"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/libc"
+license=('GPL2')
+provides=("kernel-headers=${pkgver}")
+conflicts=('kernel-headers')
+replaces=('kernel-headers')
+source=(http://www.kernel.org/pub/linux/kernel/v2.6/linux-${_basever}.tar.bz2)
+ #http://www.kernel.org/pub/linux/kernel/v2.6/patch-${pkgver}.bz2)
+md5sums=('c8ee37b4fdccdb651e0603d35350b434')
+
+build() {
+ cd ${srcdir}/linux-${_basever}
+ #patch -Np1 -i ${srcdir}/patch-${pkgver}
+
+ make mrproper
+ make headers_check
+}
+
+package() {
+ cd ${srcdir}/linux-${_basever}
+ make INSTALL_HDR_PATH=${pkgdir}/usr headers_install
+
+ # use headers from libdrm
+ rm -rf ${pkgdir}/usr/include/drm
+
+ # clean-up unnecessary files generated during install
+ find ${pkgdir} -name .install -or -name ..install.cmd | xargs rm -f
+}
diff --git a/core/linux-atm/PKGBUILD b/core/linux-atm/PKGBUILD
new file mode 100644
index 000000000..2a7f7c7e0
--- /dev/null
+++ b/core/linux-atm/PKGBUILD
@@ -0,0 +1,30 @@
+# $Id: PKGBUILD 107943 2011-01-28 01:46:01Z stephane $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Surain Mallawa Arachchi <mas@crc32.net>
+
+pkgname=linux-atm
+pkgver=2.5.1
+pkgrel=2
+pkgdesc="Drivers and tools to support ATM networking under Linux."
+arch=('i686' 'x86_64')
+depends=('glibc')
+url="http://linux-atm.sourceforge.net/"
+license=(GPL)
+source=(http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tgz
+ man-pages.patch)
+md5sums=('9560b0e1f410a05b849dfdab465dd758'
+ '181390736336cdb615ae32f1ae5acfa6')
+options=(!libtool !makeflags)
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i ../man-pages.patch
+ ./configure --prefix=/usr --sysconfdir=/etc
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
+
diff --git a/core/linux-atm/man-pages.patch b/core/linux-atm/man-pages.patch
new file mode 100644
index 000000000..c504cfe87
--- /dev/null
+++ b/core/linux-atm/man-pages.patch
@@ -0,0 +1,45 @@
+diff -up linux-atm-2.5.1/src/led/zeppelin.8.fixman linux-atm-2.5.1/src/led/zeppelin.8
+--- linux-atm-2.5.1/src/led/zeppelin.8.fixman 2003-05-02 19:35:04.000000000 +0200
++++ linux-atm-2.5.1/src/led/zeppelin.8 2010-10-13 12:58:18.000000000 +0200
+@@ -99,7 +99,7 @@ Ring and ATM parts of the ELAN, so using
+ recommended. Token Ring support has received less testing than its
+ Ethernet counterpart.
+ .SH FILES
+-.IP \fI/var/run/lec[interface number].pid\fP
++\fI/var/run/lec[interface number].pid\fP
+ The file containing the process id of zeppelin.
+ .SH BUGS
+ John Bonham died 1980 and Led Zeppelin broke.
+diff -up linux-atm-2.5.1/src/mpoad/mpcd.8.fixman linux-atm-2.5.1/src/mpoad/mpcd.8
+--- linux-atm-2.5.1/src/mpoad/mpcd.8.fixman 2001-10-10 00:33:07.000000000 +0200
++++ linux-atm-2.5.1/src/mpoad/mpcd.8 2010-10-13 12:59:14.000000000 +0200
+@@ -28,7 +28,7 @@ mpcd \- ATM MPOA (Multi\-Protocol Over A
+ .B ]]
+ .SH DESCRIPTION
+ MPOA client
+-.SM(MPC) is responsible for creating and receiving
++.SM (MPC) is responsible for creating and receiving
+ internetwork layer shortcuts. Using these shortcuts MPCs forward
+ unicast internetwork layer packets effectively over ATM without need
+ for routing protocols.
+@@ -43,7 +43,7 @@ accepts shortcuts and packets arriving o
+ shortcuts is done with the help of
+ .SM MPOA
+ server
+-.SM(MPS).
++.SM (MPS).
+ .PP
+ Just as the Linux
+ .SM LAN
+diff -up linux-atm-2.5.1/src/sigd/atmsigd.conf.4.fixman linux-atm-2.5.1/src/sigd/atmsigd.conf.4
+--- linux-atm-2.5.1/src/sigd/atmsigd.conf.4.fixman 2001-10-10 00:33:07.000000000 +0200
++++ linux-atm-2.5.1/src/sigd/atmsigd.conf.4 2010-10-13 12:58:49.000000000 +0200
+@@ -125,7 +125,7 @@ a comment. The `#' character cannot be e
+ .P
+ If an option is specified in \fBatmsigd.conf\fP and on the command
+ line, the command line has priority.
+-.COMPATIBILITY
++.SH COMPATIBILITY
+ Certain options used by past versions of \fBatmsigd\fP but no longer documented
+ on the man page are still recognized and supported, but they also yield a
+ warning message. Future versions of \fBatmsigd\fP will not recognize those
diff --git a/core/logrotate/PKGBUILD b/core/logrotate/PKGBUILD
new file mode 100644
index 000000000..1cb10e4bd
--- /dev/null
+++ b/core/logrotate/PKGBUILD
@@ -0,0 +1,39 @@
+# $Id: PKGBUILD 92736 2010-09-30 15:38:29Z allan $
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=logrotate
+pkgver=3.7.9
+pkgrel=1
+pkgdesc="Rotates system logs automatically"
+url='https://fedorahosted.org/logrotate/'
+arch=('i686' 'x86_64')
+license=('GPL')
+groups=('base')
+depends=('popt' 'cron' 'gzip')
+backup=('etc/logrotate.conf')
+source=(https://fedorahosted.org/releases/l/o/logrotate/logrotate-${pkgver}.tar.gz
+ logrotate.conf
+ logrotate.cron.daily)
+md5sums=('eeba9dbca62a9210236f4b83195e4ea5'
+ '462a5f364717461537eb2ae6394ad23e'
+ '8e23d5d4cc29b1e055b24df87e355cdc')
+
+build() {
+ cd $srcdir/${pkgname}-${pkgver}
+
+ sed -i 's|#define DEFAULT_MAIL_COMMAND .*|#define DEFAULT_MAIL_COMMAND "/usr/bin/mail"|'\
+ config.h
+ sed -i "s|CFLAGS = -Wall|CFLAGS = -Wall $CFLAGS|" Makefile
+ sed -i 's|$(BASEDIR)/man|$(BASEDIR)/share/man|' Makefile
+
+ make
+}
+
+package() {
+ cd $srcdir/${pkgname}-${pkgver}
+ make PREFIX=$pkgdir install
+
+ install -Dm644 $srcdir/logrotate.conf $pkgdir/etc/logrotate.conf
+ install -Dm744 $srcdir/logrotate.cron.daily $pkgdir/etc/cron.daily/logrotate
+}
diff --git a/core/logrotate/logrotate.conf b/core/logrotate/logrotate.conf
new file mode 100644
index 000000000..88b4935cd
--- /dev/null
+++ b/core/logrotate/logrotate.conf
@@ -0,0 +1,31 @@
+# see "man logrotate" for details
+# rotate log files weekly
+weekly
+
+# keep 4 weeks worth of backlogs
+rotate 4
+
+# restrict maximum size of log files
+#size 20M
+
+# create new (empty) log files after rotating old ones
+create
+
+# uncomment this if you want your log files compressed
+#compress
+
+# Logs are moved into directory for rotation
+# olddir /var/log/archive
+
+# Ignore pacman saved files
+tabooext + .pacorig .pacnew .pacsave
+
+# Arch packages drop log rotation information into this directory
+include /etc/logrotate.d
+
+/var/log/wtmp {
+ monthly
+ create 0664 root root
+ rotate 1
+}
+
diff --git a/core/logrotate/logrotate.cron.daily b/core/logrotate/logrotate.cron.daily
new file mode 100755
index 000000000..e8ab921ea
--- /dev/null
+++ b/core/logrotate/logrotate.cron.daily
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/sbin/logrotate /etc/logrotate.conf
diff --git a/core/lvm2/PKGBUILD b/core/lvm2/PKGBUILD
new file mode 100644
index 000000000..3a946ff04
--- /dev/null
+++ b/core/lvm2/PKGBUILD
@@ -0,0 +1,61 @@
+# $Id: PKGBUILD 109502 2011-02-10 10:44:18Z eric $
+# Maintainer: Eric Bélanger <eric@archlinux.org>
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgbase=lvm2
+pkgname=('lvm2' 'device-mapper')
+pkgver=2.02.84
+_pkgverlvm=${pkgver}
+pkgrel=1
+arch=('i686' 'x86_64')
+url="http://sourceware.org/lvm2/"
+license=('GPL2' 'LGPL2.1')
+groups=('base')
+conflicts=('mkinitcpio<0.5.99')
+source=(ftp://sources.redhat.com/pub/lvm2/LVM2.${_pkgverlvm}.tgz
+ lvm2_install
+ lvm2_hook)
+md5sums=('8b4e0897ee48f02c0dff11940e44e23b' 'e29bc80d636ed17b617d9b384a5f3aa0'\
+ '7103e3fef1180478811ac4e32aec540d')
+sha1sums=('6d92f4474f93c7d3824a0eb3469c7e4f9ef8f1d4' '662fc54ce291fd79bd09701e4c3e10854f325282'\
+ '769767d84c73674cbb68c765460e57c428c314a0')
+
+build() {
+ cd "${srcdir}/LVM2.${_pkgverlvm}"
+ sed -i 's|/usr/bin/tr|/bin/tr|' scripts/lvmdump.sh
+ unset LDFLAGS
+ ./configure --prefix= --sysconfdir=/etc --localstatedir=/var --datarootdir=/usr/share \
+ --includedir=/usr/include --with-usrlibdir=/usr/lib \
+ --enable-pkgconfig --enable-readline --enable-dmeventd --enable-cmdlib --enable-applib \
+ --with-udevdir=/lib/udev/rules.d/ --enable-udev_sync --enable-udev_rules
+ make
+}
+
+package_device-mapper() {
+ pkgdesc="Device mapper userspace library and tools"
+ url="http://sourceware.org/dm/"
+ depends=('glibc' 'udev')
+
+ cd "${srcdir}/LVM2.${_pkgverlvm}"
+ make DESTDIR="${pkgdir}" install_device-mapper
+}
+
+package_lvm2() {
+ pkgdesc="Logical Volume Manager 2 utilities"
+ depends=('bash' "device-mapper>=${pkgver}" 'udev' 'readline')
+ conflicts=('lvm' 'mkinitcpio<0.5.99')
+ backup=('etc/lvm/lvm.conf')
+ options=('!makeflags')
+
+ cd "${srcdir}/LVM2.${_pkgverlvm}"
+ make DESTDIR="${pkgdir}" install_lvm2
+ # install applib
+ cd liblvm
+ make DESTDIR="${pkgdir}" install
+ cd ..
+ # /etc directories
+ install -d "${pkgdir}"/etc/lvm/{archive,backup}
+ # mkinitcpio hook
+ install -D -m644 "${srcdir}/lvm2_hook" "${pkgdir}/lib/initcpio/hooks/lvm2"
+ install -D -m644 "${srcdir}/lvm2_install" "${pkgdir}/lib/initcpio/install/lvm2"
+}
diff --git a/core/lvm2/lvm2_hook b/core/lvm2/lvm2_hook
new file mode 100644
index 000000000..d6d1c1f94
--- /dev/null
+++ b/core/lvm2/lvm2_hook
@@ -0,0 +1,23 @@
+# vim:set ft=sh:
+run_hook ()
+{
+ /sbin/modprobe -q dm-mod >/dev/null 2>&1
+ if [ -e "/sys/class/misc/device-mapper" ]; then
+ if [ ! -e "/dev/mapper/control" ]; then
+ /bin/mknod "/dev/mapper/control" c $(cat /sys/class/misc/device-mapper/dev | sed 's|:| |')
+ fi
+
+ # If the lvmwait= parameter has been specified on the command line
+ # wait for the device(s) before trying to activate the volume group(s)
+ if [ -n "${lvmwait}" ]; then
+ for pvdev in $(echo ${lvmwait} | sed 's|,| |g'); do
+ poll_device ${pvdev} ${rootdelay}
+ done
+ fi
+
+ [ "${quiet}" = "y" ] && LVMQUIET=">/dev/null"
+
+ msg "Activating logical volumes..."
+ eval /sbin/lvm vgchange --sysinit -a y $LVMQUIET
+ fi
+}
diff --git a/core/lvm2/lvm2_install b/core/lvm2/lvm2_install
new file mode 100644
index 000000000..0c01ce69c
--- /dev/null
+++ b/core/lvm2/lvm2_install
@@ -0,0 +1,29 @@
+# vim: set ft=sh:
+
+install ()
+{
+ MODULES=" dm-mod dm-snapshot dm-mirror"
+ BINARIES=""
+ FILES=""
+ SCRIPT="lvm2"
+
+ add_dir "/dev/mapper"
+ add_binary "/sbin/lvm"
+ add_binary "/sbin/dmsetup"
+ add_file "/lib/udev/rules.d/10-dm.rules"
+ add_file "/lib/udev/rules.d/13-dm-disk.rules"
+ add_file "/lib/udev/rules.d/95-dm-notify.rules"
+ add_file "/lib/udev/rules.d/11-dm-lvm.rules"
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook loads the necessary modules for an LVM2 root device.
+
+ The optional lvmwait= parameter followed by a comma-separated
+ list of device names can be given on the command line.
+ It will cause the hook to wait until all given devices exist
+ before trying to scan and activate any volume groups.
+HELPEOF
+}
diff --git a/core/lzo2/PKGBUILD b/core/lzo2/PKGBUILD
new file mode 100644
index 000000000..4f2889baf
--- /dev/null
+++ b/core/lzo2/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 100405 2010-11-23 12:35:30Z stephane $
+# Contributor: Low Kian Seong <fastmail_low@speedymail.org>
+# Maintainer: dorphell <dorphell@archlinux.org>
+pkgname=lzo2
+pkgver=2.04
+pkgrel=1
+pkgdesc="Portable lossless data compression library"
+arch=('i686' 'x86_64')
+url="http://www.oberhumer.com/opensource/lzo"
+license=('GPL')
+depends=('glibc')
+source=(http://www.oberhumer.com/opensource/lzo/download/lzo-${pkgver}.tar.gz)
+options=(!libtool)
+sha1sums=('f5bf5c7ae4116e60513e5788d156ef78946677e7')
+
+build() {
+ cd "${srcdir}/lzo-${pkgver}"
+
+ ./configure --prefix=/usr --enable-shared
+ make
+
+ # build minilzo
+ gcc $CFLAGS -fpic -Iinclude/lzo -o minilzo/minilzo.o -c minilzo/minilzo.c
+ gcc -g -shared -o libminilzo.so.0 -Wl,-soname,libminilzo.so.0 minilzo/minilzo.o
+}
+
+package() {
+ cd "${srcdir}/lzo-${pkgver}"
+ make DESTDIR=${pkgdir} install
+
+ # install minilzo
+ install -m 755 libminilzo.so.0 ${pkgdir}/usr/lib
+ install -p -m 644 minilzo/minilzo.h ${pkgdir}/usr/include/lzo
+ cd ${pkgdir}/usr/lib
+ ln -s libminilzo.so.0 libminilzo.so
+}
diff --git a/core/m4/PKGBUILD b/core/m4/PKGBUILD
new file mode 100644
index 000000000..aec43611b
--- /dev/null
+++ b/core/m4/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 111924 2011-03-02 03:59:52Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=m4
+pkgver=1.4.16
+pkgrel=1
+pkgdesc="The GNU macro processor"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/m4"
+license=('GPL3')
+groups=('base-devel')
+depends=('glibc' 'bash')
+install=m4.install
+source=(ftp://ftp.gnu.org/gnu/m4/$pkgname-$pkgver.tar.xz)
+md5sums=('7548ec061a1ba993790159764f522d0e')
+
+build() {
+ cd ${srcdir}/$pkgname-$pkgver
+ ./configure --prefix=/usr
+ make
+ make check
+}
+
+package() {
+ cd ${srcdir}/$pkgname-$pkgver
+ make prefix=${pkgdir}/usr install
+}
diff --git a/core/m4/m4.install b/core/m4/m4.install
new file mode 100644
index 000000000..be4138170
--- /dev/null
+++ b/core/m4/m4.install
@@ -0,0 +1,20 @@
+infodir=usr/share/info
+filelist=(m4.info m4.info-1 m4.info-2)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/make/PKGBUILD b/core/make/PKGBUILD
new file mode 100644
index 000000000..8ac07413b
--- /dev/null
+++ b/core/make/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 77792 2010-04-18 03:42:45Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=make
+pkgver=3.81
+pkgrel=5
+pkgdesc="GNU make utility to maintain groups of programs"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/make"
+license=('GPL')
+groups=('base-devel')
+depends=('glibc' 'sh')
+install=$pkgname.install
+source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz)
+md5sums=('a4e9494ac6dc3f6b0c5ff75c5d52abba')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man --infodir=/usr/share/info
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+}
diff --git a/core/make/make.install b/core/make/make.install
new file mode 100644
index 000000000..0c2da13c3
--- /dev/null
+++ b/core/make/make.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(make.info make.info-1 make.info-2)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/man-db/PKGBUILD b/core/man-db/PKGBUILD
new file mode 100644
index 000000000..05265fdc1
--- /dev/null
+++ b/core/man-db/PKGBUILD
@@ -0,0 +1,52 @@
+# $Id: PKGBUILD 99794 2010-11-17 19:07:22Z andyrtr $
+# Maintainer: Andreas Radke <andyrtr@archlinux.org>
+# Contributor: Sergej Pupykin <sergej@aur.archlinux.org>
+
+pkgname=man-db
+pkgver=2.5.9
+pkgrel=1
+pkgdesc="A utility for reading man pages"
+arch=('i686' 'x86_64')
+url="http://www.nongnu.org/man-db/"
+license=('GPL' 'LGPL')
+groups=('base')
+depends=( 'bash' 'gdbm' 'zlib' 'groff')
+optdepends=('less' 'gzip')
+backup=('etc/man_db.conf'
+ 'etc/cron.daily/man-db')
+conflicts=('man')
+provides=('man')
+replaces=('man')
+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=('9841394f5c5fe7e2dd2e0c5fb4766d0f'
+ '2b7662a7d5b33fe91f9f3e034361a2f6'
+ 'd30c39ae47560304471b5461719e0f03')
+options=('!libtool')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib \
+ --with-db=gdbm --disable-setuid --enable-mandirs=GNU \
+ --with-sections="1 n l 8 3 0 2 5 4 9 6 7"
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install || return 1
+
+ # part of groff pkg
+ rm -f ${pkgdir}/usr/bin/zsoelim
+
+ # script from LFS to convert manpages, see
+ # http://www.linuxfromscratch.org/lfs/view/6.4/chapter06/man-db.html
+ install -D -m755 ${srcdir}/convert-mans ${pkgdir}/usr/bin/convert-mans
+
+ #install whatis cron script
+ install -D -m744 ${srcdir}/man-db.cron.daily ${pkgdir}/etc/cron.daily/man-db
+}
+
diff --git a/core/man-db/convert-mans b/core/man-db/convert-mans
new file mode 100644
index 000000000..58a0224b0
--- /dev/null
+++ b/core/man-db/convert-mans
@@ -0,0 +1,11 @@
+#!/bin/sh -e
+FROM="$1"
+TO="$2"
+shift ; shift
+while [ $# -gt 0 ]
+do
+ FILE="$1"
+ shift
+ iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
+ mv .tmp.iconv "$FILE"
+done
diff --git a/core/man-db/man-db.cron.daily b/core/man-db/man-db.cron.daily
new file mode 100755
index 000000000..53e66e1e9
--- /dev/null
+++ b/core/man-db/man-db.cron.daily
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# nicenesses range from -20 (most favorable scheduling) to 19 (least favorable)
+NICE=19
+
+# 0 for none, 1 for real time, 2 for best-effort, 3 for idle
+IONICE_CLASS=2
+
+# 0-7 (for IONICE_CLASS 1 and 2 only), 0=highest, 7=lowest
+IONICE_PRIORITY=7
+
+UPDATEMANDB="/usr/bin/mandb --quiet"
+
+# Update the "whatis" database
+#/usr/sbin/makewhatis -u -w
+
+# taken from Debian
+# man-db cron daily
+set -e
+
+if ! [ -d /var/cache/man ]; then
+ # Recover from deletion, per FHS.
+ mkdir -p /var/cache/man
+ chmod 755 /var/cache/man
+fi
+
+# regenerate man database
+
+if [ -x /usr/bin/nice ]; then
+ UPDATEMANDB="/usr/bin/nice -n ${NICE:-19} ${UPDATEMANDB}"
+fi
+
+if [ -x /usr/bin/ionice ]; then
+ UPDATEMANDB="/usr/bin/ionice -c ${IONICE_CLASS:-2} -n ${IONICE_PRIORITY:-7} ${UPDATEMANDB}"
+fi
+
+${UPDATEMANDB}
+
+exit 0
diff --git a/core/man-db/man-db.install b/core/man-db/man-db.install
new file mode 100644
index 000000000..6a0f36b67
--- /dev/null
+++ b/core/man-db/man-db.install
@@ -0,0 +1,18 @@
+post_install() {
+ echo "it's recommended to create an initial"
+ echo "database running as root:"
+ echo "\"/usr/bin/mandb --quiet\""
+}
+
+post_upgrade() {
+ if [ "`vercmp $2 2.5.3-2`" -lt 0 ]; then
+ echo "systemuser \"man\" is no more required"
+ echo "run \"userdel man\". please also"
+ echo "chown root:root /var/cache/man"
+ fi
+}
+
+post_remove() {
+ rm -rf /var/cache/man
+}
+
diff --git a/core/mdadm/PKGBUILD b/core/mdadm/PKGBUILD
new file mode 100644
index 000000000..94c209616
--- /dev/null
+++ b/core/mdadm/PKGBUILD
@@ -0,0 +1,41 @@
+# $Id: PKGBUILD 116698 2011-03-25 08:21:55Z tpowa $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+pkgname=mdadm
+pkgver=3.1.5
+pkgrel=1
+pkgdesc="A tool for managing/monitoring Linux md device arrays, also known as Software RAID"
+arch=(i686 x86_64)
+license=('GPL')
+url="http://www.cse.unsw.edu.au/~neilb/source/mdadm/"
+groups=('base')
+conflicts=('mkinitcpio<0.5.99')
+depends=('glibc')
+backup=('etc/mdadm.conf')
+source=(ftp://ftp.kernel.org/pub/linux/utils/raid/mdadm/mdadm-$pkgver.tar.bz2
+ mdadm
+ mdadm.conf
+ mdadm_install
+ mdadm_hook)
+install=mdadm.install
+replaces=('raidtools')
+md5sums=('a7575707a5f2d1ed6d408446eabcb19b'
+ '7bff0e506fb6017510c8ec4a01896952'
+ '00cbed931db4f15b6ce49e3e7d433966'
+ '865c3d39e5f5dae58388160b563981f1'
+ '1a3eb63832cecd6550f5b0a21d58cfdb')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ make CXFLAGS="$CFLAGS"
+ make INSTALL=/bin/install DESTDIR=$pkgdir install
+ install -D -m644 ../mdadm.conf $pkgdir/etc/mdadm.conf
+ install -D -m755 ../mdadm $pkgdir/etc/rc.d/mdadm
+ install -D -m644 ../mdadm_install $pkgdir/lib/initcpio/install/mdadm
+ install -D -m644 ../mdadm_hook $pkgdir/lib/initcpio/hooks/mdadm
+ # symlink for backward compatibility
+ ln -sf /lib/initcpio/hooks/mdadm $pkgdir/lib/initcpio/hooks/raid
+ # build static mdassemble for Arch's initramfs
+ make MDASSEMBLE_AUTO=1 mdassemble
+ install -D -m755 mdassemble $pkgdir/sbin/mdassemble
+}
diff --git a/core/mdadm/mdadm b/core/mdadm/mdadm
new file mode 100755
index 000000000..918a62537
--- /dev/null
+++ b/core/mdadm/mdadm
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /sbin/mdadm`
+case "$1" in
+ start)
+ stat_busy "Starting mdadm RAID Monitor"
+ if [ -z "$PID" ]; then
+ /sbin/mdadm --monitor --scan -i /var/run/mdadm.pid -f
+ fi
+ if [ ! -z "$PID" -o $? -gt 0 ]; then
+ stat_fail
+ else
+ mdadm --monitor --oneshot --scan
+ add_daemon mdadm
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping mdadm RAID Monitor"
+ [ ! -z "$PID" ] && kill $PID &>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon mdadm
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
diff --git a/core/mdadm/mdadm.conf b/core/mdadm/mdadm.conf
new file mode 100644
index 000000000..57bd4c683
--- /dev/null
+++ b/core/mdadm/mdadm.conf
@@ -0,0 +1,67 @@
+# mdadm configuration file
+#
+# mdadm will function properly without the use of a configuration file,
+# but this file is useful for keeping track of arrays and member disks.
+# In general, a mdadm.conf file is created, and updated, after arrays
+# are created. This is the opposite behavior of /etc/raidtab which is
+# created prior to array construction.
+#
+#
+# the config file takes two types of lines:
+#
+# DEVICE lines specify a list of devices of where to look for
+# potential member disks
+#
+# ARRAY lines specify information about how to identify arrays so
+# so that they can be activated
+#
+
+
+# You can have more than one device line and use wild cards. The first
+# example includes SCSI the first partition of SCSI disks /dev/sdb,
+# /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second
+# line looks for array slices on IDE disks.
+#
+#DEVICE /dev/sd[bcdjkl]1
+#DEVICE /dev/hda1 /dev/hdb1
+#
+# The designation "partitions" will scan all partitions found in
+# /proc/partitions
+DEVICE partitions
+
+
+# ARRAY lines specify an array to assemble and a method of identification.
+# Arrays can currently be identified by using a UUID, superblock minor number,
+# or a listing of devices.
+#
+# super-minor is usually the minor number of the metadevice
+# UUID is the Universally Unique Identifier for the array
+# Each can be obtained using
+#
+# mdadm -D <md>
+#
+# To capture the UUIDs for all your RAID arrays to this file, run these:
+# to get a list of running arrays:
+# # mdadm -D --scan >>/etc/mdadm.conf
+# to get a list from superblocks:
+# # mdadm -E --scan >>/etc/mdadm.conf
+#
+#ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
+#ARRAY /dev/md1 super-minor=1
+#ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
+#
+# ARRAY lines can also specify a "spare-group" for each array. mdadm --monitor
+# will then move a spare between arrays in a spare-group if one array has a
+# failed drive but no spare
+#ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df spare-group=group1
+#ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977 spare-group=group1
+#
+
+
+# When used in --follow (aka --monitor) mode, mdadm needs a
+# mail address and/or a program. To start mdadm's monitor mode, add
+# "mdadm" to your DAEMONS array in /etc/rc.conf
+#
+# If the lines are not found, mdadm will exit quietly
+#MAILADDR root@mydomain.tld
+#PROGRAM /usr/sbin/handle-mdadm-events
diff --git a/core/mdadm/mdadm.install b/core/mdadm/mdadm.install
new file mode 100644
index 000000000..e8404c260
--- /dev/null
+++ b/core/mdadm/mdadm.install
@@ -0,0 +1,10 @@
+# arg 1: the new package version
+# arg 2: the old package version
+
+post_upgrade() {
+ if [ "$(vercmp $2 2.6.8-2)" -lt 0 -a "$(grep raid_partitions /etc/mkinitcpio.conf)" ]; then
+ echo "Attention mdadm update:"
+ echo "raid_partitions hook has been replaced by the more powerfull mdadm hook."
+ echo "Please update your /etc/mkinitcpio.conf accordingly."
+ fi
+}
diff --git a/core/mdadm/mdadm_hook b/core/mdadm/mdadm_hook
new file mode 100755
index 000000000..57799d3b8
--- /dev/null
+++ b/core/mdadm/mdadm_hook
@@ -0,0 +1,44 @@
+# vim: set ft=sh:
+run_hook ()
+{
+ input="$(cat /proc/cmdline)"
+ mdconfig="/etc/mdadm.conf"
+ # for partitionable raid, we need to load md_mod first!
+ modprobe md_mod 2>/dev/null
+ # If md is specified on commandline, create config file from those parameters.
+ if [ "$(echo $input | grep "md=")" ]; then
+ #Create initial mdadm.conf
+ # scan all devices in /proc/partitions
+ echo DEVICE partitions > $mdconfig
+ for i in $input; do
+ case $i in
+ # raid
+ md=[0-9]*,/*)
+ device="$(echo "$i" | sed -e 's|,/.*||g' -e 's|=||g')"
+ array="$(echo $i | cut -d, -f2-)"
+ echo "ARRAY /dev/$device devices=$array" >> $mdconfig
+ ;;
+ # partitionable raid
+ md=d[0-9]*,/*)
+ device="$(echo "$i" | sed -e 's|,/.*||g' -e 's|=|_|g')"
+ array="$(echo $i | cut -d, -f2-)"
+ echo "ARRAY /dev/$device devices=$array" >> $mdconfig
+ ;;
+ # raid UUID
+ md=[0-9]*,[0-9,a-z]*)
+ device="$(echo "$i" | sed -e 's|,.*||g' -e 's|=||g')"
+ array="$(echo $i | cut -d, -f2-)"
+ echo "ARRAY /dev/$device UUID=$array" >> $mdconfig
+ ;;
+ # partitionable raid UUID
+ md=d[0-9]*,[0-9,a-z]*)
+ device="$(echo "$i" | sed -e 's|,.*||g' -e 's|=|_|g')"
+ array="$(echo $i | cut -d, -f2-)"
+ echo "ARRAY /dev/$device UUID=$array" >> $mdconfig
+ ;;
+ esac
+ done
+ fi
+ # assemble everything
+ [ -e $mdconfig ] && /sbin/mdassemble
+} \ No newline at end of file
diff --git a/core/mdadm/mdadm_install b/core/mdadm/mdadm_install
new file mode 100644
index 000000000..b7a57ea4e
--- /dev/null
+++ b/core/mdadm/mdadm_install
@@ -0,0 +1,46 @@
+# vim: set ft=sh:
+
+install ()
+{
+ MODULES=" $(checked_modules "drivers/md/*" | grep -v "dm-") "
+ BINARIES=""
+ FILES=""
+ SCRIPT="mdadm"
+ # check if a custom mdadm.conf exists
+ if grep -q ^ARRAY /etc/mdadm.conf; then
+ echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
+ add_file "/etc/mdadm.conf"
+ fi
+ add_binary "/sbin/mdassemble"
+ add_file "/lib/udev/rules.d/64-md-raid.rules"
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook loads the necessary modules for any raid root device,
+ and assembles the raid device when run.
+
+ If arrays are defined in /etc/mdadm.conf, the file will be used instead
+ of command line assembling.
+
+ Command Line Setup:
+ - for raid arrays with persistent superblocks:
+ md=<md device no.>,dev0,dev1,...,devn
+ md=<md device no.>,uuid
+ - for partitionable raid arrays with persistent superblocks:
+ md=d<md device no.>,dev0,dev1,...,devn
+ md=d<md device no.>,uuid
+
+ Parameters:
+ - <md device no.> = the number of the md device:
+ 0 means md0, 1 means md1, ...
+ - <dev0-devn>: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
+ or 0900878d:f95f6057:c39a36e9:55efa60a
+ Examples:
+ - md=d0,/dev/sda3,/dev/sda4 md=d1,/dev/hda1,/dev/hdb1
+ This will setup 2 md partitionable arrays.
+ - md=0,/dev/sda3,/dev/sda4 md=1,/dev/hda1,/dev/hdb1
+ This will setup 2 md arrays with persistent superblocks.
+HELPEOF
+}
diff --git a/core/mkinitcpio-busybox/PKGBUILD b/core/mkinitcpio-busybox/PKGBUILD
new file mode 100644
index 000000000..574435eef
--- /dev/null
+++ b/core/mkinitcpio-busybox/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 107680 2011-01-26 22:30:45Z thomas $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+pkgname=mkinitcpio-busybox
+pkgver=1.18.2
+pkgrel=1
+pkgdesc="base initramfs tools"
+arch=('i686' 'x86_64')
+url="http://www.busybox.net/"
+license=('GPL')
+depends=('glibc')
+source=(http://busybox.net/downloads/busybox-${pkgver}.tar.bz2
+ config)
+sha256sums=('aa7e1cec8cd9c7f4e56098b9e4bb2ab5d593d5a35f766ad9e6a312289bf57080'
+ 'dd6dca08fbc335f1394e0f1b619df6895349c759d0c6e43456aed411e16d4194')
+
+build() {
+ cd "${srcdir}/busybox-${pkgver}"
+
+ unset CFLAGS CXXFLAGS
+ if [ ${CARCH} = "x86_64" ]; then
+ sed 's|^CONFIG_EXTRA_CFLAGS=.*|CONFIG_EXTRA_CFLAGS="-march=x86-64 -mtune=generic -Os -pipe -fno-strict-aliasing"|' "${srcdir}/config" > .config
+ else
+ sed 's|^CONFIG_EXTRA_CFLAGS=.*|CONFIG_EXTRA_CFLAGS="-march=i686 -mtune=generic -Os -pipe -fno-strict-aliasing"|' "${srcdir}/config" > .config
+ fi
+ make
+}
+
+package() {
+ install -D -m755 "${srcdir}/busybox-${pkgver}"/busybox "${pkgdir}/lib/initcpio/busybox"
+}
+# vim:set ts=2 sw=2 et:
diff --git a/core/mkinitcpio-busybox/config b/core/mkinitcpio-busybox/config
new file mode 100644
index 000000000..1aa333faf
--- /dev/null
+++ b/core/mkinitcpio-busybox/config
@@ -0,0 +1,986 @@
+#
+# Automatically generated make config: don't edit
+# Busybox version: 1.18.2
+# Wed Jan 26 23:08:18 2011
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+
+#
+# General Configuration
+#
+# CONFIG_DESKTOP is not set
+# CONFIG_EXTRA_COMPAT is not set
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_USE_PORTABLE_CODE is not set
+CONFIG_PLATFORM_LINUX=y
+CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+CONFIG_SHOW_USAGE=y
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+# CONFIG_FEATURE_COMPRESS_USAGE is not set
+CONFIG_FEATURE_INSTALLER=y
+# CONFIG_INSTALL_NO_USR is not set
+# CONFIG_LOCALE_SUPPORT is not set
+CONFIG_UNICODE_SUPPORT=y
+# CONFIG_UNICODE_USING_LOCALE is not set
+# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
+CONFIG_SUBST_WCHAR=63
+CONFIG_LAST_SUPPORTED_WCHAR=767
+# CONFIG_UNICODE_COMBINING_WCHARS is not set
+# CONFIG_UNICODE_WIDE_WCHARS is not set
+# CONFIG_UNICODE_BIDI_SUPPORT is not set
+# CONFIG_UNICODE_NEUTRAL_TABLE is not set
+# CONFIG_UNICODE_PRESERVE_BROKEN is not set
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_DEVPTS=y
+# CONFIG_FEATURE_CLEAN_UP is not set
+# CONFIG_FEATURE_WTMP is not set
+# CONFIG_FEATURE_UTMP is not set
+# CONFIG_FEATURE_PIDFILE is not set
+CONFIG_FEATURE_SUID=y
+# CONFIG_FEATURE_SUID_CONFIG is not set
+# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_PREFER_APPLETS is not set
+CONFIG_BUSYBOX_EXEC_PATH="/bin/busybox"
+CONFIG_FEATURE_SYSLOG=y
+CONFIG_FEATURE_HAVE_RPC=y
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+# CONFIG_PIE is not set
+# CONFIG_NOMMU is not set
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_INDIVIDUAL is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_LFS=y
+CONFIG_CROSS_COMPILER_PREFIX=""
+CONFIG_EXTRA_CFLAGS=""
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_WERROR is not set
+CONFIG_NO_DEBUG_LIB=y
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+
+#
+# Installation Options ("make install" behavior)
+#
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
+# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
+# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
+CONFIG_PREFIX="./_install"
+
+#
+# Busybox Library Tuning
+#
+CONFIG_PASSWORD_MINLEN=6
+CONFIG_MD5_SIZE_VS_SPEED=3
+CONFIG_FEATURE_FAST_TOP=y
+# CONFIG_FEATURE_ETC_NETWORKS is not set
+# CONFIG_FEATURE_USE_TERMIOS is not set
+CONFIG_FEATURE_EDITING=y
+CONFIG_FEATURE_EDITING_MAX_LEN=1024
+# CONFIG_FEATURE_EDITING_VI is not set
+CONFIG_FEATURE_EDITING_HISTORY=15
+# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set
+CONFIG_FEATURE_TAB_COMPLETION=y
+# CONFIG_FEATURE_USERNAME_COMPLETION is not set
+CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
+CONFIG_FEATURE_VERBOSE_CP_MESSAGE=y
+CONFIG_FEATURE_COPYBUF_KB=4
+CONFIG_MONOTONIC_SYSCALL=y
+CONFIG_IOCTL_HEX2STR_ERROR=y
+# CONFIG_FEATURE_HWIB is not set
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+# CONFIG_FEATURE_SEAMLESS_XZ is not set
+# CONFIG_FEATURE_SEAMLESS_LZMA is not set
+# CONFIG_FEATURE_SEAMLESS_BZ2 is not set
+# CONFIG_FEATURE_SEAMLESS_GZ is not set
+# CONFIG_FEATURE_SEAMLESS_Z is not set
+# CONFIG_AR is not set
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+# CONFIG_FEATURE_AR_CREATE is not set
+# CONFIG_BUNZIP2 is not set
+# CONFIG_BZIP2 is not set
+# CONFIG_CPIO is not set
+# CONFIG_FEATURE_CPIO_O is not set
+# CONFIG_FEATURE_CPIO_P is not set
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
+# CONFIG_GUNZIP is not set
+# CONFIG_GZIP is not set
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+# CONFIG_LZOP is not set
+# CONFIG_LZOP_COMPR_HIGH is not set
+# CONFIG_RPM2CPIO is not set
+# CONFIG_RPM is not set
+# CONFIG_TAR is not set
+# CONFIG_FEATURE_TAR_CREATE is not set
+# CONFIG_FEATURE_TAR_AUTODETECT is not set
+# CONFIG_FEATURE_TAR_FROM is not set
+# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set
+# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
+# CONFIG_FEATURE_TAR_GNU_EXTENSIONS is not set
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+# CONFIG_FEATURE_TAR_TO_COMMAND is not set
+# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
+# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set
+# CONFIG_FEATURE_TAR_SELINUX is not set
+# CONFIG_UNCOMPRESS is not set
+# CONFIG_UNLZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+# CONFIG_LZMA is not set
+# CONFIG_UNXZ is not set
+# CONFIG_XZ is not set
+# CONFIG_UNZIP is not set
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+CONFIG_CAT=y
+# CONFIG_DATE is not set
+# CONFIG_FEATURE_DATE_ISOFMT is not set
+# CONFIG_FEATURE_DATE_NANO is not set
+# CONFIG_FEATURE_DATE_COMPAT is not set
+CONFIG_TEST=y
+CONFIG_FEATURE_TEST_64=y
+# CONFIG_TR is not set
+# CONFIG_FEATURE_TR_CLASSES is not set
+# CONFIG_FEATURE_TR_EQUIV is not set
+# CONFIG_BASE64 is not set
+# CONFIG_CAL is not set
+# CONFIG_CATV is not set
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
+CONFIG_CHROOT=y
+# CONFIG_CKSUM is not set
+# CONFIG_COMM is not set
+CONFIG_CP=y
+# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
+CONFIG_CUT=y
+CONFIG_DD=y
+# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set
+# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
+# CONFIG_FEATURE_DD_IBS_OBS is not set
+CONFIG_DF=y
+# CONFIG_FEATURE_DF_FANCY is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+CONFIG_DU=y
+# CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K is not set
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+CONFIG_FEATURE_ENV_LONG_OPTIONS=y
+# CONFIG_EXPAND is not set
+# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
+CONFIG_EXPR=y
+CONFIG_EXPR_MATH_SUPPORT_64=y
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+# CONFIG_FSYNC is not set
+CONFIG_HEAD=y
+CONFIG_FEATURE_FANCY_HEAD=y
+# CONFIG_HOSTID is not set
+# CONFIG_ID is not set
+CONFIG_INSTALL=y
+CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y
+# CONFIG_LENGTH is not set
+CONFIG_LN=y
+# CONFIG_LOGNAME is not set
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+# CONFIG_FEATURE_LS_COLOR is not set
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
+# CONFIG_MD5SUM is not set
+CONFIG_MKDIR=y
+CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
+CONFIG_MKFIFO=y
+CONFIG_MKNOD=y
+CONFIG_MV=y
+CONFIG_FEATURE_MV_LONG_OPTIONS=y
+# CONFIG_NICE is not set
+# CONFIG_NOHUP is not set
+# CONFIG_OD is not set
+# CONFIG_PRINTENV is not set
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+# CONFIG_REALPATH is not set
+CONFIG_RM=y
+CONFIG_RMDIR=y
+CONFIG_FEATURE_RMDIR_LONG_OPTIONS=y
+CONFIG_SEQ=y
+# CONFIG_SHA1SUM is not set
+# CONFIG_SHA256SUM is not set
+# CONFIG_SHA512SUM is not set
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+CONFIG_FEATURE_FLOAT_SLEEP=y
+CONFIG_SORT=y
+# CONFIG_FEATURE_SORT_BIG is not set
+# CONFIG_SPLIT is not set
+# CONFIG_FEATURE_SPLIT_FANCY is not set
+CONFIG_STAT=y
+CONFIG_FEATURE_STAT_FORMAT=y
+# CONFIG_STTY is not set
+# CONFIG_SUM is not set
+# CONFIG_SYNC is not set
+# CONFIG_TAC is not set
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+# CONFIG_TEE is not set
+# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
+CONFIG_TOUCH=y
+CONFIG_TRUE=y
+# CONFIG_TTY is not set
+CONFIG_UNAME=y
+# CONFIG_UNEXPAND is not set
+# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
+CONFIG_UNIQ=y
+# CONFIG_USLEEP is not set
+# CONFIG_UUDECODE is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WC=y
+CONFIG_FEATURE_WC_LARGE=y
+# CONFIG_WHO is not set
+# CONFIG_WHOAMI is not set
+CONFIG_YES=y
+
+#
+# Common options for cp and mv
+#
+# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
+
+#
+# Common options for ls, more and telnet
+#
+CONFIG_FEATURE_AUTOWIDTH=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set
+
+#
+# Console Utilities
+#
+# CONFIG_CHVT is not set
+# CONFIG_FGCONSOLE is not set
+# CONFIG_CLEAR is not set
+# CONFIG_DEALLOCVT is not set
+# CONFIG_DUMPKMAP is not set
+CONFIG_KBD_MODE=y
+CONFIG_LOADFONT=y
+CONFIG_LOADKMAP=y
+CONFIG_OPENVT=y
+# CONFIG_RESET is not set
+# CONFIG_RESIZE is not set
+# CONFIG_FEATURE_RESIZE_PRINT is not set
+# CONFIG_SETCONSOLE is not set
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+CONFIG_SETFONT=y
+# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
+CONFIG_DEFAULT_SETFONT_DIR=""
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+# CONFIG_SHOWKEY is not set
+
+#
+# Common options for loadfont and setfont
+#
+CONFIG_FEATURE_LOADFONT_PSF2=y
+CONFIG_FEATURE_LOADFONT_RAW=y
+
+#
+# Debian Utilities
+#
+CONFIG_MKTEMP=y
+# CONFIG_PIPE_PROGRESS is not set
+# CONFIG_RUN_PARTS is not set
+# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
+# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+# CONFIG_START_STOP_DAEMON is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
+# CONFIG_WHICH is not set
+
+#
+# Editors
+#
+# CONFIG_PATCH is not set
+CONFIG_AWK=y
+# CONFIG_FEATURE_AWK_LIBM is not set
+# CONFIG_CMP is not set
+# CONFIG_DIFF is not set
+# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
+# CONFIG_FEATURE_DIFF_DIR is not set
+# CONFIG_ED is not set
+CONFIG_SED=y
+CONFIG_VI=y
+CONFIG_FEATURE_VI_MAX_LEN=4096
+CONFIG_FEATURE_VI_8BIT=y
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+CONFIG_FEATURE_VI_DOT_CMD=y
+CONFIG_FEATURE_VI_READONLY=y
+CONFIG_FEATURE_VI_SETOPTS=y
+CONFIG_FEATURE_VI_SET=y
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+CONFIG_FEATURE_VI_ASK_TERMINAL=y
+CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
+# CONFIG_FEATURE_ALLOW_EXEC is not set
+
+#
+# Finding Utilities
+#
+# CONFIG_FIND is not set
+# CONFIG_FEATURE_FIND_PRINT0 is not set
+# CONFIG_FEATURE_FIND_MTIME is not set
+# CONFIG_FEATURE_FIND_MMIN is not set
+# CONFIG_FEATURE_FIND_PERM is not set
+# CONFIG_FEATURE_FIND_TYPE is not set
+# CONFIG_FEATURE_FIND_XDEV is not set
+# CONFIG_FEATURE_FIND_MAXDEPTH is not set
+# CONFIG_FEATURE_FIND_NEWER is not set
+# CONFIG_FEATURE_FIND_INUM is not set
+# CONFIG_FEATURE_FIND_EXEC is not set
+# CONFIG_FEATURE_FIND_USER is not set
+# CONFIG_FEATURE_FIND_GROUP is not set
+# CONFIG_FEATURE_FIND_NOT is not set
+# CONFIG_FEATURE_FIND_DEPTH is not set
+# CONFIG_FEATURE_FIND_PAREN is not set
+# CONFIG_FEATURE_FIND_SIZE is not set
+# CONFIG_FEATURE_FIND_PRUNE is not set
+# CONFIG_FEATURE_FIND_DELETE is not set
+# CONFIG_FEATURE_FIND_PATH is not set
+# CONFIG_FEATURE_FIND_REGEX is not set
+# CONFIG_FEATURE_FIND_CONTEXT is not set
+# CONFIG_FEATURE_FIND_LINKS is not set
+CONFIG_GREP=y
+CONFIG_FEATURE_GREP_EGREP_ALIAS=y
+# CONFIG_FEATURE_GREP_FGREP_ALIAS is not set
+# CONFIG_FEATURE_GREP_CONTEXT is not set
+# CONFIG_XARGS is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+
+#
+# Init Utilities
+#
+# CONFIG_BOOTCHARTD is not set
+# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
+# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
+CONFIG_HALT=y
+# CONFIG_FEATURE_CALL_TELINIT is not set
+CONFIG_TELINIT_PATH=""
+# CONFIG_INIT is not set
+# CONFIG_FEATURE_USE_INITTAB is not set
+# CONFIG_FEATURE_KILL_REMOVED is not set
+CONFIG_FEATURE_KILL_DELAY=0
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_INIT_SYSLOG is not set
+# CONFIG_FEATURE_EXTRA_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+# CONFIG_FEATURE_INITRD is not set
+CONFIG_INIT_TERMINAL_TYPE=""
+# CONFIG_MESG is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_ADD_SHELL is not set
+# CONFIG_REMOVE_SHELL is not set
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_USE_BB_SHADOW is not set
+# CONFIG_USE_BB_CRYPT is not set
+# CONFIG_USE_BB_CRYPT_SHA is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
+# CONFIG_FEATURE_CHECK_NAMES is not set
+CONFIG_FIRST_SYSTEM_ID=0
+CONFIG_LAST_SYSTEM_ID=0
+# CONFIG_ADDGROUP is not set
+# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
+# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
+# CONFIG_DELUSER is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
+# CONFIG_GETTY is not set
+# CONFIG_LOGIN is not set
+# CONFIG_PAM is not set
+# CONFIG_LOGIN_SCRIPTS is not set
+# CONFIG_FEATURE_NOLOGIN is not set
+# CONFIG_FEATURE_SECURETTY is not set
+# CONFIG_PASSWD is not set
+# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
+# CONFIG_CRYPTPW is not set
+# CONFIG_CHPASSWD is not set
+# CONFIG_SU is not set
+# CONFIG_FEATURE_SU_SYSLOG is not set
+# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+# CONFIG_CHATTR is not set
+# CONFIG_FSCK is not set
+# CONFIG_LSATTR is not set
+# CONFIG_TUNE2FS is not set
+
+#
+# Linux Module Utilities
+#
+CONFIG_MODINFO=y
+# CONFIG_MODPROBE_SMALL is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
+CONFIG_INSMOD=y
+CONFIG_RMMOD=y
+CONFIG_LSMOD=y
+CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y
+# CONFIG_MODPROBE is not set
+# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+# CONFIG_DEPMOD is not set
+
+#
+# Options common to multiple modutils
+#
+# CONFIG_FEATURE_2_4_MODULES is not set
+# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
+# CONFIG_FEATURE_MODUTILS_ALIAS is not set
+# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
+CONFIG_DEFAULT_MODULES_DIR=""
+CONFIG_DEFAULT_DEPMOD_FILE=""
+
+#
+# Linux System Utilities
+#
+# CONFIG_BLOCKDEV is not set
+# CONFIG_REV is not set
+# CONFIG_ACPID is not set
+# CONFIG_FEATURE_ACPID_COMPAT is not set
+# CONFIG_BLKID is not set
+CONFIG_DMESG=y
+CONFIG_FEATURE_DMESG_PRETTY=y
+# CONFIG_FBSET is not set
+# CONFIG_FEATURE_FBSET_FANCY is not set
+# CONFIG_FEATURE_FBSET_READMODE is not set
+# CONFIG_FDFLUSH is not set
+# CONFIG_FDFORMAT is not set
+# CONFIG_FDISK is not set
+CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
+# CONFIG_FEATURE_FDISK_WRITABLE is not set
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_GPT_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FINDFS is not set
+# CONFIG_FLOCK is not set
+# CONFIG_FREERAMDISK is not set
+# CONFIG_FSCK_MINIX is not set
+# CONFIG_MKFS_EXT2 is not set
+# CONFIG_MKFS_MINIX is not set
+# CONFIG_FEATURE_MINIX2 is not set
+# CONFIG_MKFS_REISER is not set
+# CONFIG_MKFS_VFAT is not set
+CONFIG_GETOPT=y
+CONFIG_FEATURE_GETOPT_LONG=y
+CONFIG_HEXDUMP=y
+# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
+# CONFIG_HD is not set
+# CONFIG_HWCLOCK is not set
+# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set
+# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+CONFIG_LOSETUP=y
+# CONFIG_LSPCI is not set
+# CONFIG_LSUSB is not set
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_RENAME is not set
+# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+# CONFIG_MKSWAP is not set
+# CONFIG_FEATURE_MKSWAP_UUID is not set
+# CONFIG_MORE is not set
+CONFIG_MOUNT=y
+CONFIG_FEATURE_MOUNT_FAKE=y
+CONFIG_FEATURE_MOUNT_VERBOSE=y
+CONFIG_FEATURE_MOUNT_HELPERS=y
+CONFIG_FEATURE_MOUNT_LABEL=y
+CONFIG_FEATURE_MOUNT_NFS=y
+CONFIG_FEATURE_MOUNT_CIFS=y
+CONFIG_FEATURE_MOUNT_FLAGS=y
+CONFIG_FEATURE_MOUNT_FSTAB=y
+# CONFIG_PIVOT_ROOT is not set
+# CONFIG_RDATE is not set
+# CONFIG_RDEV is not set
+# CONFIG_READPROFILE is not set
+# CONFIG_RTCWAKE is not set
+# CONFIG_SCRIPT is not set
+# CONFIG_SCRIPTREPLAY is not set
+# CONFIG_SETARCH is not set
+# CONFIG_SWAPONOFF is not set
+# CONFIG_FEATURE_SWAPON_PRI is not set
+CONFIG_SWITCH_ROOT=y
+CONFIG_UMOUNT=y
+CONFIG_FEATURE_UMOUNT_ALL=y
+
+#
+# Common options for mount/umount
+#
+CONFIG_FEATURE_MOUNT_LOOP=y
+CONFIG_FEATURE_MOUNT_LOOP_CREATE=y
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+CONFIG_VOLUMEID=y
+
+#
+# Filesystem/Volume identification
+#
+# CONFIG_FEATURE_VOLUMEID_EXT is not set
+# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
+# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
+# CONFIG_FEATURE_VOLUMEID_FAT is not set
+# CONFIG_FEATURE_VOLUMEID_HFS is not set
+# CONFIG_FEATURE_VOLUMEID_JFS is not set
+# CONFIG_FEATURE_VOLUMEID_XFS is not set
+# CONFIG_FEATURE_VOLUMEID_NTFS is not set
+# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
+# CONFIG_FEATURE_VOLUMEID_UDF is not set
+# CONFIG_FEATURE_VOLUMEID_LUKS is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
+# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
+# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
+# CONFIG_FEATURE_VOLUMEID_SYSV is not set
+# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_CONSPY is not set
+# CONFIG_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
+# CONFIG_UBIATTACH is not set
+# CONFIG_UBIDETACH is not set
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CHAT is not set
+# CONFIG_FEATURE_CHAT_NOFAIL is not set
+# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
+# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
+# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
+# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
+# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
+# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
+# CONFIG_CHRT is not set
+# CONFIG_CROND is not set
+# CONFIG_FEATURE_CROND_D is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_FEATURE_CROND_DIR=""
+# CONFIG_CRONTAB is not set
+# CONFIG_DC is not set
+# CONFIG_FEATURE_DC_LIBM is not set
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_DEVMEM is not set
+# CONFIG_EJECT is not set
+# CONFIG_FEATURE_EJECT_SCSI is not set
+# CONFIG_FBSPLASH is not set
+# CONFIG_FLASHCP is not set
+# CONFIG_FLASH_LOCK is not set
+# CONFIG_FLASH_UNLOCK is not set
+# CONFIG_FLASH_ERASEALL is not set
+# CONFIG_IONICE is not set
+# CONFIG_INOTIFYD is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_SMALL is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+CONFIG_LESS=y
+CONFIG_FEATURE_LESS_MAXLINES=9999999
+CONFIG_FEATURE_LESS_BRACKETS=y
+CONFIG_FEATURE_LESS_FLAGS=y
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_FEATURE_LESS_WINCH is not set
+# CONFIG_FEATURE_LESS_DASHCMD is not set
+# CONFIG_FEATURE_LESS_LINENUMS is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MAN is not set
+# CONFIG_MICROCOM is not set
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_RAIDAUTORUN is not set
+# CONFIG_READAHEAD is not set
+# CONFIG_RFKILL is not set
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+# CONFIG_SETSID is not set
+CONFIG_STRINGS=y
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
+# CONFIG_TIME is not set
+# CONFIG_TIMEOUT is not set
+# CONFIG_TTYSIZE is not set
+# CONFIG_VOLNAME is not set
+# CONFIG_WALL is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+# CONFIG_NBDCLIENT is not set
+CONFIG_NC=y
+CONFIG_NC_SERVER=y
+CONFIG_NC_EXTRA=y
+# CONFIG_NC_110_COMPAT is not set
+CONFIG_FEATURE_IPV6=y
+# CONFIG_FEATURE_UNIX_LOCAL is not set
+CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
+# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
+# CONFIG_ARP is not set
+# CONFIG_ARPING is not set
+# CONFIG_BRCTL is not set
+# CONFIG_FEATURE_BRCTL_FANCY is not set
+# CONFIG_FEATURE_BRCTL_SHOW is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_FTPD is not set
+# CONFIG_FEATURE_FTP_WRITE is not set
+# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+# CONFIG_HOSTNAME is not set
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_RANGES is not set
+# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
+# CONFIG_FEATURE_HTTPD_PROXY is not set
+# CONFIG_FEATURE_HTTPD_GZIP is not set
+CONFIG_IFCONFIG=y
+CONFIG_FEATURE_IFCONFIG_STATUS=y
+CONFIG_FEATURE_IFCONFIG_SLIP=y
+CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y
+CONFIG_FEATURE_IFCONFIG_HW=y
+CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
+# CONFIG_IFENSLAVE is not set
+# CONFIG_IFPLUGD is not set
+# CONFIG_IFUPDOWN is not set
+CONFIG_IFUPDOWN_IFSTATE_PATH=""
+# CONFIG_FEATURE_IFUPDOWN_IP is not set
+# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
+# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set
+# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set
+# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
+# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set
+# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+CONFIG_IP=y
+CONFIG_FEATURE_IP_ADDRESS=y
+CONFIG_FEATURE_IP_LINK=y
+CONFIG_FEATURE_IP_ROUTE=y
+CONFIG_FEATURE_IP_TUNNEL=y
+CONFIG_FEATURE_IP_RULE=y
+CONFIG_FEATURE_IP_SHORT_FORMS=y
+# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
+CONFIG_IPADDR=y
+CONFIG_IPLINK=y
+CONFIG_IPROUTE=y
+CONFIG_IPTUNNEL=y
+CONFIG_IPRULE=y
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+# CONFIG_NAMEIF is not set
+# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
+CONFIG_NETSTAT=y
+CONFIG_FEATURE_NETSTAT_WIDE=y
+CONFIG_FEATURE_NETSTAT_PRG=y
+CONFIG_NSLOOKUP=y
+# CONFIG_NTPD is not set
+# CONFIG_FEATURE_NTPD_SERVER is not set
+CONFIG_PING=y
+CONFIG_PING6=y
+CONFIG_FEATURE_FANCY_PING=y
+# CONFIG_PSCAN is not set
+CONFIG_ROUTE=y
+# CONFIG_SLATTACH is not set
+# CONFIG_TCPSVD is not set
+CONFIG_TELNET=y
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_STANDALONE is not set
+# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
+CONFIG_TFTP=y
+# CONFIG_TFTPD is not set
+
+#
+# Common options for tftp/tftpd
+#
+CONFIG_FEATURE_TFTP_GET=y
+# CONFIG_FEATURE_TFTP_PUT is not set
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
+# CONFIG_TFTP_DEBUG is not set
+# CONFIG_TRACEROUTE is not set
+# CONFIG_TRACEROUTE6 is not set
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+# CONFIG_TUNCTL is not set
+# CONFIG_FEATURE_TUNCTL_UG is not set
+# CONFIG_UDHCPD is not set
+# CONFIG_DHCPRELAY is not set
+# CONFIG_DUMPLEASES is not set
+# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
+CONFIG_DHCPD_LEASES_FILE=""
+# CONFIG_UDHCPC is not set
+# CONFIG_FEATURE_UDHCPC_ARPING is not set
+# CONFIG_FEATURE_UDHCP_PORT is not set
+CONFIG_UDHCP_DEBUG=0
+# CONFIG_FEATURE_UDHCP_RFC3397 is not set
+CONFIG_UDHCPC_DEFAULT_SCRIPT=""
+CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
+# CONFIG_UDPSVD is not set
+# CONFIG_VCONFIG is not set
+CONFIG_WGET=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+CONFIG_FEATURE_WGET_TIMEOUT=y
+# CONFIG_ZCIP is not set
+
+#
+# Print Utilities
+#
+# CONFIG_LPD is not set
+# CONFIG_LPR is not set
+# CONFIG_LPQ is not set
+
+#
+# Mail Utilities
+#
+# CONFIG_MAKEMIME is not set
+CONFIG_FEATURE_MIME_CHARSET=""
+# CONFIG_POPMAILDIR is not set
+# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
+# CONFIG_REFORMIME is not set
+# CONFIG_FEATURE_REFORMIME_COMPAT is not set
+# CONFIG_SENDMAIL is not set
+
+#
+# Process Utilities
+#
+# CONFIG_IOSTAT is not set
+# CONFIG_MPSTAT is not set
+# CONFIG_PMAP is not set
+# CONFIG_POWERTOP is not set
+# CONFIG_SMEMCAP is not set
+CONFIG_FREE=y
+# CONFIG_FUSER is not set
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+# CONFIG_KILLALL5 is not set
+# CONFIG_NMETER is not set
+CONFIG_PGREP=y
+CONFIG_PIDOF=y
+CONFIG_FEATURE_PIDOF_SINGLE=y
+CONFIG_FEATURE_PIDOF_OMIT=y
+# CONFIG_PKILL is not set
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+# CONFIG_FEATURE_PS_TIME is not set
+# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
+# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
+# CONFIG_RENICE is not set
+# CONFIG_BB_SYSCTL is not set
+# CONFIG_TOP is not set
+# CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set
+# CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS is not set
+# CONFIG_FEATURE_TOP_SMP_CPU is not set
+# CONFIG_FEATURE_TOP_DECIMALS is not set
+# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
+# CONFIG_FEATURE_TOPMEM is not set
+# CONFIG_FEATURE_SHOW_THREADS is not set
+CONFIG_UPTIME=y
+# CONFIG_WATCH is not set
+
+#
+# Runit Utilities
+#
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
+# CONFIG_SV is not set
+CONFIG_SV_DEFAULT_SERVICE_DIR=""
+# CONFIG_SVLOGD is not set
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
+# CONFIG_CHCON is not set
+# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
+# CONFIG_GETENFORCE is not set
+# CONFIG_GETSEBOOL is not set
+# CONFIG_LOAD_POLICY is not set
+# CONFIG_MATCHPATHCON is not set
+# CONFIG_RESTORECON is not set
+# CONFIG_RUNCON is not set
+# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_SETENFORCE is not set
+# CONFIG_SETFILES is not set
+# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
+# CONFIG_SETSEBOOL is not set
+# CONFIG_SESTATUS is not set
+
+#
+# Shells
+#
+CONFIG_ASH=y
+CONFIG_ASH_BASH_COMPAT=y
+CONFIG_ASH_JOB_CONTROL=y
+CONFIG_ASH_ALIAS=y
+CONFIG_ASH_GETOPTS=y
+CONFIG_ASH_BUILTIN_ECHO=y
+CONFIG_ASH_BUILTIN_PRINTF=y
+CONFIG_ASH_BUILTIN_TEST=y
+CONFIG_ASH_CMDCMD=y
+# CONFIG_ASH_MAIL is not set
+CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+CONFIG_ASH_EXPAND_PRMT=y
+CONFIG_CTTYHACK=y
+# CONFIG_HUSH is not set
+# CONFIG_HUSH_BASH_COMPAT is not set
+# CONFIG_HUSH_BRACE_EXPANSION is not set
+# CONFIG_HUSH_HELP is not set
+# CONFIG_HUSH_INTERACTIVE is not set
+# CONFIG_HUSH_SAVEHISTORY is not set
+# CONFIG_HUSH_JOB is not set
+# CONFIG_HUSH_TICK is not set
+# CONFIG_HUSH_IF is not set
+# CONFIG_HUSH_LOOPS is not set
+# CONFIG_HUSH_CASE is not set
+# CONFIG_HUSH_FUNCTIONS is not set
+# CONFIG_HUSH_LOCAL is not set
+# CONFIG_HUSH_RANDOM_SUPPORT is not set
+# CONFIG_HUSH_EXPORT_N is not set
+# CONFIG_HUSH_MODE_X is not set
+# CONFIG_MSH is not set
+CONFIG_FEATURE_SH_IS_ASH=y
+# CONFIG_FEATURE_SH_IS_HUSH is not set
+# CONFIG_FEATURE_SH_IS_NONE is not set
+# CONFIG_FEATURE_BASH_IS_ASH is not set
+# CONFIG_FEATURE_BASH_IS_HUSH is not set
+CONFIG_FEATURE_BASH_IS_NONE=y
+CONFIG_SH_MATH_SUPPORT=y
+# CONFIG_SH_MATH_SUPPORT_64 is not set
+CONFIG_FEATURE_SH_EXTRA_QUIET=y
+# CONFIG_FEATURE_SH_STANDALONE is not set
+# CONFIG_FEATURE_SH_NOFORK is not set
+
+#
+# System Logging Utilities
+#
+# CONFIG_SYSLOGD is not set
+# CONFIG_FEATURE_ROTATE_LOGFILE is not set
+# CONFIG_FEATURE_REMOTE_LOG is not set
+# CONFIG_FEATURE_SYSLOGD_DUP is not set
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0
+# CONFIG_FEATURE_IPC_SYSLOG is not set
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
+# CONFIG_LOGREAD is not set
+# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
+# CONFIG_KLOGD is not set
+# CONFIG_FEATURE_KLOGD_KLOGCTL is not set
+# CONFIG_LOGGER is not set
diff --git a/core/mkinitcpio-busybox/loadfont-setfont-optional-psf2-font-support.patch b/core/mkinitcpio-busybox/loadfont-setfont-optional-psf2-font-support.patch
new file mode 100644
index 000000000..a7592de09
--- /dev/null
+++ b/core/mkinitcpio-busybox/loadfont-setfont-optional-psf2-font-support.patch
@@ -0,0 +1,453 @@
+From 8ce1dc03c1b2b61e51527b987579c09c991cc4b2 Mon Sep 17 00:00:00 2001
+From: Harald Becker <ralda@gmx.de>
+Date: Sun, 21 Feb 2010 12:10:26 +0000
+Subject: loadfont/setfont: optional PSF2 font support
+
+Signed-off-by: Harald Becker <ralda@gmx.de>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+diff --git a/console-tools/Config.in b/console-tools/Config.in
+index cd0a931..195685b 100644
+--- a/console-tools/Config.in
++++ b/console-tools/Config.in
+@@ -135,4 +135,21 @@ config SHOWKEY
+ help
+ Shows keys pressed.
+
++comment "Common options for loadfont and setfont"
++ depends on LOADFONT || SETFONT
++
++config FEATURE_LOADFONT_PSF2
++ bool "Support for PSF2 console fonts"
++ default n
++ depends on LOADFONT || SETFONT
++ help
++ Support PSF2 console fonts.
++
++config FEATURE_LOADFONT_RAW
++ bool "Support for old (raw) console fonts"
++ default n
++ depends on LOADFONT || SETFONT
++ help
++ Support old (raw) console fonts.
++
+ endmenu
+diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
+index e833474..e51142c 100644
+--- a/console-tools/loadfont.c
++++ b/console-tools/loadfont.c
+@@ -13,7 +13,7 @@
+ #include <sys/kd.h>
+
+ #ifndef KDFONTOP
+-#define KDFONTOP 0x4B72
++# define KDFONTOP 0x4B72
+ struct console_font_op {
+ unsigned op; /* KD_FONT_OP_* */
+ unsigned flags; /* KD_FONT_FLAG_* */
+@@ -21,91 +21,137 @@ struct console_font_op {
+ unsigned charcount;
+ unsigned char *data; /* font data with height fixed to 32 */
+ };
+-
+-#define KD_FONT_OP_SET 0 /* Set font */
+-#define KD_FONT_OP_GET 1 /* Get font */
+-#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default,
+- data points to name / NULL */
+-#define KD_FONT_OP_COPY 3 /* Copy from another console */
+-
+-#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface */
+-#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't call adjust_height() */
++# define KD_FONT_OP_SET 0 /* Set font */
++# define KD_FONT_OP_GET 1 /* Get font */
++# define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
++# define KD_FONT_OP_COPY 3 /* Copy from another console */
++# define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface */
++# define KD_FONT_FLAG_DONT_RECALC 1 /* Don't call adjust_height() */
+ /* (Used internally for PIO_FONT support) */
+ #endif /* KDFONTOP */
+
+
+ enum {
+- PSF_MAGIC1 = 0x36,
+- PSF_MAGIC2 = 0x04,
+-
+- PSF_MODE512 = 0x01,
+- PSF_MODEHASTAB = 0x02,
+- PSF_MAXMODE = 0x03,
+- PSF_SEPARATOR = 0xffff
++ PSF1_MAGIC0 = 0x36,
++ PSF1_MAGIC1 = 0x04,
++ PSF1_MODE512 = 0x01,
++ PSF1_MODEHASTAB = 0x02,
++ PSF1_MODEHASSEQ = 0x04,
++ PSF1_MAXMODE = 0x05,
++ PSF1_STARTSEQ = 0xfffe,
++ PSF1_SEPARATOR = 0xffff,
+ };
+
+-struct psf_header {
+- unsigned char magic1, magic2; /* Magic number */
++struct psf1_header {
++ unsigned char magic[2]; /* Magic number */
+ unsigned char mode; /* PSF font mode */
+ unsigned char charsize; /* Character size */
+ };
+
+-#define PSF_MAGIC_OK(x) ((x)->magic1 == PSF_MAGIC1 && (x)->magic2 == PSF_MAGIC2)
++#define psf1h(x) ((struct psf1_header*)(x))
++
++#define PSF1_MAGIC_OK(x) ( \
++ (x)->magic[0] == PSF1_MAGIC0 \
++ && (x)->magic[1] == PSF1_MAGIC1 \
++)
++
++#if ENABLE_FEATURE_LOADFONT_PSF2
++enum {
++ PSF2_MAGIC0 = 0x72,
++ PSF2_MAGIC1 = 0xb5,
++ PSF2_MAGIC2 = 0x4a,
++ PSF2_MAGIC3 = 0x86,
++ PSF2_HAS_UNICODE_TABLE = 0x01,
++ PSF2_MAXVERSION = 0,
++ PSF2_STARTSEQ = 0xfe,
++ PSF2_SEPARATOR = 0xff
++};
++
++struct psf2_header {
++ unsigned char magic[4];
++ unsigned int version;
++ unsigned int headersize; /* offset of bitmaps in file */
++ unsigned int flags;
++ unsigned int length; /* number of glyphs */
++ unsigned int charsize; /* number of bytes for each character */
++ unsigned int height; /* max dimensions of glyphs */
++ unsigned int width; /* charsize = height * ((width + 7) / 8) */
++};
++
++#define psf2h(x) ((struct psf2_header*)(x))
++
++#define PSF2_MAGIC_OK(x) ( \
++ (x)->magic[0] == PSF2_MAGIC0 \
++ && (x)->magic[1] == PSF2_MAGIC1 \
++ && (x)->magic[2] == PSF2_MAGIC2 \
++ && (x)->magic[3] == PSF2_MAGIC3 \
++)
++#endif /* ENABLE_FEATURE_LOADFONT_PSF2 */
+
+-static void do_loadfont(int fd, unsigned char *inbuf, int unit, int fontsize)
++
++static void do_loadfont(int fd, unsigned char *inbuf, int height, int width, int charsize, int fontsize)
+ {
+- char *buf;
++ unsigned char *buf;
++ int charwidth = 32 * ((width+7)/8);
+ int i;
+
+- if (unit < 1 || unit > 32)
+- bb_error_msg_and_die("bad character size %d", unit);
++ if (height < 1 || height > 32 || width < 1 || width > 32)
++ bb_error_msg_and_die("bad character size %dx%d", height, width);
+
+- buf = xzalloc(16 * 1024);
++ buf = xzalloc(charwidth * ((fontsize < 128) ? 128 : fontsize));
+ for (i = 0; i < fontsize; i++)
+- memcpy(buf + (32 * i), inbuf + (unit * i), unit);
++ memcpy(buf + (i*charwidth), inbuf + (i*charsize), charsize);
+
+ { /* KDFONTOP */
+ struct console_font_op cfo;
+-
+ cfo.op = KD_FONT_OP_SET;
+ cfo.flags = 0;
+- cfo.width = 8;
+- cfo.height = unit;
++ cfo.width = width;
++ cfo.height = height;
+ cfo.charcount = fontsize;
+- cfo.data = (void*)buf;
+-#if 0
+- if (!ioctl_or_perror(fd, KDFONTOP, &cfo, "KDFONTOP ioctl failed (will try PIO_FONTX)"))
+- goto ret; /* success */
+-#else
++ cfo.data = buf;
+ xioctl(fd, KDFONTOP, &cfo);
+-#endif
+ }
+
+-#if 0
+-/* These ones do not honour -C tty (they set font on current tty regardless)
+- * On x86, this distinction is visible on framebuffer consoles
+- * (regular character consoles may have only one shared font anyway)
+- */
+-#if defined(PIO_FONTX) && !defined(__sparc__)
+- {
+- struct consolefontdesc cfd;
+-
+- cfd.charcount = fontsize;
+- cfd.charheight = unit;
+- cfd.chardata = buf;
+-
+- if (!ioctl_or_perror(fd, PIO_FONTX, &cfd, "PIO_FONTX ioctl failed (will try PIO_FONT)"))
+- goto ret; /* success */
+- }
+-#endif
+- xioctl(fd, PIO_FONT, buf);
+- ret:
+-#endif /* 0 */
+ free(buf);
+ }
+
+-static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
++/*
++ * Format of the Unicode information:
++ *
++ * For each font position <uc>*<seq>*<term>
++ * where <uc> is a 2-byte little endian Unicode value (PSF1)
++ * or an UTF-8 coded value (PSF2),
++ * <seq> = <ss><uc><uc>*, <ss> = psf1 ? 0xFFFE : 0xFE,
++ * <term> = psf1 ? 0xFFFF : 0xFF.
++ * and * denotes zero or more occurrences of the preceding item.
++ *
++ * Semantics:
++ * The leading <uc>* part gives Unicode symbols that are all
++ * represented by this font position. The following sequences
++ * are sequences of Unicode symbols - probably a symbol
++ * together with combining accents - also represented by
++ * this font position.
++ *
++ * Example:
++ * At the font position for a capital A-ring glyph, we
++ * may have:
++ * 00C5,212B,FFFE,0041,030A,FFFF
++ * Some font positions may be described by sequences only,
++ * namely when there is no precomposed Unicode value for the glyph.
++ */
++#if !ENABLE_FEATURE_LOADFONT_PSF2
++#define do_loadtable(fd, inbuf, tailsz, fontsize, psf2) \
++ do_loadtable(fd, inbuf, tailsz, fontsize)
++#endif
++static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize, int psf2)
+ {
++#if !ENABLE_FEATURE_LOADFONT_PSF2
++/* gcc 4.3.1 code size: */
++# define psf2 0 /* +0 bytes */
++// const int psf2 = 0; /* +8 bytes */
++// enum { psf2 = 0 }; /* +13 bytes */
++#endif
+ struct unimapinit advice;
+ struct unimapdesc ud;
+ struct unipair *up;
+@@ -114,15 +160,48 @@ static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
+ uint16_t unicode;
+
+ maxct = tailsz; /* more than enough */
+- up = xmalloc(maxct * sizeof(struct unipair));
++ up = xmalloc(maxct * sizeof(*up));
+
+ for (glyph = 0; glyph < fontsize; glyph++) {
+- while (tailsz >= 2) {
+- unicode = (((uint16_t) inbuf[1]) << 8) + inbuf[0];
+- tailsz -= 2;
+- inbuf += 2;
+- if (unicode == PSF_SEPARATOR)
+- break;
++ while (tailsz > 0) {
++ if (!psf2) { /* PSF1 */
++ unicode = (((uint16_t) inbuf[1]) << 8) + inbuf[0];
++ tailsz -= 2;
++ inbuf += 2;
++ if (unicode == PSF1_SEPARATOR)
++ break;
++ } else { /* PSF2 */
++#if ENABLE_FEATURE_LOADFONT_PSF2
++ --tailsz;
++ unicode = *inbuf++;
++ if (unicode == PSF2_SEPARATOR) {
++ break;
++ } else if (unicode == PSF2_STARTSEQ) {
++ bb_error_msg_and_die("unicode sequences not implemented");
++ } else if (unicode >= 0xC0) {
++ if (unicode >= 0xFC)
++ unicode &= 0x01, maxct = 5;
++ else if (unicode >= 0xF8)
++ unicode &= 0x03, maxct = 4;
++ else if (unicode >= 0xF0)
++ unicode &= 0x07, maxct = 3;
++ else if (unicode >= 0xE0)
++ unicode &= 0x0F, maxct = 2;
++ else
++ unicode &= 0x1F, maxct = 1;
++ do {
++ if (tailsz <= 0 || *inbuf < 0x80 || *inbuf > 0xBF)
++ bb_error_msg_and_die("illegal UTF-8 character");
++ --tailsz;
++ unicode = (unicode << 6) + (*inbuf++ & 0x3F);
++ } while (--maxct > 0);
++ } else if (unicode >= 0x80) {
++ bb_error_msg_and_die("illegal UTF-8 character");
++ }
++#else
++ return;
++#endif
++ }
+ up[ct].unicode = unicode;
+ up[ct].fontpos = glyph;
+ ct++;
+@@ -139,58 +218,78 @@ static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
+ ud.entry_ct = ct;
+ ud.entries = up;
+ xioctl(fd, PIO_UNIMAP, &ud);
++#undef psf2
+ }
+
+-static void do_load(int fd, struct psf_header *psfhdr, size_t len)
++static void do_load(int fd, unsigned char *buffer, size_t len)
+ {
+- int unit;
+- int fontsize;
+- int hastable;
+- unsigned head0, head = head;
+-
+- /* test for psf first */
+- if (len >= sizeof(struct psf_header) && PSF_MAGIC_OK(psfhdr)) {
+- if (psfhdr->mode > PSF_MAXMODE)
++ int height;
++ int width = 8;
++ int charsize;
++ int fontsize = 256;
++ int has_table = 0;
++ unsigned char *font = buffer;
++ unsigned char *table;
++
++ if (len >= sizeof(struct psf1_header) && PSF1_MAGIC_OK(psf1h(buffer))) {
++ if (psf1h(buffer)->mode > PSF1_MAXMODE)
+ bb_error_msg_and_die("unsupported psf file mode");
+- fontsize = ((psfhdr->mode & PSF_MODE512) ? 512 : 256);
+-#if !defined(PIO_FONTX) || defined(__sparc__)
+- if (fontsize != 256)
+- bb_error_msg_and_die("only fontsize 256 supported");
++ if (psf1h(buffer)->mode & PSF1_MODE512)
++ fontsize = 512;
++ if (psf1h(buffer)->mode & PSF1_MODEHASTAB)
++ has_table = 1;
++ height = charsize = psf1h(buffer)->charsize;
++ font += sizeof(struct psf1_header);
++ } else
++#if ENABLE_FEATURE_LOADFONT_PSF2
++ if (len >= sizeof(struct psf2_header) && PSF2_MAGIC_OK(psf2h(buffer))) {
++ if (psf2h(buffer)->version > PSF2_MAXVERSION)
++ bb_error_msg_and_die("unsupported psf file version");
++ fontsize = psf2h(buffer)->length;
++ if (psf2h(buffer)->flags & PSF2_HAS_UNICODE_TABLE)
++ has_table = 2;
++ charsize = psf2h(buffer)->charsize;
++ height = psf2h(buffer)->height;
++ width = psf2h(buffer)->width;
++ font += psf2h(buffer)->headersize;
++ } else
+ #endif
+- hastable = (psfhdr->mode & PSF_MODEHASTAB);
+- unit = psfhdr->charsize;
+- head0 = sizeof(struct psf_header);
+-
+- head = head0 + fontsize * unit;
+- if (head > len || (!hastable && head != len))
+- bb_error_msg_and_die("input file: bad length");
+- } else {
+- /* file with three code pages? */
+- if (len == 9780) {
+- head0 = 40;
+- unit = 16;
+- } else {
+- /* bare font */
+- if (len & 0377)
+- bb_error_msg_and_die("input file: bad length");
+- head0 = 0;
+- unit = len / 256;
+- }
+- fontsize = 256;
+- hastable = 0;
++#if ENABLE_FEATURE_LOADFONT_RAW
++ if (len == 9780) { /* file with three code pages? */
++ charsize = height = 16;
++ font += 40;
++ } else if ((len & 0377) == 0) { /* bare font */
++ charsize = height = len / 256;
++ } else
++#endif
++ {
++ bb_error_msg_and_die("input file: bad length or unsupported font type");
+ }
+
+- do_loadfont(fd, (unsigned char *)psfhdr + head0, unit, fontsize);
+- if (hastable)
+- do_loadtable(fd, (unsigned char *)psfhdr + head, len - head, fontsize);
++#if !defined(PIO_FONTX) || defined(__sparc__)
++ if (fontsize != 256)
++ bb_error_msg_and_die("only fontsize 256 supported");
++#endif
++
++ table = font + fontsize * charsize;
++ buffer += len;
++
++ if (table > buffer || (!has_table && table != buffer))
++ bb_error_msg_and_die("input file: bad length");
++
++ do_loadfont(fd, font, height, width, charsize, fontsize);
++
++ if (has_table)
++ do_loadtable(fd, table, buffer - table, fontsize, has_table - 1);
+ }
+
++
+ #if ENABLE_LOADFONT
+ int loadfont_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+ int loadfont_main(int argc UNUSED_PARAM, char **argv)
+ {
+ size_t len;
+- struct psf_header *psfhdr;
++ unsigned char *buffer;
+
+ // no arguments allowed!
+ opt_complementary = "=0";
+@@ -202,11 +301,11 @@ int loadfont_main(int argc UNUSED_PARAM, char **argv)
+ * just read the entire file.
+ */
+ len = 32*1024; // can't be larger
+- psfhdr = xmalloc_read(STDIN_FILENO, &len);
++ buffer = xmalloc_read(STDIN_FILENO, &len);
+ // xmalloc_open_zipped_read_close(filename, &len);
+- if (!psfhdr)
++ if (!buffer)
+ bb_perror_msg_and_die("error reading input font");
+- do_load(get_console_fd_or_die(), psfhdr, len);
++ do_load(get_console_fd_or_die(), buffer, len);
+
+ return EXIT_SUCCESS;
+ }
+@@ -269,7 +368,7 @@ int setfont_main(int argc UNUSED_PARAM, char **argv)
+ size_t len;
+ unsigned opts;
+ int fd;
+- struct psf_header *psfhdr;
++ unsigned char *buffer;
+ char *mapfilename;
+ const char *tty_name = CURRENT_TTY;
+
+@@ -287,10 +386,10 @@ int setfont_main(int argc UNUSED_PARAM, char **argv)
+ }
+ // load font
+ len = 32*1024; // can't be larger
+- psfhdr = xmalloc_open_zipped_read_close(*argv, &len);
+- if (!psfhdr)
++ buffer = xmalloc_open_zipped_read_close(*argv, &len);
++ if (!buffer)
+ bb_simple_perror_msg_and_die(*argv);
+- do_load(fd, psfhdr, len);
++ do_load(fd, buffer, len);
+
+ // load the screen map, if any
+ if (opts & 1) { // -m
+--
+cgit v0.8.2.1
diff --git a/core/mkinitcpio-nfs-utils/PKGBUILD b/core/mkinitcpio-nfs-utils/PKGBUILD
new file mode 100644
index 000000000..962bb33ef
--- /dev/null
+++ b/core/mkinitcpio-nfs-utils/PKGBUILD
@@ -0,0 +1,23 @@
+# $Id: PKGBUILD 68748 2010-02-14 10:45:02Z thomas $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgname=mkinitcpio-nfs-utils
+pkgver=0.2
+pkgrel=1
+pkgdesc="ipconfig and nfsmount tools for NFS root support in mkinitcpio"
+arch=('i686' 'x86_64')
+url="http://www.archlinux.org/"
+license=('GPL2')
+depends=('glibc')
+source=(ftp://ftp.archlinux.org/other/mkinitcpio/${pkgname}-${pkgver}.tar.gz)
+sha256sums=('3f2839f21a420cd732d34e58f84534acdb7fc29f69381dbba3f00e3424201cd3')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make || return 1
+}
+
+package() {
+ cd "$srcdir/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/core/mlocate/PKGBUILD b/core/mlocate/PKGBUILD
new file mode 100644
index 000000000..62f7864c3
--- /dev/null
+++ b/core/mlocate/PKGBUILD
@@ -0,0 +1,52 @@
+# $Id: PKGBUILD 97017 2010-10-26 01:53:05Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: lydgate
+
+pkgname=mlocate
+pkgver=0.23.1
+pkgrel=2
+pkgdesc="Faster merging drop-in for slocate"
+arch=('i686' 'x86_64')
+url="http://carolina.mff.cuni.cz/~trmac/blog/mlocate"
+license=('GPL')
+conflicts=('slocate')
+provides=('slocate')
+replaces=('slocate')
+depends=('glibc' 'coreutils' 'sh')
+backup=('etc/updatedb.conf'
+ 'etc/cron.daily/updatedb')
+install=mlocate.install
+source=(https://fedorahosted.org/releases/m/l/mlocate/mlocate-$pkgver.tar.xz
+ updatedb.conf
+ updatedb.cron.daily)
+md5sums=('db48f27fae91c754c46d8046919803c5'
+ 'c374ff223f2e07b5e602ba22359f2335'
+ 'cde5da81bebad2de556ef2e43d895e13')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # Build!
+ sed -i '/^groupname /s/mlocate/locate/' Makefile.in
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib
+ make
+ make check
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # Set up a default updatedb.conf and a daily cronjob
+ install -Dm644 ${srcdir}/updatedb.conf $pkgdir/etc/updatedb.conf
+ install -Dm744 ${srcdir}/updatedb.cron.daily $pkgdir/etc/cron.daily/updatedb
+
+ # Install Mlocate
+ make DESTDIR=$pkgdir install
+
+ ln -sv locate $pkgdir/usr/bin/slocate
+ chgrp -v 21 $pkgdir/usr/bin/locate
+ chmod -v 2755 $pkgdir/usr/bin/locate
+
+ install -dm755 $pkgdir/var/lib
+ install -d -m750 -g21 $pkgdir/var/lib/locate
+}
diff --git a/core/mlocate/mlocate.install b/core/mlocate/mlocate.install
new file mode 100644
index 000000000..c7b7f9cf7
--- /dev/null
+++ b/core/mlocate/mlocate.install
@@ -0,0 +1,18 @@
+post_install() {
+ post_upgrade "$1" "$1"
+ echo "mlocate command is technically locate, but slocate is symlinked and still works."
+ echo "You should run updatedb as root."
+}
+
+post_upgrade() {
+ # This can be removed after {m,x}locate have both been updated
+ getent group slocate &>/dev/null && usr/sbin/groupdel slocate &>/dev/null
+ getent group mlocate &>/dev/null && usr/sbin/groupdel mlocate &>/dev/null
+
+ getent group locate &>/dev/null || usr/sbin/groupadd -g 21 locate &>/dev/null
+ chown -R root:locate var/lib/mlocate
+}
+
+pre_remove() {
+ getent group locate &>/dev/null && usr/sbin/groupdel locate &>/dev/null
+}
diff --git a/core/mlocate/updatedb.conf b/core/mlocate/updatedb.conf
new file mode 100644
index 000000000..722b04205
--- /dev/null
+++ b/core/mlocate/updatedb.conf
@@ -0,0 +1,5 @@
+# directories to exclude from the slocate database:
+PRUNEPATHS="/media /mnt /tmp /var/tmp /var/cache /var/lock /var/run /var/spool"
+
+# filesystems to exclude from the slocate database:
+PRUNEFS="afs auto autofs binfmt_misc cifs coda configfs cramfs debugfs devpts devtmpfs ftpfs iso9660 mqueue ncpfs nfs nfs4 proc ramfs securityfs shfs smbfs sshfs sysfs tmpfs udf usbfs vboxsf"
diff --git a/core/mlocate/updatedb.cron.daily b/core/mlocate/updatedb.cron.daily
new file mode 100755
index 000000000..cac9bb063
--- /dev/null
+++ b/core/mlocate/updatedb.cron.daily
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# nicenesses range from -20 (most favorable scheduling) to 19 (least favorable)
+NICE=19
+
+# 0 for none, 1 for real time, 2 for best-effort, 3 for idle
+IONICE_CLASS=2
+
+# 0-7 (for IONICE_CLASS 1 and 2 only), 0=highest, 7=lowest
+IONICE_PRIORITY=7
+
+UPDATEDB="/usr/bin/updatedb"
+
+if [ -x /usr/bin/nice ]; then
+ UPDATEDB="/usr/bin/nice -n ${NICE:-19} ${UPDATEDB}"
+fi
+
+if [ -x /usr/bin/ionice ]; then
+ UPDATEDB="/usr/bin/ionice -c ${IONICE_CLASS:-2} -n ${IONICE_PRIORITY:-7} ${UPDATEDB}"
+fi
+
+# Update the "locate" database
+if [ -x /usr/bin/updatedb ]; then
+ if [ -f /etc/updatedb.conf ]; then
+ ${UPDATEDB}
+ else
+ ${UPDATEDB} -f proc
+ fi
+fi
diff --git a/core/module-init-tools/PKGBUILD b/core/module-init-tools/PKGBUILD
new file mode 100644
index 000000000..9cf28c18d
--- /dev/null
+++ b/core/module-init-tools/PKGBUILD
@@ -0,0 +1,39 @@
+# $Id: PKGBUILD 105077 2011-01-06 02:59:10Z allan $
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=module-init-tools
+pkgver=3.12
+pkgrel=2
+pkgdesc="utilities needed by Linux systems for managing loadable kernel modules"
+arch=('i686' 'x86_64')
+url="http://kerneltools.org"
+license=('GPL')
+depends=('glibc')
+backup=('etc/modprobe.d/modprobe.conf')
+source=(http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-$pkgver.tar.bz2
+ modprobe.conf)
+md5sums=('8b2257ce9abef74c4a44d825d23140f3'
+ '316f1bda4c21af02b30252eb014a0a55')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # do not regenerate man pages
+ touch *.{5,8}
+
+ ./configure --prefix=/usr --exec-prefix=/ --enable-zlib
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make DESTDIR=$pkgdir install
+
+ # Install our custom (read: empty) modprobe.conf
+ install -Dm644 $srcdir/modprobe.conf $pkgdir/etc/modprobe.d/modprobe.conf
+
+ # fix man page (FS#17559)
+ sed -i "s#mod#man5/mod#" $pkgdir/usr/share/man/man5/modprobe.d.5
+}
diff --git a/core/module-init-tools/modprobe.conf b/core/module-init-tools/modprobe.conf
new file mode 100644
index 000000000..83865a3af
--- /dev/null
+++ b/core/module-init-tools/modprobe.conf
@@ -0,0 +1,3 @@
+#
+# /etc/modprobe.d/modprobe.conf (for v2.6 kernels)
+#
diff --git a/core/mpfr/PKGBUILD b/core/mpfr/PKGBUILD
new file mode 100644
index 000000000..89a3b1b25
--- /dev/null
+++ b/core/mpfr/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 101731 2010-12-01 03:50:59Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+# Contributor: damir <damir@archlinux.org>
+
+pkgname=mpfr
+_basever=3.0.0
+_patchlevel=p8
+pkgver=${_basever}.${_patchlevel}
+pkgrel=1
+pkgdesc="Multiple-precision floating-point library"
+arch=('i686' 'x86_64')
+license=('LGPL')
+url="http://www.mpfr.org/"
+depends=('gmp>=5.0')
+options=('!libtool')
+install=mpfr.install
+source=(http://www.mpfr.org/mpfr-current/mpfr-${_basever}.tar.xz
+ mpfr-${_basever}-${_patchlevel}.patch)
+md5sums=('8ab3bef2864b8c6e6a291f5603141bbd'
+ 'ac4591dea9abdd7573cd05a2fce2bb14')
+
+build() {
+ cd "${srcdir}/${pkgname}-${_basever}"
+ patch -Np1 -i ${srcdir}/${pkgname}-${_basever}-${_patchlevel}.patch
+ ./configure --prefix=/usr --enable-thread-safe --enable-shared
+ make
+ make check
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${_basever}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/core/mpfr/mpfr-3.0.0-p8.patch b/core/mpfr/mpfr-3.0.0-p8.patch
new file mode 100644
index 000000000..e21571b52
--- /dev/null
+++ b/core/mpfr/mpfr-3.0.0-p8.patch
@@ -0,0 +1,1945 @@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-06-23 11:02:49.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-06-23 11:03:36.000000000 +0000
+@@ -0,0 +1 @@
++mpfr_out_str
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-06-23 11:03:20.000000000 +0000
+@@ -1 +1 @@
+-3.0.0
++3.0.0-p1
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-06-23 11:03:20.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0"
++#define MPFR_VERSION_STRING "3.0.0-p1"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/mpfr.texi mpfr-3.0.0-b/mpfr.texi
+--- mpfr-3.0.0-a/mpfr.texi 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.texi 2010-06-23 11:03:12.000000000 +0000
+@@ -2050,7 +2050,7 @@
+ are printed. If @var{base} is greater than 10, @samp{@@} will be used
+ instead of @samp{e} as exponent delimiter.
+
+-Return the number of bytes written, or if an error occurred, return 0.
++Return the number of characters written, or if an error occurred, return 0.
+ @end deftypefun
+
+ @deftypefun size_t mpfr_inp_str (mpfr_t @var{rop}, FILE *@var{stream}, int @var{base}, mpfr_rnd_t @var{rnd})
+diff -Naurd mpfr-3.0.0-a/out_str.c mpfr-3.0.0-b/out_str.c
+--- mpfr-3.0.0-a/out_str.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/out_str.c 2010-06-23 11:03:12.000000000 +0000
+@@ -22,6 +22,16 @@
+
+ #include "mpfr-impl.h"
+
++/* Warning! S should not contain "%". */
++#define OUT_STR_RET(S) \
++ do \
++ { \
++ int r; \
++ r = fprintf (stream, (S)); \
++ return r < 0 ? 0 : r; \
++ } \
++ while (0)
++
+ size_t
+ mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op,
+ mpfr_rnd_t rnd_mode)
+@@ -29,6 +39,7 @@
+ char *s, *s0;
+ size_t l;
+ mpfr_exp_t e;
++ int err;
+
+ MPFR_ASSERTN (base >= 2 && base <= 62);
+
+@@ -36,37 +47,16 @@
+ if (stream == NULL)
+ stream = stdout;
+
+- if (MPFR_IS_NAN(op))
+- {
+- fprintf (stream, "@NaN@");
+- return 3;
+- }
+-
+- if (MPFR_IS_INF(op))
+- {
+- if (MPFR_SIGN(op) > 0)
+- {
+- fprintf (stream, "@Inf@");
+- return 3;
+- }
+- else
+- {
+- fprintf (stream, "-@Inf@");
+- return 4;
+- }
+- }
+-
+- if (MPFR_IS_ZERO(op))
++ if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (op)))
+ {
+- if (MPFR_SIGN(op) > 0)
+- {
+- fprintf(stream, "0");
+- return 1;
+- }
++ if (MPFR_IS_NAN (op))
++ OUT_STR_RET ("@NaN@");
++ else if (MPFR_IS_INF (op))
++ OUT_STR_RET (MPFR_IS_POS (op) ? "@Inf@" : "-@Inf@");
+ else
+ {
+- fprintf(stream, "-0");
+- return 2;
++ MPFR_ASSERTD (MPFR_IS_ZERO (op));
++ OUT_STR_RET (MPFR_IS_POS (op) ? "0" : "-0");
+ }
+ }
+
+@@ -77,21 +67,31 @@
+
+ l = strlen (s) + 1; /* size of allocated block returned by mpfr_get_str
+ - may be incorrect, as only an upper bound? */
+- if (*s == '-')
+- fputc (*s++, stream);
+
+- /* outputs mantissa */
+- fputc (*s++, stream); e--; /* leading digit */
+- fputc ((unsigned char) MPFR_DECIMAL_POINT, stream);
+- fputs (s, stream); /* rest of mantissa */
++ /* outputs possible sign and significand */
++ err = (*s == '-' && fputc (*s++, stream) == EOF)
++ || fputc (*s++, stream) == EOF /* leading digit */
++ || fputc ((unsigned char) MPFR_DECIMAL_POINT, stream) == EOF
++ || fputs (s, stream) == EOF; /* trailing significand */
+ (*__gmp_free_func) (s0, l);
++ if (MPFR_UNLIKELY (err))
++ return 0;
++
++ e--; /* due to the leading digit */
+
+ /* outputs exponent */
+ if (e)
+ {
++ int r;
++
+ MPFR_ASSERTN(e >= LONG_MIN);
+ MPFR_ASSERTN(e <= LONG_MAX);
+- l += fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
++
++ r = fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
++ if (MPFR_UNLIKELY (r < 0))
++ return 0;
++
++ l += r;
+ }
+
+ return l;
+diff -Naurd mpfr-3.0.0-a/tests/tout_str.c mpfr-3.0.0-b/tests/tout_str.c
+--- mpfr-3.0.0-a/tests/tout_str.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tout_str.c 2010-06-23 11:03:12.000000000 +0000
+@@ -46,22 +46,54 @@
+ special (void)
+ {
+ mpfr_t x;
++ unsigned int n;
+
+ mpfr_init (x);
+
+ mpfr_set_nan (x);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 5)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, NaN, MPFR_RNDN) wrote %u "
++ "characters instead of 5.\n", n);
++ exit (1);
++ }
+
+ mpfr_set_inf (x, 1);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 5)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, +Inf, MPFR_RNDN) wrote %u "
++ "characters instead of 5.\n", n);
++ exit (1);
++ }
+
+ mpfr_set_inf (x, -1);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 6)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, -Inf, MPFR_RNDN) wrote %u "
++ "characters instead of 6.\n", n);
++ exit (1);
++ }
+
+ mpfr_set_ui (x, 0, MPFR_RNDN);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 1)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, +0, MPFR_RNDN) wrote %u "
++ "characters instead of 1.\n", n);
++ exit (1);
++ }
++
+ mpfr_neg (x, x, MPFR_RNDN);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 2)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, -0, MPFR_RNDN) wrote %u "
++ "characters instead of 2.\n", n);
++ exit (1);
++ }
+
+ mpfr_clear (x);
+ }
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-06-23 11:03:20.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0";
++ return "3.0.0-p1";
+ }
+diff -Naurd mpfr-3.0.0-a/Makefile.in mpfr-3.0.0-b/Makefile.in
+--- mpfr-3.0.0-a/Makefile.in 2010-06-10 11:00:52.000000000 +0000
++++ mpfr-3.0.0-b/Makefile.in 2010-06-10 11:00:52.000000000 +0000
+@@ -239,6 +239,7 @@
+ distuninstallcheck_listfiles = find . -type f -print
+ distcleancheck_listfiles = find . -type f -print
+ ACLOCAL = @ACLOCAL@
++ALLOCA = @ALLOCA@
+ AMTAR = @AMTAR@
+ AR = @AR@
+ AS = @AS@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-06-23 11:03:36.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-06-25 13:23:13.000000000 +0000
+@@ -0,0 +1 @@
++alloca
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-06-23 11:03:20.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-06-25 13:23:13.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p1
++3.0.0-p2
+diff -Naurd mpfr-3.0.0-a/acinclude.m4 mpfr-3.0.0-b/acinclude.m4
+--- mpfr-3.0.0-a/acinclude.m4 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/acinclude.m4 2010-06-10 11:00:14.000000000 +0000
+@@ -59,6 +59,9 @@
+ dnl sys/fpu.h - MIPS specific
+ AC_CHECK_HEADERS([sys/time.h sys/fpu.h])
+
++dnl Check how to get `alloca'
++AC_FUNC_ALLOCA
++
+ dnl SIZE_MAX macro
+ gl_SIZE_MAX
+
+diff -Naurd mpfr-3.0.0-a/configure mpfr-3.0.0-b/configure
+--- mpfr-3.0.0-a/configure 2010-06-10 11:00:51.000000000 +0000
++++ mpfr-3.0.0-b/configure 2010-06-25 13:23:05.000000000 +0000
+@@ -783,6 +783,7 @@
+ OBJDUMP
+ DLLTOOL
+ AS
++ALLOCA
+ MPFR_LIBM
+ ANSI2KNR
+ U
+@@ -5622,6 +5623,197 @@
+ done
+
+
++# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
++# for constant arguments. Useless!
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
++$as_echo_n "checking for working alloca.h... " >&6; }
++if test "${ac_cv_working_alloca_h+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#include <alloca.h>
++int
++main ()
++{
++char *p = (char *) alloca (2 * sizeof (int));
++ if (p) return 0;
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_working_alloca_h=yes
++else
++ ac_cv_working_alloca_h=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
++$as_echo "$ac_cv_working_alloca_h" >&6; }
++if test $ac_cv_working_alloca_h = yes; then
++
++$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
++
++fi
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
++$as_echo_n "checking for alloca... " >&6; }
++if test "${ac_cv_func_alloca_works+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#ifdef __GNUC__
++# define alloca __builtin_alloca
++#else
++# ifdef _MSC_VER
++# include <malloc.h>
++# define alloca _alloca
++# else
++# ifdef HAVE_ALLOCA_H
++# include <alloca.h>
++# else
++# ifdef _AIX
++ #pragma alloca
++# else
++# ifndef alloca /* predefined by HP cc +Olibcalls */
++char *alloca ();
++# endif
++# endif
++# endif
++# endif
++#endif
++
++int
++main ()
++{
++char *p = (char *) alloca (1);
++ if (p) return 0;
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_func_alloca_works=yes
++else
++ ac_cv_func_alloca_works=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
++$as_echo "$ac_cv_func_alloca_works" >&6; }
++
++if test $ac_cv_func_alloca_works = yes; then
++
++$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
++
++else
++ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
++# that cause trouble. Some versions do not even contain alloca or
++# contain a buggy version. If you still want to use their alloca,
++# use ar to extract alloca.o from them instead of compiling alloca.c.
++
++ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
++
++$as_echo "#define C_ALLOCA 1" >>confdefs.h
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
++$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
++if test "${ac_cv_os_cray+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#if defined CRAY && ! defined CRAY2
++webecray
++#else
++wenotbecray
++#endif
++
++_ACEOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++ $EGREP "webecray" >/dev/null 2>&1; then :
++ ac_cv_os_cray=yes
++else
++ ac_cv_os_cray=no
++fi
++rm -f conftest*
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
++$as_echo "$ac_cv_os_cray" >&6; }
++if test $ac_cv_os_cray = yes; then
++ for ac_func in _getb67 GETB67 getb67; do
++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
++eval as_val=\$$as_ac_var
++ if test "x$as_val" = x""yes; then :
++
++cat >>confdefs.h <<_ACEOF
++#define CRAY_STACKSEG_END $ac_func
++_ACEOF
++
++ break
++fi
++
++ done
++fi
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
++$as_echo_n "checking stack direction for C alloca... " >&6; }
++if test "${ac_cv_c_stack_direction+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test "$cross_compiling" = yes; then :
++ ac_cv_c_stack_direction=0
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++$ac_includes_default
++int
++find_stack_direction ()
++{
++ static char *addr = 0;
++ auto char dummy;
++ if (addr == 0)
++ {
++ addr = &dummy;
++ return find_stack_direction ();
++ }
++ else
++ return (&dummy > addr) ? 1 : -1;
++}
++
++int
++main ()
++{
++ return find_stack_direction () < 0;
++}
++_ACEOF
++if ac_fn_c_try_run "$LINENO"; then :
++ ac_cv_c_stack_direction=1
++else
++ ac_cv_c_stack_direction=-1
++fi
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
++ conftest.$ac_objext conftest.beam conftest.$ac_ext
++fi
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
++$as_echo "$ac_cv_c_stack_direction" >&6; }
++cat >>confdefs.h <<_ACEOF
++#define STACK_DIRECTION $ac_cv_c_stack_direction
++_ACEOF
++
++
++fi
++
++
+
+ for ac_header in stdint.h
+ do :
+@@ -7564,13 +7756,13 @@
+ else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+- (eval echo "\"\$as_me:7567: $ac_compile\"" >&5)
++ (eval echo "\"\$as_me:7759: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+- (eval echo "\"\$as_me:7570: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
++ (eval echo "\"\$as_me:7762: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+- (eval echo "\"\$as_me:7573: output\"" >&5)
++ (eval echo "\"\$as_me:7765: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+@@ -8772,7 +8964,7 @@
+ ;;
+ *-*-irix6*)
+ # Find out which ABI we are using.
+- echo '#line 8775 "configure"' > conftest.$ac_ext
++ echo '#line 8967 "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+@@ -10032,11 +10224,11 @@
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:10035: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:10227: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:10039: \$? = $ac_status" >&5
++ echo "$as_me:10231: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -10371,11 +10563,11 @@
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:10374: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:10566: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:10378: \$? = $ac_status" >&5
++ echo "$as_me:10570: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -10476,11 +10668,11 @@
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:10479: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:10671: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:10483: \$? = $ac_status" >&5
++ echo "$as_me:10675: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+@@ -10531,11 +10723,11 @@
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:10534: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:10726: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:10538: \$? = $ac_status" >&5
++ echo "$as_me:10730: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+@@ -12915,7 +13107,7 @@
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12918 "configure"
++#line 13110 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -13011,7 +13203,7 @@
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 13014 "configure"
++#line 13206 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-06-23 11:03:20.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-06-25 13:23:13.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p1"
++#define MPFR_VERSION_STRING "3.0.0-p2"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/tests/Makefile.in mpfr-3.0.0-b/tests/Makefile.in
+--- mpfr-3.0.0-a/tests/Makefile.in 2010-06-10 11:00:52.000000000 +0000
++++ mpfr-3.0.0-b/tests/Makefile.in 2010-06-10 11:00:52.000000000 +0000
+@@ -960,6 +960,7 @@
+ red=; grn=; lgn=; blu=; std=
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ ACLOCAL = @ACLOCAL@
++ALLOCA = @ALLOCA@
+ AMTAR = @AMTAR@
+ AR = @AR@
+ AS = @AS@
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-06-23 11:03:20.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-06-25 13:23:13.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p1";
++ return "3.0.0-p2";
+ }
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-07-10 00:11:19.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-07-10 00:12:50.000000000 +0000
+@@ -0,0 +1 @@
++gamma_underflow
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-06-25 13:23:13.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-07-10 00:11:53.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p2
++3.0.0-p3
+diff -Naurd mpfr-3.0.0-a/gamma.c mpfr-3.0.0-b/gamma.c
+--- mpfr-3.0.0-a/gamma.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/gamma.c 2010-07-10 00:11:46.000000000 +0000
+@@ -274,7 +274,7 @@
+ /* we want an upper bound for x * [log(2-x)-1].
+ since x < 0, we need a lower bound on log(2-x) */
+ mpfr_ui_sub (xp, 2, x, MPFR_RNDD);
+- mpfr_log (xp, xp, MPFR_RNDD);
++ mpfr_log2 (xp, xp, MPFR_RNDD);
+ mpfr_sub_ui (xp, xp, 1, MPFR_RNDD);
+ mpfr_mul (xp, xp, x, MPFR_RNDU);
+
+@@ -303,8 +303,8 @@
+ {
+ mpfr_sub (tmp, tmp, tmp2, MPFR_RNDZ); /* low bnd on |sin(Pi*(2-x))| */
+ mpfr_ui_div (tmp, 12, tmp, MPFR_RNDU); /* upper bound */
+- mpfr_log (tmp, tmp, MPFR_RNDU);
+- mpfr_add (tmp, tmp, xp, MPFR_RNDU);
++ mpfr_log2 (tmp, tmp, MPFR_RNDU);
++ mpfr_add (xp, tmp, xp, MPFR_RNDU);
+ underflow = mpfr_cmp_si (xp, expo.saved_emin - 2) <= 0;
+ }
+
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-06-25 13:23:13.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-07-10 00:11:53.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p2"
++#define MPFR_VERSION_STRING "3.0.0-p3"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/tests/tgamma.c mpfr-3.0.0-b/tests/tgamma.c
+--- mpfr-3.0.0-a/tests/tgamma.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tgamma.c 2010-07-10 00:11:46.000000000 +0000
+@@ -461,6 +461,20 @@
+ mpfr_clear (x);
+ }
+
++/* bug found by Stathis, only occurs on 32-bit machines */
++static void
++test20100709 (void)
++{
++ mpfr_t x;
++ int inex;
++
++ mpfr_init2 (x, 100);
++ mpfr_set_str (x, "-4.6308260837372266e+07", 10, MPFR_RNDN);
++ inex = mpfr_gamma (x, x, MPFR_RNDN);
++ MPFR_ASSERTN(MPFR_IS_ZERO(x) && MPFR_IS_NEG(x) && inex > 0);
++ mpfr_clear (x);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -471,6 +485,7 @@
+ test_generic (2, 100, 2);
+ gamma_integer ();
+ test20071231 ();
++ test20100709 ();
+
+ data_check ("data/gamma", mpfr_gamma, "mpfr_gamma");
+
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-06-25 13:23:13.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-07-10 00:11:53.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p2";
++ return "3.0.0-p3";
+ }
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-09-07 08:44:01.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-09-07 08:48:46.000000000 +0000
+@@ -0,0 +1 @@
++mpfr_cmp/set_ui/si
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-07-10 00:11:53.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-09-07 08:46:06.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p3
++3.0.0-p4
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-07-10 00:11:53.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-09-07 08:46:06.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p3"
++#define MPFR_VERSION_STRING "3.0.0-p4"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+@@ -798,35 +798,45 @@
+ anyway. Checking with other ICC versions is needed. Possibly detect
+ whether warnings are produced or not with a configure test.
+ + Remove C++ too, since it complains too much. */
++/* Added casts to improve robustness in case of undefined behavior and
++ compiler extensions based on UB (in particular -fwrapv). MPFR doesn't
++ use such extensions, but these macros will be used by 3rd-party code,
++ where such extensions may be required.
++ Moreover casts to unsigned long have been added to avoid warnings in
++ programs that use MPFR and are compiled with -Wconversion; such casts
++ are OK since if X is a constant expression, then (unsigned long) X is
++ also a constant expression, so that the optimizations still work. */
+ #if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
+ #if (__GNUC__ >= 2)
+ #undef mpfr_cmp_ui
+-/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0. */
+-#define mpfr_cmp_ui(_f,_u) \
+- (__builtin_constant_p (_u) && (_u) == 0 ? \
+- mpfr_sgn (_f) : \
+- mpfr_cmp_ui_2exp ((_f),(_u),0))
++/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0.
++ But warning! mpfr_sgn is specified as a macro in the API, thus the macro
++ mustn't be used if side effects are possible, like here. */
++#define mpfr_cmp_ui(_f,_u) \
++ (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
++ (mpfr_sgn) (_f) : \
++ mpfr_cmp_ui_2exp ((_f), (unsigned long) (_u), 0))
+ #undef mpfr_cmp_si
+-#define mpfr_cmp_si(_f,_s) \
+- (__builtin_constant_p (_s) && (_s) >= 0 ? \
+- mpfr_cmp_ui ((_f), (_s)) : \
+- mpfr_cmp_si_2exp ((_f), (_s), 0))
++#define mpfr_cmp_si(_f,_s) \
++ (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
++ mpfr_cmp_ui ((_f), (unsigned long) (long) (_s)) : \
++ mpfr_cmp_si_2exp ((_f), (long) (_s), 0))
+ #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
+ #undef mpfr_set_ui
+-#define mpfr_set_ui(_f,_u,_r) \
+- (__builtin_constant_p (_u) && (_u) == 0 ? \
+- __extension__ ({ \
+- mpfr_ptr _p = (_f); \
+- _p->_mpfr_sign = 1; \
+- _p->_mpfr_exp = __MPFR_EXP_ZERO; \
+- (void) (_r); 0; }) : \
+- mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
++#define mpfr_set_ui(_f,_u,_r) \
++ (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
++ __extension__ ({ \
++ mpfr_ptr _p = (_f); \
++ _p->_mpfr_sign = 1; \
++ _p->_mpfr_exp = __MPFR_EXP_ZERO; \
++ (void) (_r); 0; }) : \
++ mpfr_set_ui_2exp ((_f), (unsigned long) (_u), 0, (_r)))
+ #endif
+ #undef mpfr_set_si
+-#define mpfr_set_si(_f,_s,_r) \
+- (__builtin_constant_p (_s) && (_s) >= 0 ? \
+- mpfr_set_ui ((_f), (_s), (_r)) : \
+- mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
++#define mpfr_set_si(_f,_s,_r) \
++ (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
++ mpfr_set_ui ((_f), (unsigned long) (long) (_s), (_r)) : \
++ mpfr_set_si_2exp ((_f), (long) (_s), 0, (_r)))
+ #endif
+ #endif
+
+diff -Naurd mpfr-3.0.0-a/tests/tcmp_ui.c mpfr-3.0.0-b/tests/tcmp_ui.c
+--- mpfr-3.0.0-a/tests/tcmp_ui.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tcmp_ui.c 2010-09-07 08:45:12.000000000 +0000
+@@ -88,6 +88,126 @@
+ mpfr_clear (x);
+ }
+
++/* Since mpfr_cmp_ui and mpfr_cmp_si are also implemented by a macro
++ with __builtin_constant_p for GCC, check that side effects are
++ handled correctly. */
++static void
++check_macros (void)
++{
++ mpfr_t x;
++ int c;
++
++ mpfr_init2 (x, 32);
++
++ c = 0;
++ mpfr_set_ui (x, 17, MPFR_RNDN);
++ if (mpfr_cmp_ui (x, 17) != 0)
++ {
++ printf ("Error 1 on mpfr_cmp_ui(x,17) in check_macros\n");
++ exit (1);
++ }
++ if (mpfr_cmp_ui (x, (c++, 17)) != 0)
++ {
++ printf ("Error 2 on mpfr_cmp_ui(x,17) in check_macros\n");
++ exit (1);
++ }
++ if (c != 1)
++ {
++ printf ("Error 3 on mpfr_cmp_ui(x,17) in check_macros\n"
++ "(c = %d instead of 1)\n", c);
++ exit (1);
++ }
++ if (mpfr_cmp_si (x, 17) != 0)
++ {
++ printf ("Error 1 on mpfr_cmp_si(x,17) in check_macros\n");
++ exit (1);
++ }
++ if (mpfr_cmp_si (x, (c++, 17)) != 0)
++ {
++ printf ("Error 2 on mpfr_cmp_si(x,17) in check_macros\n");
++ exit (1);
++ }
++ if (c != 2)
++ {
++ printf ("Error 3 on mpfr_cmp_si(x,17) in check_macros\n"
++ "(c = %d instead of 2)\n", c);
++ exit (1);
++ }
++
++ c = 0;
++ mpfr_set_ui (x, 0, MPFR_RNDN);
++ if (mpfr_cmp_ui (x, 0) != 0)
++ {
++ printf ("Error 1 on mpfr_cmp_ui(x,0) in check_macros\n");
++ exit (1);
++ }
++ if (mpfr_cmp_ui (x, (c++, 0)) != 0)
++ {
++ printf ("Error 2 on mpfr_cmp_ui(x,0) in check_macros\n");
++ exit (1);
++ }
++ if (c != 1)
++ {
++ printf ("Error 3 on mpfr_cmp_ui(x,0) in check_macros\n"
++ "(c = %d instead of 1)\n", c);
++ exit (1);
++ }
++ if (mpfr_cmp_si (x, 0) != 0)
++ {
++ printf ("Error 1 on mpfr_cmp_si(x,0) in check_macros\n");
++ exit (1);
++ }
++ if (mpfr_cmp_si (x, (c++, 0)) != 0)
++ {
++ printf ("Error 2 on mpfr_cmp_si(x,0) in check_macros\n");
++ exit (1);
++ }
++ if (c != 2)
++ {
++ printf ("Error 3 on mpfr_cmp_si(x,0) in check_macros\n"
++ "(c = %d instead of 2)\n", c);
++ exit (1);
++ }
++
++ mpfr_clear (x);
++}
++
++/* Bug in r7114 */
++static void
++test_macros (void)
++{
++ mpfr_t x[3];
++ mpfr_ptr p;
++
++ mpfr_inits (x[0], x[1], x[2], (mpfr_ptr) 0);
++ mpfr_set_ui (x[0], 0, MPFR_RNDN);
++ p = x[0];
++ if (mpfr_cmp_ui (p++, 0) != 0)
++ {
++ printf ("Error in mpfr_cmp_ui macro: result should be 0.\n");
++ exit (1);
++ }
++ if (p != x[1])
++ {
++ printf ("Error in mpfr_cmp_ui macro: p - x[0] = %d (expecting 1)\n",
++ (int) (p - x[0]));
++ exit (1);
++ }
++ p = x[0];
++ if (mpfr_cmp_si (p++, 0) != 0)
++ {
++ printf ("Error in mpfr_cmp_si macro: result should be 0.\n");
++ exit (1);
++ }
++ if (p != x[1])
++ {
++ printf ("Error in mpfr_cmp_si macro: p - x[0] = %d (expecting 1)\n",
++ (int) (p - x[0]));
++ exit (1);
++ }
++ mpfr_clears (x[0], x[1], x[2], (mpfr_ptr) 0);
++}
++
+ int
+ main (void)
+ {
+@@ -216,6 +336,8 @@
+ mpfr_clear (x);
+
+ check_nan ();
++ check_macros ();
++ test_macros ();
+
+ tests_end_mpfr ();
+ return 0;
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-07-10 00:11:53.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-09-07 08:46:06.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p3";
++ return "3.0.0-p4";
+ }
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-10-21 20:28:38.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-10-21 20:28:38.000000000 +0000
+@@ -0,0 +1 @@
++tcan_round
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-09-07 08:46:06.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-10-21 20:28:38.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p4
++3.0.0-p5
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-09-07 08:46:06.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-10-21 20:28:38.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p4"
++#define MPFR_VERSION_STRING "3.0.0-p5"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/tests/tcan_round.c mpfr-3.0.0-b/tests/tcan_round.c
+--- mpfr-3.0.0-a/tests/tcan_round.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tcan_round.c 2010-10-21 20:28:38.000000000 +0000
+@@ -41,7 +41,7 @@
+ /* avoid mpn_random which leaks memory */
+ for (i = 0; i < n; i++)
+ buf[i] = randlimb ();
+- p = (mpfr_prec_t) randlimb() % ((n-1) * GMP_NUMB_BITS) + MPFR_PREC_MIN;
++ p = randlimb() % ((n-1) * GMP_NUMB_BITS) + MPFR_PREC_MIN;
+ err = p + randlimb () % GMP_NUMB_BITS;
+ r1 = mpfr_round_p (buf, n, err, p);
+ r2 = mpfr_can_round_raw (buf, n, MPFR_SIGN_POS, err,
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-09-07 08:46:06.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-10-21 20:28:38.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p4";
++ return "3.0.0-p5";
+ }
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-10-21 20:59:32.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-10-21 20:59:32.000000000 +0000
+@@ -0,0 +1 @@
++mpfr_sub1
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-10-21 20:28:38.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-10-21 20:59:32.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p5
++3.0.0-p6
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-10-21 20:28:38.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-10-21 20:59:32.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p5"
++#define MPFR_VERSION_STRING "3.0.0-p6"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/sub1.c mpfr-3.0.0-b/sub1.c
+--- mpfr-3.0.0-a/sub1.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/sub1.c 2010-10-21 20:59:32.000000000 +0000
+@@ -37,7 +37,9 @@
+ mp_size_t cancel2, an, bn, cn, cn0;
+ mp_limb_t *ap, *bp, *cp;
+ mp_limb_t carry, bb, cc, borrow = 0;
+- int inexact, shift_b, shift_c, is_exact = 1, down = 0, add_exp = 0;
++ int inexact, shift_b, shift_c, add_exp = 0;
++ int cmp_low = 0; /* used for rounding to nearest: 0 if low(b) = low(c),
++ negative if low(b) < low(c), positive if low(b)>low(c) */
+ int sh, k;
+ MPFR_TMP_DECL(marker);
+
+@@ -196,7 +198,8 @@
+ }
+
+ #ifdef DEBUG
+- printf ("shift_b=%d shift_c=%d diffexp=%lu\n", shift_b, shift_c,
++ printf ("rnd=%s shift_b=%d shift_c=%d diffexp=%lu\n",
++ mpfr_print_rnd_mode (rnd_mode), shift_b, shift_c,
+ (unsigned long) diff_exp);
+ #endif
+
+@@ -307,17 +310,18 @@
+ {
+ if (MPFR_LIKELY(sh))
+ {
+- is_exact = (carry == 0);
+ /* can decide except when carry = 2^(sh-1) [middle]
+ or carry = 0 [truncate, but cannot decide inexact flag] */
+- down = (carry < (MPFR_LIMB_ONE << (sh - 1)));
+ if (carry > (MPFR_LIMB_ONE << (sh - 1)))
+ goto add_one_ulp;
+- else if ((0 < carry) && down)
++ else if ((0 < carry) && (carry < (MPFR_LIMB_ONE << (sh - 1))))
+ {
+ inexact = -1; /* result if smaller than exact value */
+ goto truncate;
+ }
++ /* now carry = 2^(sh-1), in which case cmp_low=2,
++ or carry = 0, in which case cmp_low=0 */
++ cmp_low = (carry == 0) ? 0 : 2;
+ }
+ }
+ else /* directed rounding: set rnd_mode to RNDZ iff toward zero */
+@@ -344,12 +348,32 @@
+ cn -= (long int) an + cancel2;
+
+ #ifdef DEBUG
+- printf ("last %d bits from a are %lu, bn=%ld, cn=%ld\n",
++ printf ("last sh=%d bits from a are %lu, bn=%ld, cn=%ld\n",
+ sh, (unsigned long) carry, (long) bn, (long) cn);
+ #endif
+
++ /* for rounding to nearest, we couldn't conclude up to here in the following
++ cases:
++ 1. sh = 0, then cmp_low=0: we can either truncate, subtract one ulp
++ or add one ulp: -1 ulp < low(b)-low(c) < 1 ulp
++ 2. sh > 0 but the low sh bits from high(b)-high(c) equal 2^(sh-1):
++ -0.5 ulp <= -1/2^sh < low(b)-low(c)-0.5 < 1/2^sh <= 0.5 ulp
++ we can't decide the rounding, in that case cmp_low=2:
++ either we truncate and flag=-1, or we add one ulp and flag=1
++ 3. the low sh>0 bits from high(b)-high(c) equal 0: we know we have to
++ truncate but we can't decide the ternary value, here cmp_low=0:
++ -0.5 ulp <= -1/2^sh < low(b)-low(c) < 1/2^sh <= 0.5 ulp
++ we always truncate and inexact can be any of -1,0,1
++ */
++
++ /* note: here cn might exceed cn0, in which case we consider a zero limb */
+ for (k = 0; (bn > 0) || (cn > 0); k = 1)
+ {
++ /* if cmp_low < 0, we know low(b) - low(c) < 0
++ if cmp_low > 0, we know low(b) - low(c) > 0
++ (more precisely if cmp_low = 2, low(b) - low(c) = 0.5 ulp so far)
++ if cmp_low = 0, so far low(b) - low(c) = 0 */
++
+ /* get next limbs */
+ bb = (bn > 0) ? bp[--bn] : 0;
+ if ((cn > 0) && (cn-- <= cn0))
+@@ -357,76 +381,115 @@
+ else
+ cc = 0;
+
+- /* down is set when low(b) < low(c) */
+- if (down == 0)
+- down = (bb < cc);
++ /* cmp_low compares low(b) and low(c) */
++ if (cmp_low == 0) /* case 1 or 3 */
++ cmp_low = (bb < cc) ? -2+k : (bb > cc) ? 1 : 0;
++
++ /* Case 1 for k=0 splits into 7 subcases:
++ 1a: bb > cc + half
++ 1b: bb = cc + half
++ 1c: 0 < bb - cc < half
++ 1d: bb = cc
++ 1e: -half < bb - cc < 0
++ 1f: bb - cc = -half
++ 1g: bb - cc < -half
++
++ Case 2 splits into 3 subcases:
++ 2a: bb > cc
++ 2b: bb = cc
++ 2c: bb < cc
++
++ Case 3 splits into 3 subcases:
++ 3a: bb > cc
++ 3b: bb = cc
++ 3c: bb < cc
++ */
+
+ /* the case rounding to nearest with sh=0 is special since one couldn't
+ subtract above 1/2 ulp in the trailing limb of the result */
+- if ((rnd_mode == MPFR_RNDN) && sh == 0 && k == 0)
++ if (rnd_mode == MPFR_RNDN && sh == 0 && k == 0) /* case 1 for k=0 */
+ {
+ mp_limb_t half = MPFR_LIMB_HIGHBIT;
+
+- is_exact = (bb == cc);
+-
+ /* add one ulp if bb > cc + half
+ truncate if cc - half < bb < cc + half
+ sub one ulp if bb < cc - half
+ */
+
+- if (down)
++ if (cmp_low < 0) /* bb < cc: -1 ulp < low(b) - low(c) < 0,
++ cases 1e, 1f and 1g */
+ {
+ if (cc >= half)
+ cc -= half;
+- else
++ else /* since bb < cc < half, bb+half < 2*half */
+ bb += half;
++ /* now we have bb < cc + half:
++ we have to subtract one ulp if bb < cc,
++ and truncate if bb > cc */
+ }
+- else /* bb >= cc */
++ else if (cmp_low >= 0) /* bb >= cc, cases 1a to 1d */
+ {
+ if (cc < half)
+ cc += half;
+- else
++ else /* since bb >= cc >= half, bb - half >= 0 */
+ bb -= half;
++ /* now we have bb > cc - half: we have to add one ulp if bb > cc,
++ and truncate if bb < cc */
++ if (cmp_low > 0)
++ cmp_low = 2;
+ }
+ }
+
+ #ifdef DEBUG
+- printf (" bb=%lu cc=%lu down=%d is_exact=%d\n",
+- (unsigned long) bb, (unsigned long) cc, down, is_exact);
++ printf ("k=%u bb=%lu cc=%lu cmp_low=%d\n", k,
++ (unsigned long) bb, (unsigned long) cc, cmp_low);
+ #endif
+- if (bb < cc)
++ if (cmp_low < 0) /* low(b) - low(c) < 0: either truncate or subtract
++ one ulp */
+ {
+ if (rnd_mode == MPFR_RNDZ)
+- goto sub_one_ulp;
++ goto sub_one_ulp; /* set inexact=-1 */
+ else if (rnd_mode != MPFR_RNDN) /* round away */
+ {
+ inexact = 1;
+ goto truncate;
+ }
+- else /* round to nearest: special case here since for sh=k=0
+- bb = bb0 - MPFR_LIMB_HIGHBIT */
++ else /* round to nearest */
+ {
+- if (is_exact && sh == 0)
+- {
+- /* For k=0 we can't decide exactness since it may depend
+- from low order bits.
+- For k=1, the first low limbs matched: low(b)-low(c)<0. */
+- if (k)
+- {
+- inexact = 1;
+- goto truncate;
+- }
+- }
+- else if (down && sh == 0)
+- goto sub_one_ulp;
+- else
+- {
+- inexact = (is_exact) ? 1 : -1;
++ /* If cmp_low < 0 and bb > cc, then -0.5 ulp < low(b)-low(c) < 0,
++ whatever the value of sh.
++ If sh>0, then cmp_low < 0 implies that the initial neglected
++ sh bits were 0 (otherwise cmp_low=2 initially), thus the
++ weight of the new bits is less than 0.5 ulp too.
++ If k > 0 (and sh=0) this means that either the first neglected
++ limbs bb and cc were equal (thus cmp_low was 0 for k=0),
++ or we had bb - cc = -0.5 ulp or 0.5 ulp.
++ The last case is not possible here since we would have
++ cmp_low > 0 which is sticky.
++ In the first case (where we have cmp_low = -1), we truncate,
++ whereas in the 2nd case we have cmp_low = -2 and we subtract
++ one ulp.
++ */
++ if (bb > cc || sh > 0 || cmp_low == -1)
++ { /* -0.5 ulp < low(b)-low(c) < 0,
++ bb > cc corresponds to cases 1e and 1f1
++ sh > 0 corresponds to cases 3c and 3b3
++ cmp_low = -1 corresponds to case 1d3 (also 3b3) */
++ inexact = 1;
+ goto truncate;
+ }
++ else if (bb < cc) /* here sh = 0 and low(b)-low(c) < -0.5 ulp,
++ this corresponds to cases 1g and 1f3 */
++ goto sub_one_ulp;
++ /* the only case where we can't conclude is sh=0 and bb=cc,
++ i.e., we have low(b) - low(c) = -0.5 ulp (up to now), thus
++ we don't know if we must truncate or subtract one ulp.
++ Note: for sh=0 we can't have low(b) - low(c) = -0.5 ulp up to
++ now, since low(b) - low(c) > 1/2^sh */
+ }
+ }
+- else if (bb > cc)
++ else if (cmp_low > 0) /* 0 < low(b) - low(c): either truncate or
++ add one ulp */
+ {
+ if (rnd_mode == MPFR_RNDZ)
+ {
+@@ -437,34 +500,70 @@
+ goto add_one_ulp;
+ else /* round to nearest */
+ {
+- if (is_exact)
++ if (bb > cc)
+ {
+- inexact = -1;
+- goto truncate;
++ /* if sh=0, then bb>cc means that low(b)-low(c) > 0.5 ulp,
++ and similarly when cmp_low=2 */
++ if (cmp_low == 2) /* cases 1a, 1b1, 2a and 2b1 */
++ goto add_one_ulp;
++ /* sh > 0 and cmp_low > 0: this implies that the sh initial
++ neglected bits were 0, and the remaining low(b)-low(c)>0,
++ but its weight is less than 0.5 ulp */
++ else /* 0 < low(b) - low(c) < 0.5 ulp, this corresponds to
++ cases 3a, 1d1 and 3b1 */
++ {
++ inexact = -1;
++ goto truncate;
++ }
+ }
+- else if (down)
++ else if (bb < cc) /* 0 < low(b) - low(c) < 0.5 ulp, cases 1c,
++ 1b3, 2b3 and 2c */
+ {
+- inexact = 1;
++ inexact = -1;
+ goto truncate;
+ }
+- else
+- goto add_one_ulp;
++ /* the only case where we can't conclude is bb=cc, i.e.,
++ low(b) - low(c) = 0.5 ulp (up to now), thus we don't know
++ if we must truncate or add one ulp. */
+ }
+ }
++ /* after k=0, we cannot conclude in the following cases, we split them
++ according to the values of bb and cc for k=1:
++ 1b. sh=0 and cmp_low = 1 and bb-cc = half [around 0.5 ulp]
++ 1b1. bb > cc: add one ulp, inex = 1
++ 1b2: bb = cc: cannot conclude
++ 1b3: bb < cc: truncate, inex = -1
++ 1d. sh=0 and cmp_low = 0 and bb-cc = 0 [around 0]
++ 1d1: bb > cc: truncate, inex = -1
++ 1d2: bb = cc: cannot conclude
++ 1d3: bb < cc: truncate, inex = +1
++ 1f. sh=0 and cmp_low = -1 and bb-cc = -half [around -0.5 ulp]
++ 1f1: bb > cc: truncate, inex = +1
++ 1f2: bb = cc: cannot conclude
++ 1f3: bb < cc: sub one ulp, inex = -1
++ 2b. sh > 0 and cmp_low = 2 and bb=cc [around 0.5 ulp]
++ 2b1. bb > cc: add one ulp, inex = 1
++ 2b2: bb = cc: cannot conclude
++ 2b3: bb < cc: truncate, inex = -1
++ 3b. sh > 0 and cmp_low = 0 [around 0]
++ 3b1. bb > cc: truncate, inex = -1
++ 3b2: bb = cc: cannot conclude
++ 3b3: bb < cc: truncate, inex = +1
++ */
+ }
+
+- if ((rnd_mode == MPFR_RNDN) && !is_exact)
++ if ((rnd_mode == MPFR_RNDN) && cmp_low != 0)
+ {
+ /* even rounding rule */
+ if ((ap[0] >> sh) & 1)
+ {
+- if (down)
++ if (cmp_low < 0)
+ goto sub_one_ulp;
+ else
+ goto add_one_ulp;
+ }
+ else
+- inexact = (down) ? 1 : -1;
++ inexact = (cmp_low > 0) ? -1 : 1;
+ }
+ else
+ inexact = 0;
+diff -Naurd mpfr-3.0.0-a/tests/tfma.c mpfr-3.0.0-b/tests/tfma.c
+--- mpfr-3.0.0-a/tests/tfma.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tfma.c 2010-10-21 20:59:32.000000000 +0000
+@@ -337,6 +337,94 @@
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
+ }
+
++static void
++bug20101018 (void)
++{
++ mpfr_t x, y, z, t, u;
++ int i;
++
++ mpfr_init2 (x, 64);
++ mpfr_init2 (y, 64);
++ mpfr_init2 (z, 64);
++ mpfr_init2 (t, 64);
++ mpfr_init2 (u, 64);
++
++ mpfr_set_str (x, "0xf.fffffffffffffffp-14766", 16, MPFR_RNDN);
++ mpfr_set_str (y, "-0xf.fffffffffffffffp+317", 16, MPFR_RNDN);
++ mpfr_set_str (z, "0x8.3ffffffffffe3ffp-14443", 16, MPFR_RNDN);
++ mpfr_set_str (t, "0x8.7ffffffffffc7ffp-14444", 16, MPFR_RNDN);
++ i = mpfr_fma (u, x, y, z, MPFR_RNDN);
++ if (mpfr_cmp (u, t) != 0)
++ {
++ printf ("Wrong result in bug20101018 (a)\n");
++ printf ("Expected ");
++ mpfr_out_str (stdout, 16, 0, t, MPFR_RNDN);
++ printf ("\nGot ");
++ mpfr_out_str (stdout, 16, 0, u, MPFR_RNDN);
++ printf ("\n");
++ exit (1);
++ }
++ if (i <= 0)
++ {
++ printf ("Wrong ternary value in bug20101018 (a)\n");
++ printf ("Expected > 0\n");
++ printf ("Got %d\n", i);
++ exit (1);
++ }
++
++ mpfr_set_str (x, "-0xf.fffffffffffffffp-11420", 16, MPFR_RNDN);
++ mpfr_set_str (y, "0xf.fffffffffffffffp+9863", 16, MPFR_RNDN);
++ mpfr_set_str (z, "0x8.fffff80ffffffffp-1551", 16, MPFR_RNDN);
++ mpfr_set_str (t, "0x9.fffff01ffffffffp-1552", 16, MPFR_RNDN);
++ i = mpfr_fma (u, x, y, z, MPFR_RNDN);
++ if (mpfr_cmp (u, t) != 0)
++ {
++ printf ("Wrong result in bug20101018 (b)\n");
++ printf ("Expected ");
++ mpfr_out_str (stdout, 16, 0, t, MPFR_RNDN);
++ printf ("\nGot ");
++ mpfr_out_str (stdout, 16, 0, u, MPFR_RNDN);
++ printf ("\n");
++ exit (1);
++ }
++ if (i <= 0)
++ {
++ printf ("Wrong ternary value in bug20101018 (b)\n");
++ printf ("Expected > 0\n");
++ printf ("Got %d\n", i);
++ exit (1);
++ }
++
++ mpfr_set_str (x, "0xf.fffffffffffffffp-2125", 16, MPFR_RNDN);
++ mpfr_set_str (y, "-0xf.fffffffffffffffp-6000", 16, MPFR_RNDN);
++ mpfr_set_str (z, "0x8p-8119", 16, MPFR_RNDN);
++ mpfr_set_str (t, "0x8.000000000000001p-8120", 16, MPFR_RNDN);
++ i = mpfr_fma (u, x, y, z, MPFR_RNDN);
++ if (mpfr_cmp (u, t) != 0)
++ {
++ printf ("Wrong result in bug20101018 (c)\n");
++ printf ("Expected ");
++ mpfr_out_str (stdout, 16, 0, t, MPFR_RNDN);
++ printf ("\nGot ");
++ mpfr_out_str (stdout, 16, 0, u, MPFR_RNDN);
++ printf ("\n");
++ exit (1);
++ }
++ if (i <= 0)
++ {
++ printf ("Wrong ternary value in bug20101018 (c)\n");
++ printf ("Expected > 0\n");
++ printf ("Got %d\n", i);
++ exit (1);
++ }
++
++ mpfr_clear (x);
++ mpfr_clear (y);
++ mpfr_clear (z);
++ mpfr_clear (t);
++ mpfr_clear (u);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -345,6 +433,8 @@
+
+ tests_start_mpfr ();
+
++ bug20101018 ();
++
+ mpfr_init (x);
+ mpfr_init (s);
+ mpfr_init (y);
+diff -Naurd mpfr-3.0.0-a/tests/tsub.c mpfr-3.0.0-b/tests/tsub.c
+--- mpfr-3.0.0-a/tests/tsub.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tsub.c 2010-10-21 20:59:32.000000000 +0000
+@@ -201,6 +201,8 @@
+ if (mpfr_cmp (z, x))
+ {
+ printf ("Error in mpfr_sub (2)\n");
++ printf ("Expected "); mpfr_print_binary (x); puts ("");
++ printf ("Got "); mpfr_print_binary (z); puts ("");
+ exit (1);
+ }
+ mpfr_set_str_binary (x, "1.1110111011110001110111011111111111101000011001011100101100101101");
+@@ -478,6 +480,156 @@
+ mpfr_clear (u);
+ }
+
++/* Bug found by Jakub Jelinek
++ * http://bugzilla.redhat.com/643657
++ * https://gforge.inria.fr/tracker/index.php?func=detail&aid=11301
++ * The consequence can be either an assertion failure (i = 2 in the
++ * testcase below, in debug mode) or an incorrectly rounded value.
++ */
++static void
++bug20101017 (void)
++{
++ mpfr_t a, b, c;
++ int inex;
++ int i;
++
++ mpfr_init2 (a, GMP_NUMB_BITS * 2);
++ mpfr_init2 (b, GMP_NUMB_BITS);
++ mpfr_init2 (c, GMP_NUMB_BITS);
++
++ /* a = 2^(2N) + k.2^(2N-1) + 2^N and b = 1
++ with N = GMP_NUMB_BITS and k = 0 or 1.
++ c = a - b should round to the same value as a. */
++
++ for (i = 2; i <= 3; i++)
++ {
++ mpfr_set_ui_2exp (a, i, GMP_NUMB_BITS - 1, MPFR_RNDN);
++ mpfr_add_ui (a, a, 1, MPFR_RNDN);
++ mpfr_mul_2ui (a, a, GMP_NUMB_BITS, MPFR_RNDN);
++ mpfr_set_ui (b, 1, MPFR_RNDN);
++ inex = mpfr_sub (c, a, b, MPFR_RNDN);
++ mpfr_set (b, a, MPFR_RNDN);
++ if (! mpfr_equal_p (c, b))
++ {
++ printf ("Error in bug20101017 for i = %d.\n", i);
++ printf ("Expected ");
++ mpfr_out_str (stdout, 16, 0, b, MPFR_RNDN);
++ putchar ('\n');
++ printf ("Got ");
++ mpfr_out_str (stdout, 16, 0, c, MPFR_RNDN);
++ putchar ('\n');
++ exit (1);
++ }
++ if (inex >= 0)
++ {
++ printf ("Error in bug20101017 for i = %d: bad inex value.\n", i);
++ printf ("Expected negative, got %d.\n", inex);
++ exit (1);
++ }
++ }
++
++ mpfr_set_prec (a, 64);
++ mpfr_set_prec (b, 129);
++ mpfr_set_prec (c, 2);
++ mpfr_set_str_binary (b, "0.100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001E65");
++ mpfr_set_str_binary (c, "0.10E1");
++ inex = mpfr_sub (a, b, c, MPFR_RNDN);
++ if (mpfr_cmp_ui_2exp (a, 1, 64) != 0 || inex >= 0)
++ {
++ printf ("Error in mpfr_sub for b-c for b=2^64+1+2^(-64), c=1\n");
++ printf ("Expected result 2^64 with inex < 0\n");
++ printf ("Got "); mpfr_print_binary (a);
++ printf (" with inex=%d\n", inex);
++ exit (1);
++ }
++
++ mpfr_clears (a, b, c, (mpfr_ptr) 0);
++}
++
++/* hard test of rounding */
++static void
++check_rounding (void)
++{
++ mpfr_t a, b, c, res;
++ mpfr_prec_t p;
++ long k, l;
++ int i;
++
++#define MAXKL (2 * GMP_NUMB_BITS)
++ for (p = MPFR_PREC_MIN; p <= GMP_NUMB_BITS; p++)
++ {
++ mpfr_init2 (a, p);
++ mpfr_init2 (res, p);
++ mpfr_init2 (b, p + 1 + MAXKL);
++ mpfr_init2 (c, MPFR_PREC_MIN);
++
++ /* b = 2^p + 1 + 2^(-k), c = 2^(-l) */
++ for (k = 0; k <= MAXKL; k++)
++ for (l = 0; l <= MAXKL; l++)
++ {
++ mpfr_set_ui_2exp (b, 1, p, MPFR_RNDN);
++ mpfr_add_ui (b, b, 1, MPFR_RNDN);
++ mpfr_mul_2ui (b, b, k, MPFR_RNDN);
++ mpfr_add_ui (b, b, 1, MPFR_RNDN);
++ mpfr_div_2ui (b, b, k, MPFR_RNDN);
++ mpfr_set_ui_2exp (c, 1, -l, MPFR_RNDN);
++ i = mpfr_sub (a, b, c, MPFR_RNDN);
++ /* b - c = 2^p + 1 + 2^(-k) - 2^(-l), should be rounded to
++ 2^p for l <= k, and 2^p+2 for l < k */
++ if (l <= k)
++ {
++ if (mpfr_cmp_ui_2exp (a, 1, p) != 0)
++ {
++ printf ("Wrong result in check_rounding\n");
++ printf ("p=%lu k=%ld l=%ld\n", p, k, l);
++ printf ("b="); mpfr_print_binary (b); puts ("");
++ printf ("c="); mpfr_print_binary (c); puts ("");
++ printf ("Expected 2^%lu\n", p);
++ printf ("Got "); mpfr_print_binary (a); puts ("");
++ exit (1);
++ }
++ if (i >= 0)
++ {
++ printf ("Wrong ternary value in check_rounding\n");
++ printf ("p=%lu k=%ld l=%ld\n", p, k, l);
++ printf ("b="); mpfr_print_binary (b); puts ("");
++ printf ("c="); mpfr_print_binary (c); puts ("");
++ printf ("a="); mpfr_print_binary (a); puts ("");
++ printf ("Expected < 0, got %d\n", i);
++ exit (1);
++ }
++ }
++ else /* l < k */
++ {
++ mpfr_set_ui_2exp (res, 1, p, MPFR_RNDN);
++ mpfr_add_ui (res, res, 2, MPFR_RNDN);
++ if (mpfr_cmp (a, res) != 0)
++ {
++ printf ("Wrong result in check_rounding\n");
++ printf ("b="); mpfr_print_binary (b); puts ("");
++ printf ("c="); mpfr_print_binary (c); puts ("");
++ printf ("Expected "); mpfr_print_binary (res); puts ("");
++ printf ("Got "); mpfr_print_binary (a); puts ("");
++ exit (1);
++ }
++ if (i <= 0)
++ {
++ printf ("Wrong ternary value in check_rounding\n");
++ printf ("b="); mpfr_print_binary (b); puts ("");
++ printf ("c="); mpfr_print_binary (c); puts ("");
++ printf ("Expected > 0, got %d\n", i);
++ exit (1);
++ }
++ }
++ }
++
++ mpfr_clear (a);
++ mpfr_clear (res);
++ mpfr_clear (b);
++ mpfr_clear (c);
++ }
++}
++
+ #define TEST_FUNCTION test_sub
+ #define TWO_ARGS
+ #define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), randlimb () % 100, RANDS)
+@@ -491,6 +643,8 @@
+
+ tests_start_mpfr ();
+
++ bug20101017 ();
++ check_rounding ();
+ check_diverse ();
+ check_inexact ();
+ bug_ddefour ();
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-10-21 20:28:38.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-10-21 20:59:32.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p5";
++ return "3.0.0-p6";
+ }
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-10-21 21:18:26.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-10-21 21:18:26.000000000 +0000
+@@ -0,0 +1 @@
++mpfr_set_ld
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-10-21 20:59:32.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-10-21 21:18:26.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p6
++3.0.0-p7
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-10-21 20:59:32.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-10-21 21:18:26.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p6"
++#define MPFR_VERSION_STRING "3.0.0-p7"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/set_ld.c mpfr-3.0.0-b/set_ld.c
+--- mpfr-3.0.0-a/set_ld.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/set_ld.c 2010-10-21 21:18:26.000000000 +0000
+@@ -102,21 +102,25 @@
+ {
+ x /= div13; /* exact */
+ shift_exp += 8192;
++ mpfr_div_2si (t, t, 8192, MPFR_RNDZ);
+ }
+ if (ABS (x) >= div12)
+ {
+ x /= div12; /* exact */
+ shift_exp += 4096;
++ mpfr_div_2si (t, t, 4096, MPFR_RNDZ);
+ }
+ if (ABS (x) >= div11)
+ {
+ x /= div11; /* exact */
+ shift_exp += 2048;
++ mpfr_div_2si (t, t, 2048, MPFR_RNDZ);
+ }
+ if (ABS (x) >= div10)
+ {
+ x /= div10; /* exact */
+ shift_exp += 1024;
++ mpfr_div_2si (t, t, 1024, MPFR_RNDZ);
+ }
+ /* warning: we may have DBL_MAX=2^1024*(1-2^(-53)) < x < 2^1024,
+ therefore we have one extra exponent reduction step */
+@@ -124,9 +128,10 @@
+ {
+ x /= div9; /* exact */
+ shift_exp += 512;
++ mpfr_div_2si (t, t, 512, MPFR_RNDZ);
+ }
+ } /* Check overflow of double */
+- else
++ else /* no overflow on double */
+ {
+ long double div9, div10, div11;
+
+@@ -149,29 +154,34 @@
+ {
+ x /= div13; /* exact */
+ shift_exp -= 8192;
++ mpfr_mul_2si (t, t, 8192, MPFR_RNDZ);
+ }
+ if (ABS (x) <= div12)
+ {
+ x /= div12; /* exact */
+ shift_exp -= 4096;
++ mpfr_mul_2si (t, t, 4096, MPFR_RNDZ);
+ }
+ if (ABS (x) <= div11)
+ {
+ x /= div11; /* exact */
+ shift_exp -= 2048;
++ mpfr_mul_2si (t, t, 2048, MPFR_RNDZ);
+ }
+ if (ABS (x) <= div10)
+ {
+ x /= div10; /* exact */
+ shift_exp -= 1024;
++ mpfr_mul_2si (t, t, 1024, MPFR_RNDZ);
+ }
+ if (ABS(x) <= div9)
+ {
+ x /= div9; /* exact */
+ shift_exp -= 512;
++ mpfr_mul_2si (t, t, 512, MPFR_RNDZ);
+ }
+ }
+- else
++ else /* no underflow */
+ {
+ inexact = mpfr_set_d (u, (double) x, MPFR_RNDZ);
+ MPFR_ASSERTD (inexact == 0);
+diff -Naurd mpfr-3.0.0-a/tests/tset_ld.c mpfr-3.0.0-b/tests/tset_ld.c
+--- mpfr-3.0.0-a/tests/tset_ld.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tset_ld.c 2010-10-21 21:18:26.000000000 +0000
+@@ -147,12 +147,39 @@
+ test_fixed_bugs (void)
+ {
+ mpfr_t x;
+- long double d;
++ long double l, m;
+
+ /* bug found by Steve Kargl (2009-03-14) */
+ mpfr_init2 (x, 64);
+ mpfr_set_ui_2exp (x, 1, -16447, MPFR_RNDN);
+- d = mpfr_get_ld (x, MPFR_RNDN); /* an assertion failed in init2.c:50 */
++ mpfr_get_ld (x, MPFR_RNDN); /* an assertion failed in init2.c:50 */
++
++ /* bug reported by Jakub Jelinek (2010-10-17)
++ https://gforge.inria.fr/tracker/?func=detail&aid=11300 */
++ mpfr_set_prec (x, MPFR_LDBL_MANT_DIG);
++ /* l = 0x1.23456789abcdef0123456789abcdp-914L; */
++ l = 8.215640181713713164092636634579e-276;
++ mpfr_set_ld (x, l, MPFR_RNDN);
++ m = mpfr_get_ld (x, MPFR_RNDN);
++ if (m != l)
++ {
++ printf ("Error in get_ld o set_ld for l=%Le\n", l);
++ printf ("Got m=%Le instead of l\n", m);
++ exit (1);
++ }
++
++ /* another similar test which failed with extended double precision and the
++ generic code for mpfr_set_ld */
++ /* l = 0x1.23456789abcdef0123456789abcdp-968L; */
++ l = 4.560596445887084662336528403703e-292;
++ mpfr_set_ld (x, l, MPFR_RNDN);
++ m = mpfr_get_ld (x, MPFR_RNDN);
++ if (m != l)
++ {
++ printf ("Error in get_ld o set_ld for l=%Le\n", l);
++ printf ("Got m=%Le instead of l\n", m);
++ exit (1);
++ }
+
+ mpfr_clear (x);
+ }
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-10-21 20:59:32.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-10-21 21:18:26.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p6";
++ return "3.0.0-p7";
+ }
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-11-09 15:15:07.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-11-09 15:15:07.000000000 +0000
+@@ -0,0 +1 @@
++macros
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-10-21 21:18:26.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-11-09 15:15:07.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p7
++3.0.0-p8
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-10-21 21:18:26.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-11-09 15:15:07.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p7"
++#define MPFR_VERSION_STRING "3.0.0-p8"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+@@ -67,6 +67,16 @@
+ # define _MPFR_H_HAVE_INTMAX_T 1
+ #endif
+
++/* Avoid some problems with macro expansion if the user defines macros
++ with the same name as keywords. By convention, identifiers and macro
++ names starting with mpfr_ are reserved by MPFR. */
++typedef void mpfr_void;
++typedef int mpfr_int;
++typedef unsigned int mpfr_uint;
++typedef long mpfr_long;
++typedef unsigned long mpfr_ulong;
++typedef size_t mpfr_size_t;
++
+ /* Definition of rounding modes (DON'T USE MPFR_RNDNA!).
+ Warning! Changing the contents of this enum should be seen as an
+ interface change since the old and the new types are not compatible
+@@ -136,7 +146,7 @@
+ typedef mp_exp_t mpfr_exp_t;
+
+ /* Definition of the standard exponent limits */
+-#define MPFR_EMAX_DEFAULT ((mpfr_exp_t) (((unsigned long) 1 << 30) - 1))
++#define MPFR_EMAX_DEFAULT ((mpfr_exp_t) (((mpfr_ulong) 1 << 30) - 1))
+ #define MPFR_EMIN_DEFAULT (-(MPFR_EMAX_DEFAULT))
+
+ /* Definition of the main structure */
+@@ -725,13 +735,13 @@
+ unexpected results with future compilers and aggressive optimisations.
+ Why not working only with signed types, using INT_MIN and LONG_MIN? */
+ #if __GMP_MP_SIZE_T_INT
+-#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+2))
+-#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+1))
+-#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+3))
++#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(mpfr_uint)0)>>1))+2))
++#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(mpfr_uint)0)>>1))+1))
++#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(mpfr_uint)0)>>1))+3))
+ #else
+-#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+2))
+-#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+1))
+-#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+3))
++#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(mpfr_ulong)0)>>1))+2))
++#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(mpfr_ulong)0)>>1))+1))
++#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(mpfr_ulong)0)>>1))+3))
+ #endif
+
+ /* Define MPFR_USE_EXTENSION to avoid "gcc -pedantic" warnings. */
+@@ -760,9 +770,9 @@
+ #define mpfr_inf_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_INF)
+ #define mpfr_zero_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_ZERO)
+ #define mpfr_regular_p(_x) ((_x)->_mpfr_exp > __MPFR_EXP_INF)
+-#define mpfr_sgn(_x) \
+- ((_x)->_mpfr_exp < __MPFR_EXP_INF ? \
+- (mpfr_nan_p (_x) ? mpfr_set_erangeflag () : (void) 0), 0 : \
++#define mpfr_sgn(_x) \
++ ((_x)->_mpfr_exp < __MPFR_EXP_INF ? \
++ (mpfr_nan_p (_x) ? mpfr_set_erangeflag () : (mpfr_void) 0), 0 : \
+ MPFR_SIGN (_x))
+
+ /* Prevent them from using as lvalues */
+@@ -805,7 +815,19 @@
+ Moreover casts to unsigned long have been added to avoid warnings in
+ programs that use MPFR and are compiled with -Wconversion; such casts
+ are OK since if X is a constant expression, then (unsigned long) X is
+- also a constant expression, so that the optimizations still work. */
++ also a constant expression, so that the optimizations still work. The
++ warnings are probably related to the following two bugs:
++ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210
++ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38470 (possibly a variant)
++ and the casts could be removed once these bugs are fixed.
++ Casts shouldn't be used on the generic calls (to the ..._2exp functions),
++ where implicit conversions are performed. Indeed, having at least one
++ implicit conversion in the macro allows the compiler to emit diagnostics
++ when normally expected, for instance in the following call:
++ mpfr_set_ui (x, "foo", MPFR_RNDN);
++ If this is not possible (for future macros), one of the tricks described
++ on http://groups.google.com/group/comp.std.c/msg/e92abd24bf9eaf7b could
++ be used. */
+ #if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
+ #if (__GNUC__ >= 2)
+ #undef mpfr_cmp_ui
+@@ -813,45 +835,45 @@
+ But warning! mpfr_sgn is specified as a macro in the API, thus the macro
+ mustn't be used if side effects are possible, like here. */
+ #define mpfr_cmp_ui(_f,_u) \
+- (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
++ (__builtin_constant_p (_u) && (mpfr_ulong) (_u) == 0 ? \
+ (mpfr_sgn) (_f) : \
+- mpfr_cmp_ui_2exp ((_f), (unsigned long) (_u), 0))
++ mpfr_cmp_ui_2exp ((_f), (_u), 0))
+ #undef mpfr_cmp_si
+-#define mpfr_cmp_si(_f,_s) \
+- (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
+- mpfr_cmp_ui ((_f), (unsigned long) (long) (_s)) : \
+- mpfr_cmp_si_2exp ((_f), (long) (_s), 0))
++#define mpfr_cmp_si(_f,_s) \
++ (__builtin_constant_p (_s) && (mpfr_long) (_s) >= 0 ? \
++ mpfr_cmp_ui ((_f), (mpfr_ulong) (mpfr_long) (_s)) : \
++ mpfr_cmp_si_2exp ((_f), (_s), 0))
+ #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
+ #undef mpfr_set_ui
+ #define mpfr_set_ui(_f,_u,_r) \
+- (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
++ (__builtin_constant_p (_u) && (mpfr_ulong) (_u) == 0 ? \
+ __extension__ ({ \
+ mpfr_ptr _p = (_f); \
+ _p->_mpfr_sign = 1; \
+ _p->_mpfr_exp = __MPFR_EXP_ZERO; \
+- (void) (_r); 0; }) : \
+- mpfr_set_ui_2exp ((_f), (unsigned long) (_u), 0, (_r)))
++ (mpfr_void) (_r); 0; }) : \
++ mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
+ #endif
+ #undef mpfr_set_si
+ #define mpfr_set_si(_f,_s,_r) \
+- (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
+- mpfr_set_ui ((_f), (unsigned long) (long) (_s), (_r)) : \
+- mpfr_set_si_2exp ((_f), (long) (_s), 0, (_r)))
++ (__builtin_constant_p (_s) && (mpfr_long) (_s) >= 0 ? \
++ mpfr_set_ui ((_f), (mpfr_ulong) (mpfr_long) (_s), (_r)) : \
++ mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
+ #endif
+ #endif
+
+ /* Macro version of mpfr_stack interface for fast access */
+-#define mpfr_custom_get_size(p) ((size_t) \
++#define mpfr_custom_get_size(p) ((mpfr_size_t) \
+ (((p)+GMP_NUMB_BITS-1)/GMP_NUMB_BITS*sizeof (mp_limb_t)))
+ #define mpfr_custom_init(m,p) do {} while (0)
+-#define mpfr_custom_get_significand(x) ((void*)((x)->_mpfr_d))
++#define mpfr_custom_get_significand(x) ((mpfr_void*)((x)->_mpfr_d))
+ #define mpfr_custom_get_exp(x) ((x)->_mpfr_exp)
+ #define mpfr_custom_move(x,m) do { ((x)->_mpfr_d = (mp_limb_t*)(m)); } while (0)
+ #define mpfr_custom_init_set(x,k,e,p,m) do { \
+ mpfr_ptr _x = (x); \
+ mpfr_exp_t _e; \
+ mpfr_kind_t _t; \
+- int _s, _k; \
++ mpfr_int _s, _k; \
+ _k = (k); \
+ if (_k >= 0) { \
+ _t = (mpfr_kind_t) _k; \
+@@ -868,11 +890,13 @@
+ _x->_mpfr_exp = _e; \
+ _x->_mpfr_d = (mp_limb_t*) (m); \
+ } while (0)
+-#define mpfr_custom_get_kind(x) \
+- ( (x)->_mpfr_exp > __MPFR_EXP_INF ? (int)MPFR_REGULAR_KIND*MPFR_SIGN (x) \
+- : (x)->_mpfr_exp == __MPFR_EXP_INF ? (int)MPFR_INF_KIND*MPFR_SIGN (x) \
+- : (x)->_mpfr_exp == __MPFR_EXP_NAN ? (int)MPFR_NAN_KIND \
+- : (int) MPFR_ZERO_KIND * MPFR_SIGN (x) )
++#define mpfr_custom_get_kind(x) \
++ ( (x)->_mpfr_exp > __MPFR_EXP_INF ? \
++ (mpfr_int) MPFR_REGULAR_KIND * MPFR_SIGN (x) \
++ : (x)->_mpfr_exp == __MPFR_EXP_INF ? \
++ (mpfr_int) MPFR_INF_KIND * MPFR_SIGN (x) \
++ : (x)->_mpfr_exp == __MPFR_EXP_NAN ? (mpfr_int) MPFR_NAN_KIND \
++ : (mpfr_int) MPFR_ZERO_KIND * MPFR_SIGN (x) )
+
+
+ #endif /* MPFR_USE_NO_MACRO */
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-10-21 21:18:26.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-11-09 15:15:07.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p7";
++ return "3.0.0-p8";
+ }
diff --git a/core/mpfr/mpfr.install b/core/mpfr/mpfr.install
new file mode 100644
index 000000000..d6dd0475b
--- /dev/null
+++ b/core/mpfr/mpfr.install
@@ -0,0 +1,20 @@
+info_dir=usr/share/info
+info_files=(mpfr.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for f in ${info_files[@]}; do
+ install-info ${info_dir}/$f.gz ${info_dir}/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ for f in ${info_files[@]}; do
+ install-info --delete ${info_dir}/$f.gz ${info_dir}/dir 2> /dev/null
+ done
+}
diff --git a/core/nano/PKGBUILD b/core/nano/PKGBUILD
new file mode 100644
index 000000000..ab760c2df
--- /dev/null
+++ b/core/nano/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 101599 2010-11-29 19:19:03Z andyrtr $
+# Maintainer: Andreas Radke <andyrtr@archlinux.org>
+# Contributor: Judd <judd@archlinux.org>
+
+pkgname=nano
+pkgver=2.2.6
+pkgrel=1
+pkgdesc="Pico editor clone with enhancements"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.nano-editor.org"
+groups=('base')
+depends=('ncurses' 'sh')
+backup=('etc/nanorc')
+install=nano.install
+source=(http://www.nano-editor.org/dist/v2.2/${pkgname}-${pkgver}.tar.gz)
+md5sums=('03233ae480689a008eb98feb1b599807')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --enable-color \
+ --enable-nanorc \
+ --enable-multibuffer \
+ --disable-wrapping-as-root
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+ install -DTm644 ${srcdir}/${pkgname}-${pkgver}/doc/nanorc.sample ${pkgdir}/etc/nanorc
+}
diff --git a/core/nano/nano.install b/core/nano/nano.install
new file mode 100644
index 000000000..a320c40d8
--- /dev/null
+++ b/core/nano/nano.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(nano.info.gz)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file $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
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/ncurses/PKGBUILD b/core/ncurses/PKGBUILD
new file mode 100644
index 000000000..abe1cede5
--- /dev/null
+++ b/core/ncurses/PKGBUILD
@@ -0,0 +1,73 @@
+# $Id: PKGBUILD 111464 2011-02-27 00:26:17Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=ncurses
+pkgver=5.8
+pkgrel=1
+pkgdesc="System V Release 4.0 curses emulation library"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/ncurses/"
+license=('MIT')
+depends=('glibc')
+source=(ftp://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz)
+md5sums=('20ed3fa7599937f0ca268d9088837a64')
+
+build() {
+ cd ${srcdir}/
+ mkdir ncurses{,w}-build
+
+ cd ${srcdir}/ncursesw-build
+ ../${pkgname}-${pkgver}/configure --prefix=/usr --mandir=/usr/share/man \
+ --with-shared --with-normal --without-debug --without-ada \
+ --with-install-prefix=${pkgdir} --enable-widec
+ # add --enable-ext-colors with next soname bump
+ make
+
+ # libncurses.so.5 for external binary support
+ cd ${srcdir}/ncurses-build
+ [ $CARCH = "x86_64" ] && CONFIGFLAG="--with-chtype=long"
+ ../${pkgname}-${pkgver}/configure --prefix=/usr \
+ --with-shared --with-normal --without-debug --without-ada \
+ --with-install-prefix=${pkgdir} $CONFIGFLAG
+ make
+}
+
+package() {
+ cd ${srcdir}/ncursesw-build
+ make install
+
+ # move libraries needed for boot to /lib (we call tput in initscripts)
+ install -dm755 ${pkgdir}/lib
+ mv ${pkgdir}/usr/lib/libncursesw.so.5* ${pkgdir}/lib
+ ln -sf ../../lib/libncursesw.so.5 ${pkgdir}/usr/lib/libncursesw.so
+
+ # Fool packages looking to link to non-wide-character ncurses libraries
+ for lib in curses ncurses form panel menu; do
+ rm -f ${pkgdir}/usr/lib/lib${lib}.so
+ echo "INPUT(-l${lib}w)" >${pkgdir}/usr/lib/lib${lib}.so
+ ln -sf lib${lib}w.a ${pkgdir}/usr/lib/lib${lib}.a
+ done
+ ln -sf libncurses++w.a ${pkgdir}/usr/lib/libncurses++.a
+
+ # install tput to /bin
+ install -dm755 ${pkgdir}/bin/
+ mv ${pkgdir}/usr/bin/tput ${pkgdir}/bin/tput
+
+ # Some packages look for -lcurses during build
+ rm -f ${pkgdir}/usr/lib/libcursesw.so
+ echo "INPUT(-lncursesw)" >${pkgdir}/usr/lib/libcursesw.so
+ ln -sf libncurses.so ${pkgdir}/usr/lib/libcurses.so
+ ln -sf libncursesw.a ${pkgdir}/usr/lib/libcursesw.a
+ ln -sf libncurses.a ${pkgdir}/usr/lib/libcurses.a
+
+ # non-widec compatibility library
+ cd ${srcdir}/ncurses-build
+ install -Dm755 lib/libncurses.so.${pkgver} ${pkgdir}/usr/lib/libncurses.so.${pkgver}
+ ln -sf libncurses.so.${pkgver} ${pkgdir}/usr/lib/libncurses.so.5
+
+ # install license, rip it from the readme
+ cd ${srcdir}/${pkgname}-${pkgver}
+ install -dm755 ${pkgdir}/usr/share/licenses/$pkgname
+ grep -B 100 '$Id' README > ${pkgdir}/usr/share/licenses/${pkgname}/license.txt
+}
diff --git a/core/ncurses/set_field_buffer.patch b/core/ncurses/set_field_buffer.patch
new file mode 100644
index 000000000..a2132043e
--- /dev/null
+++ b/core/ncurses/set_field_buffer.patch
@@ -0,0 +1,9 @@
+--- src/ncurses-5.7/form/frm_driver.c 2008/10/18 16:25:00 1.88
++++ src/ncurses-5.7/form/frm_driver.c 2008/12/06 23:08:12
+@@ -4366,6 +4366,7 @@
+ delwin(field->working);
+ field->working = newpad(field->drows, field->dcols);
+ }
++ len = Buffer_Length(field);
+ wclear(field->working);
+ mvwaddstr(field->working, 0, 0, value);
diff --git a/core/net-tools/PKGBUILD b/core/net-tools/PKGBUILD
new file mode 100644
index 000000000..b50b5669d
--- /dev/null
+++ b/core/net-tools/PKGBUILD
@@ -0,0 +1,40 @@
+# $Id: PKGBUILD 38718 2009-05-10 07:37:29Z tpowa $
+# Maintainer: judd <jvinet@zeroflux.org>
+pkgname=net-tools
+pkgver=1.60
+pkgrel=14
+pkgdesc="Configuration tools for Linux networking"
+arch=(i686 x86_64)
+license=('GPL')
+url="http://www.tazenda.demon.co.uk/phil/net-tools"
+groups=('base')
+depends=('glibc')
+backup=('etc/conf.d/nisdomainname')
+source=(http://www.tazenda.demon.co.uk/phil/$pkgname/$pkgname-$pkgver.tar.bz2
+ net-tools.patch gcc340.patch net-tools-1.60-2.6-compilefix.patch
+ net-tools-1.60-miiioctl.patch nisdomainname.conf.d
+ net-tools-1.60-nameif.patch
+ net-tools-1.60-nameif_strncpy.patch)
+options=(!makeflags)
+md5sums=('888774accab40217dde927e21979c165'
+ '7ef8d0c6818faa0fdeea94970a20e3fb'
+ 'b52d899cba9956bb0055150506f41ac1'
+ '51de6eabe2d6d6dc860f72c41cee636b'
+ 'c16109863bc63f3dad4ef35305a340bb'
+ 'af3eef5d4837939f7858eec692aa4671'
+ '29a32617382fab1735acba4d920f1fcd'
+ 'e66466b9304dac85eb42b32f1ec3b284')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ patch -Np1 -i ../net-tools.patch || return 1
+ patch -Np1 -i ../net-tools-1.60-2.6-compilefix.patch || return 1
+ patch -Np1 -i ../net-tools-1.60-miiioctl.patch || return 1
+ patch -Np1 -i ../gcc340.patch || return 1
+ patch -Np1 -i ${srcdir}/net-tools-1.60-nameif.patch || return 1
+ patch -Np1 -i ${srcdir}/net-tools-1.60-nameif_strncpy.patch || return 1
+ yes "" | make || return 1
+ make BASEDIR=$pkgdir update
+ install -D -m644 ../nisdomainname.conf.d \
+ $pkgdir/etc/conf.d/nisdomainname
+}
diff --git a/core/net-tools/gcc340.patch b/core/net-tools/gcc340.patch
new file mode 100644
index 000000000..8089bf217
--- /dev/null
+++ b/core/net-tools/gcc340.patch
@@ -0,0 +1,46 @@
+diff -Naur net-tools-1.60-orig/hostname.c net-tools-1.60/hostname.c
+--- net-tools-1.60-orig/hostname.c 2001-04-08 10:04:23.000000000 -0700
++++ net-tools-1.60/hostname.c 2004-05-07 17:22:14.000000000 -0700
+@@ -78,6 +78,7 @@
+ fprintf(stderr, _("%s: name too long\n"), program_name);
+ break;
+ default:
++ ;
+ }
+ exit(1);
+ }
+@@ -98,6 +99,7 @@
+ fprintf(stderr, _("%s: name too long\n"), program_name);
+ break;
+ default:
++ ;
+ }
+ exit(1);
+ };
+@@ -117,6 +119,7 @@
+ fprintf(stderr, _("%s: name too long\n"), program_name);
+ break;
+ default:
++ ;
+ }
+ exit(1);
+ };
+@@ -174,6 +177,7 @@
+ printf("%s\n", hp->h_name);
+ break;
+ default:
++ ;
+ }
+ }
+
+diff -Naur net-tools-1.60-orig/lib/inet_sr.c net-tools-1.60/lib/inet_sr.c
+--- net-tools-1.60-orig/lib/inet_sr.c 2000-02-20 13:46:45.000000000 -0800
++++ net-tools-1.60/lib/inet_sr.c 2004-05-07 17:20:14.000000000 -0700
+@@ -105,6 +105,7 @@
+ case 2:
+ isnet = 0; break;
+ default:
++ ;
+ }
+
+ /* Fill in the other fields. */
diff --git a/core/net-tools/net-tools-1.60-2.6-compilefix.patch b/core/net-tools/net-tools-1.60-2.6-compilefix.patch
new file mode 100644
index 000000000..92ce90128
--- /dev/null
+++ b/core/net-tools/net-tools-1.60-2.6-compilefix.patch
@@ -0,0 +1,23 @@
+diff -ruN net-tools-1.60.orig/lib/x25_sr.c net-tools-1.60/lib/x25_sr.c
+--- net-tools-1.60.orig/lib/x25_sr.c 2000-05-20 15:38:10.000000000 +0200
++++ net-tools-1.60/lib/x25_sr.c 2003-10-18 20:33:31.927574928 +0200
+@@ -22,6 +22,7 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <linux/x25.h>
++#include <linux/version.h>
+ #include <ctype.h>
+ #include <errno.h>
+ #include <netdb.h>
+@@ -77,7 +78,11 @@
+ rt.sigdigits=sigdigits;
+
+ /* x25_route_struct.address isn't type struct sockaddr_x25, Why? */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+ memcpy(&rt.address, &sx25.sx25_addr, sizeof(x25_address));
++#else
++ memcpy(&rt.address, &sx25.sx25_addr, sizeof(struct x25_address));
++#endif
+
+ while (*args) {
+ if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {
diff --git a/core/net-tools/net-tools-1.60-miiioctl.patch b/core/net-tools/net-tools-1.60-miiioctl.patch
new file mode 100644
index 000000000..4859273ed
--- /dev/null
+++ b/core/net-tools/net-tools-1.60-miiioctl.patch
@@ -0,0 +1,17 @@
+--- net-tools-1.60/include/mii.h.bar Tue Jul 31 11:49:39 2001
++++ net-tools-1.60/include/mii.h Tue Jul 31 11:49:33 2001
+@@ -11,11 +11,9 @@
+
+ /* network interface ioctl's for MII commands */
+ #ifndef SIOCGMIIPHY
+-#define SIOCGMIIPHY (SIOCDEVPRIVATE) /* Read from current PHY */
+-#define SIOCGMIIREG (SIOCDEVPRIVATE+1) /* Read any PHY register */
+-#define SIOCSMIIREG (SIOCDEVPRIVATE+2) /* Write any PHY register */
+-#define SIOCGPARAMS (SIOCDEVPRIVATE+3) /* Read operational parameters */
+-#define SIOCSPARAMS (SIOCDEVPRIVATE+4) /* Set operational parameters */
++#define SIOCGMIIPHY 0x8947 /* Read from current PHY */
++#define SIOCGMIIREG 0x8948 /* Read any PHY register */
++#define SIOCSMIIREG 0x8949 /* Write any PHY register */
+ #endif
+
+ #include <linux/types.h>
diff --git a/core/net-tools/net-tools-1.60-nameif.patch b/core/net-tools/net-tools-1.60-nameif.patch
new file mode 100644
index 000000000..54def00c2
--- /dev/null
+++ b/core/net-tools/net-tools-1.60-nameif.patch
@@ -0,0 +1,58 @@
+--- net-tools-1.60/nameif.c.nameif 2000-10-18 19:26:29.000000000 +0200
++++ net-tools-1.60/nameif.c 2003-03-19 11:02:01.000000000 +0100
+@@ -117,7 +117,8 @@
+ }
+
+ struct change {
+- struct change *next,**pprev;
++ struct change *next;
++ int found;
+ char ifname[IFNAMSIZ+1];
+ unsigned char mac[6];
+ };
+@@ -139,10 +140,7 @@
+ ch->ifname, pos);
+ if (parsemac(p,ch->mac) < 0)
+ complain(_("cannot parse MAC `%s' at %s"), p, pos);
+- if (clist)
+- clist->pprev = &ch->next;
+ ch->next = clist;
+- ch->pprev = &clist;
+ clist = ch;
+ return 0;
+ }
+@@ -200,7 +198,7 @@
+
+ void usage(void)
+ {
+- fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}"));
++ fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}\n"));
+ exit(1);
+ }
+
+@@ -277,21 +275,21 @@
+ ch = lookupmac(mac);
+ if (!ch)
+ continue;
+-
+- *ch->pprev = ch->next;
++
++ ch->found = 1;
+ if (strcmp(p, ch->ifname)) {
+ if (setname(p, ch->ifname) < 0)
+ complain(_("cannot change name of %s to %s: %s"),
+ p, ch->ifname, strerror(errno));
+ }
+- free(ch);
+ }
+ fclose(ifh);
+
+ while (clist) {
+ struct change *ch = clist;
+ clist = clist->next;
+- warning(_("interface '%s' not found"), ch->ifname);
++ if (!ch->found)
++ warning(_("interface '%s' not found"), ch->ifname);
+ free(ch);
+ }
+
diff --git a/core/net-tools/net-tools-1.60-nameif_strncpy.patch b/core/net-tools/net-tools-1.60-nameif_strncpy.patch
new file mode 100644
index 000000000..7568e21a2
--- /dev/null
+++ b/core/net-tools/net-tools-1.60-nameif_strncpy.patch
@@ -0,0 +1,13 @@
+--- net-tools-1.60/nameif.c.ncpy 2006-10-03 14:24:21.000000000 +0200
++++ net-tools-1.60/nameif.c 2006-10-03 14:22:43.000000000 +0200
+@@ -100,8 +100,8 @@
+ struct ifreq ifr;
+ opensock();
+ memset(&ifr,0,sizeof(struct ifreq));
+- strcpy(ifr.ifr_name, oldname);
+- strcpy(ifr.ifr_newname, newname);
++ strncpy(ifr.ifr_name, oldname, IF_NAMESIZE);
++ strncpy(ifr.ifr_newname, newname, IF_NAMESIZE);
+ return ioctl(ctl_sk, SIOCSIFNAME, &ifr);
+ }
+
diff --git a/core/net-tools/net-tools.patch b/core/net-tools/net-tools.patch
new file mode 100644
index 000000000..87e062eb2
--- /dev/null
+++ b/core/net-tools/net-tools.patch
@@ -0,0 +1,52 @@
+diff -Naur net-tools-1.60-orig/config.in net-tools-1.60/config.in
+--- net-tools-1.60-orig/config.in 2000-05-21 07:32:12.000000000 -0700
++++ net-tools-1.60/config.in 2004-05-31 12:36:00.000000000 -0700
+@@ -49,7 +49,7 @@
+ *
+ bool 'UNIX protocol family' HAVE_AFUNIX y
+ bool 'INET (TCP/IP) protocol family' HAVE_AFINET y
+-bool 'INET6 (IPv6) protocol family' HAVE_AFINET6 n
++bool 'INET6 (IPv6) protocol family' HAVE_AFINET6 y
+ bool 'Novell IPX/SPX protocol family' HAVE_AFIPX y
+ bool 'Appletalk DDP protocol family' HAVE_AFATALK y
+ bool 'AX25 (packet radio) protocol family' HAVE_AFAX25 y
+@@ -86,6 +86,6 @@
+ *
+ * Other Features.
+ *
+-bool 'IP Masquerading support' HAVE_FW_MASQUERADE n
+-bool 'Build iptunnel and ipmaddr' HAVE_IP_TOOLS n
+-bool 'Build mii-tool' HAVE_MII n
++bool 'IP Masquerading support' HAVE_FW_MASQUERADE y
++bool 'Build iptunnel and ipmaddr' HAVE_IP_TOOLS y
++bool 'Build mii-tool' HAVE_MII y
+diff -Naur net-tools-1.60-orig/mii-tool.c net-tools-1.60/mii-tool.c
+--- net-tools-1.60-orig/mii-tool.c 2000-05-21 07:31:17.000000000 -0700
++++ net-tools-1.60/mii-tool.c 2004-05-31 12:35:21.000000000 -0700
+@@ -379,16 +379,16 @@
+ /*--------------------------------------------------------------------*/
+
+ const char *usage =
+-"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]
+- -V, --version display version information
+- -v, --verbose more verbose output
+- -R, --reset reset MII to poweron state
+- -r, --restart restart autonegotiation
+- -w, --watch monitor for link status changes
+- -l, --log with -w, write events to syslog
+- -A, --advertise=media,... advertise only specified media
+- -F, --force=media force specified media technology
+-media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
++"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n\
++ -V, --version display version information\n\
++ -v, --verbose more verbose output\n\
++ -R, --reset reset MII to poweron state\n\
++ -r, --restart restart autonegotiation\n\
++ -w, --watch monitor for link status changes\n\
++ -l, --log with -w, write events to syslog\n\
++ -A, --advertise=media,... advertise only specified media\n\
++ -F, --force=media force specified media technology\n\
++media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,\n\
+ (to advertise both HD and FD) 100baseTx, 10baseT\n";
+
+ int main(int argc, char **argv)
diff --git a/core/net-tools/nisdomainname.conf.d b/core/net-tools/nisdomainname.conf.d
new file mode 100644
index 000000000..6033ecf1c
--- /dev/null
+++ b/core/net-tools/nisdomainname.conf.d
@@ -0,0 +1,3 @@
+# Set your NIS domain name here
+NISDOMAINNAME=""
+
diff --git a/core/nfs-utils/PKGBUILD b/core/nfs-utils/PKGBUILD
new file mode 100644
index 000000000..339d9a32a
--- /dev/null
+++ b/core/nfs-utils/PKGBUILD
@@ -0,0 +1,87 @@
+# $Id: PKGBUILD 109322 2011-02-08 08:33:56Z ibiru $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: John Proctor <jproctor@prium.net>
+# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
+# Contributor: abelstr <abel@pinklf.eu>
+# Contributor: Marco Lima <cipparello gmail com>
+
+pkgname=nfs-utils
+pkgver=1.2.2
+pkgrel=6
+pkgdesc="Support programs for Network File Systems"
+arch=('i686' 'x86_64')
+url='http://nfs.sourceforge.net'
+license=('GPL')
+backup=(etc/{exports,idmapd.conf} etc/conf.d/{nfs-common.conf,nfs-server.conf})
+depends=('glibc' 'tcp_wrappers' 'e2fsprogs' 'rpcbind' 'libtirpc>=0.2.1' 'librpcsecgss>=0.19-2' 'nfsidmap' 'libevent>=2.0.10' 'libgssglue')
+makedepends=('pkgconfig' 'autoconf' 'automake')
+source=(http://downloads.sourceforge.net/project/nfs/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2
+ nfs-common
+ nfs-common.conf
+ nfs-server
+ nfs-server.conf
+ exports
+ idmapd.conf
+ start-statd.patch
+ nfs-utils-1.1.2-kerberos-ac.patch
+ nfs-utils-1.1.6-no_libgssapi.patch
+ nfs-utils-1.1.6-heimdal_functions.patch
+ nfs-utils-1.1.4-mtab-sym.patch
+ nfs-utils-1.1.4-no-exec.patch)
+install=nfs-utils.install
+md5sums=('dad92f64db3266c7757f71bb53ee8f35'
+ 'fc508e10cdf5e8ddd80373b1b2bc99a1'
+ 'f73f197a16b02c3e248488ec35c4cf43'
+ '5ae080f6117cef3140f02bc162bdc755'
+ 'b9b334414baec31b97f0431d9ecdcfb9'
+ 'ff585faf410a62c4333a027c50b56bae'
+ 'eb4f4027fab6fc1201f1ca04f5954c76'
+ 'e24f81a8c8657672e262c61235d34b4a'
+ 'f3be115d392d9f9bb0f056e8d4341a14'
+ '20c6fae1c771b9d8e91c4973f16372e3'
+ 'e6fd3a8acfe97970a53db1b902c34f45'
+ '7674106eaaa4c149bccd4f05fe3604e9'
+ '4f4827dfc93008dfadd0a530ad0872b2')
+
+build() {
+ cd $srcdir/${pkgname}-${pkgver}
+ # Patches from gentoo for heimdal compatibility Bug 231396
+ # http://bugs.gentoo.org/show_bug.cgi?id=231396
+ patch -Np1 -i ../nfs-utils-1.1.2-kerberos-ac.patch
+ patch -Np1 -i ../nfs-utils-1.1.6-no_libgssapi.patch
+ patch -Np0 -i ../nfs-utils-1.1.6-heimdal_functions.patch
+ patch -Np1 -i ../nfs-utils-1.1.4-mtab-sym.patch
+ patch -Np1 -i ../nfs-utils-1.1.4-no-exec.patch
+
+ # arch specific patch
+ patch -Np0 -i $srcdir/start-statd.patch
+
+ rm -f config.guess config.sub ltmain.sh
+ autoreconf -i
+
+ export GSSGLUE_CFLAGS='-I/usr/include/gssapi'
+ export GSSGLUE_LIBS='-lgssapi -ldl'
+
+ ./configure --prefix=/usr --enable-nfsv3 --enable-nfsv4 --enable-gss \
+ --with-tcp-wrappers --with-statedir=/var/lib/nfs --enable-ipv6 --sysconfdir=/etc
+
+ unset LDFLAGS
+ make
+}
+
+package() {
+ cd $srcdir/${pkgname}-${pkgver}
+ make DESTDIR=$pkgdir install
+
+ # NFS & NFSv4 init scripts
+ install -D -m 755 ../nfs-common "$pkgdir/"etc/rc.d/nfs-common
+ install -D -m 755 ../nfs-server "$pkgdir/"etc/rc.d/nfs-server
+ # Configuration
+ install -D -m 644 ../exports "$pkgdir/"etc/exports
+ install -D -m 644 ../idmapd.conf "$pkgdir/"etc/idmapd.conf
+ install -D -m 644 ../nfs-common.conf "$pkgdir/"etc/conf.d/nfs-common.conf
+ install -D -m 644 ../nfs-server.conf "$pkgdir/"etc/conf.d/nfs-server.conf
+ # directories
+ mkdir "$pkgdir/"var/lib/nfs/rpc_pipefs
+ mkdir "$pkgdir/"var/lib/nfs/v4recovery
+}
diff --git a/core/nfs-utils/exports b/core/nfs-utils/exports
new file mode 100644
index 000000000..8f4aac598
--- /dev/null
+++ b/core/nfs-utils/exports
@@ -0,0 +1,15 @@
+# /etc/exports
+#
+# List of directories exported to NFS clients. See exports(5).
+# Use exportfs -arv to reread.
+#
+# Example for NFSv2 and NFSv3:
+# /srv/home hostname1(rw,sync) hostname2(ro,sync)
+#
+# Example for NFSv4:
+# /srv/nfs4 hostname1(rw,sync,fsid=0)
+# /srv/nfs4/home hostname1(rw,sync,nohide)
+# Using Kerberos and integrity checking:
+# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt)
+# /srv/nfs4/home gss/krb5i(rw,sync,nohide)
+#
diff --git a/core/nfs-utils/idmapd.conf b/core/nfs-utils/idmapd.conf
new file mode 100644
index 000000000..b1b23afe9
--- /dev/null
+++ b/core/nfs-utils/idmapd.conf
@@ -0,0 +1,14 @@
+[General]
+
+Verbosity = 0
+Pipefs-Directory = /var/lib/nfs/rpc_pipefs
+Domain = localdomain
+
+[Mapping]
+
+Nobody-User = nobody
+Nobody-Group = nobody
+
+[Translation]
+
+Method = nsswitch
diff --git a/core/nfs-utils/nfs-common b/core/nfs-utils/nfs-common
new file mode 100644
index 000000000..13742bde3
--- /dev/null
+++ b/core/nfs-utils/nfs-common
@@ -0,0 +1,319 @@
+#!/bin/bash
+
+daemon_name=nfs-common
+
+# daemon dependencies
+DAEMON_DEPENDS=('rpcbind')
+
+NEED_STATD=
+STATD_OPTS=
+NEED_IDMAPD=
+IDMAPD_OPTS=
+NEED_GSSD=
+GSSD_OPTS=
+PIPEFS_MOUNTPOINT=
+PIPEFS_MOUNTOPTS=
+
+# rpc.statd daemon & binary location
+STATD_DAEMON_NAME=rpc.statd
+STATD="/usr/sbin/rpc.statd"
+
+# rpc.idmapd daemon & binary location
+IDMAPD_DAEMON_NAME=rpc.idmapd
+IDMAPD="/usr/sbin/rpc.idmapd"
+
+# rpc.gssd daemon & binary location
+GSSD_DAEMON_NAME=rpc.gssd
+GSSD="/usr/sbin/rpc.gssd"
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/$daemon_name.conf
+
+# Default mountpoint and options for rpc_pipefs filesystem
+[ -z "$PIPEFS_MOUNTPOINT" ] && PIPEFS_MOUNTPOINT="/var/lib/nfs/rpc_pipefs"
+[ -z "$PIPEFS_MOUNTOPTS" ] && PIPEFS_MOUNTOPTS="defaults"
+
+# Parse the fstab file, and determine whether we need idmapd and gssd. (The
+# /etc/conf.d/nfs-common settings, if any, will override our autodetection.)
+AUTO_NEED_IDMAPD=no
+AUTO_NEED_GSSD=no
+
+if [ -f /etc/fstab ]; then
+ exec 9<&0 </etc/fstab
+
+ while read DEV MTPT FSTYPE OPTS REST; do
+ if [ "$FSTYPE" = "nfs4" ]; then
+ AUTO_NEED_IDMAPD=yes
+ fi
+ case "$OPTS" in
+ sec=krb5|*,sec=krb5|sec=krb5,*|*,sec=krb5i,*|sec=krb5i|*,sec=krb5i|sec=krb5i,*|*,sec=krb5i,*|sec=krb5p|*,sec=krb5p|sec=krb5p,*|*,sec=krb5p,*)
+ AUTO_NEED_GSSD=yes
+ ;;
+ esac
+ done
+
+ exec 0<&9 9<&-
+fi
+
+# We also need idmapd if we run an NFSv4 server. It's fairly difficult
+# to autodetect whether there are NFSv4 exports or not, and idmapd is not a
+# particularily heavy daemon, so we auto-enable it if we find an /etc/exports
+# file. This does not mean that there are NFSv4 or other mounts active (or
+# even that nfs-kernel-server is installed), but it matches what the "start"
+# condition in nfs-kernel-server's init script does, which has a value in
+# itself.
+if [ -f /etc/exports ] && grep -q '^[[:space:]]*[^#]*/' /etc/exports; then
+ AUTO_NEED_IDMAPD=yes
+fi
+
+case "$NEED_STATD" in
+ yes|no)
+ ;;
+ *)
+ NEED_STATD=yes
+ ;;
+esac
+
+case "$NEED_IDMAPD" in
+ yes|no)
+ ;;
+ *)
+ NEED_IDMAPD=$AUTO_NEED_IDMAPD
+ ;;
+esac
+
+case "$NEED_GSSD" in
+ yes|no)
+ ;;
+ *)
+ NEED_GSSD=$AUTO_NEED_GSSD
+ ;;
+esac
+
+do_modprobe() {
+ if [ -x /sbin/modprobe -a -f /proc/modules ]; then
+ modprobe -q "$1" || true
+ fi
+}
+
+do_mount() {
+ if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then
+ return 1
+ fi
+
+ if grep -vw "$1" /proc/mounts &> /dev/null ; then
+ if ! mountpoint -q "$2" ; then
+ mount -t "$1" "$1" "$2" -o "$3"
+ return
+ fi
+ fi
+ return 0
+}
+
+do_umount() {
+ if mountpoint -q "$1" ; then
+ umount "$1"
+ fi
+ return 0
+}
+
+get_pid() {
+ pidof -o %PPID "$1"
+}
+
+case "$1" in
+ start)
+ ck_depends ${DAEMON_DEPENDS[@]}
+
+ rc=0
+ if [ "$NEED_STATD" = yes ]; then
+ stat_busy "Starting $STATD_DAEMON_NAME daemon"
+ PID=$(get_pid $STATD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$STATD_DAEMON_NAME.pid ] && rm -f /var/run/$STATD_DAEMON_NAME.pid
+ # RUN
+ $STATD $STATD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $STATD) > /var/run/$STATD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ # Run sm-notify
+ /usr/sbin/sm-notify $SMNOTIFY_OPTS
+ fi
+
+ if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then
+ stat_busy "Mounting pipefs filesystem"
+ do_modprobe sunrpc
+ do_modprobe nfs
+ do_modprobe nfsd
+ do_mount rpc_pipefs "$PIPEFS_MOUNTPOINT" "$PIPEFS_MOUNTOPTS"
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+
+ if [ "$NEED_IDMAPD" = yes ]; then
+ stat_busy "Starting $IDMAPD_DAEMON_NAME daemon"
+ PID=$(get_pid $IDMAPD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$IDMAPD_DAEMON_NAME.pid ] && rm -f /var/run/$IDMAPD_DAEMON_NAME.pid
+ # RUN
+ $IDMAPD $IDMAPD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $IDMAPD) > /var/run/$IDMAPD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ fi
+
+ if [ "$NEED_GSSD" = yes ]; then
+ do_modprobe rpcsec_gss_krb5
+ stat_busy "Starting $GSSD_DAEMON_NAME daemon"
+ PID=$(get_pid $GSSD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$GSSD_DAEMON_NAME.pid ] && rm -f /var/run/$GSSD_DAEMON_NAME.pid
+ # RUN
+ $GSSD $GSSD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $GSSD) > /var/run/$GSSD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ fi
+ fi
+
+ add_daemon $daemon_name
+ ;;
+
+ stop)
+ rc=0
+ if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then
+
+ if [ "$NEED_GSSD" = yes ]; then
+ stat_busy "Stopping $GSSD_DAEMON_NAME daemon"
+ PID=$(get_pid $GSSD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$GSSD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+ fi
+
+ if [ "$NEED_IDMAPD" = yes ]; then
+ stat_busy "Stopping $IDMAPD_DAEMON_NAME daemon"
+ PID=$(get_pid $IDMAPD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$IDMAPD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+ fi
+ do_umount "$PIPEFS_MOUNTPOINT" 2>/dev/null || true
+ fi
+
+ if [ "$NEED_STATD" = yes ]; then
+ stat_busy "Stopping $STATD_DAEMON_NAME daemon"
+ PID=$(get_pid $STATD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$STATD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+ fi
+
+ rm_daemon $daemon_name
+ ;;
+
+ status)
+ stat_busy "Checking $daemon_name status";
+ ck_status $daemon_name
+
+ if [ "$NEED_STATD" = yes ]; then
+ stat_busy "Daemon $STATD_DAEMON_NAME running"
+ PID=$(get_pid $STATD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ fi
+
+ if [ "$NEED_GSSD" = yes ]; then
+ stat_busy "Daemon $GSSD_DAEMON_NAME running"
+ PID=$(get_pid $GSSD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ fi
+
+ if [ "$NEED_IDMAPD" = yes ]; then
+ stat_busy "Daemon $IDMAPD_DAEMON_NAME running"
+ PID=$(get_pid $IDMAPD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ fi
+ echo
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|status|restart}"
+esac
+exit 0
+
diff --git a/core/nfs-utils/nfs-common.conf b/core/nfs-utils/nfs-common.conf
new file mode 100644
index 000000000..12466b3e5
--- /dev/null
+++ b/core/nfs-utils/nfs-common.conf
@@ -0,0 +1,40 @@
+# Parameters to be passed to nfs-common (nfs clients & server) init script.
+#
+
+# If you do not set values for the NEED_ options, they will be attempted
+# autodetected; this should be sufficient for most people. Valid alternatives
+# for the NEED_ options are "yes" and "no".
+
+# Do you want to start the statd daemon? It is not needed for NFSv4.
+NEED_STATD=""
+
+# Options to pass to rpc.statd.
+# See rpc.statd(8) for more details.
+# N.B. statd normally runs on both client and server, and run-time
+# options should be specified accordingly.
+# STATD_OPTS="-p 32765 -o 32766"
+STATD_OPTS=""
+
+# Options to pass to sm-notify
+# e.g. SMNOTIFY_OPTS="-p 32764"
+SMNOTIFY_OPTS=""
+
+# Do you want to start the idmapd daemon? It is only needed for NFSv4.
+NEED_IDMAPD=""
+
+# Options to pass to rpc.idmapd.
+# See rpc.idmapd(8) for more details.
+IDMAPD_OPTS=""
+
+# Do you want to start the gssd daemon? It is required for Kerberos mounts.
+NEED_GSSD=""
+
+# Options to pass to rpc.gssd.
+# See rpc.gssd(8) for more details.
+GSSD_OPTS=""
+
+# Where to mount rpc_pipefs filesystem; the default is "/var/lib/nfs/rpc_pipefs".
+PIPEFS_MOUNTPOINT=""
+
+# Options used to mount rpc_pipefs filesystem; the default is "defaults".
+PIPEFS_MOUNTOPTS=""
diff --git a/core/nfs-utils/nfs-server b/core/nfs-utils/nfs-server
new file mode 100644
index 000000000..9574cbc12
--- /dev/null
+++ b/core/nfs-utils/nfs-server
@@ -0,0 +1,303 @@
+#!/bin/bash
+
+daemon_name=nfs-server
+
+# daemon dependencies
+DAEMON_DEPENDS=('nfs-common')
+
+NFSD_COUNT=
+NFSD_OPTS=
+NEED_SVCGSSD=
+SVCGSSD_OPTS=
+MOUNTD_OPTS=
+PROCNFSD_MOUNTPOINT=
+PROCNFSD_MOUNTOPTS=
+
+# rpc.nfsd daemon & binary location
+NFSD_PROCESS_NAME=nfsd
+NFSD_DAEMON_NAME=rpc.nfsd
+NFSD="/usr/sbin/rpc.nfsd"
+
+# rpc.svcgssd daemon & binary location
+SVCGSSD_DAEMON_NAME=rpc.svcgssd
+SVCGSSD="/usr/sbin/rpc.svcgssd"
+
+# rpc.idmapd daemon & binary location
+IDMAPD_DAEMON_NAME=rpc.idmapd
+IDMAPD="/usr/sbin/rpc.idmapd"
+
+# rpc.mountd daemon & binary location
+MOUNTD_DAEMON_NAME=rpc.mountd
+MOUNTD="/usr/sbin/rpc.mountd"
+
+# exortfs binary location
+EXPORTFS="/usr/sbin/exportfs"
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/$daemon_name.conf
+
+# Default number of nfsd servers
+[ -z "$NFSD_COUNT" ] && NFSD_COUNT=8
+
+# Default mountpoint and options for nfsd filesystem
+[ -z "$PROCNFSD_MOUNTPOINT" ] && PROCNFSD_MOUNTPOINT="/proc/fs/nfsd"
+[ -z "$PROCNFSD_MOUNTOPTS" ] && PROCNFSD_MOUNTOPTS="rw,nodev,noexec,nosuid"
+
+case "$NEED_SVCGSSD" in
+ yes|no)
+ ;;
+ *)
+ NEED_SVCGSSD=no
+ ;;
+esac
+
+do_modprobe() {
+ if [ -x /sbin/modprobe -a -f /proc/modules ]; then
+ modprobe -q "$1" || true
+ fi
+}
+
+do_mount() {
+ if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then
+ return 1
+ fi
+
+ if grep -vw "$1" /proc/mounts &> /dev/null ; then
+ if ! mountpoint -q "$2" ; then
+ mount -t "$1" "$1" "$2" -o "$3"
+ return
+ fi
+ fi
+ return 0
+}
+
+do_umount() {
+ if mountpoint -q "$1" ; then
+ umount "$1"
+ fi
+ return 0
+}
+
+get_pid() {
+ pidof -o %PPID "$1"
+}
+
+case "$1" in
+ start)
+ ck_depends ${DAEMON_DEPENDS[@]}
+
+ rc=0
+ stat_busy "Mounting nfsd filesystem"
+ do_modprobe nfsd
+ do_mount nfsd "$PROCNFSD_MOUNTPOINT" "$PROCNFSD_MOUNTOPTS"
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+
+ stat_busy "Exporting all directories"
+ $EXPORTFS -r
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+
+ stat_busy "Starting $NFSD_DAEMON_NAME daemon"
+ PID=$(get_pid $NFSD_PROCESS_NAME)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$NFSD_DAEMON_NAME.pid ] && rm -f /var/run/$NFSD_DAEMON_NAME.pid
+ # RUN
+ $NFSD $NFSD_OPTS $NFSD_COUNT
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $NFSD_PROCESS_NAME) > /var/run/$NFSD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+
+ if [ "$NEED_SVCGSSD" = yes ]; then
+ do_modprobe rpcsec_gss_krb5
+ stat_busy "Starting $SVCGSSD_DAEMON_NAME daemon"
+ PID=$(get_pid $SVCGSSD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$SVCGSSD_DAEMON_NAME.pid ] && rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid
+ # RUN
+ $SVCGSSD $SVCGSSD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $SVCGSSD) > /var/run/$SVCGSSD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ fi
+
+ PID=$(get_pid $IDMAPD)
+ [ ! -z "$PID" ] && kill -SIGHUP $IDMAPD_DAEMON_NAME &> /dev/null
+
+ stat_busy "Starting $MOUNTD_DAEMON_NAME daemon"
+ PID=$(get_pid $MOUNTD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$MOUNTD_DAEMON_NAME.pid ] && rm -f /var/run/$MOUNTD_DAEMON_NAME.pid
+ # RUN
+ $MOUNTD $MOUNTD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $MOUNTD) > /var/run/$MOUNTD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+
+ add_daemon $daemon_name
+ ;;
+
+ stop)
+ rc=0
+ stat_busy "Stopping $MOUNTD_DAEMON_NAME daemon"
+ PID=$(get_pid $MOUNTD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$MOUNTD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+
+ if [ "$NEED_SVCGSSD" = yes ]; then
+ stat_busy "Stopping $SVCGSSD_DAEMON_NAME daemon"
+ PID=$(get_pid $SVCGSSD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+ fi
+
+ stat_busy "Stopping $NFSD_DAEMON_NAME daemon"
+ PID=$(get_pid $NFSD_PROCESS_NAME)
+ # KILL (SIGINT)
+ [ ! -z "$PID" ] && kill -2 $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ sleep 1
+ PID=$(get_pid $NFSD_PROCESS_NAME)
+ # KILL (KILL) - just to be sure
+ [ ! -z "$PID" ] && kill -9 $PID &> /dev/null
+ #
+ rm -f /var/run/$NFSD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+
+ stat_busy "Unexporting all directories"
+ $EXPORTFS -au
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+
+ # flush everything out of the kernels export table
+ if mountpoint -q "$PROCNFSD_MOUNTPOINT" ; then
+ $EXPORTFS -f
+ fi
+ do_umount "$PROCNFSD_MOUNTPOINT" 2>/dev/null || true
+ rm_daemon $daemon_name
+ ;;
+
+ status)
+ stat_busy "Checking $daemon_name status";
+ ck_status $daemon_name
+
+ stat_busy "Daemon $NFSD_DAEMON_NAME running"
+ PID=$(get_pid $NFSD_PROCESS_NAME)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+
+ stat_busy "Daemon $MOUNTD_DAEMON_NAME running"
+ PID=$(get_pid $MOUNTD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+
+ if [ "$NEED_SVCGSSD" = yes ]; then
+ stat_busy "Daemon $SVCGSSD_DAEMON_NAME running"
+ PID=$(get_pid $SVCGSSD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ fi
+ echo
+ ;;
+
+ reload)
+ rc=0
+ stat_busy "Re-exporting all directories"
+ $EXPORTFS -r
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|status|reload|restart}"
+esac
+exit 0
diff --git a/core/nfs-utils/nfs-server.conf b/core/nfs-utils/nfs-server.conf
new file mode 100644
index 000000000..cf75fb6f9
--- /dev/null
+++ b/core/nfs-utils/nfs-server.conf
@@ -0,0 +1,29 @@
+# Parameters to be passed to nfs-server init script.
+#
+
+# Options to pass to rpc.nfsd.
+# See rpc.nfsd(8) for more details.
+NFSD_OPTS=""
+
+# Number of servers to start up; the default is 8 servers.
+NFSD_COUNT=""
+
+# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd".
+PROCNFSD_MOUNTPOINT=""
+
+# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid".
+PROCNFSD_MOUNTOPTS=""
+
+# Options for rpc.mountd.
+# If you have a port-based firewall, you might want to set up
+# a fixed port here using the --port option.
+# See rpc.mountd(8) for more details.
+MOUNTD_OPTS="--no-nfs-version 1 --no-nfs-version 2"
+
+# Do you want to start the svcgssd daemon? It is only required for Kerberos
+# exports. Valid alternatives are "yes" and "no"; the default is "no".
+NEED_SVCGSSD=""
+
+# Options to pass to rpc.svcgssd.
+# See rpc.svcgssd(8) for more details.
+SVCGSSD_OPTS=""
diff --git a/core/nfs-utils/nfs-utils-1.1.2-kerberos-ac.patch b/core/nfs-utils/nfs-utils-1.1.2-kerberos-ac.patch
new file mode 100644
index 000000000..4a5a138e7
--- /dev/null
+++ b/core/nfs-utils/nfs-utils-1.1.2-kerberos-ac.patch
@@ -0,0 +1,138 @@
+diff -NaurwB nfs-utils-1.1.2.orig/aclocal/kerberos5.m4 nfs-utils-1.1.2/aclocal/kerberos5.m4
+--- nfs-utils-1.1.2.orig/aclocal/kerberos5.m4 2008-03-14 16:46:29.000000000 +0100
++++ nfs-utils-1.1.2/aclocal/kerberos5.m4 2008-06-12 17:13:51.000000000 +0200
+@@ -1,112 +1,48 @@
+-dnl Checks for Kerberos
+-dnl NOTE: while we intend to do generic gss-api, currently we
+-dnl have a requirement to get an initial Kerberos machine
+-dnl credential. Thus, the requirement for Kerberos.
+-dnl The Kerberos gssapi library will be dynamically loaded?
+ AC_DEFUN([AC_KERBEROS_V5],[
++ K5CONFIG="krb5-config"
+ AC_MSG_CHECKING(for Kerberos v5)
+- AC_ARG_WITH(krb5,
+- [AC_HELP_STRING([--with-krb5=DIR], [use Kerberos v5 installation in DIR])],
++ AC_ARG_WITH(krb5-config,
++ [AC_HELP_STRING([--with-krb5-config=PATH], [Full Path to krb5-config.])],
+ [ case "$withval" in
+ yes|no)
+- krb5_with=""
++ K5CONFIG="krb5-config"
+ ;;
+ *)
+- krb5_with="$withval"
++ K5CONFIG="$withval"
+ ;;
+ esac ]
+ )
+
+- for dir in $krb5_with /usr /usr/kerberos /usr/local /usr/local/krb5 \
+- /usr/krb5 /usr/heimdal /usr/local/heimdal /usr/athena ; do
+- dnl This ugly hack brought on by the split installation of
+- dnl MIT Kerberos on Fedora Core 1
+- K5CONFIG=""
+- if test -f $dir/bin/krb5-config; then
+- K5CONFIG=$dir/bin/krb5-config
+- elif test -f "/usr/kerberos/bin/krb5-config"; then
+- K5CONFIG="/usr/kerberos/bin/krb5-config"
+- elif test -f "/usr/lib/mit/bin/krb5-config"; then
+- K5CONFIG="/usr/lib/mit/bin/krb5-config"
+- fi
+ if test "$K5CONFIG" != ""; then
+ KRBCFLAGS=`$K5CONFIG --cflags`
+ KRBLIBS=`$K5CONFIG --libs gssapi`
+- K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($(4),v,"."); if (v@<:@"3"@:>@ == "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }'`
+- AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
+- if test -f $dir/include/gssapi/gssapi_krb5.h -a \
+- \( -f $dir/lib/libgssapi_krb5.a -o \
+- -f $dir/lib64/libgssapi_krb5.a -o \
+- -f $dir/lib64/libgssapi_krb5.so -o \
+- -f $dir/lib/libgssapi_krb5.so \) ; then
++ if $K5CONFIG --version | grep -q -e heimdal; then
++ K5VERS=`$K5CONFIG --version | head -n 1 | cut -f2 -d ' ' | tr -d '.'`
++ AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries])
++ gssapi_lib=gssapi
++ KRBIMPL="heimdal"
++ elif $K5CONFIG --version | grep -q -e mit; then
++ K5VERS=`$K5CONFIG --version | head -n 1 | cut -f4 -d ' ' | tr -d '.'`
+ AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries])
+- KRBDIR="$dir"
+- dnl If we are using MIT K5 1.3.1 and before, we *MUST* use the
+- dnl private function (gss_krb5_ccache_name) to get correct
+- dnl behavior of changing the ccache used by gssapi.
+- dnl Starting in 1.3.2, we *DO NOT* want to use
+- dnl gss_krb5_ccache_name, instead we want to set KRB5CCNAME
+- dnl to get gssapi to use a different ccache
+ if test $K5VERS -le 131; then
+ AC_DEFINE(USE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the private function, gss_krb5_cache_name, must be used to tell the Kerberos library which credentials cache to use. Otherwise, this is done by setting the KRB5CCNAME environment variable])
+ fi
+ gssapi_lib=gssapi_krb5
+- break
+- dnl The following ugly hack brought on by the split installation
+- dnl of Heimdal Kerberos on SuSe
+- elif test \( -f $dir/include/heim_err.h -o\
+- -f $dir/include/heimdal/heim_err.h \) -a \
+- -f $dir/lib/libroken.a; then
+- AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries])
+- KRBDIR="$dir"
+- gssapi_lib=gssapi
+- break
+- fi
+- fi
+- done
+- dnl We didn't find a usable Kerberos environment
+- if test "x$KRBDIR" = "x"; then
+- if test "x$krb5_with" = "x"; then
+- AC_MSG_ERROR(Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=)
++ KRBIMPL="mit-krb5"
+ else
+- AC_MSG_ERROR(Kerberos v5 with GSS support not found at $krb5_with)
+- fi
++ AC_MSG_ERROR(Unknown Kerberos 5 Implementation. Is neither heimdal or mit-krb5.)
++ KRBIMPL="unknown"
+ fi
+- AC_MSG_RESULT($KRBDIR)
+-
+- dnl Check if -rpath=$(KRBDIR)/lib is needed
+- echo "The current KRBDIR is $KRBDIR"
+- if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \
+- -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then
+- KRBLDFLAGS="";
+- elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then
+- KRBLDFLAGS="";
+- else
+- KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib"
++ AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
+ fi
++ AC_MSG_RESULT($KRBIMPL)
+
+- dnl Now check for functions within gssapi library
+- AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context,
+- AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
+- AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes,
+- AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS)
+- AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name,
+- AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS)
+-
+- dnl Check for newer error message facility
+- AC_CHECK_LIB($gssapi_lib, krb5_get_error_message,
+- AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS)
++ AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
++ AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes, AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS)
++ AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name, AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS)
++ AC_CHECK_LIB($gssapi_lib, krb5_get_error_message, AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS)
++ AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless, AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS)
+
+- dnl Check for function to specify addressless tickets
+- AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless,
+- AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS)
+-
+- dnl If they specified a directory and it didn't work, give them a warning
+- if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then
+- AC_MSG_WARN(Using $KRBDIR instead of requested value of $krb5_with for Kerberos!)
+- fi
+-
+- AC_SUBST([KRBDIR])
+ AC_SUBST([KRBLIBS])
+ AC_SUBST([KRBCFLAGS])
+ AC_SUBST([KRBLDFLAGS])
diff --git a/core/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch b/core/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch
new file mode 100644
index 000000000..c9e60afc7
--- /dev/null
+++ b/core/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch
@@ -0,0 +1,39 @@
+ripped from Debian
+
+--- nfs-utils-1.1.4/utils/mount/fstab.c
++++ nfs-utils-1.1.4/utils/mount/fstab.c
+@@ -57,7 +57,7 @@ mtab_does_not_exist(void) {
+ return var_mtab_does_not_exist;
+ }
+
+-static int
++int
+ mtab_is_a_symlink(void) {
+ get_mtab_info();
+ return var_mtab_is_a_symlink;
+--- nfs-utils-1.1.4/utils/mount/fstab.h
++++ nfs-utils-1.1.4/utils/mount/fstab.h
+@@ -7,6 +7,7 @@
+ #define _PATH_FSTAB "/etc/fstab"
+ #endif
+
++int mtab_is_a_symlink(void);
+ int mtab_is_writable(void);
+ int mtab_does_not_exist(void);
+ void reset_mtab_info(void);
+--- nfs-utils-1.1.4/utils/mount/mount.c
++++ nfs-utils-1.1.4/utils/mount/mount.c
+@@ -230,6 +230,13 @@ create_mtab (void) {
+ int flags;
+ mntFILE *mfp;
+
++ /* Avoid writing if the mtab is a symlink to /proc/mounts, since
++ that would create a file /proc/mounts in case the proc filesystem
++ is not mounted, and the fchmod below would also fail. */
++ if (mtab_is_a_symlink()) {
++ return EX_SUCCESS;
++ }
++
+ lock_mtab();
+
+ mfp = nfs_setmntent (MOUNTED, "a+");
diff --git a/core/nfs-utils/nfs-utils-1.1.4-no-exec.patch b/core/nfs-utils/nfs-utils-1.1.4-no-exec.patch
new file mode 100644
index 000000000..ea50a21d8
--- /dev/null
+++ b/core/nfs-utils/nfs-utils-1.1.4-no-exec.patch
@@ -0,0 +1,15 @@
+ripped from Debian
+
+--- nfs-utils-1.1.2/utils/mount/mount.c
++++ nfs-utils-1.1.2/utils/mount/mount.c
+@@ -381,10 +381,6 @@
+ mount_error(NULL, mount_point, ENOTDIR);
+ return 1;
+ }
+- if (access(mount_point, X_OK) < 0) {
+- mount_error(NULL, mount_point, errno);
+- return 1;
+- }
+
+ return 0;
+ }
diff --git a/core/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch b/core/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch
new file mode 100644
index 000000000..7f6c7a751
--- /dev/null
+++ b/core/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch
@@ -0,0 +1,69 @@
+diff -Naur nfs-utils-1.1.6.orig/utils/gssd/krb5_util.c nfs-utils-1.1.6/utils/gssd/krb5_util.c
+--- utils/gssd/krb5_util.c 2009-04-20 19:32:50.000000000 +0200
++++ utils/gssd/krb5_util.c 2009-04-20 20:57:31.000000000 +0200
+@@ -940,9 +940,37 @@
+ {
+ krb5_error_code ret;
+ krb5_creds creds;
+- krb5_cc_cursor cur;
+ int found = 0;
+
++#ifdef HAVE_HEIMDAL
++ krb5_creds pattern;
++ krb5_realm *client_realm;
++
++ krb5_cc_clear_mcred(&pattern);
++
++ client_realm = krb5_princ_realm (context, principal);
++
++ ret = krb5_make_principal (context, &pattern.server,
++ *client_realm, KRB5_TGS_NAME, *client_realm,
++ NULL);
++ if (ret)
++ krb5_err (context, 1, ret, "krb5_make_principal");
++ pattern.client = principal;
++
++ ret = krb5_cc_retrieve_cred (context, ccache, 0, &pattern, &creds);
++ krb5_free_principal (context, pattern.server);
++ if (ret) {
++ if (ret == KRB5_CC_END)
++ return 1;
++ krb5_err (context, 1, ret, "krb5_cc_retrieve_cred");
++ }
++
++ found = creds.times.endtime > time(NULL);
++
++ krb5_free_cred_contents (context, &creds);
++#else
++ krb5_cc_cursor cur;
++
+ ret = krb5_cc_start_seq_get(context, ccache, &cur);
+ if (ret)
+ return 0;
+@@ -962,6 +990,7 @@
+ krb5_free_cred_contents(context, &creds);
+ }
+ krb5_cc_end_seq_get(context, ccache, &cur);
++#endif
+
+ return found;
+ }
+@@ -1008,6 +1037,9 @@
+ }
+ krb5_free_principal(context, principal);
+ err_princ:
++#ifdef HAVE_HEIMDAL
++#define KRB5_TC_OPENCLOSE 0x00000001
++#endif
+ krb5_cc_set_flags(context, ccache, KRB5_TC_OPENCLOSE);
+ krb5_cc_close(context, ccache);
+ err_cache:
+@@ -1262,7 +1294,7 @@
+ if (context != NULL) {
+ origmsg = krb5_get_error_message(context, code);
+ msg = strdup(origmsg);
+- krb5_free_error_message(context, origmsg);
++ krb5_free_error_string(context, origmsg);
+ }
+ #endif
+ if (msg != NULL)
diff --git a/core/nfs-utils/nfs-utils-1.1.6-no_libgssapi.patch b/core/nfs-utils/nfs-utils-1.1.6-no_libgssapi.patch
new file mode 100644
index 000000000..917136a8c
--- /dev/null
+++ b/core/nfs-utils/nfs-utils-1.1.6-no_libgssapi.patch
@@ -0,0 +1,57 @@
+Index: nfs-utils-1.1.6/utils/gssd/context_lucid.c
+===================================================================
+--- nfs-utils-1.1.6.orig/utils/gssd/context_lucid.c
++++ nfs-utils-1.1.6/utils/gssd/context_lucid.c
+@@ -51,8 +51,10 @@
+ #include "context.h"
+
+ #ifndef OM_uint64
++#ifndef GSSAPI_GSSAPI_H_
+ typedef uint64_t OM_uint64;
+ #endif
++#endif
+
+ static int
+ write_lucid_keyblock(char **p, char *end, gss_krb5_lucid_key_t *key)
+@@ -177,10 +179,10 @@
+ int retcode = 0;
+
+ printerr(2, "DEBUG: serialize_krb5_ctx: lucid version!\n");
+- maj_stat = gss_export_lucid_sec_context(&min_stat, &ctx,
++ maj_stat = gss_krb5_export_lucid_sec_context(&min_stat, &ctx,
+ 1, &return_ctx);
+ if (maj_stat != GSS_S_COMPLETE) {
+- pgsserr("gss_export_lucid_sec_context",
++ pgsserr("gss_krb5_export_lucid_sec_context",
+ maj_stat, min_stat, &krb5oid);
+ goto out_err;
+ }
+@@ -204,9 +206,9 @@
+ else
+ retcode = prepare_krb5_rfc_cfx_buffer(lctx, buf, endtime);
+
+- maj_stat = gss_free_lucid_sec_context(&min_stat, ctx, return_ctx);
++ maj_stat = gss_krb5_free_lucid_sec_context(&min_stat, ctx);
+ if (maj_stat != GSS_S_COMPLETE) {
+- pgsserr("gss_export_lucid_sec_context",
++ pgsserr("gss_krb5_export_lucid_sec_context",
+ maj_stat, min_stat, &krb5oid);
+ printerr(0, "WARN: failed to free lucid sec context\n");
+ }
+Index: nfs-utils-1.1.6/utils/gssd/krb5_util.c
+===================================================================
+--- nfs-utils-1.1.6.orig/utils/gssd/krb5_util.c
++++ nfs-utils-1.1.6/utils/gssd/krb5_util.c
+@@ -332,10 +332,10 @@
+ return -1;
+ }
+
+- maj_stat = gss_set_allowable_enctypes(&min_stat, credh, &krb5oid,
++ maj_stat = gss_krb5_set_allowable_enctypes(&min_stat, credh,
+ num_enctypes, &enctypes);
+ if (maj_stat != GSS_S_COMPLETE) {
+- pgsserr("gss_set_allowable_enctypes",
++ pgsserr("gss_krb5_set_allowable_enctypes",
+ maj_stat, min_stat, &krb5oid);
+ gss_release_cred(&min_stat, &credh);
+ return -1;
diff --git a/core/nfs-utils/nfs-utils.install b/core/nfs-utils/nfs-utils.install
new file mode 100644
index 000000000..7dcdf9575
--- /dev/null
+++ b/core/nfs-utils/nfs-utils.install
@@ -0,0 +1,32 @@
+## arg 1: the new package version
+post_install() {
+cat << 'EOM'
+ ==> PLEASE NOTE:
+ ==> Extended configuration options for NFS (clients & server) are available in
+ ==> /etc/conf.d/nfs-common.conf and in /etc/conf.d/nfs-server.conf
+ ==>
+ ==> Please refer to http://wiki.archlinux.org/index.php/Nfs
+ ==> for further information on NFS; for NFSv4, refer to
+ ==> http://wiki.archlinux.org/index.php/NFSv4
+EOM
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+post_upgrade() {
+ if [ "$(vercmp $2 1.2.0-2)" -lt 0 ]; then
+cat << 'EOM'
+ ==> IMPORTANT NFS UTILS CHANGES:
+ ==> This is a rather important upgrade, you are going to have to change config files.
+ ==> /etc/rc.conf daemons changes:
+ ==> Change portmap to rpcbind
+ ==> Change nfslock to nfs-common
+ ==> Change nfsd to nfs-server
+ ==>
+ ==> Extended configuration options for NFS (clients & server) are available in:
+ ==> /etc/conf.d/nfs-common
+ ==> /etc/conf.d/nfs-server
+ ==> Please change them to your needs.
+EOM
+ fi
+}
diff --git a/core/nfs-utils/start-statd.patch b/core/nfs-utils/start-statd.patch
new file mode 100644
index 000000000..38c60a784
--- /dev/null
+++ b/core/nfs-utils/start-statd.patch
@@ -0,0 +1,22 @@
+--- utils/statd/start-statd 2007-05-11 04:40:57.000000000 +0100
++++ utils/statd/start-statd.new 2007-09-21 17:11:34.000000000 +0100
+@@ -1,9 +1,16 @@
+-#!/bin/sh -p
++#!/bin/sh
++
++# Original script provided by the NFS project
++# Modified for Arch Linux by Tom Killian
++
+ # nfsmount calls this script when mounting a filesystem with locking
+ # enabled, but when statd does not seem to be running (based on
+ # /var/run/rpc.statd.pid).
+ # It should run run statd with whatever flags are apropriate for this
+ # site.
+-PATH=/sbin:/usr/sbin
+-exec rpc.statd --no-notify
++
++# source application-specific settings
++[ -f /etc/conf.d/nfs-common.conf ] && . /etc/conf.d/nfs-common.conf
++
++exec /usr/sbin/rpc.statd $STATD_OPTS
+
diff --git a/core/nfsidmap/PKGBUILD b/core/nfsidmap/PKGBUILD
new file mode 100644
index 000000000..f744598ce
--- /dev/null
+++ b/core/nfsidmap/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 111577 2011-02-27 18:55:50Z tpowa $
+# Maintainer:
+# Contributor: Judd <jvinet@zeroflux.org>
+
+pkgname=nfsidmap
+pkgver=0.24
+pkgrel=2
+pkgdesc="Library to help mapping IDs, mainly for NFSv4"
+arch=('i686' 'x86_64')
+url="http://www.citi.umich.edu/projects/nfsv4/linux/"
+depends=('glibc' 'libldap>=2.4.18')
+license=('custom:nfsidmap')
+options=(!libtool)
+source=(http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/libnfsidmap-$pkgver.tar.gz)
+md5sums=('d71a1ee9881d5b5814ff3ec41256937d')
+
+build() {
+ cd $srcdir/lib$pkgname-$pkgver
+ ./configure --prefix=/usr --sysconfdir=/etc
+ make
+}
+
+package() {
+ cd $srcdir/lib$pkgname-$pkgver
+ make DESTDIR=$pkgdir install
+
+ # remove idmap manpage provided by nfs-utils!
+ rm $pkgdir/usr/share/man/man5/idmapd.conf.5
+
+ # install license
+ install -Dm644 COPYING $pkgdir/usr/share/licenses/nfsidmap/LICENSE
+}
diff --git a/core/nilfs-utils/PKGBUILD b/core/nilfs-utils/PKGBUILD
new file mode 100644
index 000000000..12571ea11
--- /dev/null
+++ b/core/nilfs-utils/PKGBUILD
@@ -0,0 +1,22 @@
+# $Id: PKGBUILD 107520 2011-01-26 13:39:05Z ibiru $
+# Maintainer : Ionut Biru <ibiru@archlinux.org>
+# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>
+pkgname=nilfs-utils
+pkgver=2.0.21
+pkgrel=1
+pkgdesc="A log-structured file system supporting continuous snapshotting (userspace utils)"
+arch=('i686' 'x86_64')
+url="http://www.nilfs.org/"
+license=('GPL2' 'LGPL2.1')
+backup=('etc/nilfs_cleanerd.conf')
+depends=('util-linux-ng')
+options=(!libtool)
+source=(http://www.nilfs.org/download/${pkgname}-${pkgver}.tar.bz2)
+md5sums=('7f970f35950b429ac490df594c9d8fc1')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --libdir=/lib
+ make
+ make DESTDIR="${pkgdir}" install LDCONFIG=/bin/true
+}
diff --git a/core/openssh/PKGBUILD b/core/openssh/PKGBUILD
new file mode 100644
index 000000000..389d009c8
--- /dev/null
+++ b/core/openssh/PKGBUILD
@@ -0,0 +1,55 @@
+# $Id: PKGBUILD 108830 2011-02-04 07:33:09Z bisson $
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=openssh
+pkgver=5.8p1
+pkgrel=1
+pkgdesc='Free version of the SSH connectivity tools'
+arch=('i686' 'x86_64')
+license=('custom:BSD')
+url='http://www.openssh.org/portable.html'
+backup=('etc/ssh/ssh_config' 'etc/ssh/sshd_config' 'etc/pam.d/sshd' 'etc/conf.d/sshd')
+depends=('tcp_wrappers' 'heimdal' 'libedit')
+source=("ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${pkgname}-${pkgver}.tar.gz"
+ 'sshd.confd'
+ 'sshd.pam'
+ 'sshd')
+sha1sums=('adebb2faa9aba2a3a3c8b401b2b19677ab53f0de'
+ 'ec102deb69cad7d14f406289d2fc11fee6eddbdd'
+ '660092c57bde28bed82078f74011f95fc51c2293'
+ '6b7f8ebf0c1cc37137a7d9a53447ac8a0ee6a2b5')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure --prefix=/usr --libexecdir=/usr/lib/ssh \
+ --sysconfdir=/etc/ssh --with-tcp-wrappers --with-privsep-user=nobody \
+ --with-md5-passwords --with-pam --with-mantype=man --mandir=/usr/share/man \
+ --with-xauth=/usr/bin/xauth --with-kerberos5=/usr --with-ssl-engine \
+ --with-libedit=/usr/lib --disable-strip # stripping is done by makepkg
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ install -Dm755 ../sshd "${pkgdir}"/etc/rc.d/sshd
+ install -Dm644 ../sshd.pam "${pkgdir}"/etc/pam.d/sshd
+ install -Dm644 ../sshd.confd "${pkgdir}"/etc/conf.d/sshd
+ install -Dm644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENCE"
+
+ rm "${pkgdir}"/usr/share/man/man1/slogin.1
+ ln -sf ssh.1.gz "${pkgdir}"/usr/share/man/man1/slogin.1.gz
+
+ # additional contrib scripts that we like
+ install -Dm755 contrib/findssl.sh "${pkgdir}"/usr/bin/findssl.sh
+ install -Dm755 contrib/ssh-copy-id "${pkgdir}"/usr/bin/ssh-copy-id
+ install -Dm644 contrib/ssh-copy-id.1 "${pkgdir}"/usr/share/man/man1/ssh-copy-id.1
+
+ # PAM is a common, standard feature to have
+ sed -i -e '/^#ChallengeResponseAuthentication yes$/c ChallengeResponseAuthentication no' \
+ -e '/^#UsePAM no$/c UsePAM yes' \
+ "$pkgdir"/etc/ssh/sshd_config
+}
diff --git a/core/openssh/sshd b/core/openssh/sshd
new file mode 100755
index 000000000..2ee1091f0
--- /dev/null
+++ b/core/openssh/sshd
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/sshd
+
+PIDFILE=/var/run/sshd.pid
+PID=$(cat $PIDFILE 2>/dev/null)
+if ! readlink -q /proc/$PID/exe | grep -q '^/usr/sbin/sshd'; then
+ PID=
+ rm $PIDFILE 2>/dev/null
+fi
+
+case "$1" in
+ start)
+ stat_busy "Starting Secure Shell Daemon"
+ [ -f /etc/ssh/ssh_host_key ] || { /usr/bin/ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key >/dev/null; }
+ [ -f /etc/ssh/ssh_host_rsa_key ] || { /usr/bin/ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key >/dev/null; }
+ [ -f /etc/ssh/ssh_host_dsa_key ] || { /usr/bin/ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key >/dev/null; }
+ [ -f /etc/ssh/ssh_host_ecdsa_key ] || { /usr/bin/ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key >/dev/null; }
+ [ -d /var/empty ] || mkdir -p /var/empty
+ [ -z "$PID" ] && /usr/sbin/sshd $SSHD_ARGS
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon sshd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Secure Shell Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon sshd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/openssh/sshd.confd b/core/openssh/sshd.confd
new file mode 100644
index 000000000..5ce7c0079
--- /dev/null
+++ b/core/openssh/sshd.confd
@@ -0,0 +1,4 @@
+#
+# Parameters to be passed to sshd
+#
+SSHD_ARGS=""
diff --git a/core/openssh/sshd.pam b/core/openssh/sshd.pam
new file mode 100644
index 000000000..ae028ceb5
--- /dev/null
+++ b/core/openssh/sshd.pam
@@ -0,0 +1,10 @@
+#%PAM-1.0
+#auth required pam_securetty.so #Disable remote root
+auth required pam_unix.so
+auth required pam_env.so
+account required pam_nologin.so
+account required pam_unix.so
+account required pam_time.so
+password required pam_unix.so
+session required pam_unix_session.so
+session required pam_limits.so
diff --git a/core/openssl/PKGBUILD b/core/openssl/PKGBUILD
new file mode 100644
index 000000000..756338040
--- /dev/null
+++ b/core/openssl/PKGBUILD
@@ -0,0 +1,56 @@
+# $Id: PKGBUILD 109351 2011-02-08 19:05:04Z pierre $
+# Maintainer: Pierre Schmitz <pierre@archlinux.de>
+
+pkgname=openssl
+_ver=1.0.0d
+# use a pacman compatible version scheme
+pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
+pkgrel=1
+pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security'
+arch=('i686' 'x86_64')
+url='https://www.openssl.org'
+license=('custom:BSD')
+depends=('perl')
+optdepends=('ca-certificates')
+options=('!makeflags')
+backup=('etc/ssl/openssl.cnf')
+source=("https://www.openssl.org/source/${pkgname}-${_ver}.tar.gz"
+ 'fix-manpages.patch'
+ 'no-rpath.patch'
+ 'ca-dir.patch')
+md5sums=('40b6ea380cc8a5bf9734c2f8bf7e701e'
+ '5bbc0655bda2af95bc8eb568963ce8ba'
+ 'dc78d3d06baffc16217519242ce92478'
+ '3bf51be3a1bbd262be46dc619f92aa90')
+
+# keep an upgrade path for older installations
+PKGEXT='.pkg.tar.gz'
+
+build() {
+ cd $srcdir/$pkgname-$_ver
+
+ # avoid conflicts with other man pages
+ # see http://www.linuxfromscratch.org/patches/downloads/openssl/
+ patch -p1 -i $srcdir/fix-manpages.patch
+ # remove rpath: http://bugs.archlinux.org/task/14367
+ patch -p0 -i $srcdir/no-rpath.patch
+ # set ca dir to /etc/ssl by default
+ patch -p0 -i $srcdir/ca-dir.patch
+ # mark stack as non-executable: http://bugs.archlinux.org/task/12434
+ ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib \
+ shared zlib enable-md2 -Wa,--noexecstack
+
+ make
+
+ # the test fails due to missing write permissions in /etc/ssl
+ # revert this patch for make test
+ #patch -p0 -R -i $srcdir/ca-dir.patch
+ #make test
+ #patch -p0 -i $srcdir/ca-dir.patch
+}
+
+package() {
+ cd $srcdir/$pkgname-$_ver
+ make INSTALL_PREFIX=$pkgdir MANDIR=/usr/share/man install
+ install -D -m644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
+}
diff --git a/core/openssl/ca-dir.patch b/core/openssl/ca-dir.patch
new file mode 100644
index 000000000..41d1386d3
--- /dev/null
+++ b/core/openssl/ca-dir.patch
@@ -0,0 +1,33 @@
+--- apps/CA.pl.in 2006-04-28 02:30:49.000000000 +0200
++++ apps/CA.pl.in 2010-04-01 00:35:02.600553509 +0200
+@@ -53,7 +53,7 @@
+ $X509="$openssl x509";
+ $PKCS12="$openssl pkcs12";
+
+-$CATOP="./demoCA";
++$CATOP="/etc/ssl";
+ $CAKEY="cakey.pem";
+ $CAREQ="careq.pem";
+ $CACERT="cacert.pem";
+--- apps/CA.sh 2009-10-15 19:27:47.000000000 +0200
++++ apps/CA.sh 2010-04-01 00:35:02.600553509 +0200
+@@ -68,7 +68,7 @@
+ X509="$OPENSSL x509"
+ PKCS12="openssl pkcs12"
+
+-if [ -z "$CATOP" ] ; then CATOP=./demoCA ; fi
++if [ -z "$CATOP" ] ; then CATOP=/etc/ssl ; fi
+ CAKEY=./cakey.pem
+ CAREQ=./careq.pem
+ CACERT=./cacert.pem
+--- apps/openssl.cnf 2009-04-04 20:09:43.000000000 +0200
++++ apps/openssl.cnf 2010-04-01 00:35:02.607220681 +0200
+@@ -39,7 +39,7 @@
+ ####################################################################
+ [ CA_default ]
+
+-dir = ./demoCA # Where everything is kept
++dir = /etc/ssl # Where everything is kept
+ certs = $dir/certs # Where the issued certs are kept
+ crl_dir = $dir/crl # Where the issued crl are kept
+ database = $dir/index.txt # database index file.
diff --git a/core/openssl/fix-manpages.patch b/core/openssl/fix-manpages.patch
new file mode 100644
index 000000000..0a300f3b9
--- /dev/null
+++ b/core/openssl/fix-manpages.patch
@@ -0,0 +1,1920 @@
+Submitted By: Robert Connolly <robert at linuxfromscratch dot org>
+Date: 2005-11-13
+Initial Package Version: 0.9.8a
+Upstream Status: Submitted upstream
+Origin: Anderson Lizardo
+Description: This patch fixes conflicts between man pages
+ installed by OpenSSL and those found on other
+ packages (particulary Shadow, Perl, and
+ Man-pages). It also fixes syntax errors on some
+ POD files that generates slightly broken man
+ pages. Rediffed for 1.0.0a by Ken Moffat
+
+diff -Naur openssl-1.0.0a.orig//crypto/rand/md_rand.c openssl-1.0.0a/crypto/rand/md_rand.c
+--- openssl-1.0.0a.orig//crypto/rand/md_rand.c 2009-01-03 09:25:32.000000000 +0000
++++ openssl-1.0.0a/crypto/rand/md_rand.c 2010-09-01 19:36:31.604126440 +0100
+@@ -196,7 +196,7 @@
+ int do_not_lock;
+
+ /*
+- * (Based on the rand(3) manpage)
++ * (Based on the openssl_rand(3) manpage)
+ *
+ * The input is chopped up into units of 20 bytes (or less for
+ * the last block). Each of these blocks is run through the hash
+@@ -361,7 +361,7 @@
+ num_ceil = (1 + (num-1)/(MD_DIGEST_LENGTH/2)) * (MD_DIGEST_LENGTH/2);
+
+ /*
+- * (Based on the rand(3) manpage:)
++ * (Based on the openssl_rand(3) manpage)
+ *
+ * For each group of 10 bytes (or less), we do the following:
+ *
+diff -Naur openssl-1.0.0a.orig//doc/apps/openssl-passwd.pod openssl-1.0.0a/doc/apps/openssl-passwd.pod
+--- openssl-1.0.0a.orig//doc/apps/openssl-passwd.pod 1970-01-01 01:00:00.000000000 +0100
++++ openssl-1.0.0a/doc/apps/openssl-passwd.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -0,0 +1,82 @@
++=pod
++
++=head1 NAME
++
++openssl-passwd - compute password hashes
++
++=head1 SYNOPSIS
++
++B<openssl passwd>
++[B<-crypt>]
++[B<-1>]
++[B<-apr1>]
++[B<-salt> I<string>]
++[B<-in> I<file>]
++[B<-stdin>]
++[B<-noverify>]
++[B<-quiet>]
++[B<-table>]
++{I<password>}
++
++=head1 DESCRIPTION
++
++The B<passwd> command computes the hash of a password typed at
++run-time or the hash of each password in a list. The password list is
++taken from the named file for option B<-in file>, from stdin for
++option B<-stdin>, or from the command line, or from the terminal otherwise.
++The Unix standard algorithm B<crypt> and the MD5-based BSD password
++algorithm B<1> and its Apache variant B<apr1> are available.
++
++=head1 OPTIONS
++
++=over 4
++
++=item B<-crypt>
++
++Use the B<crypt> algorithm (default).
++
++=item B<-1>
++
++Use the MD5 based BSD password algorithm B<1>.
++
++=item B<-apr1>
++
++Use the B<apr1> algorithm (Apache variant of the BSD algorithm).
++
++=item B<-salt> I<string>
++
++Use the specified salt.
++When reading a password from the terminal, this implies B<-noverify>.
++
++=item B<-in> I<file>
++
++Read passwords from I<file>.
++
++=item B<-stdin>
++
++Read passwords from B<stdin>.
++
++=item B<-noverify>
++
++Don't verify when reading a password from the terminal.
++
++=item B<-quiet>
++
++Don't output warnings when passwords given at the command line are truncated.
++
++=item B<-table>
++
++In the output list, prepend the cleartext password and a TAB character
++to each password hash.
++
++=back
++
++=head1 EXAMPLES
++
++B<openssl passwd -crypt -salt xx password> prints B<xxj31ZMTZzkVA>.
++
++B<openssl passwd -1 -salt xxxxxxxx password> prints B<$1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a.>.
++
++B<openssl passwd -apr1 -salt xxxxxxxx password> prints B<$apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0>.
++
++=cut
+diff -Naur openssl-1.0.0a.orig//doc/apps/openssl.pod openssl-1.0.0a/doc/apps/openssl.pod
+--- openssl-1.0.0a.orig//doc/apps/openssl.pod 2010-01-21 18:46:28.000000000 +0000
++++ openssl-1.0.0a/doc/apps/openssl.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -163,7 +163,7 @@
+
+ Online Certificate Status Protocol utility.
+
+-=item L<B<passwd>|passwd(1)>
++=item L<B<passwd>|openssl-passwd(1)>
+
+ Generation of hashed passwords.
+
+@@ -401,7 +401,7 @@
+ L<dhparam(1)|dhparam(1)>, L<dsa(1)|dsa(1)>, L<dsaparam(1)|dsaparam(1)>,
+ L<enc(1)|enc(1)>, L<gendsa(1)|gendsa(1)>, L<genpkey(1)|genpkey(1)>,
+ L<genrsa(1)|genrsa(1)>, L<nseq(1)|nseq(1)>, L<openssl(1)|openssl(1)>,
+-L<passwd(1)|passwd(1)>,
++L<openssl-passwd(1)|openssl-passwd(1)>,
+ L<pkcs12(1)|pkcs12(1)>, L<pkcs7(1)|pkcs7(1)>, L<pkcs8(1)|pkcs8(1)>,
+ L<rand(1)|rand(1)>, L<req(1)|req(1)>, L<rsa(1)|rsa(1)>,
+ L<rsautl(1)|rsautl(1)>, L<s_client(1)|s_client(1)>,
+diff -Naur openssl-1.0.0a.orig//doc/apps/passwd.pod openssl-1.0.0a/doc/apps/passwd.pod
+--- openssl-1.0.0a.orig//doc/apps/passwd.pod 2002-10-04 13:59:00.000000000 +0100
++++ openssl-1.0.0a/doc/apps/passwd.pod 1970-01-01 01:00:00.000000000 +0100
+@@ -1,82 +0,0 @@
+-=pod
+-
+-=head1 NAME
+-
+-passwd - compute password hashes
+-
+-=head1 SYNOPSIS
+-
+-B<openssl passwd>
+-[B<-crypt>]
+-[B<-1>]
+-[B<-apr1>]
+-[B<-salt> I<string>]
+-[B<-in> I<file>]
+-[B<-stdin>]
+-[B<-noverify>]
+-[B<-quiet>]
+-[B<-table>]
+-{I<password>}
+-
+-=head1 DESCRIPTION
+-
+-The B<passwd> command computes the hash of a password typed at
+-run-time or the hash of each password in a list. The password list is
+-taken from the named file for option B<-in file>, from stdin for
+-option B<-stdin>, or from the command line, or from the terminal otherwise.
+-The Unix standard algorithm B<crypt> and the MD5-based BSD password
+-algorithm B<1> and its Apache variant B<apr1> are available.
+-
+-=head1 OPTIONS
+-
+-=over 4
+-
+-=item B<-crypt>
+-
+-Use the B<crypt> algorithm (default).
+-
+-=item B<-1>
+-
+-Use the MD5 based BSD password algorithm B<1>.
+-
+-=item B<-apr1>
+-
+-Use the B<apr1> algorithm (Apache variant of the BSD algorithm).
+-
+-=item B<-salt> I<string>
+-
+-Use the specified salt.
+-When reading a password from the terminal, this implies B<-noverify>.
+-
+-=item B<-in> I<file>
+-
+-Read passwords from I<file>.
+-
+-=item B<-stdin>
+-
+-Read passwords from B<stdin>.
+-
+-=item B<-noverify>
+-
+-Don't verify when reading a password from the terminal.
+-
+-=item B<-quiet>
+-
+-Don't output warnings when passwords given at the command line are truncated.
+-
+-=item B<-table>
+-
+-In the output list, prepend the cleartext password and a TAB character
+-to each password hash.
+-
+-=back
+-
+-=head1 EXAMPLES
+-
+-B<openssl passwd -crypt -salt xx password> prints B<xxj31ZMTZzkVA>.
+-
+-B<openssl passwd -1 -salt xxxxxxxx password> prints B<$1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a.>.
+-
+-B<openssl passwd -apr1 -salt xxxxxxxx password> prints B<$apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0>.
+-
+-=cut
+diff -Naur openssl-1.0.0a.orig//doc/crypto/BN_generate_prime.pod openssl-1.0.0a/doc/crypto/BN_generate_prime.pod
+--- openssl-1.0.0a.orig//doc/crypto/BN_generate_prime.pod 2003-01-13 13:18:22.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/BN_generate_prime.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -90,7 +90,7 @@
+
+ =head1 SEE ALSO
+
+-L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>
++L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/bn.pod openssl-1.0.0a/doc/crypto/bn.pod
+--- openssl-1.0.0a.orig//doc/crypto/bn.pod 2008-07-03 20:59:24.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/bn.pod 2010-09-01 19:36:31.620125025 +0100
+@@ -167,7 +167,7 @@
+ =head1 SEE ALSO
+
+ L<bn_internal(3)|bn_internal(3)>,
+-L<dh(3)|dh(3)>, L<err(3)|err(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>,
++L<dh(3)|dh(3)>, L<openssl_err(3)|openssl_err(3)>, L<openssl_rand(3)|openssl_rand(3)>, L<rsa(3)|rsa(3)>,
+ L<BN_new(3)|BN_new(3)>, L<BN_CTX_new(3)|BN_CTX_new(3)>,
+ L<BN_copy(3)|BN_copy(3)>, L<BN_swap(3)|BN_swap(3)>, L<BN_num_bytes(3)|BN_num_bytes(3)>,
+ L<BN_add(3)|BN_add(3)>, L<BN_add_word(3)|BN_add_word(3)>,
+diff -Naur openssl-1.0.0a.orig//doc/crypto/BN_rand.pod openssl-1.0.0a/doc/crypto/BN_rand.pod
+--- openssl-1.0.0a.orig//doc/crypto/BN_rand.pod 2002-09-25 14:33:26.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/BN_rand.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -45,7 +45,7 @@
+
+ =head1 SEE ALSO
+
+-L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>,
++L<bn(3)|bn(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<RAND_add(3)|RAND_add(3)>, L<RAND_bytes(3)|RAND_bytes(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/CONF_modules_free.pod openssl-1.0.0a/doc/crypto/CONF_modules_free.pod
+--- openssl-1.0.0a.orig//doc/crypto/CONF_modules_free.pod 2006-12-21 21:13:27.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/CONF_modules_free.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -37,7 +37,7 @@
+ =head1 SEE ALSO
+
+ L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>,
+-L<CONF_modules_load_file(3), CONF_modules_load_file(3)>
++L<CONF_modules_load_file(3)|CONF_modules_load_file(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/CONF_modules_load_file.pod openssl-1.0.0a/doc/crypto/CONF_modules_load_file.pod
+--- openssl-1.0.0a.orig//doc/crypto/CONF_modules_load_file.pod 2004-03-02 13:31:32.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/CONF_modules_load_file.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -51,7 +51,7 @@
+ =head1 SEE ALSO
+
+ L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>,
+-L<CONF_free(3), CONF_free(3)>, L<err(3),err(3)>
++L<CONF_free(3)|CONF_free(3)>, L<openssl_err(3)|openssl_err(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/crypto.pod openssl-1.0.0a/doc/crypto/crypto.pod
+--- openssl-1.0.0a.orig//doc/crypto/crypto.pod 2002-10-06 13:59:25.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/crypto.pod 2010-09-01 19:36:31.620125025 +0100
+@@ -46,7 +46,7 @@
+
+ =item AUXILIARY FUNCTIONS
+
+-L<err(3)|err(3)>, L<threads(3)|threads(3)>, L<rand(3)|rand(3)>,
++L<openssl_err(3)|openssl_err(3)>, L<openssl_threads(3)|openssl_threads(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<OPENSSL_VERSION_NUMBER(3)|OPENSSL_VERSION_NUMBER(3)>
+
+ =item INPUT/OUTPUT, DATA ENCODING
+diff -Naur openssl-1.0.0a.orig//doc/crypto/des.pod openssl-1.0.0a/doc/crypto/des.pod
+--- openssl-1.0.0a.orig//doc/crypto/des.pod 2003-10-01 16:02:45.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/des.pod 2010-09-01 19:36:31.620125025 +0100
+@@ -115,7 +115,7 @@
+ the key; it is used to speed the encryption process.
+
+ DES_random_key() generates a random key. The PRNG must be seeded
+-prior to using this function (see L<rand(3)|rand(3)>). If the PRNG
++prior to using this function (see L<openssl_rand(3)|openssl_rand(3)>). If the PRNG
+ could not generate a secure key, 0 is returned.
+
+ Before a DES key can be used, it must be converted into the
+@@ -317,7 +317,7 @@
+
+ =head1 SEE ALSO
+
+-crypt(3), L<des_modes(7)|des_modes(7)>, L<evp(3)|evp(3)>, L<rand(3)|rand(3)>
++crypt(3), L<des_modes(7)|des_modes(7)>, L<evp(3)|evp(3)>, L<openssl_rand(3)|openssl_rand(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/DH_generate_key.pod openssl-1.0.0a/doc/crypto/DH_generate_key.pod
+--- openssl-1.0.0a.orig//doc/crypto/DH_generate_key.pod 2002-09-25 14:33:27.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/DH_generate_key.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -40,7 +40,7 @@
+
+ =head1 SEE ALSO
+
+-L<dh(3)|dh(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<DH_size(3)|DH_size(3)>
++L<dh(3)|dh(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>, L<DH_size(3)|DH_size(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/DH_generate_parameters.pod openssl-1.0.0a/doc/crypto/DH_generate_parameters.pod
+--- openssl-1.0.0a.orig//doc/crypto/DH_generate_parameters.pod 2002-09-25 14:33:27.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/DH_generate_parameters.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -59,7 +59,7 @@
+
+ =head1 SEE ALSO
+
+-L<dh(3)|dh(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>,
++L<dh(3)|dh(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<DH_free(3)|DH_free(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/dh.pod openssl-1.0.0a/doc/crypto/dh.pod
+--- openssl-1.0.0a.orig//doc/crypto/dh.pod 2002-08-05 17:27:01.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/dh.pod 2010-09-01 19:36:31.620125025 +0100
+@@ -67,8 +67,8 @@
+
+ =head1 SEE ALSO
+
+-L<dhparam(1)|dhparam(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<err(3)|err(3)>,
+-L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<engine(3)|engine(3)>,
++L<dhparam(1)|dhparam(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<openssl_err(3)|openssl_err(3)>,
++L<openssl_rand(3)|openssl_rand(3)>, L<rsa(3)|rsa(3)>, L<engine(3)|engine(3)>,
+ L<DH_set_method(3)|DH_set_method(3)>, L<DH_new(3)|DH_new(3)>,
+ L<DH_get_ex_new_index(3)|DH_get_ex_new_index(3)>,
+ L<DH_generate_parameters(3)|DH_generate_parameters(3)>,
+diff -Naur openssl-1.0.0a.orig//doc/crypto/DSA_do_sign.pod openssl-1.0.0a/doc/crypto/DSA_do_sign.pod
+--- openssl-1.0.0a.orig//doc/crypto/DSA_do_sign.pod 2002-09-25 14:33:27.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/DSA_do_sign.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -36,7 +36,7 @@
+
+ =head1 SEE ALSO
+
+-L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>,
++L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<DSA_SIG_new(3)|DSA_SIG_new(3)>,
+ L<DSA_sign(3)|DSA_sign(3)>
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/DSA_generate_key.pod openssl-1.0.0a/doc/crypto/DSA_generate_key.pod
+--- openssl-1.0.0a.orig//doc/crypto/DSA_generate_key.pod 2002-09-25 14:33:27.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/DSA_generate_key.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -24,7 +24,7 @@
+
+ =head1 SEE ALSO
+
+-L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>,
++L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<DSA_generate_parameters(3)|DSA_generate_parameters(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/DSA_generate_parameters.pod openssl-1.0.0a/doc/crypto/DSA_generate_parameters.pod
+--- openssl-1.0.0a.orig//doc/crypto/DSA_generate_parameters.pod 2002-09-25 14:33:27.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/DSA_generate_parameters.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -90,7 +90,7 @@
+
+ =head1 SEE ALSO
+
+-L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>,
++L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<DSA_free(3)|DSA_free(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/dsa.pod openssl-1.0.0a/doc/crypto/dsa.pod
+--- openssl-1.0.0a.orig//doc/crypto/dsa.pod 2002-08-05 17:27:01.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/dsa.pod 2010-09-01 19:36:31.620125025 +0100
+@@ -100,7 +100,7 @@
+
+ =head1 SEE ALSO
+
+-L<bn(3)|bn(3)>, L<dh(3)|dh(3)>, L<err(3)|err(3)>, L<rand(3)|rand(3)>,
++L<bn(3)|bn(3)>, L<dh(3)|dh(3)>, L<openssl_err(3)|openssl_err(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<rsa(3)|rsa(3)>, L<sha(3)|sha(3)>, L<engine(3)|engine(3)>,
+ L<DSA_new(3)|DSA_new(3)>,
+ L<DSA_size(3)|DSA_size(3)>,
+diff -Naur openssl-1.0.0a.orig//doc/crypto/DSA_sign.pod openssl-1.0.0a/doc/crypto/DSA_sign.pod
+--- openssl-1.0.0a.orig//doc/crypto/DSA_sign.pod 2002-09-25 14:33:27.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/DSA_sign.pod 2010-09-01 19:36:31.608126088 +0100
+@@ -55,7 +55,7 @@
+
+ =head1 SEE ALSO
+
+-L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>,
++L<dsa(3)|dsa(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<DSA_do_sign(3)|DSA_do_sign(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/engine.pod openssl-1.0.0a/doc/crypto/engine.pod
+--- openssl-1.0.0a.orig//doc/crypto/engine.pod 2007-11-19 09:18:03.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/engine.pod 2010-09-01 19:36:31.620125025 +0100
+@@ -594,6 +594,6 @@
+
+ =head1 SEE ALSO
+
+-L<rsa(3)|rsa(3)>, L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>, L<rand(3)|rand(3)>
++L<rsa(3)|rsa(3)>, L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>, L<openssl_rand(3)|openssl_rand(3)>
+
+ =cut
+diff -Naur openssl-1.0.0a.orig//doc/crypto/ERR_clear_error.pod openssl-1.0.0a/doc/crypto/ERR_clear_error.pod
+--- openssl-1.0.0a.orig//doc/crypto/ERR_clear_error.pod 2000-02-01 01:36:58.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/ERR_clear_error.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -20,7 +20,7 @@
+
+ =head1 SEE ALSO
+
+-L<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>
++L<openssl_err(3)|openssl_err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/ERR_error_string.pod openssl-1.0.0a/doc/crypto/ERR_error_string.pod
+--- openssl-1.0.0a.orig//doc/crypto/ERR_error_string.pod 2004-11-14 15:11:37.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/ERR_error_string.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -60,7 +60,7 @@
+
+ =head1 SEE ALSO
+
+-L<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>,
++L<openssl_err(3)|openssl_err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>,
+ L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)>,
+ L<SSL_load_error_strings(3)|SSL_load_error_strings(3)>
+ L<ERR_print_errors(3)|ERR_print_errors(3)>
+diff -Naur openssl-1.0.0a.orig//doc/crypto/ERR_get_error.pod openssl-1.0.0a/doc/crypto/ERR_get_error.pod
+--- openssl-1.0.0a.orig//doc/crypto/ERR_get_error.pod 2002-11-29 14:21:54.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/ERR_get_error.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -61,7 +61,7 @@
+
+ =head1 SEE ALSO
+
+-L<err(3)|err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>,
++L<openssl_err(3)|openssl_err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>,
+ L<ERR_GET_LIB(3)|ERR_GET_LIB(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/ERR_GET_LIB.pod openssl-1.0.0a/doc/crypto/ERR_GET_LIB.pod
+--- openssl-1.0.0a.orig//doc/crypto/ERR_GET_LIB.pod 2000-02-01 01:36:58.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/ERR_GET_LIB.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -41,7 +41,7 @@
+
+ =head1 SEE ALSO
+
+-L<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>
++L<openssl_err(3)|openssl_err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/ERR_load_crypto_strings.pod openssl-1.0.0a/doc/crypto/ERR_load_crypto_strings.pod
+--- openssl-1.0.0a.orig//doc/crypto/ERR_load_crypto_strings.pod 2000-02-24 11:55:08.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/ERR_load_crypto_strings.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -35,7 +35,7 @@
+
+ =head1 SEE ALSO
+
+-L<err(3)|err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>
++L<openssl_err(3)|openssl_err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/ERR_load_strings.pod openssl-1.0.0a/doc/crypto/ERR_load_strings.pod
+--- openssl-1.0.0a.orig//doc/crypto/ERR_load_strings.pod 2000-02-24 11:55:08.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/ERR_load_strings.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -43,7 +43,7 @@
+
+ =head1 SEE ALSO
+
+-L<err(3)|err(3)>, L<ERR_load_strings(3)|ERR_load_strings(3)>
++L<openssl_err(3)|openssl_err(3)>, L<ERR_load_strings(3)|ERR_load_strings(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/err.pod openssl-1.0.0a/doc/crypto/err.pod
+--- openssl-1.0.0a.orig//doc/crypto/err.pod 2002-07-10 20:35:46.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/err.pod 1970-01-01 01:00:00.000000000 +0100
+@@ -1,187 +0,0 @@
+-=pod
+-
+-=head1 NAME
+-
+-err - error codes
+-
+-=head1 SYNOPSIS
+-
+- #include <openssl/err.h>
+-
+- unsigned long ERR_get_error(void);
+- unsigned long ERR_peek_error(void);
+- unsigned long ERR_get_error_line(const char **file, int *line);
+- unsigned long ERR_peek_error_line(const char **file, int *line);
+- unsigned long ERR_get_error_line_data(const char **file, int *line,
+- const char **data, int *flags);
+- unsigned long ERR_peek_error_line_data(const char **file, int *line,
+- const char **data, int *flags);
+-
+- int ERR_GET_LIB(unsigned long e);
+- int ERR_GET_FUNC(unsigned long e);
+- int ERR_GET_REASON(unsigned long e);
+-
+- void ERR_clear_error(void);
+-
+- char *ERR_error_string(unsigned long e, char *buf);
+- const char *ERR_lib_error_string(unsigned long e);
+- const char *ERR_func_error_string(unsigned long e);
+- const char *ERR_reason_error_string(unsigned long e);
+-
+- void ERR_print_errors(BIO *bp);
+- void ERR_print_errors_fp(FILE *fp);
+-
+- void ERR_load_crypto_strings(void);
+- void ERR_free_strings(void);
+-
+- void ERR_remove_state(unsigned long pid);
+-
+- void ERR_put_error(int lib, int func, int reason, const char *file,
+- int line);
+- void ERR_add_error_data(int num, ...);
+-
+- void ERR_load_strings(int lib,ERR_STRING_DATA str[]);
+- unsigned long ERR_PACK(int lib, int func, int reason);
+- int ERR_get_next_error_library(void);
+-
+-=head1 DESCRIPTION
+-
+-When a call to the OpenSSL library fails, this is usually signalled
+-by the return value, and an error code is stored in an error queue
+-associated with the current thread. The B<err> library provides
+-functions to obtain these error codes and textual error messages.
+-
+-The L<ERR_get_error(3)|ERR_get_error(3)> manpage describes how to
+-access error codes.
+-
+-Error codes contain information about where the error occurred, and
+-what went wrong. L<ERR_GET_LIB(3)|ERR_GET_LIB(3)> describes how to
+-extract this information. A method to obtain human-readable error
+-messages is described in L<ERR_error_string(3)|ERR_error_string(3)>.
+-
+-L<ERR_clear_error(3)|ERR_clear_error(3)> can be used to clear the
+-error queue.
+-
+-Note that L<ERR_remove_state(3)|ERR_remove_state(3)> should be used to
+-avoid memory leaks when threads are terminated.
+-
+-=head1 ADDING NEW ERROR CODES TO OPENSSL
+-
+-See L<ERR_put_error(3)> if you want to record error codes in the
+-OpenSSL error system from within your application.
+-
+-The remainder of this section is of interest only if you want to add
+-new error codes to OpenSSL or add error codes from external libraries.
+-
+-=head2 Reporting errors
+-
+-Each sub-library has a specific macro XXXerr() that is used to report
+-errors. Its first argument is a function code B<XXX_F_...>, the second
+-argument is a reason code B<XXX_R_...>. Function codes are derived
+-from the function names; reason codes consist of textual error
+-descriptions. For example, the function ssl23_read() reports a
+-"handshake failure" as follows:
+-
+- SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE);
+-
+-Function and reason codes should consist of upper case characters,
+-numbers and underscores only. The error file generation script translates
+-function codes into function names by looking in the header files
+-for an appropriate function name, if none is found it just uses
+-the capitalized form such as "SSL23_READ" in the above example.
+-
+-The trailing section of a reason code (after the "_R_") is translated
+-into lower case and underscores changed to spaces.
+-
+-When you are using new function or reason codes, run B<make errors>.
+-The necessary B<#define>s will then automatically be added to the
+-sub-library's header file.
+-
+-Although a library will normally report errors using its own specific
+-XXXerr macro, another library's macro can be used. This is normally
+-only done when a library wants to include ASN1 code which must use
+-the ASN1err() macro.
+-
+-=head2 Adding new libraries
+-
+-When adding a new sub-library to OpenSSL, assign it a library number
+-B<ERR_LIB_XXX>, define a macro XXXerr() (both in B<err.h>), add its
+-name to B<ERR_str_libraries[]> (in B<crypto/err/err.c>), and add
+-C<ERR_load_XXX_strings()> to the ERR_load_crypto_strings() function
+-(in B<crypto/err/err_all.c>). Finally, add an entry
+-
+- L XXX xxx.h xxx_err.c
+-
+-to B<crypto/err/openssl.ec>, and add B<xxx_err.c> to the Makefile.
+-Running B<make errors> will then generate a file B<xxx_err.c>, and
+-add all error codes used in the library to B<xxx.h>.
+-
+-Additionally the library include file must have a certain form.
+-Typically it will initially look like this:
+-
+- #ifndef HEADER_XXX_H
+- #define HEADER_XXX_H
+-
+- #ifdef __cplusplus
+- extern "C" {
+- #endif
+-
+- /* Include files */
+-
+- #include <openssl/bio.h>
+- #include <openssl/x509.h>
+-
+- /* Macros, structures and function prototypes */
+-
+-
+- /* BEGIN ERROR CODES */
+-
+-The B<BEGIN ERROR CODES> sequence is used by the error code
+-generation script as the point to place new error codes, any text
+-after this point will be overwritten when B<make errors> is run.
+-The closing #endif etc will be automatically added by the script.
+-
+-The generated C error code file B<xxx_err.c> will load the header
+-files B<stdio.h>, B<openssl/err.h> and B<openssl/xxx.h> so the
+-header file must load any additional header files containing any
+-definitions it uses.
+-
+-=head1 USING ERROR CODES IN EXTERNAL LIBRARIES
+-
+-It is also possible to use OpenSSL's error code scheme in external
+-libraries. The library needs to load its own codes and call the OpenSSL
+-error code insertion script B<mkerr.pl> explicitly to add codes to
+-the header file and generate the C error code file. This will normally
+-be done if the external library needs to generate new ASN1 structures
+-but it can also be used to add more general purpose error code handling.
+-
+-TBA more details
+-
+-=head1 INTERNALS
+-
+-The error queues are stored in a hash table with one B<ERR_STATE>
+-entry for each pid. ERR_get_state() returns the current thread's
+-B<ERR_STATE>. An B<ERR_STATE> can hold up to B<ERR_NUM_ERRORS> error
+-codes. When more error codes are added, the old ones are overwritten,
+-on the assumption that the most recent errors are most important.
+-
+-Error strings are also stored in hash table. The hash tables can
+-be obtained by calling ERR_get_err_state_table(void) and
+-ERR_get_string_table(void) respectively.
+-
+-=head1 SEE ALSO
+-
+-L<CRYPTO_set_id_callback(3)|CRYPTO_set_id_callback(3)>,
+-L<CRYPTO_set_locking_callback(3)|CRYPTO_set_locking_callback(3)>,
+-L<ERR_get_error(3)|ERR_get_error(3)>,
+-L<ERR_GET_LIB(3)|ERR_GET_LIB(3)>,
+-L<ERR_clear_error(3)|ERR_clear_error(3)>,
+-L<ERR_error_string(3)|ERR_error_string(3)>,
+-L<ERR_print_errors(3)|ERR_print_errors(3)>,
+-L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)>,
+-L<ERR_remove_state(3)|ERR_remove_state(3)>,
+-L<ERR_put_error(3)|ERR_put_error(3)>,
+-L<ERR_load_strings(3)|ERR_load_strings(3)>,
+-L<SSL_get_error(3)|SSL_get_error(3)>
+-
+-=cut
+diff -Naur openssl-1.0.0a.orig//doc/crypto/ERR_print_errors.pod openssl-1.0.0a/doc/crypto/ERR_print_errors.pod
+--- openssl-1.0.0a.orig//doc/crypto/ERR_print_errors.pod 2000-02-01 01:36:59.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/ERR_print_errors.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -38,7 +38,7 @@
+
+ =head1 SEE ALSO
+
+-L<err(3)|err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>,
++L<openssl_err(3)|openssl_err(3)>, L<ERR_error_string(3)|ERR_error_string(3)>,
+ L<ERR_get_error(3)|ERR_get_error(3)>,
+ L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)>,
+ L<SSL_load_error_strings(3)|SSL_load_error_strings(3)>
+diff -Naur openssl-1.0.0a.orig//doc/crypto/ERR_put_error.pod openssl-1.0.0a/doc/crypto/ERR_put_error.pod
+--- openssl-1.0.0a.orig//doc/crypto/ERR_put_error.pod 2000-02-24 11:55:08.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/ERR_put_error.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -34,7 +34,7 @@
+
+ =head1 SEE ALSO
+
+-L<err(3)|err(3)>, L<ERR_load_strings(3)|ERR_load_strings(3)>
++L<openssl_err(3)|openssl_err(3)>, L<ERR_load_strings(3)|ERR_load_strings(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/ERR_remove_state.pod openssl-1.0.0a/doc/crypto/ERR_remove_state.pod
+--- openssl-1.0.0a.orig//doc/crypto/ERR_remove_state.pod 2000-05-19 08:54:42.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/ERR_remove_state.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -25,7 +25,7 @@
+
+ =head1 SEE ALSO
+
+-L<err(3)|err(3)>
++L<openssl_err(3)|openssl_err(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/EVP_BytesToKey.pod openssl-1.0.0a/doc/crypto/EVP_BytesToKey.pod
+--- openssl-1.0.0a.orig//doc/crypto/EVP_BytesToKey.pod 2004-11-25 17:47:30.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/EVP_BytesToKey.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -59,7 +59,7 @@
+
+ =head1 SEE ALSO
+
+-L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
++L<evp(3)|evp(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/EVP_OpenInit.pod openssl-1.0.0a/doc/crypto/EVP_OpenInit.pod
+--- openssl-1.0.0a.orig//doc/crypto/EVP_OpenInit.pod 2000-09-23 08:16:14.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/EVP_OpenInit.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -54,7 +54,7 @@
+
+ =head1 SEE ALSO
+
+-L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
++L<evp(3)|evp(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
+ L<EVP_SealInit(3)|EVP_SealInit(3)>
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/EVP_SealInit.pod openssl-1.0.0a/doc/crypto/EVP_SealInit.pod
+--- openssl-1.0.0a.orig//doc/crypto/EVP_SealInit.pod 2005-03-29 18:50:08.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/EVP_SealInit.pod 2010-09-01 19:36:31.612125737 +0100
+@@ -74,7 +74,7 @@
+
+ =head1 SEE ALSO
+
+-L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
++L<evp(3)|evp(3)>, L<openssl_rand(3)|openssl_rand(3)>,
+ L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
+ L<EVP_OpenInit(3)|EVP_OpenInit(3)>
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/EVP_SignInit.pod openssl-1.0.0a/doc/crypto/EVP_SignInit.pod
+--- openssl-1.0.0a.orig//doc/crypto/EVP_SignInit.pod 2006-07-12 13:31:29.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/EVP_SignInit.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -89,7 +89,7 @@
+ =head1 SEE ALSO
+
+ L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>,
+-L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<err(3)|err(3)>,
++L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<openssl_err(3)|openssl_err(3)>,
+ L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>,
+ L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>,
+ L<sha(3)|sha(3)>, L<dgst(1)|dgst(1)>
+diff -Naur openssl-1.0.0a.orig//doc/crypto/EVP_VerifyInit.pod openssl-1.0.0a/doc/crypto/EVP_VerifyInit.pod
+--- openssl-1.0.0a.orig//doc/crypto/EVP_VerifyInit.pod 2006-07-12 13:31:30.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/EVP_VerifyInit.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -80,7 +80,7 @@
+
+ L<evp(3)|evp(3)>,
+ L<EVP_SignInit(3)|EVP_SignInit(3)>,
+-L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<err(3)|err(3)>,
++L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<openssl_err(3)|openssl_err(3)>,
+ L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>,
+ L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>,
+ L<sha(3)|sha(3)>, L<dgst(1)|dgst(1)>
+diff -Naur openssl-1.0.0a.orig//doc/crypto/OPENSSL_config.pod openssl-1.0.0a/doc/crypto/OPENSSL_config.pod
+--- openssl-1.0.0a.orig//doc/crypto/OPENSSL_config.pod 2005-06-03 00:19:56.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/OPENSSL_config.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -73,7 +73,7 @@
+ =head1 SEE ALSO
+
+ L<conf(5)|conf(5)>, L<CONF_load_modules_file(3)|CONF_load_modules_file(3)>,
+-L<CONF_modules_free(3),CONF_modules_free(3)>
++L<CONF_modules_free(3)|CONF_modules_free(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/openssl_err.pod openssl-1.0.0a/doc/crypto/openssl_err.pod
+--- openssl-1.0.0a.orig//doc/crypto/openssl_err.pod 1970-01-01 01:00:00.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/openssl_err.pod 2010-09-01 19:36:31.624124669 +0100
+@@ -0,0 +1,187 @@
++=pod
++
++=head1 NAME
++
++openssl_err - error codes
++
++=head1 SYNOPSIS
++
++ #include <openssl/err.h>
++
++ unsigned long ERR_get_error(void);
++ unsigned long ERR_peek_error(void);
++ unsigned long ERR_get_error_line(const char **file, int *line);
++ unsigned long ERR_peek_error_line(const char **file, int *line);
++ unsigned long ERR_get_error_line_data(const char **file, int *line,
++ const char **data, int *flags);
++ unsigned long ERR_peek_error_line_data(const char **file, int *line,
++ const char **data, int *flags);
++
++ int ERR_GET_LIB(unsigned long e);
++ int ERR_GET_FUNC(unsigned long e);
++ int ERR_GET_REASON(unsigned long e);
++
++ void ERR_clear_error(void);
++
++ char *ERR_error_string(unsigned long e, char *buf);
++ const char *ERR_lib_error_string(unsigned long e);
++ const char *ERR_func_error_string(unsigned long e);
++ const char *ERR_reason_error_string(unsigned long e);
++
++ void ERR_print_errors(BIO *bp);
++ void ERR_print_errors_fp(FILE *fp);
++
++ void ERR_load_crypto_strings(void);
++ void ERR_free_strings(void);
++
++ void ERR_remove_state(unsigned long pid);
++
++ void ERR_put_error(int lib, int func, int reason, const char *file,
++ int line);
++ void ERR_add_error_data(int num, ...);
++
++ void ERR_load_strings(int lib,ERR_STRING_DATA str[]);
++ unsigned long ERR_PACK(int lib, int func, int reason);
++ int ERR_get_next_error_library(void);
++
++=head1 DESCRIPTION
++
++When a call to the OpenSSL library fails, this is usually signalled
++by the return value, and an error code is stored in an error queue
++associated with the current thread. The B<err> library provides
++functions to obtain these error codes and textual error messages.
++
++The L<ERR_get_error(3)|ERR_get_error(3)> manpage describes how to
++access error codes.
++
++Error codes contain information about where the error occurred, and
++what went wrong. L<ERR_GET_LIB(3)|ERR_GET_LIB(3)> describes how to
++extract this information. A method to obtain human-readable error
++messages is described in L<ERR_error_string(3)|ERR_error_string(3)>.
++
++L<ERR_clear_error(3)|ERR_clear_error(3)> can be used to clear the
++error queue.
++
++Note that L<ERR_remove_state(3)|ERR_remove_state(3)> should be used to
++avoid memory leaks when threads are terminated.
++
++=head1 ADDING NEW ERROR CODES TO OPENSSL
++
++See L<ERR_put_error(3)> if you want to record error codes in the
++OpenSSL error system from within your application.
++
++The remainder of this section is of interest only if you want to add
++new error codes to OpenSSL or add error codes from external libraries.
++
++=head2 Reporting errors
++
++Each sub-library has a specific macro XXXerr() that is used to report
++errors. Its first argument is a function code B<XXX_F_...>, the second
++argument is a reason code B<XXX_R_...>. Function codes are derived
++from the function names; reason codes consist of textual error
++descriptions. For example, the function ssl23_read() reports a
++"handshake failure" as follows:
++
++ SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE);
++
++Function and reason codes should consist of upper case characters,
++numbers and underscores only. The error file generation script translates
++function codes into function names by looking in the header files
++for an appropriate function name, if none is found it just uses
++the capitalized form such as "SSL23_READ" in the above example.
++
++The trailing section of a reason code (after the "_R_") is translated
++into lower case and underscores changed to spaces.
++
++When you are using new function or reason codes, run B<make errors>.
++The necessary B<#define>s will then automatically be added to the
++sub-library's header file.
++
++Although a library will normally report errors using its own specific
++XXXerr macro, another library's macro can be used. This is normally
++only done when a library wants to include ASN1 code which must use
++the ASN1err() macro.
++
++=head2 Adding new libraries
++
++When adding a new sub-library to OpenSSL, assign it a library number
++B<ERR_LIB_XXX>, define a macro XXXerr() (both in B<err.h>), add its
++name to B<ERR_str_libraries[]> (in B<crypto/err/err.c>), and add
++C<ERR_load_XXX_strings()> to the ERR_load_crypto_strings() function
++(in B<crypto/err/err_all.c>). Finally, add an entry
++
++ L XXX xxx.h xxx_err.c
++
++to B<crypto/err/openssl.ec>, and add B<xxx_err.c> to the Makefile.
++Running B<make errors> will then generate a file B<xxx_err.c>, and
++add all error codes used in the library to B<xxx.h>.
++
++Additionally the library include file must have a certain form.
++Typically it will initially look like this:
++
++ #ifndef HEADER_XXX_H
++ #define HEADER_XXX_H
++
++ #ifdef __cplusplus
++ extern "C" {
++ #endif
++
++ /* Include files */
++
++ #include <openssl/bio.h>
++ #include <openssl/x509.h>
++
++ /* Macros, structures and function prototypes */
++
++
++ /* BEGIN ERROR CODES */
++
++The B<BEGIN ERROR CODES> sequence is used by the error code
++generation script as the point to place new error codes, any text
++after this point will be overwritten when B<make errors> is run.
++The closing #endif etc will be automatically added by the script.
++
++The generated C error code file B<xxx_err.c> will load the header
++files B<stdio.h>, B<openssl/err.h> and B<openssl/xxx.h> so the
++header file must load any additional header files containing any
++definitions it uses.
++
++=head1 USING ERROR CODES IN EXTERNAL LIBRARIES
++
++It is also possible to use OpenSSL's error code scheme in external
++libraries. The library needs to load its own codes and call the OpenSSL
++error code insertion script B<mkerr.pl> explicitly to add codes to
++the header file and generate the C error code file. This will normally
++be done if the external library needs to generate new ASN1 structures
++but it can also be used to add more general purpose error code handling.
++
++TBA more details
++
++=head1 INTERNALS
++
++The error queues are stored in a hash table with one B<ERR_STATE>
++entry for each pid. ERR_get_state() returns the current thread's
++B<ERR_STATE>. An B<ERR_STATE> can hold up to B<ERR_NUM_ERRORS> error
++codes. When more error codes are added, the old ones are overwritten,
++on the assumption that the most recent errors are most important.
++
++Error strings are also stored in hash table. The hash tables can
++be obtained by calling ERR_get_err_state_table(void) and
++ERR_get_string_table(void) respectively.
++
++=head1 SEE ALSO
++
++L<CRYPTO_set_id_callback(3)|CRYPTO_set_id_callback(3)>,
++L<CRYPTO_set_locking_callback(3)|CRYPTO_set_locking_callback(3)>,
++L<ERR_get_error(3)|ERR_get_error(3)>,
++L<ERR_GET_LIB(3)|ERR_GET_LIB(3)>,
++L<ERR_clear_error(3)|ERR_clear_error(3)>,
++L<ERR_error_string(3)|ERR_error_string(3)>,
++L<ERR_print_errors(3)|ERR_print_errors(3)>,
++L<ERR_load_crypto_strings(3)|ERR_load_crypto_strings(3)>,
++L<ERR_remove_state(3)|ERR_remove_state(3)>,
++L<ERR_put_error(3)|ERR_put_error(3)>,
++L<ERR_load_strings(3)|ERR_load_strings(3)>,
++L<SSL_get_error(3)|SSL_get_error(3)>
++
++=cut
+diff -Naur openssl-1.0.0a.orig//doc/crypto/openssl_rand.pod openssl-1.0.0a/doc/crypto/openssl_rand.pod
+--- openssl-1.0.0a.orig//doc/crypto/openssl_rand.pod 1970-01-01 01:00:00.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/openssl_rand.pod 2010-09-01 19:36:31.624124669 +0100
+@@ -0,0 +1,175 @@
++=pod
++
++=head1 NAME
++
++openssl_rand - pseudo-random number generator
++
++=head1 SYNOPSIS
++
++ #include <openssl/rand.h>
++
++ int RAND_set_rand_engine(ENGINE *engine);
++
++ int RAND_bytes(unsigned char *buf, int num);
++ int RAND_pseudo_bytes(unsigned char *buf, int num);
++
++ void RAND_seed(const void *buf, int num);
++ void RAND_add(const void *buf, int num, int entropy);
++ int RAND_status(void);
++
++ int RAND_load_file(const char *file, long max_bytes);
++ int RAND_write_file(const char *file);
++ const char *RAND_file_name(char *file, size_t num);
++
++ int RAND_egd(const char *path);
++
++ void RAND_set_rand_method(const RAND_METHOD *meth);
++ const RAND_METHOD *RAND_get_rand_method(void);
++ RAND_METHOD *RAND_SSLeay(void);
++
++ void RAND_cleanup(void);
++
++ /* For Win32 only */
++ void RAND_screen(void);
++ int RAND_event(UINT, WPARAM, LPARAM);
++
++=head1 DESCRIPTION
++
++Since the introduction of the ENGINE API, the recommended way of controlling
++default implementations is by using the ENGINE API functions. The default
++B<RAND_METHOD>, as set by RAND_set_rand_method() and returned by
++RAND_get_rand_method(), is only used if no ENGINE has been set as the default
++"rand" implementation. Hence, these two functions are no longer the recommened
++way to control defaults.
++
++If an alternative B<RAND_METHOD> implementation is being used (either set
++directly or as provided by an ENGINE module), then it is entirely responsible
++for the generation and management of a cryptographically secure PRNG stream. The
++mechanisms described below relate solely to the software PRNG implementation
++built in to OpenSSL and used by default.
++
++These functions implement a cryptographically secure pseudo-random
++number generator (PRNG). It is used by other library functions for
++example to generate random keys, and applications can use it when they
++need randomness.
++
++A cryptographic PRNG must be seeded with unpredictable data such as
++mouse movements or keys pressed at random by the user. This is
++described in L<RAND_add(3)|RAND_add(3)>. Its state can be saved in a seed file
++(see L<RAND_load_file(3)|RAND_load_file(3)>) to avoid having to go through the
++seeding process whenever the application is started.
++
++L<RAND_bytes(3)|RAND_bytes(3)> describes how to obtain random data from the
++PRNG.
++
++=head1 INTERNALS
++
++The RAND_SSLeay() method implements a PRNG based on a cryptographic
++hash function.
++
++The following description of its design is based on the SSLeay
++documentation:
++
++First up I will state the things I believe I need for a good RNG.
++
++=over 4
++
++=item 1
++
++A good hashing algorithm to mix things up and to convert the RNG 'state'
++to random numbers.
++
++=item 2
++
++An initial source of random 'state'.
++
++=item 3
++
++The state should be very large. If the RNG is being used to generate
++4096 bit RSA keys, 2 2048 bit random strings are required (at a minimum).
++If your RNG state only has 128 bits, you are obviously limiting the
++search space to 128 bits, not 2048. I'm probably getting a little
++carried away on this last point but it does indicate that it may not be
++a bad idea to keep quite a lot of RNG state. It should be easier to
++break a cipher than guess the RNG seed data.
++
++=item 4
++
++Any RNG seed data should influence all subsequent random numbers
++generated. This implies that any random seed data entered will have
++an influence on all subsequent random numbers generated.
++
++=item 5
++
++When using data to seed the RNG state, the data used should not be
++extractable from the RNG state. I believe this should be a
++requirement because one possible source of 'secret' semi random
++data would be a private key or a password. This data must
++not be disclosed by either subsequent random numbers or a
++'core' dump left by a program crash.
++
++=item 6
++
++Given the same initial 'state', 2 systems should deviate in their RNG state
++(and hence the random numbers generated) over time if at all possible.
++
++=item 7
++
++Given the random number output stream, it should not be possible to determine
++the RNG state or the next random number.
++
++=back
++
++The algorithm is as follows.
++
++There is global state made up of a 1023 byte buffer (the 'state'), a
++working hash value ('md'), and a counter ('count').
++
++Whenever seed data is added, it is inserted into the 'state' as
++follows.
++
++The input is chopped up into units of 20 bytes (or less for
++the last block). Each of these blocks is run through the hash
++function as follows: The data passed to the hash function
++is the current 'md', the same number of bytes from the 'state'
++(the location determined by in incremented looping index) as
++the current 'block', the new key data 'block', and 'count'
++(which is incremented after each use).
++The result of this is kept in 'md' and also xored into the
++'state' at the same locations that were used as input into the
++hash function. I
++believe this system addresses points 1 (hash function; currently
++SHA-1), 3 (the 'state'), 4 (via the 'md'), 5 (by the use of a hash
++function and xor).
++
++When bytes are extracted from the RNG, the following process is used.
++For each group of 10 bytes (or less), we do the following:
++
++Input into the hash function the local 'md' (which is initialized from
++the global 'md' before any bytes are generated), the bytes that are to
++be overwritten by the random bytes, and bytes from the 'state'
++(incrementing looping index). From this digest output (which is kept
++in 'md'), the top (up to) 10 bytes are returned to the caller and the
++bottom 10 bytes are xored into the 'state'.
++
++Finally, after we have finished 'num' random bytes for the caller,
++'count' (which is incremented) and the local and global 'md' are fed
++into the hash function and the results are kept in the global 'md'.
++
++I believe the above addressed points 1 (use of SHA-1), 6 (by hashing
++into the 'state' the 'old' data from the caller that is about to be
++overwritten) and 7 (by not using the 10 bytes given to the caller to
++update the 'state', but they are used to update 'md').
++
++So of the points raised, only 2 is not addressed (but see
++L<RAND_add(3)|RAND_add(3)>).
++
++=head1 SEE ALSO
++
++L<BN_rand(3)|BN_rand(3)>, L<RAND_add(3)|RAND_add(3)>,
++L<RAND_load_file(3)|RAND_load_file(3)>, L<RAND_egd(3)|RAND_egd(3)>,
++L<RAND_bytes(3)|RAND_bytes(3)>,
++L<RAND_set_rand_method(3)|RAND_set_rand_method(3)>,
++L<RAND_cleanup(3)|RAND_cleanup(3)>
++
++=cut
+diff -Naur openssl-1.0.0a.orig//doc/crypto/openssl_threads.pod openssl-1.0.0a/doc/crypto/openssl_threads.pod
+--- openssl-1.0.0a.orig//doc/crypto/openssl_threads.pod 1970-01-01 01:00:00.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/openssl_threads.pod 2010-09-01 19:36:31.624124669 +0100
+@@ -0,0 +1,175 @@
++=pod
++
++=head1 NAME
++
++CRYPTO_set_locking_callback, CRYPTO_set_id_callback, CRYPTO_num_locks,
++CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback,
++CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid,
++CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support
++
++=head1 SYNOPSIS
++
++ #include <openssl/crypto.h>
++
++ void CRYPTO_set_locking_callback(void (*locking_function)(int mode,
++ int n, const char *file, int line));
++
++ void CRYPTO_set_id_callback(unsigned long (*id_function)(void));
++
++ int CRYPTO_num_locks(void);
++
++
++ /* struct CRYPTO_dynlock_value needs to be defined by the user */
++ struct CRYPTO_dynlock_value;
++
++ void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *
++ (*dyn_create_function)(char *file, int line));
++ void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)
++ (int mode, struct CRYPTO_dynlock_value *l,
++ const char *file, int line));
++ void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)
++ (struct CRYPTO_dynlock_value *l, const char *file, int line));
++
++ int CRYPTO_get_new_dynlockid(void);
++
++ void CRYPTO_destroy_dynlockid(int i);
++
++ void CRYPTO_lock(int mode, int n, const char *file, int line);
++
++ #define CRYPTO_w_lock(type) \
++ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
++ #define CRYPTO_w_unlock(type) \
++ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
++ #define CRYPTO_r_lock(type) \
++ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
++ #define CRYPTO_r_unlock(type) \
++ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
++ #define CRYPTO_add(addr,amount,type) \
++ CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
++
++=head1 DESCRIPTION
++
++OpenSSL can safely be used in multi-threaded applications provided
++that at least two callback functions are set.
++
++locking_function(int mode, int n, const char *file, int line) is
++needed to perform locking on shared data structures.
++(Note that OpenSSL uses a number of global data structures that
++will be implicitly shared whenever multiple threads use OpenSSL.)
++Multi-threaded applications will crash at random if it is not set.
++
++locking_function() must be able to handle up to CRYPTO_num_locks()
++different mutex locks. It sets the B<n>-th lock if B<mode> &
++B<CRYPTO_LOCK>, and releases it otherwise.
++
++B<file> and B<line> are the file number of the function setting the
++lock. They can be useful for debugging.
++
++id_function(void) is a function that returns a thread ID, for example
++pthread_self() if it returns an integer (see NOTES below). It isn't
++needed on Windows nor on platforms where getpid() returns a different
++ID for each thread (see NOTES below).
++
++Additionally, OpenSSL supports dynamic locks, and sometimes, some parts
++of OpenSSL need it for better performance. To enable this, the following
++is required:
++
++=over 4
++
++=item *
++Three additional callback function, dyn_create_function, dyn_lock_function
++and dyn_destroy_function.
++
++=item *
++A structure defined with the data that each lock needs to handle.
++
++=back
++
++struct CRYPTO_dynlock_value has to be defined to contain whatever structure
++is needed to handle locks.
++
++dyn_create_function(const char *file, int line) is needed to create a
++lock. Multi-threaded applications might crash at random if it is not set.
++
++dyn_lock_function(int mode, CRYPTO_dynlock *l, const char *file, int line)
++is needed to perform locking off dynamic lock numbered n. Multi-threaded
++applications might crash at random if it is not set.
++
++dyn_destroy_function(CRYPTO_dynlock *l, const char *file, int line) is
++needed to destroy the lock l. Multi-threaded applications might crash at
++random if it is not set.
++
++CRYPTO_get_new_dynlockid() is used to create locks. It will call
++dyn_create_function for the actual creation.
++
++CRYPTO_destroy_dynlockid() is used to destroy locks. It will call
++dyn_destroy_function for the actual destruction.
++
++CRYPTO_lock() is used to lock and unlock the locks. mode is a bitfield
++describing what should be done with the lock. n is the number of the
++lock as returned from CRYPTO_get_new_dynlockid(). mode can be combined
++from the following values. These values are pairwise exclusive, with
++undefined behaviour if misused (for example, CRYPTO_READ and CRYPTO_WRITE
++should not be used together):
++
++ CRYPTO_LOCK 0x01
++ CRYPTO_UNLOCK 0x02
++ CRYPTO_READ 0x04
++ CRYPTO_WRITE 0x08
++
++=head1 RETURN VALUES
++
++CRYPTO_num_locks() returns the required number of locks.
++
++CRYPTO_get_new_dynlockid() returns the index to the newly created lock.
++
++The other functions return no values.
++
++=head1 NOTES
++
++You can find out if OpenSSL was configured with thread support:
++
++ #define OPENSSL_THREAD_DEFINES
++ #include <openssl/opensslconf.h>
++ #if defined(OPENSSL_THREADS)
++ // thread support enabled
++ #else
++ // no thread support
++ #endif
++
++Also, dynamic locks are currently not used internally by OpenSSL, but
++may do so in the future.
++
++Defining id_function(void) has it's own issues. Generally speaking,
++pthread_self() should be used, even on platforms where getpid() gives
++different answers in each thread, since that may depend on the machine
++the program is run on, not the machine where the program is being
++compiled. For instance, Red Hat 8 Linux and earlier used
++LinuxThreads, whose getpid() returns a different value for each
++thread. Red Hat 9 Linux and later use NPTL, which is
++Posix-conformant, and has a getpid() that returns the same value for
++all threads in a process. A program compiled on Red Hat 8 and run on
++Red Hat 9 will therefore see getpid() returning the same value for
++all threads.
++
++There is still the issue of platforms where pthread_self() returns
++something other than an integer. This is a bit unusual, and this
++manual has no cookbook solution for that case.
++
++=head1 EXAMPLES
++
++B<crypto/threads/mttest.c> shows examples of the callback functions on
++Solaris, Irix and Win32.
++
++=head1 HISTORY
++
++CRYPTO_set_locking_callback() and CRYPTO_set_id_callback() are
++available in all versions of SSLeay and OpenSSL.
++CRYPTO_num_locks() was added in OpenSSL 0.9.4.
++All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev.
++
++=head1 SEE ALSO
++
++L<crypto(3)|crypto(3)>
++
++=cut
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RAND_add.pod openssl-1.0.0a/doc/crypto/RAND_add.pod
+--- openssl-1.0.0a.orig//doc/crypto/RAND_add.pod 2000-03-22 15:30:03.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/RAND_add.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -65,7 +65,7 @@
+
+ =head1 SEE ALSO
+
+-L<rand(3)|rand(3)>, L<RAND_egd(3)|RAND_egd(3)>,
++L<openssl_rand(3)|openssl_rand(3)>, L<RAND_egd(3)|RAND_egd(3)>,
+ L<RAND_load_file(3)|RAND_load_file(3)>, L<RAND_cleanup(3)|RAND_cleanup(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RAND_bytes.pod openssl-1.0.0a/doc/crypto/RAND_bytes.pod
+--- openssl-1.0.0a.orig//doc/crypto/RAND_bytes.pod 2007-09-24 12:01:18.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/RAND_bytes.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -38,7 +38,7 @@
+
+ =head1 SEE ALSO
+
+-L<rand(3)|rand(3)>, L<ERR_get_error(3)|ERR_get_error(3)>,
++L<openssl_rand(3)|openssl_rand(3)>, L<ERR_get_error(3)|ERR_get_error(3)>,
+ L<RAND_add(3)|RAND_add(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RAND_cleanup.pod openssl-1.0.0a/doc/crypto/RAND_cleanup.pod
+--- openssl-1.0.0a.orig//doc/crypto/RAND_cleanup.pod 2000-01-27 01:25:06.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/RAND_cleanup.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -20,7 +20,7 @@
+
+ =head1 SEE ALSO
+
+-L<rand(3)|rand(3)>
++L<openssl_rand(3)|openssl_rand(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RAND_egd.pod openssl-1.0.0a/doc/crypto/RAND_egd.pod
+--- openssl-1.0.0a.orig//doc/crypto/RAND_egd.pod 2008-11-10 11:26:44.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/RAND_egd.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -72,7 +72,7 @@
+
+ =head1 SEE ALSO
+
+-L<rand(3)|rand(3)>, L<RAND_add(3)|RAND_add(3)>,
++L<openssl_rand(3)|openssl_rand(3)>, L<RAND_add(3)|RAND_add(3)>,
+ L<RAND_cleanup(3)|RAND_cleanup(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RAND_load_file.pod openssl-1.0.0a/doc/crypto/RAND_load_file.pod
+--- openssl-1.0.0a.orig//doc/crypto/RAND_load_file.pod 2001-03-21 15:25:56.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/RAND_load_file.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -43,7 +43,7 @@
+
+ =head1 SEE ALSO
+
+-L<rand(3)|rand(3)>, L<RAND_add(3)|RAND_add(3)>, L<RAND_cleanup(3)|RAND_cleanup(3)>
++L<openssl_rand(3)|openssl_rand(3)>, L<RAND_add(3)|RAND_add(3)>, L<RAND_cleanup(3)|RAND_cleanup(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/rand.pod openssl-1.0.0a/doc/crypto/rand.pod
+--- openssl-1.0.0a.orig//doc/crypto/rand.pod 2002-08-05 17:27:01.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/rand.pod 1970-01-01 01:00:00.000000000 +0100
+@@ -1,175 +0,0 @@
+-=pod
+-
+-=head1 NAME
+-
+-rand - pseudo-random number generator
+-
+-=head1 SYNOPSIS
+-
+- #include <openssl/rand.h>
+-
+- int RAND_set_rand_engine(ENGINE *engine);
+-
+- int RAND_bytes(unsigned char *buf, int num);
+- int RAND_pseudo_bytes(unsigned char *buf, int num);
+-
+- void RAND_seed(const void *buf, int num);
+- void RAND_add(const void *buf, int num, int entropy);
+- int RAND_status(void);
+-
+- int RAND_load_file(const char *file, long max_bytes);
+- int RAND_write_file(const char *file);
+- const char *RAND_file_name(char *file, size_t num);
+-
+- int RAND_egd(const char *path);
+-
+- void RAND_set_rand_method(const RAND_METHOD *meth);
+- const RAND_METHOD *RAND_get_rand_method(void);
+- RAND_METHOD *RAND_SSLeay(void);
+-
+- void RAND_cleanup(void);
+-
+- /* For Win32 only */
+- void RAND_screen(void);
+- int RAND_event(UINT, WPARAM, LPARAM);
+-
+-=head1 DESCRIPTION
+-
+-Since the introduction of the ENGINE API, the recommended way of controlling
+-default implementations is by using the ENGINE API functions. The default
+-B<RAND_METHOD>, as set by RAND_set_rand_method() and returned by
+-RAND_get_rand_method(), is only used if no ENGINE has been set as the default
+-"rand" implementation. Hence, these two functions are no longer the recommened
+-way to control defaults.
+-
+-If an alternative B<RAND_METHOD> implementation is being used (either set
+-directly or as provided by an ENGINE module), then it is entirely responsible
+-for the generation and management of a cryptographically secure PRNG stream. The
+-mechanisms described below relate solely to the software PRNG implementation
+-built in to OpenSSL and used by default.
+-
+-These functions implement a cryptographically secure pseudo-random
+-number generator (PRNG). It is used by other library functions for
+-example to generate random keys, and applications can use it when they
+-need randomness.
+-
+-A cryptographic PRNG must be seeded with unpredictable data such as
+-mouse movements or keys pressed at random by the user. This is
+-described in L<RAND_add(3)|RAND_add(3)>. Its state can be saved in a seed file
+-(see L<RAND_load_file(3)|RAND_load_file(3)>) to avoid having to go through the
+-seeding process whenever the application is started.
+-
+-L<RAND_bytes(3)|RAND_bytes(3)> describes how to obtain random data from the
+-PRNG.
+-
+-=head1 INTERNALS
+-
+-The RAND_SSLeay() method implements a PRNG based on a cryptographic
+-hash function.
+-
+-The following description of its design is based on the SSLeay
+-documentation:
+-
+-First up I will state the things I believe I need for a good RNG.
+-
+-=over 4
+-
+-=item 1
+-
+-A good hashing algorithm to mix things up and to convert the RNG 'state'
+-to random numbers.
+-
+-=item 2
+-
+-An initial source of random 'state'.
+-
+-=item 3
+-
+-The state should be very large. If the RNG is being used to generate
+-4096 bit RSA keys, 2 2048 bit random strings are required (at a minimum).
+-If your RNG state only has 128 bits, you are obviously limiting the
+-search space to 128 bits, not 2048. I'm probably getting a little
+-carried away on this last point but it does indicate that it may not be
+-a bad idea to keep quite a lot of RNG state. It should be easier to
+-break a cipher than guess the RNG seed data.
+-
+-=item 4
+-
+-Any RNG seed data should influence all subsequent random numbers
+-generated. This implies that any random seed data entered will have
+-an influence on all subsequent random numbers generated.
+-
+-=item 5
+-
+-When using data to seed the RNG state, the data used should not be
+-extractable from the RNG state. I believe this should be a
+-requirement because one possible source of 'secret' semi random
+-data would be a private key or a password. This data must
+-not be disclosed by either subsequent random numbers or a
+-'core' dump left by a program crash.
+-
+-=item 6
+-
+-Given the same initial 'state', 2 systems should deviate in their RNG state
+-(and hence the random numbers generated) over time if at all possible.
+-
+-=item 7
+-
+-Given the random number output stream, it should not be possible to determine
+-the RNG state or the next random number.
+-
+-=back
+-
+-The algorithm is as follows.
+-
+-There is global state made up of a 1023 byte buffer (the 'state'), a
+-working hash value ('md'), and a counter ('count').
+-
+-Whenever seed data is added, it is inserted into the 'state' as
+-follows.
+-
+-The input is chopped up into units of 20 bytes (or less for
+-the last block). Each of these blocks is run through the hash
+-function as follows: The data passed to the hash function
+-is the current 'md', the same number of bytes from the 'state'
+-(the location determined by in incremented looping index) as
+-the current 'block', the new key data 'block', and 'count'
+-(which is incremented after each use).
+-The result of this is kept in 'md' and also xored into the
+-'state' at the same locations that were used as input into the
+-hash function. I
+-believe this system addresses points 1 (hash function; currently
+-SHA-1), 3 (the 'state'), 4 (via the 'md'), 5 (by the use of a hash
+-function and xor).
+-
+-When bytes are extracted from the RNG, the following process is used.
+-For each group of 10 bytes (or less), we do the following:
+-
+-Input into the hash function the local 'md' (which is initialized from
+-the global 'md' before any bytes are generated), the bytes that are to
+-be overwritten by the random bytes, and bytes from the 'state'
+-(incrementing looping index). From this digest output (which is kept
+-in 'md'), the top (up to) 10 bytes are returned to the caller and the
+-bottom 10 bytes are xored into the 'state'.
+-
+-Finally, after we have finished 'num' random bytes for the caller,
+-'count' (which is incremented) and the local and global 'md' are fed
+-into the hash function and the results are kept in the global 'md'.
+-
+-I believe the above addressed points 1 (use of SHA-1), 6 (by hashing
+-into the 'state' the 'old' data from the caller that is about to be
+-overwritten) and 7 (by not using the 10 bytes given to the caller to
+-update the 'state', but they are used to update 'md').
+-
+-So of the points raised, only 2 is not addressed (but see
+-L<RAND_add(3)|RAND_add(3)>).
+-
+-=head1 SEE ALSO
+-
+-L<BN_rand(3)|BN_rand(3)>, L<RAND_add(3)|RAND_add(3)>,
+-L<RAND_load_file(3)|RAND_load_file(3)>, L<RAND_egd(3)|RAND_egd(3)>,
+-L<RAND_bytes(3)|RAND_bytes(3)>,
+-L<RAND_set_rand_method(3)|RAND_set_rand_method(3)>,
+-L<RAND_cleanup(3)|RAND_cleanup(3)>
+-
+-=cut
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RAND_set_rand_method.pod openssl-1.0.0a/doc/crypto/RAND_set_rand_method.pod
+--- openssl-1.0.0a.orig//doc/crypto/RAND_set_rand_method.pod 2007-11-19 09:18:03.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/RAND_set_rand_method.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -67,7 +67,7 @@
+
+ =head1 SEE ALSO
+
+-L<rand(3)|rand(3)>, L<engine(3)|engine(3)>
++L<openssl_rand(3)|openssl_rand(3)>, L<engine(3)|engine(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RSA_blinding_on.pod openssl-1.0.0a/doc/crypto/RSA_blinding_on.pod
+--- openssl-1.0.0a.orig//doc/crypto/RSA_blinding_on.pod 2000-02-24 11:55:10.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/RSA_blinding_on.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -34,7 +34,7 @@
+
+ =head1 SEE ALSO
+
+-L<rsa(3)|rsa(3)>, L<rand(3)|rand(3)>
++L<rsa(3)|rsa(3)>, L<openssl_rand(3)|openssl_rand(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RSA_generate_key.pod openssl-1.0.0a/doc/crypto/RSA_generate_key.pod
+--- openssl-1.0.0a.orig//doc/crypto/RSA_generate_key.pod 2002-09-25 14:33:27.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/RSA_generate_key.pod 2010-09-01 19:36:31.616125383 +0100
+@@ -59,7 +59,7 @@
+
+ =head1 SEE ALSO
+
+-L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>,
++L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>, L<rsa(3)|rsa(3)>,
+ L<RSA_free(3)|RSA_free(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/rsa.pod openssl-1.0.0a/doc/crypto/rsa.pod
+--- openssl-1.0.0a.orig//doc/crypto/rsa.pod 2002-08-04 22:08:36.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/rsa.pod 2010-09-01 19:36:31.624124669 +0100
+@@ -108,7 +108,7 @@
+ =head1 SEE ALSO
+
+ L<rsa(1)|rsa(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>,
+-L<rand(3)|rand(3)>, L<engine(3)|engine(3)>, L<RSA_new(3)|RSA_new(3)>,
++L<openssl_rand(3)|openssl_rand(3)>, L<engine(3)|engine(3)>, L<RSA_new(3)|RSA_new(3)>,
+ L<RSA_public_encrypt(3)|RSA_public_encrypt(3)>,
+ L<RSA_sign(3)|RSA_sign(3)>, L<RSA_size(3)|RSA_size(3)>,
+ L<RSA_generate_key(3)|RSA_generate_key(3)>,
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RSA_public_encrypt.pod openssl-1.0.0a/doc/crypto/RSA_public_encrypt.pod
+--- openssl-1.0.0a.orig//doc/crypto/RSA_public_encrypt.pod 2004-03-23 21:01:34.000000000 +0000
++++ openssl-1.0.0a/doc/crypto/RSA_public_encrypt.pod 2010-09-01 19:36:31.620125025 +0100
+@@ -73,7 +73,7 @@
+
+ =head1 SEE ALSO
+
+-L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>,
++L<ERR_get_error(3)|ERR_get_error(3)>, L<openssl_rand(3)|openssl_rand(3)>, L<rsa(3)|rsa(3)>,
+ L<RSA_size(3)|RSA_size(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/RSA_sign_ASN1_OCTET_STRING.pod openssl-1.0.0a/doc/crypto/RSA_sign_ASN1_OCTET_STRING.pod
+--- openssl-1.0.0a.orig//doc/crypto/RSA_sign_ASN1_OCTET_STRING.pod 2002-09-25 14:33:28.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/RSA_sign_ASN1_OCTET_STRING.pod 2010-09-01 19:36:31.620125025 +0100
+@@ -48,7 +48,7 @@
+ =head1 SEE ALSO
+
+ L<ERR_get_error(3)|ERR_get_error(3)>, L<objects(3)|objects(3)>,
+-L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<RSA_sign(3)|RSA_sign(3)>,
++L<openssl_rand(3)|openssl_rand(3)>, L<rsa(3)|rsa(3)>, L<RSA_sign(3)|RSA_sign(3)>,
+ L<RSA_verify(3)|RSA_verify(3)>
+
+ =head1 HISTORY
+diff -Naur openssl-1.0.0a.orig//doc/crypto/threads.pod openssl-1.0.0a/doc/crypto/threads.pod
+--- openssl-1.0.0a.orig//doc/crypto/threads.pod 2009-10-01 00:40:52.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/threads.pod 1970-01-01 01:00:00.000000000 +0100
+@@ -1,210 +0,0 @@
+-=pod
+-
+-=head1 NAME
+-
+-CRYPTO_THREADID_set_callback, CRYPTO_THREADID_get_callback,
+-CRYPTO_THREADID_current, CRYPTO_THREADID_cmp, CRYPTO_THREADID_cpy,
+-CRYPTO_THREADID_hash, CRYPTO_set_locking_callback, CRYPTO_num_locks,
+-CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback,
+-CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid,
+-CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support
+-
+-=head1 SYNOPSIS
+-
+- #include <openssl/crypto.h>
+-
+- /* Don't use this structure directly. */
+- typedef struct crypto_threadid_st
+- {
+- void *ptr;
+- unsigned long val;
+- } CRYPTO_THREADID;
+- /* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */
+- void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val);
+- void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr);
+- int CRYPTO_THREADID_set_callback(void (*threadid_func)(CRYPTO_THREADID *));
+- void (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *);
+- void CRYPTO_THREADID_current(CRYPTO_THREADID *id);
+- int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a,
+- const CRYPTO_THREADID *b);
+- void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest,
+- const CRYPTO_THREADID *src);
+- unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id);
+-
+- int CRYPTO_num_locks(void);
+-
+- /* struct CRYPTO_dynlock_value needs to be defined by the user */
+- struct CRYPTO_dynlock_value;
+-
+- void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *
+- (*dyn_create_function)(char *file, int line));
+- void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)
+- (int mode, struct CRYPTO_dynlock_value *l,
+- const char *file, int line));
+- void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)
+- (struct CRYPTO_dynlock_value *l, const char *file, int line));
+-
+- int CRYPTO_get_new_dynlockid(void);
+-
+- void CRYPTO_destroy_dynlockid(int i);
+-
+- void CRYPTO_lock(int mode, int n, const char *file, int line);
+-
+- #define CRYPTO_w_lock(type) \
+- CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+- #define CRYPTO_w_unlock(type) \
+- CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+- #define CRYPTO_r_lock(type) \
+- CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+- #define CRYPTO_r_unlock(type) \
+- CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+- #define CRYPTO_add(addr,amount,type) \
+- CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
+-
+-=head1 DESCRIPTION
+-
+-OpenSSL can safely be used in multi-threaded applications provided
+-that at least two callback functions are set, locking_function and
+-threadid_func.
+-
+-locking_function(int mode, int n, const char *file, int line) is
+-needed to perform locking on shared data structures.
+-(Note that OpenSSL uses a number of global data structures that
+-will be implicitly shared whenever multiple threads use OpenSSL.)
+-Multi-threaded applications will crash at random if it is not set.
+-
+-locking_function() must be able to handle up to CRYPTO_num_locks()
+-different mutex locks. It sets the B<n>-th lock if B<mode> &
+-B<CRYPTO_LOCK>, and releases it otherwise.
+-
+-B<file> and B<line> are the file number of the function setting the
+-lock. They can be useful for debugging.
+-
+-threadid_func(CRYPTO_THREADID *id) is needed to record the currently-executing
+-thread's identifier into B<id>. The implementation of this callback should not
+-fill in B<id> directly, but should use CRYPTO_THREADID_set_numeric() if thread
+-IDs are numeric, or CRYPTO_THREADID_set_pointer() if they are pointer-based.
+-If the application does not register such a callback using
+-CRYPTO_THREADID_set_callback(), then a default implementation is used - on
+-Windows and BeOS this uses the system's default thread identifying APIs, and on
+-all other platforms it uses the address of B<errno>. The latter is satisfactory
+-for thread-safety if and only if the platform has a thread-local error number
+-facility.
+-
+-Once threadid_func() is registered, or if the built-in default implementation is
+-to be used;
+-
+-=over 4
+-
+-=item *
+-CRYPTO_THREADID_current() records the currently-executing thread ID into the
+-given B<id> object.
+-
+-=item *
+-CRYPTO_THREADID_cmp() compares two thread IDs (returning zero for equality, ie.
+-the same semantics as memcmp()).
+-
+-=item *
+-CRYPTO_THREADID_cpy() duplicates a thread ID value,
+-
+-=item *
+-CRYPTO_THREADID_hash() returns a numeric value usable as a hash-table key. This
+-is usually the exact numeric or pointer-based thread ID used internally, however
+-this also handles the unusual case where pointers are larger than 'long'
+-variables and the platform's thread IDs are pointer-based - in this case, mixing
+-is done to attempt to produce a unique numeric value even though it is not as
+-wide as the platform's true thread IDs.
+-
+-=back
+-
+-Additionally, OpenSSL supports dynamic locks, and sometimes, some parts
+-of OpenSSL need it for better performance. To enable this, the following
+-is required:
+-
+-=over 4
+-
+-=item *
+-Three additional callback function, dyn_create_function, dyn_lock_function
+-and dyn_destroy_function.
+-
+-=item *
+-A structure defined with the data that each lock needs to handle.
+-
+-=back
+-
+-struct CRYPTO_dynlock_value has to be defined to contain whatever structure
+-is needed to handle locks.
+-
+-dyn_create_function(const char *file, int line) is needed to create a
+-lock. Multi-threaded applications might crash at random if it is not set.
+-
+-dyn_lock_function(int mode, CRYPTO_dynlock *l, const char *file, int line)
+-is needed to perform locking off dynamic lock numbered n. Multi-threaded
+-applications might crash at random if it is not set.
+-
+-dyn_destroy_function(CRYPTO_dynlock *l, const char *file, int line) is
+-needed to destroy the lock l. Multi-threaded applications might crash at
+-random if it is not set.
+-
+-CRYPTO_get_new_dynlockid() is used to create locks. It will call
+-dyn_create_function for the actual creation.
+-
+-CRYPTO_destroy_dynlockid() is used to destroy locks. It will call
+-dyn_destroy_function for the actual destruction.
+-
+-CRYPTO_lock() is used to lock and unlock the locks. mode is a bitfield
+-describing what should be done with the lock. n is the number of the
+-lock as returned from CRYPTO_get_new_dynlockid(). mode can be combined
+-from the following values. These values are pairwise exclusive, with
+-undefined behaviour if misused (for example, CRYPTO_READ and CRYPTO_WRITE
+-should not be used together):
+-
+- CRYPTO_LOCK 0x01
+- CRYPTO_UNLOCK 0x02
+- CRYPTO_READ 0x04
+- CRYPTO_WRITE 0x08
+-
+-=head1 RETURN VALUES
+-
+-CRYPTO_num_locks() returns the required number of locks.
+-
+-CRYPTO_get_new_dynlockid() returns the index to the newly created lock.
+-
+-The other functions return no values.
+-
+-=head1 NOTES
+-
+-You can find out if OpenSSL was configured with thread support:
+-
+- #define OPENSSL_THREAD_DEFINES
+- #include <openssl/opensslconf.h>
+- #if defined(OPENSSL_THREADS)
+- // thread support enabled
+- #else
+- // no thread support
+- #endif
+-
+-Also, dynamic locks are currently not used internally by OpenSSL, but
+-may do so in the future.
+-
+-=head1 EXAMPLES
+-
+-B<crypto/threads/mttest.c> shows examples of the callback functions on
+-Solaris, Irix and Win32.
+-
+-=head1 HISTORY
+-
+-CRYPTO_set_locking_callback() is
+-available in all versions of SSLeay and OpenSSL.
+-CRYPTO_num_locks() was added in OpenSSL 0.9.4.
+-All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev.
+-B<CRYPTO_THREADID> and associated functions were introduced in OpenSSL 1.0.0
+-to replace (actually, deprecate) the previous CRYPTO_set_id_callback(),
+-CRYPTO_get_id_callback(), and CRYPTO_thread_id() functions which assumed
+-thread IDs to always be represented by 'unsigned long'.
+-
+-=head1 SEE ALSO
+-
+-L<crypto(3)|crypto(3)>
+-
+-=cut
+diff -Naur openssl-1.0.0a.orig//doc/crypto/X509_NAME_ENTRY_get_object.pod openssl-1.0.0a/doc/crypto/X509_NAME_ENTRY_get_object.pod
+--- openssl-1.0.0a.orig//doc/crypto/X509_NAME_ENTRY_get_object.pod 2006-05-14 12:27:59.000000000 +0100
++++ openssl-1.0.0a/doc/crypto/X509_NAME_ENTRY_get_object.pod 2010-09-01 19:36:31.620125025 +0100
+@@ -65,7 +65,7 @@
+ =head1 SEE ALSO
+
+ L<ERR_get_error(3)|ERR_get_error(3)>, L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>,
+-L<OBJ_nid2obj(3),OBJ_nid2obj(3)>
++L<OBJ_nid2obj(3)|OBJ_nid2obj(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/ssl/SSL_get_error.pod openssl-1.0.0a/doc/ssl/SSL_get_error.pod
+--- openssl-1.0.0a.orig//doc/ssl/SSL_get_error.pod 2005-03-30 12:50:14.000000000 +0100
++++ openssl-1.0.0a/doc/ssl/SSL_get_error.pod 2010-09-01 19:36:40.259360162 +0100
+@@ -105,7 +105,7 @@
+
+ =head1 SEE ALSO
+
+-L<ssl(3)|ssl(3)>, L<err(3)|err(3)>
++L<ssl(3)|ssl(3)>, L<openssl_err(3)|openssl_err(3)>
+
+ =head1 HISTORY
+
+diff -Naur openssl-1.0.0a.orig//doc/ssl/SSL_want.pod openssl-1.0.0a/doc/ssl/SSL_want.pod
+--- openssl-1.0.0a.orig//doc/ssl/SSL_want.pod 2005-03-30 12:50:14.000000000 +0100
++++ openssl-1.0.0a/doc/ssl/SSL_want.pod 2010-09-01 19:36:40.259360162 +0100
+@@ -72,6 +72,6 @@
+
+ =head1 SEE ALSO
+
+-L<ssl(3)|ssl(3)>, L<err(3)|err(3)>, L<SSL_get_error(3)|SSL_get_error(3)>
++L<ssl(3)|ssl(3)>, L<openssl_err(3)|openssl_err(3)>, L<SSL_get_error(3)|SSL_get_error(3)>
+
+ =cut
+diff -Naur openssl-1.0.0a.orig//FAQ openssl-1.0.0a/FAQ
+--- openssl-1.0.0a.orig//FAQ 2010-06-01 14:31:36.000000000 +0100
++++ openssl-1.0.0a/FAQ 2010-09-01 19:39:19.677244857 +0100
+@@ -724,7 +724,7 @@
+ CRYPTO_set_id_callback(), for all versions of OpenSSL up to and
+ including 0.9.8[abc...]. As of version 1.0.0, CRYPTO_set_id_callback()
+ and associated APIs are deprecated by CRYPTO_THREADID_set_callback()
+-and friends. This is described in the threads(3) manpage.
++and friends. This is described in the openssl_threads(3) manpage.
+
+ * I've compiled a program under Windows and it crashes: why?
+
diff --git a/core/openssl/no-rpath.patch b/core/openssl/no-rpath.patch
new file mode 100644
index 000000000..ebd95e23d
--- /dev/null
+++ b/core/openssl/no-rpath.patch
@@ -0,0 +1,11 @@
+--- Makefile.shared.no-rpath 2005-06-23 22:47:54.000000000 +0200
++++ Makefile.shared 2005-11-16 22:35:37.000000000 +0100
+@@ -153,7 +153,7 @@
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
+
+-DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
++DO_GNU_APP=LDFLAGS="$(CFLAGS)"
+
+ #This is rather special. It's a special target with which one can link
+ #applications without bothering with any features that have anything to
diff --git a/core/openvpn/PKGBUILD b/core/openvpn/PKGBUILD
new file mode 100644
index 000000000..3926f5f1c
--- /dev/null
+++ b/core/openvpn/PKGBUILD
@@ -0,0 +1,61 @@
+# $Id: PKGBUILD 98730 2010-11-13 13:55:32Z thomas $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgname=openvpn
+pkgver=2.1.4
+pkgrel=1
+pkgdesc="An easy-to-use, robust, and highly configurable VPN (Virtual Private Network)"
+arch=(i686 x86_64)
+url="http://openvpn.net/index.php/open-source.html"
+depends=('openssl' 'lzo2')
+license=('custom')
+backup=(usr/share/openvpn/easy-rsa/vars
+ usr/share/openvpn/easy-rsa/openssl.cnf
+ etc/conf.d/openvpn-tapdev)
+source=(http://swupdate.openvpn.net/community/releases/openvpn-${pkgver}.tar.gz
+ openvpn.rc
+ openvpn-tapdev.rc
+ openvpn-tapdev.conf)
+md5sums=('96a11868082685802489254f03ff3bde'
+ 'a3809b9727f0c2af2d0770f5c7442db2'
+ 'd2c48e970088d679dd3c2afd914ff731'
+ '722f483c9e3ce2ec66d3301aaf7cf3d5')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ # Build openvpn
+ CFLAGS="$CFLAGS -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn\\\"" ./configure --prefix=/usr --enable-password-save --mandir=/usr/share/man
+ make
+
+ # Build plugins
+ for plug in auth-pam down-root; do
+ cd $srcdir/$pkgname-$pkgver/plugin/$plug
+ make
+ done
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ # Install openvpn
+ make DESTDIR=$pkgdir install
+ install -d -m755 $pkgdir/etc/openvpn
+ # Install examples
+ install -d -m755 $pkgdir/usr/share/openvpn
+ cp -r sample-config-files $pkgdir/usr/share/openvpn/examples
+ find $pkgdir/usr/share/openvpn -type f -exec chmod 644 {} \;
+ find $pkgdir/usr/share/openvpn -type d -exec chmod 755 {} \;
+ # Install license
+ install -D -m644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
+ # Install plugins
+ for plug in auth-pam down-root; do
+ cd $srcdir/$pkgname-$pkgver/plugin/$plug
+ install -D -m755 openvpn-$plug.so $pkgdir/usr/lib/openvpn/openvpn-$plug.so
+ done
+ # Install easy-rsa
+ cd $srcdir/$pkgname-$pkgver
+ make -C easy-rsa/2.0 install DESTDIR=$pkgdir PREFIX=usr/share/openvpn/easy-rsa
+ # Install rc scripts
+ install -D -m755 $srcdir/openvpn.rc $pkgdir/etc/rc.d/openvpn
+ install -D -m755 $srcdir/openvpn-tapdev.rc $pkgdir/etc/rc.d/openvpn-tapdev
+ install -D -m644 $srcdir/openvpn-tapdev.conf $pkgdir/etc/conf.d/openvpn-tapdev
+}
diff --git a/core/openvpn/openvpn-tapdev.conf b/core/openvpn/openvpn-tapdev.conf
new file mode 100644
index 000000000..afa5586dd
--- /dev/null
+++ b/core/openvpn/openvpn-tapdev.conf
@@ -0,0 +1,12 @@
+#
+# /etc/conf.d/openvpn-tapdev
+#
+# Place openvpn-tapdev before network into your DAEMONS array
+# This will create permanent tap devices which you can use for bridging
+#
+# Example:
+# TAPDEVS="work home"
+# Will create two tap devices "work" and "home"
+#
+
+TAPDEVS=""
diff --git a/core/openvpn/openvpn-tapdev.rc b/core/openvpn/openvpn-tapdev.rc
new file mode 100755
index 000000000..2c51f8248
--- /dev/null
+++ b/core/openvpn/openvpn-tapdev.rc
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+. /etc/conf.d/openvpn-tapdev
+
+case "$1" in
+ start)
+ stat_busy "Creating tap devices for OpenVPN ... "
+ success=0
+ for tapdev in ${TAPDEVS}; do
+ stat_append "${tapdev} "
+ /usr/sbin/openvpn --mktun --dev-type tap --dev ${tapdev} >/dev/null 2>&1 || success=$?
+ done
+ if [ $success -eq 0 ]; then
+ add_daemon openvpn-tapdev
+ stat_done
+ else
+ stat_fail
+ fi
+ ;;
+ stop)
+ stat_busy "Destroying tap devices for OpenVPN ..."
+ for tapdev in ${TAPDEVS}; do
+ stat_append "${tapdev} "
+ /usr/sbin/openvpn --rmtun --dev-type tap --dev ${tapdev} >/dev/null 2>&1 || success=$?
+ done
+ rm_daemon openvpn-tapdev
+ stat_done
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/openvpn/openvpn.rc b/core/openvpn/openvpn.rc
new file mode 100755
index 000000000..96c28b641
--- /dev/null
+++ b/core/openvpn/openvpn.rc
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+CFGDIR="/etc/openvpn"
+STATEDIR="/var/run/openvpn"
+
+case "$1" in
+ start)
+ stat_busy "Starting OpenVPN ... "
+ success=0
+ mkdir -p "${STATEDIR}"
+ for cfg in "${CFGDIR}"/*.conf; do
+ stat_append "$(basename "${cfg}" .conf) "
+ /usr/sbin/openvpn --daemon --writepid "${STATEDIR}"/"$(basename "${cfg}" .conf)".pid --cd "${CFGDIR}" --config "${cfg}" || success=$?
+ done
+ if [ $success -eq 0 ]; then
+ add_daemon openvpn
+ stat_done
+ else
+ stat_fail
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping OpenVPN ..."
+ for pidfile in "${STATEDIR}"/*.pid; do
+ stat_append "$(basename "${pidfile}" .pid) "
+ kill $(cat "${pidfile}" 2>/dev/null) 2>/dev/null
+ rm -f "${pidfile}"
+ done
+ rm_daemon openvpn
+ stat_done
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/pacman/PKGBUILD b/core/pacman/PKGBUILD
new file mode 100644
index 000000000..d8513e4e6
--- /dev/null
+++ b/core/pacman/PKGBUILD
@@ -0,0 +1,71 @@
+# $Id: PKGBUILD 116411 2011-03-23 16:23:20Z dan $
+# Maintainer: Dan McGee <dan@archlinux.org>
+
+pkgname=pacman
+pkgver=3.5.1
+pkgrel=1
+pkgdesc="A library-based package manager with dependency support"
+arch=('i686' 'x86_64')
+url="http://www.archlinux.org/pacman/"
+license=('GPL')
+groups=('base')
+depends=('bash' 'libarchive>=2.8.4' 'libfetch>=2.28' 'pacman-mirrorlist')
+optdepends=('fakeroot: for makepkg usage as normal user'
+ 'curl: for rankmirrors usage')
+backup=(etc/pacman.conf etc/makepkg.conf)
+install=pacman.install
+options=(!libtool)
+source=(ftp://ftp.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz
+ pacman.conf
+ pacman.conf.x86_64
+ makepkg.conf)
+md5sums=('6e609a6cf0af2a49a0f8b35fc2459131'
+ 'e99eb721b6b704f68c5f47468507c102'
+ '28e6a1f97ed3c47a3961ad00d2a43822'
+ 'a8684989d3dfad5a6e1bcf95af3e571b')
+
+# keep an upgrade path for older installations
+PKGEXT='.pkg.tar.gz'
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --localstatedir=/var --enable-doc
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install
+
+ # install Arch specific stuff
+ mkdir -p $pkgdir/etc
+ case "$CARCH" in
+ i686)
+ install -m644 $srcdir/pacman.conf $pkgdir/etc/pacman.conf
+ mycarch="i686"
+ mychost="i686-pc-linux-gnu"
+ myflags="-march=i686 "
+ ;;
+ x86_64)
+ install -m644 $srcdir/pacman.conf.x86_64 $pkgdir/etc/pacman.conf
+ mycarch="x86_64"
+ mychost="x86_64-unknown-linux-gnu"
+ myflags="-march=x86-64 "
+ ;;
+ esac
+ install -m644 $srcdir/makepkg.conf $pkgdir/etc/
+ # set things correctly in the default conf file
+ sed -i $pkgdir/etc/makepkg.conf \
+ -e "s|@CARCH[@]|$mycarch|g" \
+ -e "s|@CHOST[@]|$mychost|g" \
+ -e "s|@CARCHFLAGS[@]|$myflags|g"
+
+ # install completion files
+ mkdir -p $pkgdir/etc/bash_completion.d/
+ install -m644 contrib/bash_completion $pkgdir/etc/bash_completion.d/pacman
+ mkdir -p $pkgdir/usr/share/zsh/site-functions/
+ install -m644 contrib/zsh_completion $pkgdir/usr/share/zsh/site-functions/_pacman
+}
+
+# vim: set ts=2 sw=2 et:
diff --git a/core/pacman/makepkg.conf b/core/pacman/makepkg.conf
new file mode 100644
index 000000000..a655e935f
--- /dev/null
+++ b/core/pacman/makepkg.conf
@@ -0,0 +1,114 @@
+#
+# /etc/makepkg.conf
+#
+
+#########################################################################
+# SOURCE ACQUISITION
+#########################################################################
+#
+#-- The download utilities that makepkg should use to acquire sources
+# Format: 'protocol::agent'
+DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u'
+ 'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'
+ 'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate -O %o %u'
+ 'rsync::/usr/bin/rsync -z %u %o'
+ 'scp::/usr/bin/scp -C %u %o')
+
+# Other common tools:
+# /usr/bin/snarf
+# /usr/bin/lftpget -c
+# /usr/bin/curl
+
+#########################################################################
+# ARCHITECTURE, COMPILE FLAGS
+#########################################################################
+#
+CARCH="@CARCH@"
+CHOST="@CHOST@"
+
+#-- Exclusive: will only run on @CARCH@
+# -march (or -mcpu) builds exclusively for an architecture
+# -mtune optimizes for an architecture, but builds for whole processor family
+CFLAGS="@CARCHFLAGS@-mtune=generic -O2 -pipe"
+CXXFLAGS="@CARCHFLAGS@-mtune=generic -O2 -pipe"
+LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed"
+#-- Make Flags: change this for DistCC/SMP systems
+#MAKEFLAGS="-j2"
+
+#########################################################################
+# BUILD ENVIRONMENT
+#########################################################################
+#
+# Defaults: BUILDENV=(fakeroot !distcc color !ccache check)
+# A negated environment option will do the opposite of the comments below.
+#
+#-- fakeroot: Allow building packages as a non-root user
+#-- distcc: Use the Distributed C/C++/ObjC compiler
+#-- color: Colorize output messages
+#-- ccache: Use ccache to cache compilation
+#-- check: Run the check() function if present in the PKGBUILD
+#
+BUILDENV=(fakeroot !distcc color !ccache check)
+#
+#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
+#-- specify a space-delimited list of hosts running in the DistCC cluster.
+#DISTCC_HOSTS=""
+
+#########################################################################
+# GLOBAL PACKAGE OPTIONS
+# These are default values for the options=() settings
+#########################################################################
+#
+# Default: OPTIONS=(strip docs libtool emptydirs zipman purge)
+# A negated option will do the opposite of the comments below.
+#
+#-- strip: Strip symbols from binaries/libraries
+#-- docs: Save doc directories specified by DOC_DIRS
+#-- libtool: Leave libtool (.la) files in packages
+#-- emptydirs: Leave empty directories in packages
+#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
+#-- purge: Remove files specified by PURGE_TARGETS
+#
+OPTIONS=(strip docs libtool emptydirs zipman purge)
+
+#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
+INTEGRITY_CHECK=(md5)
+#-- Options to be used when stripping binaries. See `man strip' for details.
+STRIP_BINARIES="--strip-all"
+#-- Options to be used when stripping shared libraries. See `man strip' for details.
+STRIP_SHARED="--strip-unneeded"
+#-- Options to be used when stripping static libraries. See `man strip' for details.
+STRIP_STATIC="--strip-debug"
+#-- Manual (man and info) directories to compress (if zipman is specified)
+MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
+#-- Doc directories to remove (if !docs is specified)
+DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
+#-- Files to be removed from all packages (if purge is specified)
+PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
+
+#########################################################################
+# PACKAGE OUTPUT
+#########################################################################
+#
+# Default: put built package and cached source in build directory
+#
+#-- Destination: specify a fixed directory where all packages will be placed
+#PKGDEST=/home/packages
+#-- Source cache: specify a fixed directory where source files will be cached
+#SRCDEST=/home/sources
+#-- Source packages: specify a fixed directory where all src packages will be placed
+#SRCPKGDEST=/home/srcpackages
+#-- Packager: name/email of the person or organization building packages
+#PACKAGER="John Doe <john@doe.com>"
+
+#########################################################################
+# EXTENSION DEFAULTS
+#########################################################################
+#
+# WARNING: Do NOT modify these variables unless you know what you are
+# doing.
+#
+PKGEXT='.pkg.tar.xz'
+SRCEXT='.src.tar.gz'
+
+# vim: set ft=sh ts=2 sw=2 et:
diff --git a/core/pacman/pacman.conf b/core/pacman/pacman.conf
new file mode 100644
index 000000000..206ab23b4
--- /dev/null
+++ b/core/pacman/pacman.conf
@@ -0,0 +1,80 @@
+#
+# /etc/pacman.conf
+#
+# See the pacman.conf(5) manpage for option and repository directives
+
+#
+# GENERAL OPTIONS
+#
+[options]
+# The following paths are commented out with their default values listed.
+# If you wish to use different paths, uncomment and update the paths.
+#RootDir = /
+#DBPath = /var/lib/pacman/
+#CacheDir = /var/cache/pacman/pkg/
+#LogFile = /var/log/pacman.log
+HoldPkg = pacman glibc
+# If upgrades are available for these packages they will be asked for first
+SyncFirst = pacman
+#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
+#XferCommand = /usr/bin/curl -C - -f %u > %o
+#CleanMethod = KeepInstalled
+Architecture = auto
+
+# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
+#IgnorePkg =
+#IgnoreGroup =
+
+#NoUpgrade =
+#NoExtract =
+
+# Misc options (all disabled by default)
+#UseSyslog
+#ShowSize
+#UseDelta
+#TotalDownload
+#CheckSpace
+
+#
+# REPOSITORIES
+# - can be defined here or included from another file
+# - pacman will search repositories in the order defined here
+# - local/custom mirrors can be added here or in separate files
+# - repositories listed first will take precedence when packages
+# have identical names, regardless of version number
+# - URLs will have $repo replaced by the name of the current repo
+# - URLs will have $arch replaced by the name of the architecture
+#
+# Repository entries are of the format:
+# [repo-name]
+# Server = ServerName
+# Include = IncludePath
+#
+# The header [repo-name] is crucial - it must be present and
+# uncommented to enable the repo.
+#
+
+# The testing repositories are disabled by default. To enable, uncomment the
+# repo name header and Include lines. You can add preferred servers immediately
+# after the header, and they will be used before the default mirrors.
+
+#[testing]
+#Include = /etc/pacman.d/mirrorlist
+
+[core]
+Include = /etc/pacman.d/mirrorlist
+
+[extra]
+Include = /etc/pacman.d/mirrorlist
+
+#[community-testing]
+#Include = /etc/pacman.d/mirrorlist
+
+[community]
+Include = /etc/pacman.d/mirrorlist
+
+# An example of a custom package repository. See the pacman manpage for
+# tips on creating your own repositories.
+#[custom]
+#Server = file:///home/custompkgs
+
diff --git a/core/pacman/pacman.conf.x86_64 b/core/pacman/pacman.conf.x86_64
new file mode 100644
index 000000000..a5bb2db61
--- /dev/null
+++ b/core/pacman/pacman.conf.x86_64
@@ -0,0 +1,85 @@
+#
+# /etc/pacman.conf
+#
+# See the pacman.conf(5) manpage for option and repository directives
+
+#
+# GENERAL OPTIONS
+#
+[options]
+# The following paths are commented out with their default values listed.
+# If you wish to use different paths, uncomment and update the paths.
+#RootDir = /
+#DBPath = /var/lib/pacman/
+#CacheDir = /var/cache/pacman/pkg/
+#LogFile = /var/log/pacman.log
+HoldPkg = pacman glibc
+# If upgrades are available for these packages they will be asked for first
+SyncFirst = pacman
+#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
+#XferCommand = /usr/bin/curl -C - -f %u > %o
+#CleanMethod = KeepInstalled
+Architecture = auto
+
+# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
+#IgnorePkg =
+#IgnoreGroup =
+
+#NoUpgrade =
+#NoExtract =
+
+# Misc options (all disabled by default)
+#UseSyslog
+#ShowSize
+#UseDelta
+#TotalDownload
+#CheckSpace
+
+#
+# REPOSITORIES
+# - can be defined here or included from another file
+# - pacman will search repositories in the order defined here
+# - local/custom mirrors can be added here or in separate files
+# - repositories listed first will take precedence when packages
+# have identical names, regardless of version number
+# - URLs will have $repo replaced by the name of the current repo
+# - URLs will have $arch replaced by the name of the architecture
+#
+# Repository entries are of the format:
+# [repo-name]
+# Server = ServerName
+# Include = IncludePath
+#
+# The header [repo-name] is crucial - it must be present and
+# uncommented to enable the repo.
+#
+
+# The testing repositories are disabled by default. To enable, uncomment the
+# repo name header and Include lines. You can add preferred servers immediately
+# after the header, and they will be used before the default mirrors.
+
+#[testing]
+#Include = /etc/pacman.d/mirrorlist
+
+[core]
+Include = /etc/pacman.d/mirrorlist
+
+[extra]
+Include = /etc/pacman.d/mirrorlist
+
+#[community-testing]
+#Include = /etc/pacman.d/mirrorlist
+
+[community]
+Include = /etc/pacman.d/mirrorlist
+
+# If you want to run 32 bit applications on your x86_64 system,
+# enable the multilib repository here.
+#[multilib]
+#Include = /etc/pacman.d/mirrorlist
+
+# An example of a custom package repository. See the pacman manpage for
+# tips on creating your own repositories.
+#[custom]
+#Server = file:///home/custompkgs
+
diff --git a/core/pacman/pacman.install b/core/pacman/pacman.install
new file mode 100644
index 000000000..0e598bb4b
--- /dev/null
+++ b/core/pacman/pacman.install
@@ -0,0 +1,62 @@
+#!/bin/sh
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ # one time stuff for md5sum issue with older pacman versions
+ if [ "$(vercmp $2 3.0.2)" -lt 0 ]; then
+ _resetbackups
+ fi
+ if [ "$(vercmp $2 3.5.0)" -lt 0 ]; then
+ _warnupgrade
+ fi
+}
+
+_warnupgrade() {
+ echo ">>> The pacman database format has changed as of pacman 3.5.0."
+ echo ">>> You will need to run \`pacman-db-upgrade\` as root."
+ echo ">>>"
+}
+
+_resetbackups() {
+ echo ">>> Performing one-time reset of NoUpgrade md5sums. After this reset"
+ echo ">>> you are able to remove all NoUpgrade lines of already protected"
+ echo ">>> files from pacman.conf."
+ echo ">>>"
+
+ # path variables
+ pacconf="/etc/pacman.conf"
+ dbpath="/var/lib/pacman/local"
+
+ # get a list of NoUpgrade files from the user's pacman.conf
+ echo ">>> Retrieving pacman.conf NoUpgrade list..."
+ config=$(grep "^NoUpgrade" $pacconf | cut -d'=' -f2)
+ # add the standard list of files, even if they are already above
+ config="$config \
+ etc/passwd etc/group etc/shadow etc/sudoers \
+ etc/fstab etc/raidtab etc/ld.so.conf \
+ etc/rc.conf etc/rc.local \
+ etc/modprobe.conf etc/modules.conf \
+ etc/lilo.conf boot/grub/menu.lst"
+
+ # blank md5sum for use in sed expression
+ zeroes='00000000000000000000000000000000'
+
+ for file in $config; do
+ echo ">>> -> finding owner of /$file..."
+ line=$(LC_ALL=C LANG=C pacman -Qo /$file 2>/dev/null)
+ # if file is owned by a package, go find its incorrectly stored sum
+ if [ ! -z "$line" ]; then
+ # get the name and version of the package owning file
+ name=$(echo $line | awk '{print $5}')
+ version=$(echo $line | awk '{print $6}')
+ # set the path to the backup array holding the md5sum
+ path="$dbpath/$name-$version/files"
+ # run a sed on the path to reset the line containing $file
+ # NOTE: literal tab characters in sed expression after $file
+ echo ">>> -> resetting sum of /$file..."
+ sed -i "s#$file [0-9a-fA-F]*#$file $zeroes#" $path
+ else
+ echo ">>> -> $file is unowned."
+ fi
+ done
+}
diff --git a/core/pam/PKGBUILD b/core/pam/PKGBUILD
new file mode 100644
index 000000000..3fe44d8aa
--- /dev/null
+++ b/core/pam/PKGBUILD
@@ -0,0 +1,56 @@
+# $Id: PKGBUILD 104544 2011-01-03 22:58:23Z tpowa $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=pam
+pkgver=1.1.3
+pkgrel=1
+pkgdesc="PAM (Pluggable Authentication Modules) library"
+arch=('i686' 'x86_64')
+license=('GPL2')
+url="http://www.kernel.org/pub/linux/libs/pam/"
+depends=('glibc' 'db' 'cracklib')
+makedepends=('flex' 'w3m' 'docbook-xml>=4.4' 'docbook-xsl')
+backup=(etc/security/{access.conf,group.conf,limits.conf,namespace.conf,namespace.init,pam_env.conf,time.conf} etc/pam.d/other etc/default/passwd etc/environment)
+source=(http://www.kernel.org/pub/linux/libs/pam/library/Linux-PAM-$pkgver.tar.bz2
+ ftp://ftp.suse.com/pub/people/kukuk/pam/pam_unix2/pam_unix2-2.6.tar.bz2
+ other)
+options=('!libtool' '!emptydirs')
+md5sums=('6db7fcb5db6253350e3a4648ceac40e7'
+ 'e2788389a6c59224110a45fcff30e02b'
+ '6e6c8719e5989d976a14610f340bd33a')
+
+build() {
+ cd $srcdir/Linux-PAM-$pkgver
+ ./configure --sysconfdir=/etc DESTDIR=$pkgdir --libdir=/lib
+ make
+}
+
+package() {
+ cd $srcdir/Linux-PAM-$pkgver
+ make INSTALL=/bin/install DESTDIR=$pkgdir install
+ install -D -m644 ../other $pkgdir/etc/pam.d/other
+ # build pam_unix2 module
+ # source ftp://ftp.suse.com/pub/people/kukuk/pam/pam_unix2
+ cd $srcdir/pam_unix2-2.6
+ ./configure
+ make
+ make DESTDIR=$pkgdir install
+ # add the realtime permissions for audio users
+ sed -i 's|# End of file||' $pkgdir/etc/security/limits.conf
+ cat >>$pkgdir/etc/security/limits.conf <<_EOT
+* - rtprio 0
+* - nice 0
+@audio - rtprio 65
+@audio - nice -10
+@audio - memlock 40000
+_EOT
+ # fix some missing symlinks from old pam for compatibility
+ cd $pkgdir/lib/security
+ ln -s pam_unix.so pam_unix_acct.so
+ ln -s pam_unix.so pam_unix_auth.so
+ ln -s pam_unix.so pam_unix_passwd.so
+ ln -s pam_unix.so pam_unix_session.so
+ # set unix_chkpwd uid
+ chmod +s $pkgdir/sbin/unix_chkpwd
+}
diff --git a/core/pam/other b/core/pam/other
new file mode 100644
index 000000000..08498b423
--- /dev/null
+++ b/core/pam/other
@@ -0,0 +1,5 @@
+#%PAM-1.0
+auth required pam_unix.so
+account required pam_unix.so
+password required pam_unix.so
+session required pam_unix.so
diff --git a/core/pam/pam.install b/core/pam/pam.install
new file mode 100644
index 000000000..9d4588084
--- /dev/null
+++ b/core/pam/pam.install
@@ -0,0 +1,12 @@
+# arg 1: the new package version
+post_install() {
+ # need to run this immediately -- pacman only runs it at the end of
+ # all package installs
+ /sbin/ldconfig -r .
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install $1
+}
diff --git a/core/patch/PKGBUILD b/core/patch/PKGBUILD
new file mode 100644
index 000000000..c51ae2eed
--- /dev/null
+++ b/core/patch/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 99945 2010-11-19 15:36:41Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=patch
+pkgver=2.6.1
+pkgrel=2
+pkgdesc="A utility to apply patch files to original sources"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/patch/patch.html"
+license=('GPL')
+groups=('base-devel')
+depends=('glibc')
+optdepends=('ed: Interpret the patch as an ed script; for patch -e functionality(deprecated)')
+source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz patch-2.6.1-get-arg.patch)
+md5sums=('d758eb96d3f75047efc004a720d33daf' '45cd5709adbbcdcb3ab95dc43559c07c')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # Fixed argument type for --get
+ # see https://bugzilla.redhat.com/show_bug.cgi?id=553624
+ patch -Np1 -i ../patch-2.6.1-get-arg.patch
+ ./configure --prefix=/usr --mandir=/usr/share/man
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make prefix=${pkgdir}/usr mandir=${pkgdir}/usr/share/man install
+}
diff --git a/core/patch/patch-2.6.1-get-arg.patch b/core/patch/patch-2.6.1-get-arg.patch
new file mode 100644
index 000000000..45f3bc8a5
--- /dev/null
+++ b/core/patch/patch-2.6.1-get-arg.patch
@@ -0,0 +1,12 @@
+diff -up patch-2.6.1/src/patch.c.get-arg patch-2.6.1/src/patch.c
+--- patch-2.6.1/src/patch.c.get-arg 2010-07-27 18:05:26.217150510 +0100
++++ patch-2.6.1/src/patch.c 2010-07-27 18:05:47.464150892 +0100
+@@ -558,7 +558,7 @@ static struct option const longopts[] =
+ {"remove-empty-files", no_argument, NULL, 'E'},
+ {"force", no_argument, NULL, 'f'},
+ {"fuzz", required_argument, NULL, 'F'},
+- {"get", no_argument, NULL, 'g'},
++ {"get", required_argument, NULL, 'g'},
+ {"input", required_argument, NULL, 'i'},
+ {"ignore-whitespace", no_argument, NULL, 'l'},
+ #ifdef ENABLE_MERGE
diff --git a/core/pciutils/PKGBUILD b/core/pciutils/PKGBUILD
new file mode 100644
index 000000000..84717cd2e
--- /dev/null
+++ b/core/pciutils/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 107583 2011-01-26 21:07:38Z tpowa $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+pkgname=pciutils
+pkgver=3.1.7
+pkgrel=3
+pkgdesc="PCI bus configuration space access library and tools"
+arch=(i686 x86_64)
+license=('GPL2')
+groups=('base')
+url="http://mj.ucw.cz/pciutils.html"
+optdepends=('sh: required by update-pciids')
+makedepends=('wget')
+depends=('glibc')
+source=(ftp://ftp.kernel.org/pub/software/utils/${pkgname}/${pkgname}-${pkgver}.tar.bz2)
+md5sums=('35222edb86b50a6641352c66fe829b2e')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./update-pciids.sh
+ make OPT="$CFLAGS -fPIC -DPIC" ZLIB=no PREFIX=/usr SHAREDIR=/usr/share/hwdata MANDIR=/usr/share/man all
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make PREFIX=${pkgdir}/usr SHAREDIR=${pkgdir}/usr/share/hwdata MANDIR=${pkgdir}/usr/share/man install
+ install -d ${pkgdir}/usr/lib
+ install -m644 lib/libpci.a ${pkgdir}/usr/lib
+ for i in config.h header.h pci.h types.h; do
+ install -D -m 644 lib/${i} ${pkgdir}/usr/include/pci/${i}
+ done
+}
diff --git a/core/pcmciautils/60-pcmcia.rules b/core/pcmciautils/60-pcmcia.rules
new file mode 100644
index 000000000..aa3c1a2d3
--- /dev/null
+++ b/core/pcmciautils/60-pcmcia.rules
@@ -0,0 +1,30 @@
+# PCMCIA devices:
+#
+ACTION!="add", GOTO="pcmciautils_end"
+# modprobe $env{MODALIAS} loads all possibly appropriate modules
+SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
+ RUN+="/lib/udev/load-modules.sh $env{MODALIAS}"
+
+# Very few CIS firmware entries (which we use for matching)
+# are so broken that we need to read out random bytes of it
+# instead of the manufactor, card or product ID. Then the
+# matching is done in userspace.
+SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
+ RUN+="/lib/udev/pcmcia-check-broken-cis"
+
+# However, the "weak" matching by func_id is only allowed _after_ modprobe
+# returns, so that "strong" matches have a higher priority.
+SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", ATTR{allow_func_id_match}="1"
+
+# PCMCIA sockets:
+#
+# modprobe the pcmcia bus module so that 16-bit PCMCIA devices work
+SUBSYSTEM=="pcmcia_socket", \
+ RUN+="/lib/udev/load-modules.sh pcmcia"
+
+# if this is a PCMCIA socket which needs a resource database,
+# pcmcia-socket-startup sets it up
+SUBSYSTEM=="pcmcia_socket", \
+ RUN+="/lib/udev/pcmcia-socket-startup"
+
+LABEL="pcmciautils_end"
diff --git a/core/pcmciautils/PKGBUILD b/core/pcmciautils/PKGBUILD
new file mode 100644
index 000000000..8744b8392
--- /dev/null
+++ b/core/pcmciautils/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 113400 2011-03-08 14:24:47Z stephane $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+pkgname=pcmciautils
+pkgver=017
+pkgrel=2
+pkgdesc="Utilities for inserting and removing PCMCIA cards"
+arch=(i686 x86_64)
+url="http://kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html"
+license=('GPL')
+groups=('base')
+depends=('glibc' 'sysfsutils' 'module-init-tools>=3.2pre9')
+conflicts=('pcmcia-cs')
+source=(http://kernel.org/pub/linux/utils/kernel/pcmcia/pcmciautils-${pkgver}.tar.bz2
+ 60-pcmcia.rules)
+options=(!makeflags)
+md5sums=('5245af28eeba57ec0606a874d44d10f7'
+ 'f88ac464ab9c75fe1565af551e6553a2')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ sed -i -e 's,/usr/bin/install,/bin/install,g' Makefile
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ # fix lspcmcia symlink
+ ln -sf pccardctl "${pkgdir}"/sbin/lspcmcia
+ # add fixed rules file
+ install -D -m644 "${srcdir}"/60-pcmcia.rules "${pkgdir}"/lib/udev/rules.d/
+}
diff --git a/core/pcre/PKGBUILD b/core/pcre/PKGBUILD
new file mode 100644
index 000000000..c765d79a3
--- /dev/null
+++ b/core/pcre/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 106454 2011-01-17 12:49:41Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Eric Belanger <eric@archlinux.org>
+# Contributor: John Proctor <jproctor@prium.net>
+
+pkgname=pcre
+pkgver=8.12
+pkgrel=1
+pkgdesc="A library that implements Perl 5-style regular expressions"
+arch=('i686' 'x86_64')
+url="http://www.pcre.org/"
+license=('BSD')
+depends=('gcc-libs')
+options=('!libtool')
+source=(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${pkgname}-${pkgver}.tar.bz2)
+md5sums=('f14a9fef3c92f3fc6c5ac92d7a2c7eb3')
+sha1sums=('2219b372bff53ee29a7e44ecf5977ad15df01cea')
+
+build() {
+ cd "${srcdir}"/${pkgname}-${pkgver}
+ [ "${CARCH}" = "x86_64" ] && export CFLAGS="${CFLAGS} -fPIC"
+ ./configure --prefix=/usr --enable-utf8 --enable-unicode-properties
+ make
+}
+
+package() {
+ cd "${srcdir}"/${pkgname}-${pkgver}
+ make DESTDIR="${pkgdir}" install
+
+ # grep uses pcre, so we need the libs in /lib
+ install -dm755 "${pkgdir}"/lib
+ mv "${pkgdir}"/usr/lib/libpcre.so.* "${pkgdir}"/lib/
+ ln -sf /lib/libpcre.so.0 "${pkgdir}"/usr/lib/libpcre.so
+
+ install -Dm644 LICENCE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+}
diff --git a/core/perl/ChangeLog b/core/perl/ChangeLog
new file mode 100644
index 000000000..2de069d5d
--- /dev/null
+++ b/core/perl/ChangeLog
@@ -0,0 +1,50 @@
+2010-11-07 kevin <kevin@archlinux.org>
+
+ * perl 5.12.2-1
+ - Using /usr/bin/*_perl for script directories
+
+2010-11-06 kevin <kevin@archlinux.org>
+
+ - Removed otherlibdirs directive from Configure
+ - Removed /usr/*/perl5/site_perl/5.10.1 from INC
+ - Finally removed legacy dirs /usr/lib/perl5/current and
+ /usr/lib/perl5/site_perl/current from @INC
+
+2010-05-23 kevin <kevin@archlinux.org>
+
+ * perl 5.12.1-2
+ - Francois updated the provides array.
+
+2010-05-23 kevin <kevin@archlinux.org>
+
+ * perl 5.12.1-1
+
+2010-05-16 kevin <kevin@archlinux.org>
+
+ * perl 5.12.0-2
+
+2010-05-12 kevin <kevin@archlinux.org>
+
+ - FS#19411. Removed the for loop in perlbin.sh which didn't work on zsh.
+ This makes the loop variables unnecessary so the script no longer
+ pollutes the user's environment.
+ - FS#19427. Added /usr/*/perl5/site_perl/5.10.1 to otherlibdirs to support
+ user built modules.
+
+2010-05-09 kevin <kevin@archlinux.org>
+
+ * perl 5.12.0-1
+ - Modified perlbin.sh to only add existing dirs to PATH. Fixes FS#17402,
+ path points to non-existant directories
+
+2010-05-07 kevin <kevin@archlinux.org>
+
+ - Added this changelog.
+ - Added -Dinc_version_list=none to fix FS#19136, double entry in @INC.
+ This removes the duplicates and versioned directory entries.
+ - Change scriptdirs to /usr/lib/perl5/{core,vendor,site}_perl/bin to fix
+ Fix FS#13808, binaries don't follow FHS.
+ - Stopped using versioned directories in sitelib and sitearch.
+
+
+# vim: set ft=changelog ts=4 sw=4 et:
diff --git a/core/perl/PKGBUILD b/core/perl/PKGBUILD
new file mode 100644
index 000000000..37f3a0e91
--- /dev/null
+++ b/core/perl/PKGBUILD
@@ -0,0 +1,208 @@
+# $Id: PKGBUILD 107935 2011-01-27 21:58:49Z angvp $
+# Maintainer: kevin <kevin.archlinux.org>
+# Contributor: judd <jvinet.zeroflux.org>
+# Contributor: francois <francois.archlinux.org>
+pkgname=perl
+pkgver=5.12.3
+pkgrel=1
+pkgdesc="A highly capable, feature-rich programming language"
+arch=(i686 x86_64)
+license=('GPL' 'PerlArtistic')
+url="http://www.perl.org"
+groups=('base')
+depends=('gdbm' 'db>=4.8' 'coreutils' 'glibc' 'sh')
+changelog=ChangeLog
+source=(http://www.cpan.org/src/5.0/perl-${pkgver}.tar.bz2 perlbin.sh fix-h2ph-and-tests.patch)
+install=perl.install
+provides=(
+perl-archive-extract=0.38
+perl-archive-tar=1.54
+perl-attribute-handlers=0.87
+perl-autodie=2.06_01
+perl-autoloader=5.70
+perl-base=2.15
+perl-b-debug=1.12
+perl-bignum=0.23
+perl-b-lint=1.11_01
+perl-cgi=3.49
+perl-class-isa=0.36
+perl-compress-raw-bzip2=2.024
+perl-compress-raw-zlib=2.024
+perl-constant=1.20
+perl-cpan=1.94_56
+perl-cpanplus=0.90
+perl-cpanplus-dist-build=0.46
+perl-data-dumper=2.125
+perl-db_file=1.820
+perl-devel-dprof=20080331.00
+perl-devel-peek=1.04
+perl-devel-ppport=3.19
+perl-digest=1.16
+perl-digest-md5=2.39
+perl-digest-sha=5.47
+perl-encode=2.39
+perl-encoding-warnings=0.11
+perl-exporter=5.64_01
+perl-extutils-cbuilder=0.27
+perl-extutils-command=1.16
+perl-extutils-constant=0.22
+perl-extutils-embed=1.28
+perl-extutils-install=1.55
+perl-extutils-makemaker=6.56
+perl-extutils-manifest=1.57
+perl-extutils-parsexs=2.21
+perl-file-fetch=0.24
+perl-file-path=2.08_01
+perl-file-temp=0.22
+perl-filter=1.37
+perl-filter-simple=0.84
+perl-getopt-long=2.38
+perl-if=0.05
+perl-io=1.25_02
+perl-io-compress=2.024
+perlio-via-quotedprint=0.06
+perl-io-zlib=1.10
+perl-ipc-cmd=0.54
+perl-ipc-sysv=2.01
+perl-libnet=1.22
+perl-locale-codes=2.07
+perl-locale-maketext=1.14
+perl-locale-maketext-simple=0.21
+perl-log-message=0.02
+perl-log-message-simple=0.06
+perl-math-bigint=1.89_01
+perl-math-bigint-fastcalc=0.19
+perl-math-bigrat=0.24
+perl-math-complex=1.56
+perl-memoize=1.01_03
+perl-mime-base64=3.08
+perl-module-build=0.3603
+perl-module-corelist=2.29
+perl-module-load=0.16
+perl-module-load-conditional=0.34
+perl-module-loaded=0.06
+perl-module-pluggable=3.9
+perl-net-ping=2.36
+perl-next=0.64
+perl-object-accessor=0.36
+perl-package-constants=0.02
+perl-params-check=0.26
+perl-parent=0.223
+perl-parse-cpan-meta=1.40
+perl-pathtools=3.31
+perl-pod-escapes=1.04
+perl-pod-latex=0.58
+perl-podlators=2.3.1
+perl-pod-parser=1.37
+perl-pod-perldoc=3.15_02
+perl-pod-plainer=1.02
+perl-pod-simple=3.14
+perl-safe=2.27
+perl-scalar-list-utils=1.22
+perl-selfloader=1.17
+perl-shell=0.72_01
+perl-storable=2.22
+perl-switch=2.16
+perl-sys-syslog=0.27
+perl-term-ansicolor=2.02
+perl-term-cap=1.12
+perl-term-ui=0.20
+perl-test=1.25_02
+perl-test-harness=3.17
+perl-test-simple=0.94
+perl-text-balanced=2.02
+perl-text-parsewords=3.27
+perl-text-soundex=3.03_01
+perl-text-tabs+wraps=2009.0305
+perl-thread-queue=2.11
+perl-threads=1.75
+perl-thread-semaphore=2.09
+perl-threads-shared=1.32
+perl-tie-file=0.97_02
+perl-tie-refhash=1.38
+perl-time-hires=1.9719
+perl-time-local=1.1901_01
+perl-time-piece=1.15_01
+perl-unicode-collate=0.52_01
+perl-unicode-normalize=1.03
+perl-version=0.82
+perl-win32=0.39
+perl-win32api-file=0.1101
+perl-xsloader=0.10
+)
+options=('!makeflags' '!purge')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ if [ "${CARCH}" = "x86_64" ]; then
+ # for x86_64
+ arch_opts="-Dcccdlflags='-fPIC'"
+ else
+ # for i686
+ arch_opts=""
+ fi
+ ./Configure -des -Dusethreads -Duseshrplib -Doptimize="${CFLAGS}" \
+ -Dprefix=/usr -Dinstallprefix=${pkgdir}/usr -Dvendorprefix=/usr \
+ -Dprivlib=/usr/share/perl5/core_perl \
+ -Darchlib=/usr/lib/perl5/core_perl \
+ -Dsitelib=/usr/share/perl5/site_perl \
+ -Dsitearch=/usr/lib/perl5/site_perl \
+ -Dvendorlib=/usr/share/perl5/vendor_perl \
+ -Dvendorarch=/usr/lib/perl5/vendor_perl \
+ -Dscriptdir=/usr/bin/core_perl \
+ -Dsitescript=/usr/bin/site_perl \
+ -Dvendorscript=/usr/bin/vendor_perl \
+ -Dinc_version_list=none \
+ -Dman1ext=1perl -Dman3ext=3perl ${arch_opts}
+ #-Dotherlibdirs=/usr/lib/perl5/site_perl/5.10.1:/usr/share/perl5/site_perl/5.10.1:/usr/lib/perl5/current:/usr/lib/perl5/site_perl/current \
+ patch -Np1 -i $srcdir/fix-h2ph-and-tests.patch
+ make
+}
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make install
+
+ ### Perl Settings ###
+ # Change man page extensions for site and vendor module builds.
+ # Use archlinux email address instead of my own.
+ sed -e '/^man1ext=/ s/1perl/1p/' -e '/^man3ext=/ s/3perl/3pm/' \
+ -e "/^cf_email=/ s/'.*'/'kevin@archlinux.org'/" \
+ -e "/^perladmin=/ s/'.*'/'kevin@archlinux.org'/" \
+ -i ${pkgdir}/usr/lib/perl5/core_perl/Config_heavy.pl
+
+ ### CPAN Settings ###
+ # Set CPAN default config to use the site directories.
+ sed -e '/(makepl_arg =>/ s/""/"INSTALLDIRS=site"/' \
+ -e '/(mbuildpl_arg =>/ s/""/"installdirs=site"/' \
+ -i ${pkgdir}/usr/share/perl5/core_perl/CPAN/FirstTime.pm
+
+ ### CPANPLUS Settings ###
+ # Set CPANPLUS default config to use the site directories.
+ sed -e "/{'makemakerflags'}/ s/'';/'INSTALLDIRS=site';/" \
+ -e "/{'buildflags'}/ s/'';/'installdirs=site';/" \
+ -i ${pkgdir}/usr/share/perl5/core_perl/CPANPLUS/Config.pm
+
+ # Profile script so set paths to perl scripts.
+ install -D -m755 ${srcdir}/perlbin.sh \
+ ${pkgdir}/etc/profile.d/perlbin.sh
+
+ (cd ${pkgdir}/usr/bin; mv perl${pkgver} perl)
+ (cd ${pkgdir}/usr/bin/core_perl; ln -sf c2ph pstruct; ln -sf s2p psed)
+ grep -Rl "${pkgdir}" ${pkgdir}/usr | \
+ xargs sed -i "s^${pkgdir}^^g"
+
+ # Remove all pod files *except* those under /usr/share/perl5/core_perl/pod/
+ # (FS#16488)
+ rm -f $pkgdir/usr/share/perl5/core_perl/*.pod
+ for d in $pkgdir/usr/share/perl5/core_perl/*; do
+ if [ -d $d -a $(basename $d) != "pod" ]; then
+ find $d -name *.pod -delete
+ fi
+ done
+ find $pkgdir/usr/lib -name *.pod -delete
+ find $pkgdir -name .packlist -delete
+}
+md5sums=('72f3f7e1c700e79bbf9d9279ca5b42d9'
+ 'f86eb0dba1638ca6d1c8fff1b06c2a71'
+ '294b5311cbfc50e7dcffbee85854da38')
diff --git a/core/perl/fix-h2ph-and-tests.patch b/core/perl/fix-h2ph-and-tests.patch
new file mode 100644
index 000000000..a2d176ec6
--- /dev/null
+++ b/core/perl/fix-h2ph-and-tests.patch
@@ -0,0 +1,104 @@
+From 8d66b3f930dc6d88b524d103e304308ae73a46e7 Mon Sep 17 00:00:00 2001
+From: Robin Barker <rmbarker@cpan.org>
+Date: Thu, 22 Apr 2010 11:51:20 +0100
+Subject: [PATCH 1/1] Fix h2ph and test
+
+---
+ lib/h2ph.t | 12 ++++++++++--
+ utils/h2ph.PL | 28 +++++++++++++++++++++++-----
+ 2 files changed, 33 insertions(+), 7 deletions(-)
+
+diff --git a/lib/h2ph.t b/lib/h2ph.t
+index 27dd7b9..8d62d46 100644
+--- a/lib/h2ph.t
++++ b/lib/h2ph.t
+@@ -18,7 +18,7 @@ if (!(-e $extracted_program)) {
+ exit 0;
+ }
+
+-plan(4);
++plan(5);
+
+ # quickly compare two text files
+ sub txt_compare {
+@@ -41,8 +41,16 @@ $result = runperl( progfile => 'lib/h2ph.pht',
+ stderr => 1 );
+ like( $result, qr/syntax OK$/, "output compiles");
+
++$result = runperl( progfile => '_h2ph_pre.ph',
++ switches => ['-c'],
++ stderr => 1 );
++like( $result, qr/syntax OK$/, "preamble compiles");
++
+ $result = runperl( switches => ["-w"],
+- prog => '$SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht);');
++ stderr => 1,
++ prog => <<'PROG' );
++$SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht);
++PROG
+ is( $result, '', "output free of warnings" );
+
+ # cleanup
+diff --git a/utils/h2ph.PL b/utils/h2ph.PL
+index 8f56db4..1255807 100644
+--- a/utils/h2ph.PL
++++ b/utils/h2ph.PL
+@@ -401,7 +401,10 @@ if ($opt_e && (scalar(keys %bad_file) > 0)) {
+ exit $Exit;
+
+ sub expr {
+- $new = '"(assembly code)"' and return if /\b__asm__\b/; # freak out.
++ if (/\b__asm__\b/) { # freak out
++ $new = '"(assembly code)"';
++ return
++ }
+ my $joined_args;
+ if(keys(%curargs)) {
+ $joined_args = join('|', keys(%curargs));
+@@ -770,7 +773,7 @@ sub inc_dirs
+ sub build_preamble_if_necessary
+ {
+ # Increment $VERSION every time this function is modified:
+- my $VERSION = 2;
++ my $VERSION = 3;
+ my $preamble = "$Dest_dir/_h2ph_pre.ph";
+
+ # Can we skip building the preamble file?
+@@ -798,7 +801,16 @@ sub build_preamble_if_necessary
+ # parenthesized value: d=(v)
+ $define{$_} = $1;
+ }
+- if ($define{$_} =~ /^([+-]?(\d+)?\.\d+([eE][+-]?\d+)?)[FL]?$/) {
++ if (/^(\w+)\((\w)\)$/) {
++ my($macro, $arg) = ($1, $2);
++ my $def = $define{$_};
++ $def =~ s/$arg/\$\{$arg\}/g;
++ print PREAMBLE <<DEFINE;
++unless (defined &$macro) { sub $macro(\$) { my (\$$arg) = \@_; \"$def\" } }
++
++DEFINE
++ } elsif
++ ($define{$_} =~ /^([+-]?(\d+)?\.\d+([eE][+-]?\d+)?)[FL]?$/) {
+ # float:
+ print PREAMBLE
+ "unless (defined &$_) { sub $_() { $1 } }\n\n";
+@@ -807,8 +819,14 @@ sub build_preamble_if_necessary
+ print PREAMBLE
+ "unless (defined &$_) { sub $_() { $1 } }\n\n";
+ } elsif ($define{$_} =~ /^\w+$/) {
+- print PREAMBLE
+- "unless (defined &$_) { sub $_() { &$define{$_} } }\n\n";
++ my $def = $define{$_};
++ if ($isatype{$def}) {
++ print PREAMBLE
++ "unless (defined &$_) { sub $_() { \"$def\" } }\n\n";
++ } else {
++ print PREAMBLE
++ "unless (defined &$_) { sub $_() { &$def } }\n\n";
++ }
+ } else {
+ print PREAMBLE
+ "unless (defined &$_) { sub $_() { \"",
+--
+1.6.5.2.74.g610f9.dirty
+
diff --git a/core/perl/perl.install b/core/perl/perl.install
new file mode 100644
index 000000000..3f7d58f23
--- /dev/null
+++ b/core/perl/perl.install
@@ -0,0 +1,18 @@
+# arg 1: the new package version
+post_install() {
+ for ver in 5.8.{0,1,2,3,4,5,6,7,8}; do
+ [ -h usr/lib/perl5/$ver ] && rm usr/lib/perl5/$ver
+ [ -h usr/lib/perl5/site_perl/$ver ] && rm usr/lib/perl5/site_perl/$ver
+ [ -h usr/bin/perl$ver ] && rm usr/bin/perl$ver
+ done
+ return 0
+}
+
+post_upgrade() {
+ echo '- The directories /usr/lib/perl5/current, /usr/lib/perl5/site_perl/current,'
+ echo ' /usr/lib/perl5/site_perl/5.10.1, and /usr/share/perl5/site_perl/5.10.1'
+ echo ' have been removed from @INC.'
+
+ echo '- The script/binary directories are now /usr/bin/*_perl instead of'
+ echo ' /usr/lib/perl5/*_perl/bin which will be eventually removed.'
+}
diff --git a/core/perl/perlbin.sh b/core/perl/perlbin.sh
new file mode 100755
index 000000000..09811a8b4
--- /dev/null
+++ b/core/perl/perlbin.sh
@@ -0,0 +1,23 @@
+# Set path to perl scriptdirs if they exist
+# https://wiki.archlinux.org/index.php/Perl_Policy#Binaries_and_Scripts
+# Added /usr/bin/*_perl dirs for scripts
+# Remove /usr/lib/perl5/*_perl/bin in next release
+
+[ -d /usr/bin/site_perl ] &&
+ PATH=$PATH:/usr/bin/site_perl
+[ -d /usr/lib/perl5/site_perl/bin ] &&
+ PATH=$PATH:/usr/lib/perl5/site_perl/bin
+
+[ -d /usr/bin/vendor_perl ] &&
+ PATH=$PATH:/usr/bin/vendor_perl
+[ -d /usr/lib/perl5/vendor_perl/bin ] &&
+ PATH=$PATH:/usr/lib/perl5/vendor_perl/bin
+
+[ -d /usr/bin/core_perl ] &&
+ PATH=$PATH:/usr/bin/core_perl
+
+export PATH
+
+# If you have modules in non-standard directories you can add them here.
+#export PERLLIB=dir1:dir2
+
diff --git a/core/pkg-config/PKGBUILD b/core/pkg-config/PKGBUILD
new file mode 100644
index 000000000..b432af63e
--- /dev/null
+++ b/core/pkg-config/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 102636 2010-12-09 12:15:21Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Committer: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=pkg-config
+pkgver=0.25
+pkgrel=3
+pkgdesc="A system for managing library compile/link flags"
+arch=('i686' 'x86_64')
+url="http://pkgconfig.freedesktop.org/wiki/"
+license=('GPL')
+groups=('base-devel')
+depends=('glibc' 'popt' 'glib2')
+provides=("pkgconfig=${pkgver}")
+conflicts=('pkgconfig')
+replaces=('pkgconfig')
+source=(http://pkgconfig.freedesktop.org/releases/${pkgname}-${pkgver}.tar.gz
+ autoconf-2.66.patch)
+md5sums=('a3270bab3f4b69b7dc6dbdacbcae9745'
+ '0fbfc1a5088f792bbeec7b5090e449f1')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i $srcdir/autoconf-2.66.patch
+ # Use system popt and glib
+ ./configure --prefix=/usr --with-installed-glib --with-installed-popt
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR=${pkgdir} install
+}
diff --git a/core/pkg-config/autoconf-2.66.patch b/core/pkg-config/autoconf-2.66.patch
new file mode 100644
index 000000000..14cabdf9f
--- /dev/null
+++ b/core/pkg-config/autoconf-2.66.patch
@@ -0,0 +1,12 @@
+diff -Naur pkg-config-0.25-old//pkg.m4 pkg-config-0.25/pkg.m4
+--- pkg-config-0.25-old//pkg.m4 2009-12-07 06:39:02.000000000 +1000
++++ pkg-config-0.25/pkg.m4 2010-07-15 14:44:37.466942978 +1000
+@@ -135,7 +135,7 @@
+ Consider adjusting the PKG_CONFIG_PATH environment variable if you
+ installed software in a non-standard prefix.
+
+-_PKG_TEXT])dnl
++_PKG_TEXT])[]dnl
+ ])
+ elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
diff --git a/core/popt/PKGBUILD b/core/popt/PKGBUILD
new file mode 100644
index 000000000..4445eb0a1
--- /dev/null
+++ b/core/popt/PKGBUILD
@@ -0,0 +1,41 @@
+# $Id: PKGBUILD 105825 2011-01-12 14:39:27Z stephane $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: dorphell <dorphell@archlinux.org>
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+# Contributor: John Proctor <jproctor@prium.net>
+
+pkgname=popt
+pkgver=1.16
+pkgrel=3
+pkgdesc="A commandline option parser"
+arch=('i686' 'x86_64')
+url="http://rpm5.org"
+license=('custom')
+depends=('glibc')
+options=('!libtool')
+source=(http://rpm5.org/files/${pkgname}/${pkgname}-${pkgver}.tar.gz)
+md5sums=('3743beefa3dd6247a73f8f7a32c14c33')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ # move libs in /lib
+ install -Dm755 ${pkgdir}/usr/lib/libpopt.so.0.0.0 \
+ ${pkgdir}/lib/libpopt.so.0.0.0
+
+ rm ${pkgdir}/usr/lib/libpopt.so*
+ ln -sf /lib/libpopt.so ${pkgdir}/usr/lib/libpopt.so
+ ln -sf libpopt.so.0 ${pkgdir}/lib/libpopt.so
+ ln -sf libpopt.so.0.0.0 ${pkgdir}/lib/libpopt.so.0
+
+ # install license
+ install -Dm644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
diff --git a/core/ppl/PKGBUILD b/core/ppl/PKGBUILD
new file mode 100644
index 000000000..230b48de4
--- /dev/null
+++ b/core/ppl/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 111674 2011-02-28 10:47:00Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: ezzetabi <ezzetabi at gawab dot com>
+
+pkgname=ppl
+pkgver=0.11.2
+pkgrel=1
+pkgdesc="A modern library for convex polyhedra and other numerical abstractions."
+arch=('i686' 'x86_64')
+url="http://www.cs.unipr.it/ppl"
+license=('GPL3')
+depends=('gmp>=5.0')
+options=('!docs' '!libtool')
+source=(http://www.cs.unipr.it/ppl/Download/ftp/releases/$pkgver/ppl-$pkgver.tar.gz)
+md5sums=('ce014f153a28006009db207ca953a984')
+
+build() {
+ cd $srcdir/ppl-$pkgver
+ ./configure --prefix=/usr --enable-interfaces="c,cxx"
+ make
+ make check
+}
+
+package() {
+ cd $srcdir/ppl-$pkgver
+ make DESTDIR=$pkgdir install
+}
+
diff --git a/core/ppp/PKGBUILD b/core/ppp/PKGBUILD
new file mode 100644
index 000000000..6d283d52a
--- /dev/null
+++ b/core/ppp/PKGBUILD
@@ -0,0 +1,80 @@
+# $Id: PKGBUILD 109460 2011-02-09 19:24:24Z stephane $
+# Maintainer: Thomas Baechler <thomas@archlinux.org>
+pkgname=ppp
+pkgver=2.4.5
+pkgrel=2
+pkgdesc="A daemon which implements the Point-to-Point Protocol for dial-up networking"
+arch=(i686 x86_64)
+url="http://www.samba.org/ppp/"
+license=('custom:GPL/BSD')
+groups=('base')
+depends=('glibc' 'libpcap>=1.0.0')
+backup=(etc/ppp/{chap-secrets,pap-secrets,options,ip-up,ip-down})
+source=(ftp://ftp.samba.org/pub/ppp/ppp-${pkgver}.tar.gz
+ options
+ pon
+ poff
+ ppp
+ plog
+ pon.1
+ ip-up
+ ip-down
+ ip-up.d.dns.sh
+ ip-down.d.dns.sh)
+md5sums=('4621bc56167b6953ec4071043fe0ec57'
+ '7a9259a8f038073eeea7e4552ff1849f'
+ '48c024f73a80c8b69c4def22f86902cc'
+ '2d811f8470ccdea3b8c4505a438483e9'
+ '7561c73b557292d5ba1a9c5dbd270fde'
+ '86cdaf133f7a79fb464f02d83afc7734'
+ '44cc662ba9aa61dd9add3ddd4c5ded57'
+ 'e4beb16ed600b61336d50b2bd2df7cd5'
+ '2fa0671f40711e69194ccf60979f8b33'
+ '4a074d74c29625b254a1db720cb87b99'
+ '8d1be5af8e46393ba6eb273377831e38')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ # fix CFLAGS
+ # -D_GNU_SOURCE is needed for IPv6 to work apparently
+ export CFLAGS="$CFLAGS -D_GNU_SOURCE"
+ sed -i "s:-O2 -pipe -Wall -g:${CFLAGS}:" pppd/Makefile.linux
+ sed -i "s:-g -O2:${CFLAGS}:" pppd/plugins/Makefile.linux
+ sed -i "s:-O2:${CFLAGS}:" pppstats/Makefile.linux
+ sed -i "s:-O2 -g -pipe:${CFLAGS}:" chat/Makefile.linux
+ sed -i "s:-O:${CFLAGS}:" pppdump/Makefile.linux
+
+ # enable active filter
+ sed -i "s:^#FILTER=y:FILTER=y:" pppd/Makefile.linux
+ # enable ipv6 support
+ sed -i "s:^#HAVE_INET6=y:HAVE_INET6=y:" pppd/Makefile.linux
+ # Enable Microsoft proprietary Callback Control Protocol
+ sed -i "s:^#CBCP=y:CBCP=y:" pppd/Makefile.linux
+
+ # Fix build error with recent kernels
+ rm include/linux/if_pppol2tp.h
+
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}/usr" install
+ install -D -m644 ../options "${pkgdir}/etc/ppp/options"
+ install -D -m755 ../ip-up "${pkgdir}/etc/ppp/ip-up"
+ install -D -m755 ../ip-down "${pkgdir}/etc/ppp/ip-down"
+ install -d -m755 "${pkgdir}/etc/ppp/ip-up.d"
+ install -d -m755 "${pkgdir}/etc/ppp/ip-down.d"
+ install -m755 ../ip-up.d.dns.sh "${pkgdir}/etc/ppp/ip-up.d/00-dns.sh"
+ install -m755 ../ip-down.d.dns.sh "${pkgdir}/etc/ppp/ip-down.d/00-dns.sh"
+ install -D -m755 ../pon "${pkgdir}/usr/bin/pon"
+ install -D -m755 ../poff "${pkgdir}/usr/bin/poff"
+ install -D -m755 ../plog "${pkgdir}/usr/sbin/plog"
+ install -D -m600 etc.ppp/pap-secrets "${pkgdir}/etc/ppp/pap-secrets"
+ install -D -m600 etc.ppp/chap-secrets "${pkgdir}/etc/ppp/chap-secrets"
+ install -D -m755 ${srcdir}/ppp "${pkgdir}/etc/rc.d/ppp"
+ install -D -m644 ${srcdir}/pon.1 "${pkgdir}/usr/share/man/man1/pon.1"
+ install -d -m755 "${pkgdir}/etc/ppp/peers"
+ chmod 0755 "${pkgdir}/usr/lib/pppd/${pkgver}"/*.so
+}
diff --git a/core/ppp/ip-down b/core/ppp/ip-down
new file mode 100644
index 000000000..301f3ab9b
--- /dev/null
+++ b/core/ppp/ip-down
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# This script is run by pppd after the connection has ended.
+#
+
+# Execute all scripts in /etc/ppp/ip-up.d/
+for ipdown in /etc/ppp/ip-down.d/*.sh; do
+ if [ -x $ipdown ]; then
+ # Parameters: interface-name tty-device speed local-IP-address remote-IP-address ipparam
+ $ipdown "$@"
+ fi
+done
diff --git a/core/ppp/ip-down.d.dns.sh b/core/ppp/ip-down.d.dns.sh
new file mode 100644
index 000000000..9e19f7d1b
--- /dev/null
+++ b/core/ppp/ip-down.d.dns.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+[ -e /etc/resolv.conf.backup.${IFNAME} ] && mv /etc/resolv.conf.backup.${IFNAME} /etc/resolv.conf
diff --git a/core/ppp/ip-up b/core/ppp/ip-up
new file mode 100644
index 000000000..20473d73a
--- /dev/null
+++ b/core/ppp/ip-up
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# This script is run by pppd when there's a successful ppp connection.
+#
+
+# Execute all scripts in /etc/ppp/ip-up.d/
+for ipup in /etc/ppp/ip-up.d/*.sh; do
+ if [ -x $ipup ]; then
+ # Parameters: interface-name tty-device speed local-IP-address remote-IP-address ipparam
+ $ipup "$@"
+ fi
+done
diff --git a/core/ppp/ip-up.d.dns.sh b/core/ppp/ip-up.d.dns.sh
new file mode 100644
index 000000000..f9df543a4
--- /dev/null
+++ b/core/ppp/ip-up.d.dns.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ "$USEPEERDNS" = "1" -a -f /etc/ppp/resolv.conf ]; then
+ [ -e /etc/resolv.conf ] && mv /etc/resolv.conf /etc/resolv.conf.backup.${IFNAME}
+ mv /etc/ppp/resolv.conf /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+fi
diff --git a/core/ppp/options b/core/ppp/options
new file mode 100644
index 000000000..63691842c
--- /dev/null
+++ b/core/ppp/options
@@ -0,0 +1,352 @@
+# /etc/ppp/options
+#
+# Originally created by Jim Knoble <jmknoble@mercury.interpath.net>
+# Modified for Debian by alvar Bray <alvar@meiko.co.uk>
+# Modified for PPP Server setup by Christoph Lameter <clameter@debian.org>
+# Modified for ArchLinux by Manolis Tzanidakis <manolis@archlinux.org>
+#
+# To quickly see what options are active in this file, use this command:
+# egrep -v '#|^ *$' /etc/ppp/options
+
+# Specify which DNS Servers the incoming Win95 or WinNT Connection should use
+# Two Servers can be remotely configured
+# ms-dns 192.168.1.1
+# ms-dns 192.168.1.2
+
+# Specify which WINS Servers the incoming connection Win95 or WinNT should use
+# ms-wins 192.168.1.50
+# ms-wins 192.168.1.51
+
+# Run the executable or shell command specified after pppd has
+# terminated the link. This script could, for example, issue commands
+# to the modem to cause it to hang up if hardware modem control signals
+# were not available.
+#disconnect "chat -- \d+++\d\c OK ath0 OK"
+
+# async character map -- 32-bit hex; each bit is a character
+# that needs to be escaped for pppd to receive it. 0x00000001
+# represents '\x01', and 0x80000000 represents '\x1f'.
+asyncmap 0
+
+# Require the peer to authenticate itself before allowing network
+# packets to be sent or received.
+# Please do not disable this setting. It is expected to be standard in
+# future releases of pppd. Use the call option (see manpage) to disable
+# authentication for specific peers.
+auth
+
+# Use hardware flow control (i.e. RTS/CTS) to control the flow of data
+# on the serial port.
+crtscts
+
+# Use software flow control (i.e. XON/XOFF) to control the flow of data
+# on the serial port.
+#xonxoff
+
+# Specifies that certain characters should be escaped on transmission
+# (regardless of whether the peer requests them to be escaped with its
+# async control character map). The characters to be escaped are
+# specified as a list of hex numbers separated by commas. Note that
+# almost any character can be specified for the escape option, unlike
+# the asyncmap option which only allows control characters to be
+# specified. The characters which may not be escaped are those with hex
+# values 0x20 - 0x3f or 0x5e.
+#escape 11,13,ff
+
+# Don't use the modem control lines.
+#local
+
+# Specifies that pppd should use a UUCP-style lock on the serial device
+# to ensure exclusive access to the device.
+lock
+
+# Don't show the passwords when logging the contents of PAP packets.
+# This is the default.
+hide-password
+
+# When logging the contents of PAP packets, this option causes pppd to
+# show the password string in the log message.
+#show-password
+
+# Use the modem control lines. On Ultrix, this option implies hardware
+# flow control, as for the crtscts option. (This option is not fully
+# implemented.)
+modem
+
+# Set the MRU [Maximum Receive Unit] value to <n> for negotiation. pppd
+# will ask the peer to send packets of no more than <n> bytes. The
+# minimum MRU value is 128. The default MRU value is 1500. A value of
+# 296 is recommended for slow links (40 bytes for TCP/IP header + 256
+# bytes of data).
+#mru 542
+
+# Set the interface netmask to <n>, a 32 bit netmask in "decimal dot"
+# notation (e.g. 255.255.255.0).
+#netmask 255.255.255.0
+
+# Disables the default behaviour when no local IP address is specified,
+# which is to determine (if possible) the local IP address from the
+# hostname. With this option, the peer will have to supply the local IP
+# address during IPCP negotiation (unless it specified explicitly on the
+# command line or in an options file).
+#noipdefault
+
+# Enables the "passive" option in the LCP. With this option, pppd will
+# attempt to initiate a connection; if no reply is received from the
+# peer, pppd will then just wait passively for a valid LCP packet from
+# the peer (instead of exiting, as it does without this option).
+#passive
+
+# With this option, pppd will not transmit LCP packets to initiate a
+# connection until a valid LCP packet is received from the peer (as for
+# the "passive" option with old versions of pppd).
+#silent
+
+# Don't request or allow negotiation of any options for LCP and IPCP
+# (use default values).
+#-all
+
+# Disable Address/Control compression negotiation (use default, i.e.
+# address/control field disabled).
+#-ac
+
+# Disable asyncmap negotiation (use the default asyncmap, i.e. escape
+# all control characters).
+#-am
+
+# Don't fork to become a background process (otherwise pppd will do so
+# if a serial device is specified).
+#-detach
+
+# Disable IP address negotiation (with this option, the remote IP
+# address must be specified with an option on the command line or in
+# an options file).
+#-ip
+
+# Disable IPCP negotiation and IP communication. This option should
+# only be required if the peer is buggy and gets confused by requests
+# from pppd for IPCP negotiation.
+#noip
+
+# Disable magic number negotiation. With this option, pppd cannot
+# detect a looped-back line.
+#-mn
+
+# Disable MRU [Maximum Receive Unit] negotiation (use default, i.e.
+# 1500).
+#-mru
+
+# Disable protocol field compression negotiation (use default, i.e.
+# protocol field compression disabled).
+#-pc
+
+# Require the peer to authenticate itself using PAP.
+#+pap
+
+# Don't agree to authenticate using PAP.
+#-pap
+
+# Require the peer to authenticate itself using CHAP [Cryptographic
+# Handshake Authentication Protocol] authentication.
+#+chap
+
+# Don't agree to authenticate using CHAP.
+#-chap
+
+# Disable negotiation of Van Jacobson style IP header compression (use
+# default, i.e. no compression).
+#-vj
+
+# Increase debugging level (same as -d). If this option is given, pppd
+# will log the contents of all control packets sent or received in a
+# readable form. The packets are logged through syslog with facility
+# daemon and level debug. This information can be directed to a file by
+# setting up /etc/syslog.conf appropriately (see syslog.conf(5)). (If
+# pppd is compiled with extra debugging enabled, it will log messages
+# using facility local2 instead of daemon).
+#debug
+
+# Append the domain name <d> to the local host name for authentication
+# purposes. For example, if gethostname() returns the name porsche,
+# but the fully qualified domain name is porsche.Quotron.COM, you would
+# use the domain option to set the domain name to Quotron.COM.
+#domain <d>
+
+# Enable debugging code in the kernel-level PPP driver. The argument n
+# is a number which is the sum of the following values: 1 to enable
+# general debug messages, 2 to request that the contents of received
+# packets be printed, and 4 to request that the contents of transmitted
+# packets be printed.
+#kdebug n
+
+# Set the MTU [Maximum Transmit Unit] value to <n>. Unless the peer
+# requests a smaller value via MRU negotiation, pppd will request that
+# the kernel networking code send data packets of no more than n bytes
+# through the PPP network interface.
+#mtu <n>
+
+# Set the name of the local system for authentication purposes to <n>.
+# This is a privileged option. With this option, pppd will use lines in the
+# secrets files which have <n> as the second field when looking for a
+# secret to use in authenticating the peer. In addition, unless overridden
+# with the user option, <n> will be used as the name to send to the peer
+# when authenticating the local system to the peer. (Note that pppd does
+# not append the domain name to <n>.)
+#name <n>
+
+# Enforce the use of the hostname as the name of the local system for
+# authentication purposes (overrides the name option).
+#usehostname
+
+# Set the assumed name of the remote system for authentication purposes
+# to <n>.
+#remotename <n>
+
+# Add an entry to this system's ARP [Address Resolution Protocol]
+# table with the IP address of the peer and the Ethernet address of this
+# system.
+proxyarp
+
+# Use the system password database for authenticating the peer using
+# PAP. Note: mgetty already provides this option. If this is specified
+# then dialin from users using a script under Linux to fire up ppp wont work.
+# login
+
+# If this option is given, pppd will send an LCP echo-request frame to the
+# peer every n seconds. Normally the peer should respond to the echo-request
+# by sending an echo-reply. This option can be used with the
+# lcp-echo-failure option to detect that the peer is no longer connected.
+lcp-echo-interval 30
+
+# If this option is given, pppd will presume the peer to be dead if n
+# LCP echo-requests are sent without receiving a valid LCP echo-reply.
+# If this happens, pppd will terminate the connection. Use of this
+# option requires a non-zero value for the lcp-echo-interval parameter.
+# This option can be used to enable pppd to terminate after the physical
+# connection has been broken (e.g., the modem has hung up) in
+# situations where no hardware modem control lines are available.
+lcp-echo-failure 4
+
+# Set the LCP restart interval (retransmission timeout) to <n> seconds
+# (default 3).
+#lcp-restart <n>
+
+# Set the maximum number of LCP terminate-request transmissions to <n>
+# (default 3).
+#lcp-max-terminate <n>
+
+# Set the maximum number of LCP configure-request transmissions to <n>
+# (default 10).
+#lcp-max-configure <n>
+
+# Set the maximum number of LCP configure-NAKs returned before starting
+# to send configure-Rejects instead to <n> (default 10).
+#lcp-max-failure <n>
+
+# Set the IPCP restart interval (retransmission timeout) to <n>
+# seconds (default 3).
+#ipcp-restart <n>
+
+# Set the maximum number of IPCP terminate-request transmissions to <n>
+# (default 3).
+#ipcp-max-terminate <n>
+
+# Set the maximum number of IPCP configure-request transmissions to <n>
+# (default 10).
+#ipcp-max-configure <n>
+
+# Set the maximum number of IPCP configure-NAKs returned before starting
+# to send configure-Rejects instead to <n> (default 10).
+#ipcp-max-failure <n>
+
+# Set the PAP restart interval (retransmission timeout) to <n> seconds
+# (default 3).
+#pap-restart <n>
+
+# Set the maximum number of PAP authenticate-request transmissions to
+# <n> (default 10).
+#pap-max-authreq <n>
+
+# Set the maximum time that pppd will wait for the peer to authenticate
+# itself with PAP to <n> seconds (0 means no limit).
+#pap-timeout <n>
+
+# Set the CHAP restart interval (retransmission timeout for
+# challenges) to <n> seconds (default 3).
+#chap-restart <n>
+
+# Set the maximum number of CHAP challenge transmissions to <n>
+# (default 10).
+#chap-max-challenge
+
+# If this option is given, pppd will rechallenge the peer every <n>
+# seconds.
+#chap-interval <n>
+
+# With this option, pppd will accept the peer's idea of our local IP
+# address, even if the local IP address was specified in an option.
+#ipcp-accept-local
+
+# With this option, pppd will accept the peer's idea of its (remote) IP
+# address, even if the remote IP address was specified in an option.
+#ipcp-accept-remote
+
+# Disable the IPXCP and IPX protocols.
+# To let pppd pass IPX packets comment this out --- you'll probably also
+# want to install ipxripd, and have the Internal IPX Network option enabled
+# in your kernel. /usr/doc/HOWTO/IPX-HOWTO.gz contains more info.
+noipx
+
+# Exit once a connection has been made and terminated. This is the default,
+# unless the `persist' or `demand' option has been specified.
+#nopersist
+
+# Do not exit after a connection is terminated; instead try to reopen
+# the connection.
+#persist
+
+# Terminate after n consecutive failed connection attempts.
+# A value of 0 means no limit. The default value is 10.
+#maxfail <n>
+
+# Initiate the link only on demand, i.e. when data traffic is present.
+# With this option, the remote IP address must be specified by the user on
+# the command line or in an options file. Pppd will initially configure
+# the interface and enable it for IP traffic without connecting to the peer.
+# When traffic is available, pppd will connect to the peer and perform
+# negotiation, authentication, etc. When this is completed, pppd will
+# commence passing data packets (i.e., IP packets) across the link.
+#demand
+
+# Specifies that pppd should disconnect if the link is idle for <n> seconds.
+# The link is idle when no data packets (i.e. IP packets) are being sent or
+# received. Note: it is not advisable to use this option with the persist
+# option without the demand option. If the active-filter option is given,
+# data packets which are rejected by the specified activity filter also
+# count as the link being idle.
+#idle <n>
+
+# Specifies how many seconds to wait before re-initiating the link after
+# it terminates. This option only has any effect if the persist or demand
+# option is used. The holdoff period is not applied if the link was
+# terminated because it was idle.
+#holdoff <n>
+
+# Wait for up n milliseconds after the connect script finishes for a valid
+# PPP packet from the peer. At the end of this time, or when a valid PPP
+# packet is received from the peer, pppd will commence negotiation by
+# sending its first LCP packet. The default value is 1000 (1 second).
+# This wait period only applies if the connect or pty option is used.
+#connect-delay <n>
+
+# Packet filtering: for more information, see pppd(8)
+# Any packets matching the filter expression will be interpreted as link
+# activity, and will cause a "demand" connection to be activated, and reset
+# the idle connection timer. (idle option)
+# The filter expression is akin to that of tcpdump(1)
+#active-filter <filter-expression>
+
+# uncomment the line below this if you use PPPoE
+#plugin /usr/lib/pppd/plugins/pppoe.so
+
+# ---<End of File>---
diff --git a/core/ppp/plog b/core/ppp/plog
new file mode 100644
index 000000000..84d2c7340
--- /dev/null
+++ b/core/ppp/plog
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -s /var/log/ppp.log ]; then
+ exec tail "$@" /var/log/ppp.log
+else
+ exec tail "$@" /var/log/syslog | grep ' \(pppd\|chat\)\['
+fi
diff --git a/core/ppp/poff b/core/ppp/poff
new file mode 100644
index 000000000..8b4dffc59
--- /dev/null
+++ b/core/ppp/poff
@@ -0,0 +1,103 @@
+#!/bin/sh
+
+# Written by John Hasler <john@dhh.gt.org> and based on work
+# by Phil Hands <phil@hands.com>. Distributed under the GNU GPL
+
+if [ -x /usr/bin/kill ]; then
+ KILL="/usr/bin/kill"
+else
+ KILL="/bin/kill"
+fi
+SIG=TERM
+DONE="stopped"
+MODE=""
+
+usage ()
+{
+ cat <<!EOF!
+usage: $0 [option] [provider]
+options:
+ -r Cause pppd to drop the line and redial.
+ -d Toggle the state of pppd's debug option.
+ -c Cause pppd to renegotiate compression.
+ -a Stop all pppd's. 'provider' will be ignored.
+ -h Print this help summary and exit.
+ -v Print version and exit.
+ none Stop pppd.
+
+Options may not be combined.
+
+If 'provider' is omitted pppd will be stopped or signalled if and only if
+there is exactly one running unless the '-a' option was given. If
+'provider' is supplied the pppd controlling the connection to that
+provider will be stopped or signalled.
+!EOF!
+}
+
+# Get option. If there are none replace the "?" that getopts puts in
+# FLAG on error with "null".
+getopts rdcavh FLAG
+if [ "$?" -ne 0 ]; then
+ FLAG="null"
+fi
+
+# Check for additional options. Should be none.
+getopts :rdcavh DUMMY
+if [ "$?" -eq 0 ]; then
+ echo "$0: Illegal option -- ${OPTARG}."
+ exit 1
+fi
+
+case $FLAG in
+ "r") SIG=HUP; DONE=signalled; shift ;;
+ "d") SIG=USR1; DONE=signalled; shift ;;
+ "c") SIG=USR2; DONE=signalled; shift ;;
+ "a") MODE="all"; shift ;;
+ "v") echo "$0$Revision: 1.1 $_TrickToPrint_RCS_Revision"; exit 0 ;;
+ "h") usage; exit 0 ;;
+ "?") exit 1;
+esac
+
+# Get the PIDs of all the pppds running. Could also get these from
+# /var/run, but pppd doesn't create .pid files until ppp is up.
+PIDS=`pidof pppd`
+
+# poff is pointless if pppd isn't running.
+if test -z "$PIDS"; then
+ echo "$0: No pppd is running. None ${DONE}."
+ exit 1
+fi
+
+# Find out how many pppd's are running.
+N=`echo "$PIDS" | wc -w`
+
+# If there are no arguments we can't do anything if there is more than one
+# pppd running.
+if test "$#" -eq 0 -a "$N" -gt 1 -a $FLAG != "a" ; then
+ echo "$0: More than one pppd running and no "-a" option and
+no arguments supplied. Nothing ${DONE}."
+ exit 1
+fi
+
+# If either there are no arguments or '-a' was specified kill all the
+# pppd's.
+if test "$#" -eq 0 -o "$MODE" = "all" ; then
+ $KILL -$SIG $PIDS || {
+ echo "$0: $KILL failed. None ${DONE}."
+ exit 1
+ }
+ exit 0
+fi
+
+# There is an argument, so kill the pppd started on that provider.
+PID=`ps axw | grep "[ /]pppd call $1 *\$" | awk '{print $1}'`
+if test -n "$PID" ; then
+ $KILL -$SIG $PID || {
+ echo "$0: $KILL failed. None ${DONE}."
+ exit 1
+ }
+else
+ echo "$0: I could not find a pppd process for provider '$1'. None ${DONE}."
+ exit 1
+fi
+exit 0
diff --git a/core/ppp/pon b/core/ppp/pon
new file mode 100644
index 000000000..36885050b
--- /dev/null
+++ b/core/ppp/pon
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+case "$1" in
+ -*) echo "
+Usage: pon [provider] [arguments]
+
+If you specify one argument, a PPP connection will be started using
+settings from the appropriate file in the /etc/ppp/peers/ directory, and
+any additional arguments supplied will be passed as extra arguments to
+pppd.
+"
+ exit 0
+ ;;
+esac
+
+if [ -z "$1" -a ! -f /etc/ppp/peers/provider ]; then
+ echo "
+Please configure /etc/ppp/peers/provider or use a command line argument to
+use another file in /etc/ppp/peers/ directory.
+"
+ exit 1
+fi
+
+if [ "$1" -a ! -f "/etc/ppp/peers/$1" ]; then
+ echo "
+The file /etc/ppp/peers/$1 does not exist.
+"
+ exit 1
+fi
+
+exec /usr/sbin/pppd call ${@:-provider}
+
diff --git a/core/ppp/pon.1 b/core/ppp/pon.1
new file mode 100644
index 000000000..bb3220564
--- /dev/null
+++ b/core/ppp/pon.1
@@ -0,0 +1,121 @@
+.\" This manual is published under the GPL.
+.\" All guidelines specified in the GPL apply here.
+.\" To get an ascii file:
+.\" groff -man -Tascii pon.1 > pon.txt
+.\"
+.TH PON 1 "July 2000" "Debian Project" "Debian PPPD"
+.SH NAME
+pon, poff, plog \- starts up, shuts down or lists the log of PPP connections
+.SH SYNOPSIS
+.B pon
+[ isp-name [ options ] ]
+.br
+.B poff
+[ -r ] [ -d ] [ -c ] [ -a ] [ -h ] [ isp-name ]
+.br
+.B plog
+[ arguments ]
+.SH DESCRIPTION
+This manual page describes the \fBpon\fP, \fBplog\fP and \fBpoff\fP
+scripts, which allow users to control PPP connections.
+..
+.SS pon
+\fBpon\fP, invoked without arguments, runs the \fI/etc/ppp/ppp_on_boot\fP
+file, if it exists and is executable. Otherwise, a PPP connection will be
+started using configuration from \fI/etc/ppp/peers/provider\fP.
+This is the default behaviour unless an \fBisp-name\fP argument is given.
+.PP
+For instance, to use ISP configuration "myisp" run:
+.IP
+pon myisp
+.PP
+\fBpon\fP will then use the options file \fI/etc/ppp/peers/myisp\fP.
+You can pass additional \fBoptions\fP after the ISP name, too.
+\fBpon\fP can be used to run multiple, simultaneous PPP connections.
+..
+.SS poff
+\fBpoff\fP closes a PPP connection. If more than one PPP connection exists,
+the one named in the argument to \fBpoff\fP will be killed, e.g.
+.IP
+poff myprovider2
+.PP
+will terminate the connection to myprovider2, and leave the PPP connections
+to e.g. "myprovider1" or "myprovider3" up and running.
+.PP
+\fBpoff\fP takes the following command line options:
+.RS
+.TP
+.B "\-r"
+causes the connection to be redialed after it is dropped.
+.TP
+.B "\-d"
+toggles the state of pppd's debug option.
+.TP
+.B "\-c"
+causes
+.BR pppd (8)
+to renegotiate compression.
+.TP
+.B "\-a"
+stops all running ppp connections. If the argument \fBisp-name\fP
+is given it will be ignored.
+.TP
+.B "\-h"
+displays help information.
+.TP
+.B "\-v"
+prints the version and exits.
+.PP
+If no argument is given, \fBpoff\fP will stop or signal pppd if and only
+if there is exactly one running. If more than one connection is active,
+it will exit with an error code of 1.
+..
+.SS plog
+\fBplog\fP shows you the last few lines of \fI/var/log/ppp.log\fP. If that
+file doesn't exist, it shows you the last few lines of your
+\fI/var/log/syslog\fP file, but excluding the lines not generated by pppd.
+This script makes use of the
+.BR tail (1)
+command, so arguments that can be passed to
+.BR tail (1)
+can also be passed to \fBplog\fP.
+.PP
+Note: the \fBplog\fP script can only be used by root or another system
+administrator in group "adm", due to security reasons. Also, to have all
+pppd-generated information in one logfile, that plog can show, you need the
+following line in your \fI/etc/syslog.conf\fP file:
+.PP
+local2.* -/var/log/ppp.log
+.RE
+.SH FILES
+.TP
+.I /etc/ppp/options
+PPPd system options file.
+.TP
+.I /etc/ppp/pap-secrets
+System PAP passwords file.
+.TP
+.I /etc/ppp/chap-secrets
+System CHAP passwords file.
+.TP
+.I /etc/ppp/peers/
+Directory holding the peer options files. The default file is called
+\fIprovider\fP.
+.TP
+.I /etc/chatscripts/provider
+The chat script invoked from the default \fI/etc/ppp/peers/provider\fP.
+.TP
+.I /var/log/ppp.log
+The default PPP log file.
+.SH AUTHORS
+The p-commands were written by Christoph Lameter <clameter@debian.org>.
+Updated and revised by Philip Hands <phil@hands.com>.
+.br
+This manual was written by Othmar Pasteka <othmar@tron.at>. Modified
+by Rob Levin <lilo@openprojects.net>, with some extensions taken from
+the old p-commands manual written by John Hasler <jhasler@debian.org>.
+.SH "SEE ALSO"
+.BR pppd (8),
+.BR chat (8),
+.BR tail (1).
+
diff --git a/core/ppp/ppp b/core/ppp/ppp
new file mode 100644
index 000000000..16e01bad7
--- /dev/null
+++ b/core/ppp/ppp
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/pppd`
+case "$1" in
+ start)
+ stat_busy "Starting PPP daemon"
+ [ -z "$PID" ] && /usr/bin/pon
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon ppp
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping PPP daemon"
+ [ ! -z "$PID" ] && poff -a &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon ppp
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/pptpclient/PKGBUILD b/core/pptpclient/PKGBUILD
new file mode 100644
index 000000000..85bf0544e
--- /dev/null
+++ b/core/pptpclient/PKGBUILD
@@ -0,0 +1,33 @@
+# $Id: PKGBUILD 99891 2010-11-19 12:45:55Z allan $
+# Maintainer: Daniel Isenmann <daniel @ archlinux.org>
+# Contributor: Mark Nikkel <mnikkel@gmail.com>
+
+pkgname=pptpclient
+pkgver=1.7.2
+pkgrel=3
+pkgdesc="Client for the proprietary Microsoft Point-to-Point Tunneling Protocol, PPTP."
+arch=('i686' 'x86_64')
+url="http://pptpclient.sourceforge.net/"
+license=('GPL')
+depends=('ppp' 'iproute2')
+backup=(etc/ppp/options.pptp)
+source=(http://downloads.sourceforge.net/sourceforge/pptpclient/pptp-$pkgver.tar.gz)
+md5sums=('4c3d19286a37459a632c7128c92a9857')
+
+build() {
+ cd $srcdir/pptp-$pkgver
+
+ # use our CFLAGS and LDFLAGS
+ sed -i -e "/CFLAGS =/ c\CFLAGS = ${CFLAGS}" Makefile
+ sed -i -e "/LDFLAGS =/ c\LDFLAGS = ${LDFLAGS}" Makefile
+
+ # adjust ip path
+ sed -i 's#/bin/ip#/usr/sbin/ip#' routing.c
+
+ make
+}
+
+package() {
+ cd $srcdir/pptp-$pkgver
+ make DESTDIR=$pkgdir install
+}
diff --git a/core/procinfo-ng/PKGBUILD b/core/procinfo-ng/PKGBUILD
new file mode 100644
index 000000000..f908879af
--- /dev/null
+++ b/core/procinfo-ng/PKGBUILD
@@ -0,0 +1,37 @@
+# $Id: PKGBUILD 102696 2010-12-09 23:17:33Z eric $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+# Contributor: Allan McRae <allan@archlinux.org>
+
+pkgname=procinfo-ng
+pkgver=2.0.304
+pkgrel=2
+pkgdesc="Displays useful information from /proc"
+arch=('i686' 'x86_64')
+url="http://procinfo-ng.sourceforge.net/"
+license=('GPL2' 'LGPL2.1')
+depends=('ncurses' 'perl')
+provides=('procinfo')
+conflicts=('procinfo')
+replaces=('procinfo')
+source=(http://downloads.sourceforge.net/project/procinfo-ng/procinfo-ng/2.0.304/${pkgname}-${pkgver}.tar.bz2
+ ftp://ftp.archlinux.org/other/procinfo-ng/procinfo-18.tar.gz)
+md5sums=('ed018fe37becc36ceb1ebe3ed909c4d2' '27658d0a69040aca05a65b9888599d50')
+sha1sums=('da2176a505bcdf65c4eadcf5a2e056fb7a3f84af' '8bc75669cbd27775c3a837209425c5ce76238ebc')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ # install tools from old procinfo package
+ cd "${srcdir}/procinfo-18"
+ install -m755 lsdev.pl "${pkgdir}/usr/bin/lsdev"
+ install -m755 socklist.pl "${pkgdir}/usr/bin/socklist"
+ install -m644 lsdev.8 "${pkgdir}/usr/share/man/man8/lsdev.8"
+ install -m644 socklist.8 "${pkgdir}/usr/share/man/man8/socklist.8"
+}
diff --git a/core/procps/PKGBUILD b/core/procps/PKGBUILD
new file mode 100644
index 000000000..225e4db6f
--- /dev/null
+++ b/core/procps/PKGBUILD
@@ -0,0 +1,75 @@
+# $Id: PKGBUILD 102904 2010-12-12 23:53:18Z eric $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+
+pkgname=procps
+pkgver=3.2.8
+pkgrel=3
+pkgdesc="Utilities for monitoring your system and processes on your system"
+arch=('i686' 'x86_64')
+url="http://procps.sourceforge.net/"
+license=('GPL' 'LGPL')
+groups=('base')
+depends=('ncurses')
+backup=('etc/sysctl.conf')
+source=(http://procps.sourceforge.net/procps-${pkgver}.tar.gz sysctl.conf\
+ groff-top-manpage.patch procps-3.2.7-free-hlmem.patch\
+ procps-3.2.7-longcmd.patch procps-3.2.7-ps-man-fmt.patch\
+ procps-3.2.7-psman.patch procps-3.2.7-slabtop-once.patch\
+ procps-3.2.7-top-clrscr.patch procps-3.2.7-top-cpu0.patch\
+ procps-3.2.7-top-env-cpuloop.patch procps-3.2.7-top-manpage.patch\
+ procps-3.2.7-top-remcpu.patch procps-3.2.7-top-sorthigh.patch\
+ procps-3.2.7-watch-unicode.patch procps-3.2.7-w-best.patch\
+ procps-3.2.8+gmake-3.82.patch procps-3.2.8-setlocale.patch\
+ procps-3.2.8-threads.patch procps-3.2.8-linux-ver-init.patch)
+md5sums=('9532714b6846013ca9898984ba4cd7e0' '9be3a131a7068aae11418e6dd99e2221'\
+ '111f33c3fd8fab2fed36c279065fefff' '81ac7fb50fcdb03e57055c7b763bb275'\
+ 'cb020bfd46689908b56bf3fc5a55828a' '8d74603be1e426037a1e2c2743ef7345'\
+ 'bfb7530e248b86f1abf32bca09f28b68' '9a8c81aee89531b4a72f4e4e44fb055d'\
+ '511023a3f39a90aa6efcf77120d32eb6' 'f29ef0b3a74767469651c9c335f09403'\
+ 'd49673c19fa1a70f8e03fc1c24233458' '669955ca7fa7688e1c3ae7e723e0a567'\
+ 'f77626450619b4bebbd67b9e164f1857' 'c71b853144b4d22b861e435362845091'\
+ '105fbbf179e63b7ca960a2dd2e5fab5b' '7f2540d2d4a2a1a6af70e9a980835753'\
+ '8d1025ae906bf0320ad9bb5095f1b970' '2e6cce598f11d75becebbe58dbe9cbd4'\
+ 'e2e5393d49034435c68469d008d56489' '6f46c8ea37c447a2d478883e89bf4d25')
+sha1sums=('a0c86790569dec26b5d9037e8868ca907acc9829' '9b9a314010d042b5aa487893c06f361531525e6a'\
+ 'bdd627f602ed2e38994d49309de0edbd90b41aff' 'da1b9e61f8df4a8e23a7032b245dd99e32e2c01c'\
+ '1a656d8094be41e019b2a9598b07c8a3d47f9de3' 'ba9ad9f0bde3e84484b5a0238e53534438e924be'\
+ '9944224ed2f5bd7d7fb505127bd71d6f01d88373' '954026785a9e6c90d796e93563fcea2a693691e8'\
+ '8582cd15346fa939f3fd01081620de0ffc617335' '80e31310da53baf095e905d94485324932e433df'\
+ '15fe886a2b4bed5885e6d457954e1145d1dcd2a2' '16737700b22eec8f4e8d16bce099f4b1662501e2'\
+ 'bce21809ee0cb917ddf5b0c0bf2a91ea50feb0c6' '1be00d71e8e16ff2d656e5dd1f9988f2f3c0d5a0'\
+ '52068a433535ec3d5d974141be3d6d3b6a41725a' '3a8f1ba912112d7520becb28746e97b11d9b0c86'\
+ '3a4908ed8dbc936e39cb9094af8098ef9e656581' '09b1f6a3f9691b9f1432549a7a74a90ee5cfbdde'\
+ '926b92913201f21c45d48436c0902cffc059ce27' '171d5352940200c209e0c2d43c17f01c02173a66')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -p1 < ../groff-top-manpage.patch
+ patch -p1 < ../procps-3.2.7-top-manpage.patch
+ patch -p1 < ../procps-3.2.7-free-hlmem.patch
+ patch -p1 < ../procps-3.2.7-ps-man-fmt.patch
+ patch -p1 < ../procps-3.2.7-psman.patch
+ patch -p1 < ../procps-3.2.7-longcmd.patch
+ patch -p1 < ../procps-3.2.7-slabtop-once.patch
+ patch -p1 < ../procps-3.2.7-top-clrscr.patch
+ patch -p1 < ../procps-3.2.7-top-cpu0.patch
+ patch -p1 < ../procps-3.2.7-top-env-cpuloop.patch
+ patch -p1 < ../procps-3.2.7-top-remcpu.patch
+ patch -p1 < ../procps-3.2.7-top-sorthigh.patch
+ patch -p1 < ../procps-3.2.7-watch-unicode.patch
+ patch -p1 < ../procps-3.2.7-w-best.patch
+ patch -p1 < ../procps-3.2.8+gmake-3.82.patch
+ patch -p1 < ../procps-3.2.8-setlocale.patch
+ patch -p1 < ../procps-3.2.8-threads.patch
+ patch -p0 < ../procps-3.2.8-linux-ver-init.patch
+ sed -i "s:\$(lib64):lib:" Makefile
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" ldconfig=/bin/true install
+ install -D -m644 "${srcdir}/sysctl.conf" "${pkgdir}/etc/sysctl.conf"
+ install -d "${pkgdir}/usr/include/proc"
+ install -m644 proc/*.h "${pkgdir}/usr/include/proc"
+}
diff --git a/core/procps/groff-top-manpage.patch b/core/procps/groff-top-manpage.patch
new file mode 100644
index 000000000..625053c72
--- /dev/null
+++ b/core/procps/groff-top-manpage.patch
@@ -0,0 +1,39 @@
+diff -Naur procps-3.2.8-orig//top.1 procps-3.2.8/top.1
+--- procps-3.2.8-orig//top.1 2010-11-19 00:43:13.000000000 -0500
++++ procps-3.2.8/top.1 2010-11-19 00:44:06.000000000 -0500
+@@ -42,7 +42,7 @@
+ .ds EM \ \fB\-\-\ \fR
+ \# - these two are for chuckles, makes great grammar
+ .ds Me top
+-.ds ME \fBtop\fR
++.ds MM \fBtop\fR
+ \# - other misc strings for consistent usage/emphasis
+ .ds F \fIOff\fR
+ .ds O \fIOn\fR
+@@ -85,7 +85,7 @@
+ .\" ----------------------------------------------------------------------
+ .SH SYNOPSIS
+ .\" ----------------------------------------------------------------------
+-\*(ME \-\fBhv\fR | \-\fBbcHisS\fR \-\fBd\fI delay\fR \-\fBn\fI
++\*(MM \-\fBhv\fR | \-\fBbcHisS\fR \-\fBd\fI delay\fR \-\fBn\fI
+ iterations\fR \-\fBp\fI pid\fR [,\fI pid\fR ...]
+
+ The traditional switches '-' and whitespace are optional.
+@@ -94,7 +94,7 @@
+ .\" ----------------------------------------------------------------------
+ .SH DESCRIPTION
+ .\" ----------------------------------------------------------------------
+-The \*(ME program provides a dynamic real-time view of a running system.
++The \*(MM program provides a dynamic real-time view of a running system.
+ It can display\fB system\fR summary information as well as a list of\fB
+ tasks\fR currently being managed by the Linux kernel.
+ The types of system summary information shown and the types, order and
+@@ -104,7 +104,7 @@
+ The program provides a limited interactive interface for process
+ manipulation as well as a much more extensive interface for personal
+ configuration \*(EM encompassing every aspect of its operation.
+-And while \*(ME is referred to throughout this document, you are free
++And while \*(MM is referred to throughout this document, you are free
+ to name the program anything you wish.
+ That new name, possibly an alias, will then be reflected on \*(Me's display
+ and used when reading and writing a \*(CF.
diff --git a/core/procps/procps-3.2.7-free-hlmem.patch b/core/procps/procps-3.2.7-free-hlmem.patch
new file mode 100644
index 000000000..c5ef9cc4c
--- /dev/null
+++ b/core/procps/procps-3.2.7-free-hlmem.patch
@@ -0,0 +1,23 @@
+diff -up procps-3.2.7/free.1.hlmem procps-3.2.7/free.1
+--- procps-3.2.7/free.1.hlmem 2009-02-24 10:54:35.000000000 +0100
++++ procps-3.2.7/free.1 2009-02-24 11:00:26.000000000 +0100
+@@ -7,7 +7,7 @@ free \- Display amount of free and used
+ .SH SYNOPSIS
+ .BR "free " [ "\-b" " | " "\-k" " | " "\-m" "] [" "\-o" "] [" "\-s"
+ .I delay
+-.RB "] [" "\-t" "] [" "\-V" ]
++.RB "] [" "\-t" "] [" "\-l" "] [" "\-V" "]
+ .SH DESCRIPTION
+ \fBfree\fP displays the total amount of free and used physical and swap
+ memory in the system, as well as the buffers used by the kernel.
+@@ -28,7 +28,9 @@ may actually specify any floating point
+ .BR usleep (3)
+ is used for microsecond resolution delay times.
+ .PP
+-The \fB\-V\fP displays version information.
++The \fB-l\fP switch shows detailed low and high memory statistics.
++.PP
++The \fB\-V\fP switch displays version information.
+ .SH FILES
+ .ta
+ .IR /proc/meminfo "\-\- memory information"
diff --git a/core/procps/procps-3.2.7-longcmd.patch b/core/procps/procps-3.2.7-longcmd.patch
new file mode 100644
index 000000000..7c4fdca36
--- /dev/null
+++ b/core/procps/procps-3.2.7-longcmd.patch
@@ -0,0 +1,22 @@
+--- procps-3.2.7/proc/readproc.c.kzak 2006-06-16 10:18:13.000000000 +0200
++++ procps-3.2.7/proc/readproc.c 2006-09-27 11:25:13.000000000 +0200
+@@ -432,14 +432,17 @@
+ if(fd==-1) return NULL;
+
+ /* read whole file into a memory buffer, allocating as we go */
+- while ((n = read(fd, buf, sizeof buf - 1)) > 0) {
++ while ((n = read(fd, buf, sizeof buf - 1)) >= 0) {
+ if (n < (int)(sizeof buf - 1))
+ end_of_file = 1;
+- if (n == 0 && rbuf == 0)
++ if (n == 0 && rbuf == 0) {
++ close(fd);
+ return NULL; /* process died between our open and read */
++ }
+ if (n < 0) {
+ if (rbuf)
+ free(rbuf);
++ close(fd);
+ return NULL; /* read error */
+ }
+ if (end_of_file && buf[n-1]) /* last read char not null */
diff --git a/core/procps/procps-3.2.7-ps-man-fmt.patch b/core/procps/procps-3.2.7-ps-man-fmt.patch
new file mode 100644
index 000000000..f3a80dca7
--- /dev/null
+++ b/core/procps/procps-3.2.7-ps-man-fmt.patch
@@ -0,0 +1,12 @@
+diff -up procps-3.2.7/ps/ps.1.ps-man-fmt procps-3.2.7/ps/ps.1
+--- procps-3.2.7/ps/ps.1.ps-man-fmt 2008-09-01 11:43:18.000000000 +0200
++++ procps-3.2.7/ps/ps.1 2008-09-01 11:43:41.000000000 +0200
+@@ -30,7 +30,7 @@
+ .\" the space needed for the 1st two columns.
+ .\" Making it messy: inches, ens, points, scaled points...
+ .\"
+-.nr ColSize ((\n(.lu-\n(.iu/\n(.Hu-20u)n)
++.nr ColSize ((\n[.l] - \n[.i]) / 1n - 20)
+ .\"
+ .\" This is for command options
+ .nr OptSize (16u)
diff --git a/core/procps/procps-3.2.7-psman.patch b/core/procps/procps-3.2.7-psman.patch
new file mode 100644
index 000000000..7ba6cff34
--- /dev/null
+++ b/core/procps/procps-3.2.7-psman.patch
@@ -0,0 +1,22 @@
+--- procps-3.2.7/ps/ps.1.psman 2007-06-20 08:30:47.000000000 +0200
++++ procps-3.2.7/ps/ps.1 2007-06-20 08:50:10.000000000 +0200
+@@ -21,8 +21,8 @@
+ .\" See /usr/share/groff/current/tmac/an-old.tmac for what these do.
+ .\" Setting them to zero provides extra space, but only do that for
+ .\" plain text output. PostScript and such will remain indented.
+-.if n .nr IN 0n
+-.if n .nr an-prevailing-indent 0n
++.\" .if n .nr IN 0n
++.\" .if n .nr an-prevailing-indent 0n
+ .\"
+ .\"
+ .\" ColSize is used for the format spec table.
+@@ -838,6 +838,8 @@
+ .\" lB1 lB1 lBw(5.5i)
+ .\" lB1 l1 l.
+ .\"
++.RE
++
+ .TS
+ expand;
+ lB1 lB1 lBw(\n[ColSize]n)
diff --git a/core/procps/procps-3.2.7-slabtop-once.patch b/core/procps/procps-3.2.7-slabtop-once.patch
new file mode 100644
index 000000000..d3319cfe7
--- /dev/null
+++ b/core/procps/procps-3.2.7-slabtop-once.patch
@@ -0,0 +1,113 @@
+diff -up procps-3.2.7/slabtop.c.once procps-3.2.7/slabtop.c
+--- procps-3.2.7/slabtop.c.once 2008-12-11 13:24:52.000000000 +0100
++++ procps-3.2.7/slabtop.c 2008-12-11 13:33:12.000000000 +0100
+@@ -268,9 +268,24 @@ static void parse_input(char c)
+ }
+ }
+
++/*printw or printf depending on the context*/
++static void printwf(int once, const char *s,...)
++{
++va_list va;
++
++va_start(va,s);
++if(once)
++ vprintf(s,va);
++else
++ vwprintw(stdscr, s, va);
++va_end(va);
++}
++
++
+ int main(int argc, char *argv[])
+ {
+ int o;
++ int once = 0;
+ unsigned short old_rows;
+ struct slab_info *slab_list = NULL;
+
+@@ -307,6 +322,7 @@ int main(int argc, char *argv[])
+ break;
+ case 'o':
+ delay = 0;
++ once = 1;
+ break;
+ case 'V':
+ display_version();
+@@ -322,12 +338,18 @@ int main(int argc, char *argv[])
+ if (tcgetattr(0, &saved_tty) == -1)
+ perror("tcgetattr");
+
+- initscr();
+- term_size(0);
+- old_rows = rows;
+- resizeterm(rows, cols);
+- signal(SIGWINCH, term_size);
+- signal(SIGINT, sigint_handler);
++ if(!once) {
++ initscr();
++ term_size(0);
++ old_rows = rows;
++ resizeterm(rows, cols);
++ signal(SIGWINCH, term_size);
++ signal(SIGINT, sigint_handler);
++ } else {
++ old_rows = rows;
++ rows = 80;
++ cols = 24;
++ }
+
+ do {
+ struct slab_info *curr;
+@@ -341,12 +363,12 @@ int main(int argc, char *argv[])
+ break;
+
+ if (old_rows != rows) {
+- resizeterm(rows, cols);
++ if(!once) resizeterm(rows, cols);
+ old_rows = rows;
+ }
+
+ move(0,0);
+- printw( " Active / Total Objects (%% used) : %d / %d (%.1f%%)\n"
++ printwf(once, " Active / Total Objects (%% used) : %d / %d (%.1f%%)\n"
+ " Active / Total Slabs (%% used) : %d / %d (%.1f%%)\n"
+ " Active / Total Caches (%% used) : %d / %d (%.1f%%)\n"
+ " Active / Total Size (%% used) : %.2fK / %.2fK (%.1f%%)\n"
+@@ -360,15 +382,15 @@ int main(int argc, char *argv[])
+
+ slab_list = slabsort(slab_list);
+
+- attron(A_REVERSE);
+- printw( "%6s %6s %4s %8s %6s %8s %10s %-23s\n",
++ if(!once) attron(A_REVERSE);
++ printwf(once, "%6s %6s %4s %8s %6s %8s %10s %-23s\n",
+ "OBJS", "ACTIVE", "USE", "OBJ SIZE", "SLABS",
+ "OBJ/SLAB", "CACHE SIZE", "NAME");
+- attroff(A_REVERSE);
++ if(!once) attroff(A_REVERSE);
+
+ curr = slab_list;
+ for (i = 0; i < rows - 8 && curr->next; i++) {
+- printw("%6u %6u %3u%% %7.2fK %6u %8u %9uK %-23s\n",
++ printwf(once, "%6u %6u %3u%% %7.2fK %6u %8u %9uK %-23s\n",
+ curr->nr_objs, curr->nr_active_objs, curr->use,
+ curr->obj_size / 1024.0, curr->nr_slabs,
+ curr->objs_per_slab, (unsigned)(curr->cache_size / 1024),
+@@ -376,7 +398,7 @@ int main(int argc, char *argv[])
+ curr = curr->next;
+ }
+
+- refresh();
++ if(!once) refresh();
+ put_slabinfo(slab_list);
+
+ FD_ZERO(&readfds);
+@@ -392,6 +414,6 @@ int main(int argc, char *argv[])
+
+ tcsetattr(0, TCSAFLUSH, &saved_tty);
+ free_slabinfo(slab_list);
+- endwin();
++ if(!once) endwin();
+ return 0;
+ }
diff --git a/core/procps/procps-3.2.7-top-clrscr.patch b/core/procps/procps-3.2.7-top-clrscr.patch
new file mode 100644
index 000000000..8a0256846
--- /dev/null
+++ b/core/procps/procps-3.2.7-top-clrscr.patch
@@ -0,0 +1,19 @@
+diff -up procps-3.2.7/top.c.clrscr procps-3.2.7/top.c
+--- procps-3.2.7/top.c.clrscr 2008-04-08 08:49:48.000000000 +0200
++++ procps-3.2.7/top.c 2008-04-08 08:50:07.000000000 +0200
+@@ -2109,6 +2109,7 @@ static void fields_sort (void)
+ *p = x + 'A';
+ Curwin->rc.sortindx = x;
+ putp(Cap_curs_norm);
++ putp(Cap_clr_scr);
+ }
+
+
+@@ -2134,6 +2135,7 @@ static void fields_toggle (void)
+ *p = i + 'A';
+ }
+ putp(Cap_curs_norm);
++ putp(Cap_clr_scr);
+ }
+
+ /*###### Windows/Field Groups support #################################*/
diff --git a/core/procps/procps-3.2.7-top-cpu0.patch b/core/procps/procps-3.2.7-top-cpu0.patch
new file mode 100644
index 000000000..eb81121c5
--- /dev/null
+++ b/core/procps/procps-3.2.7-top-cpu0.patch
@@ -0,0 +1,20 @@
+--- procps-3.2.7/top.c.orig 2007-09-07 21:28:41.000000000 +0100
++++ procps-3.2.7/top.c 2007-09-07 21:29:15.000000000 +0100
+@@ -959,8 +959,15 @@
+
+ // and just in case we're 2.2.xx compiled without SMP support...
+ if (Cpu_tot == 1) {
+- cpus[1].id = 0;
+- memcpy(cpus, &cpus[1], sizeof(CPU_t));
++ cpus[0].id = cpus[1].id = 0;
++ cpus[0].u = cpus[1].u;
++ cpus[0].n = cpus[1].n;
++ cpus[0].s = cpus[1].s;
++ cpus[0].i = cpus[1].i;
++ cpus[0].w = cpus[1].w;
++ cpus[0].x = cpus[1].x;
++ cpus[0].y = cpus[1].y;
++ cpus[0].z = cpus[1].z;
+ }
+
+ // now value each separate cpu's tics
diff --git a/core/procps/procps-3.2.7-top-env-cpuloop.patch b/core/procps/procps-3.2.7-top-env-cpuloop.patch
new file mode 100644
index 000000000..0034dcafb
--- /dev/null
+++ b/core/procps/procps-3.2.7-top-env-cpuloop.patch
@@ -0,0 +1,84 @@
+diff -up procps-3.2.7/top.c.p15 procps-3.2.7/top.c
+--- procps-3.2.7/top.c.p15 2008-09-01 11:37:51.000000000 +0200
++++ procps-3.2.7/top.c 2008-09-01 11:37:51.000000000 +0200
+@@ -121,6 +121,7 @@ static int No_ksyms = -1, // set t
+ Batch = 0, // batch mode, collect no input, dumb output
+ Loops = -1, // number of iterations, -1 loops forever
+ Secure_mode = 0; // set if some functionality restricted
++static int CPU_loop = 0; // wait for reliable CPU data
+
+ /* Some cap's stuff to reduce runtime calls --
+ to accomodate 'Batch' mode, they begin life as empty strings */
+@@ -1679,6 +1680,9 @@ static void before (char *me)
+ Fieldstab[P_PPD].fmts = pid_fmt;
+ Fieldstab[P_PPD].head = " PPID" + 10 - pid_digits;
+ }
++
++ if (( getenv("CPULOOP")) && ( atoi(getenv("CPULOOP")) == 1 ))
++ CPU_loop = 1;
+ }
+
+
+@@ -2978,6 +2981,7 @@ static proc_t **summary_show (void)
+ {
+ static proc_t **p_table = NULL;
+ static CPU_t *smpcpu = NULL;
++ static int first = 0;
+
+ // whoa first time, gotta' prime the pump...
+ if (!p_table) {
+@@ -3025,6 +3029,28 @@ static proc_t **summary_show (void)
+
+ smpcpu = cpus_refresh(smpcpu);
+
++ if (first==0 && CPU_loop)
++ {
++ int i;
++ CPU_t *cpu;
++ for (i = 0; i < Cpu_tot; i++) {
++ cpu = &smpcpu[i];
++ cpu->u_sav = cpu->u;
++ cpu->s_sav = cpu->s;
++ cpu->n_sav = cpu->n;
++ cpu->i_sav = cpu->i;
++ cpu->w_sav = cpu->w;
++ cpu->x_sav = cpu->x;
++ cpu->y_sav = cpu->y;
++ cpu->z_sav = cpu->z;
++ }
++ tv.tv_sec = Rc.delay_time;
++ tv.tv_usec = (Rc.delay_time - (int)Rc.delay_time) * 1000000;
++ select(0, NULL, NULL, NULL, &tv);
++
++ smpcpu = cpus_refresh(smpcpu);
++ }
++
+ if (CHKw(Curwin, View_CPUSUM)) {
+ // display just the 1st /proc/stat line
+ summaryhlp(&smpcpu[Cpu_tot], "Cpu(s):");
+@@ -3050,6 +3076,8 @@ static proc_t **summary_show (void)
+ }
+
+ SETw(Curwin, NEWFRAM_cwo);
++
++ first = 1;
+ return p_table;
+ }
+
+diff -up procps-3.2.7/top.1.p15 procps-3.2.7/top.1
+--- procps-3.2.7/top.1.p15 2008-09-01 11:37:51.000000000 +0200
++++ procps-3.2.7/top.1 2008-09-01 11:37:51.000000000 +0200
+@@ -1183,6 +1183,13 @@ Then ponder this:
+ Send bug reports to:
+ Albert D\. Cahalan, <albert@users.sf.net>
+
++The top command calculates Cpu(s) by looking at the change in CPU time values
++between samples. When you first run it, it has no previous sample to compare
++to, so these initial values are the percentages since boot. It means you need
++at least two loops or you have to ignore summary output from the first loop.
++This is problem for example for batch mode. There is a possible workaround if
++you define the CPULOOP=1 environment variable. The top command will be run one
++extra hidden loop for CPU data before standard output.
+
+ .\" ----------------------------------------------------------------------
+ .SH 8. HISTORY Former top
diff --git a/core/procps/procps-3.2.7-top-manpage.patch b/core/procps/procps-3.2.7-top-manpage.patch
new file mode 100644
index 000000000..4ce077946
--- /dev/null
+++ b/core/procps/procps-3.2.7-top-manpage.patch
@@ -0,0 +1,32 @@
+diff -up procps-3.2.7/top.1.cpudesc procps-3.2.7/top.1
+--- procps-3.2.7/top.1.cpudesc 2008-01-18 08:04:19.000000000 +0100
++++ procps-3.2.7/top.1 2008-01-18 08:15:49.000000000 +0100
+@@ -121,6 +121,7 @@
+ 2. FIELDS / Columns
+ a. DESCRIPTIONS of Fields
+ b. SELECTING and ORDERING Columns
++ c. SUMMARY Area Fields
+ 3. INTERACTIVE Commands
+ a. GLOBAL Commands
+ b. SUMMARY Area Commands
+@@ -540,6 +540,20 @@ You\fI move\fR a field to the\fB left\fR
+ upper case\fR letter and to the\fB right\fR with the\fB lower case\fR
+ letter.
+
++.\" ......................................................................
++.SS 2c. SUMMARY Area Fields
++.\" ----------------------------------------------------------------------
++The summary area fields describing CPU statistics are abbreviated. They provide
++information about times spent in:
++ \fR us = user mode
++ \fR sy = system mode
++ \fR ni = low priority user mode (nice)
++ \fR id = idle task
++ \fR wa = I/O waiting
++ \fR hi = servicing IRQs
++ \fR si = servicing soft IRQs
++ \fR st = steal (time given to other DomU instances)
++
+
+ .\" ----------------------------------------------------------------------
+ .SH 3. INTERACTIVE Commands
diff --git a/core/procps/procps-3.2.7-top-remcpu.patch b/core/procps/procps-3.2.7-top-remcpu.patch
new file mode 100644
index 000000000..88d14ef0a
--- /dev/null
+++ b/core/procps/procps-3.2.7-top-remcpu.patch
@@ -0,0 +1,98 @@
+--- procps-3.2.7/top.c.remcpu 2006-07-10 10:41:11.000000000 +0200
++++ procps-3.2.7/top.c 2006-07-10 10:41:35.000000000 +0200
+@@ -912,6 +912,7 @@
+ static CPU_t *cpus_refresh (CPU_t *cpus)
+ {
+ static FILE *fp = NULL;
++ static int cpu_max;
+ int i;
+ int num;
+ // enough for a /proc/stat CPU line (not the intr line)
+@@ -926,24 +927,29 @@
+ can hold tics representing the /proc/stat cpu summary (the first
+ line read) -- that slot supports our View_CPUSUM toggle */
+ cpus = alloc_c((1 + Cpu_tot) * sizeof(CPU_t));
++ cpu_max = Cpu_tot;
+ }
++ else if (cpu_max > Cpu_tot)
++ /* move saved CUPs summary to cpu_max possition */
++ memcpy(&cpus[cpu_max], &cpus[Cpu_tot], sizeof(CPU_t));
++
+ rewind(fp);
+ fflush(fp);
+
+ // first value the last slot with the cpu summary line
+ if (!fgets(buf, sizeof(buf), fp)) std_err("failed /proc/stat read");
+- cpus[Cpu_tot].x = 0; // FIXME: can't tell by kernel version number
+- cpus[Cpu_tot].y = 0; // FIXME: can't tell by kernel version number
+- cpus[Cpu_tot].z = 0; // FIXME: can't tell by kernel version number
++ cpus[cpu_max].x = 0; // FIXME: can't tell by kernel version number
++ cpus[cpu_max].y = 0; // FIXME: can't tell by kernel version number
++ cpus[cpu_max].z = 0; // FIXME: can't tell by kernel version number
+ num = sscanf(buf, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu",
+- &cpus[Cpu_tot].u,
+- &cpus[Cpu_tot].n,
+- &cpus[Cpu_tot].s,
+- &cpus[Cpu_tot].i,
+- &cpus[Cpu_tot].w,
+- &cpus[Cpu_tot].x,
+- &cpus[Cpu_tot].y,
+- &cpus[Cpu_tot].z
++ &cpus[cpu_max].u,
++ &cpus[cpu_max].n,
++ &cpus[cpu_max].s,
++ &cpus[cpu_max].i,
++ &cpus[cpu_max].w,
++ &cpus[cpu_max].x,
++ &cpus[cpu_max].y,
++ &cpus[cpu_max].z
+ );
+ if (num < 4)
+ std_err("failed /proc/stat read");
+@@ -955,7 +961,7 @@
+ }
+
+ // now value each separate cpu's tics
+- for (i = 0; 1 < Cpu_tot && i < Cpu_tot; i++) {
++ for (i = 0; ; i++) {
+ if (!fgets(buf, sizeof(buf), fp)) std_err("failed /proc/stat read");
+ cpus[i].x = 0; // FIXME: can't tell by kernel version number
+ cpus[i].y = 0; // FIXME: can't tell by kernel version number
+@@ -964,9 +970,35 @@
+ &cpus[i].id,
+ &cpus[i].u, &cpus[i].n, &cpus[i].s, &cpus[i].i, &cpus[i].w, &cpus[i].x, &cpus[i].y, &cpus[i].z
+ );
+- if (num < 4)
+- std_err("failed /proc/stat read");
++ if (num < 4) {
++ Cpu_tot = i;
++ break;
++ }
++ if (i == cpu_max - 1) {
++ // Bump cpu_max and extend cpus
++ cpu_max++;
++ cpus = realloc(cpus, (1 + cpu_max) * sizeof(CPU_t));
++ if (!cpus) std_err("realloc failed");
++ memcpy(&cpus[cpu_max], &cpus[cpu_max-1], sizeof(CPU_t));
++ }
++ }
++
++ if (cpu_max > Cpu_tot)
++ memcpy(&cpus[Cpu_tot], &cpus[cpu_max], sizeof(CPU_t));
++
++ // and just in case we're 2.2.xx compiled without SMP support...
++ if (Cpu_tot == 1) {
++ cpus[0].id = cpus[1].id = 0;
++ cpus[0].u = cpus[1].u;
++ cpus[0].n = cpus[1].n;
++ cpus[0].s = cpus[1].s;
++ cpus[0].i = cpus[1].i;
++ cpus[0].w = cpus[1].w;
++ cpus[0].x = cpus[1].x;
++ cpus[0].y = cpus[1].y;
++ cpus[0].z = cpus[1].z;
+ }
++
+ return cpus;
+ }
+
diff --git a/core/procps/procps-3.2.7-top-sorthigh.patch b/core/procps/procps-3.2.7-top-sorthigh.patch
new file mode 100644
index 000000000..e17df1e22
--- /dev/null
+++ b/core/procps/procps-3.2.7-top-sorthigh.patch
@@ -0,0 +1,37 @@
+--- procps-3.2.7/top.c.sorthigh 2007-02-05 09:06:34.000000000 +0100
++++ procps-3.2.7/top.c 2007-02-05 09:09:35.000000000 +0100
+@@ -3121,6 +3121,7 @@
+ unsigned w = Fieldstab[i].width;
+
+ int advance = (x==0) && !Rc.mode_altscr;
++ f += advance;
+
+ switch (i) {
+ case P_CMD:
+@@ -3179,7 +3180,7 @@
+ break;
+ case P_PRI:
+ if (unlikely(-99 > p->priority) || unlikely(999 < p->priority)) {
+- f = " RT";
++ f = advance ? " RT" : " RT";
+ MKCOL("");
+ } else
+ MKCOL((int)p->priority);
+@@ -3227,7 +3228,7 @@
+ break;
+ case P_WCH:
+ if (No_ksyms) {
+- f = " %08lx ";
++ f = advance ? "%08lx " : " %08lx ";
+ MKCOL((long)p->wchan);
+ } else {
+ MKCOL(lookup_wchan(p->wchan, p->XXXID));
+@@ -3236,7 +3237,7 @@
+
+ } /* end: switch 'procflag' */
+
+- rp = scat(rp, cbuf+advance);
++ rp = scat(rp, cbuf);
+ } /* end: for 'maxpflgs' */
+
+ PUFF(
diff --git a/core/procps/procps-3.2.7-w-best.patch b/core/procps/procps-3.2.7-w-best.patch
new file mode 100644
index 000000000..86b3e9328
--- /dev/null
+++ b/core/procps/procps-3.2.7-w-best.patch
@@ -0,0 +1,16 @@
+--- procps-3.2.7/w.c.kzak 2007-04-02 23:58:30.000000000 +0200
++++ procps-3.2.7/w.c 2007-04-03 00:09:15.000000000 +0200
+@@ -149,11 +149,11 @@
+ const proc_t *restrict const tmp = *pptr;
+ if(unlikely(tmp->tgid == u->ut_pid)) {
+ *found_utpid = 1;
+- best = tmp;
++ if (!best)
++ best = tmp;
+ }
+ if(tmp->tty != line) continue;
+ (*jcpu) += tmp->utime + tmp->stime;
+- secondbest = tmp;
+ /* same time-logic here as for "best" below */
+ if(! (secondbest && tmp->start_time <= secondbest->start_time) ){
+ secondbest = tmp;
diff --git a/core/procps/procps-3.2.7-watch-unicode.patch b/core/procps/procps-3.2.7-watch-unicode.patch
new file mode 100644
index 000000000..1b3d97488
--- /dev/null
+++ b/core/procps/procps-3.2.7-watch-unicode.patch
@@ -0,0 +1,139 @@
+diff -u procps-3.2.7/Makefile procps/Makefile
+--- procps-3.2.7/Makefile 2007-01-16 17:24:49.000000000 +0100
++++ procps/Makefile 2007-01-16 17:29:27.000000000 +0100
+@@ -67,7 +67,7 @@
+ # plus the top-level Makefile to make it work stand-alone.
+ _TARFILES := Makefile
+
+-CURSES := -lncurses
++CURSES := -lncursesw
+
+ # This seems about right for the dynamic library stuff.
+ # Something like this is probably needed to make the SE Linux
+diff -u procps-3.2.7/watch.c procps/watch.c
+--- procps-3.2.7/watch.c 2007-01-16 17:24:49.000000000 +0100
++++ procps/watch.c 2007-01-16 18:06:57.000000000 +0100
+@@ -28,6 +28,8 @@
+ #include <termios.h>
+ #include <locale.h>
+ #include "proc/procps.h"
++#include <wchar.h>
++#include <wctype.h>
+
+ #ifdef FORCE_8BIT
+ #undef isprint
+@@ -137,6 +139,27 @@
+ }
+ }
+
++static wint_t
++readwc(FILE *stream, mbstate_t *mbs)
++{
++ for (;;) {
++ int chr;
++ char c;
++ wchar_t wc;
++ size_t len;
++
++ chr = getc(stream);
++ if (chr == EOF)
++ return WEOF;
++ c = chr;
++ len = mbrtowc(&wc, &c, 1, mbs);
++ if (len == (size_t)-1)
++ memset(mbs, 0, sizeof(*mbs));
++ else if (len != (size_t)-2)
++ return wc;
++ }
++}
++
+ int
+ main(int argc, char *argv[])
+ {
+@@ -243,6 +266,7 @@
+ FILE *p;
+ int x, y;
+ int oldeolseen = 1;
++ mbstate_t mbs;
+
+ if (screen_size_changed) {
+ get_terminal_size();
+@@ -276,49 +300,63 @@
+ do_exit(2);
+ }
+
++ memset(&mbs, 0, sizeof(mbs));
+ for (y = show_title; y < height; y++) {
+ int eolseen = 0, tabpending = 0;
+ for (x = 0; x < width; x++) {
+- int c = ' ';
+- int attr = 0;
++ wint_t c = L' ';
++ int attr = 0, c_width;
++ cchar_t cc;
++ wchar_t wstr[2];
+
+ if (!eolseen) {
+ /* if there is a tab pending, just spit spaces until the
+ next stop instead of reading characters */
+ if (!tabpending)
+ do
+- c = getc(p);
+- while (c != EOF && !isprint(c)
+- && c != '\n'
+- && c != '\t');
+- if (c == '\n')
++ c = readwc(p, &mbs);
++ while (c != WEOF && !iswprint(c)
++ && c != L'\n'
++ && c != L'\t');
++ if (c == L'\n')
+ if (!oldeolseen && x == 0) {
+ x = -1;
+ continue;
+ } else
+ eolseen = 1;
+- else if (c == '\t')
++ else if (c == L'\t')
+ tabpending = 1;
+- if (c == EOF || c == '\n' || c == '\t')
+- c = ' ';
++ if (c == WEOF || c == L'\n' || c == L'\t')
++ c = L' ';
+ if (tabpending && (((x + 1) % 8) == 0))
+ tabpending = 0;
+ }
++ wstr[0] = c;
++ wstr[1] = 0;
++ setcchar (&cc, wstr, 0, 0, NULL);
+ move(y, x);
+ if (option_differences) {
+- chtype oldch = inch();
+- char oldc = oldch & A_CHARTEXT;
++ cchar_t oldc;
++ wchar_t oldwstr[2];
++ attr_t attrs;
++ short colors;
++
++ in_wch(&oldc);
++ getcchar(&oldc, oldwstr, &attrs, &colors, NULL);
+ attr = !first_screen
+- && ((char)c != oldc
++ && (wstr[0] != oldwstr[0]
+ ||
+ (option_differences_cumulative
+- && (oldch & A_ATTRIBUTES)));
++ && attrs));
+ }
+ if (attr)
+ standout();
+- addch(c);
++ add_wch(&cc);
+ if (attr)
+ standend();
++ c_width = wcwidth(c);
++ if (c_width > 1)
++ x += c_width - 1;
+ }
+ oldeolseen = eolseen;
+ }
diff --git a/core/procps/procps-3.2.8+gmake-3.82.patch b/core/procps/procps-3.2.8+gmake-3.82.patch
new file mode 100644
index 000000000..87ab13ea4
--- /dev/null
+++ b/core/procps/procps-3.2.8+gmake-3.82.patch
@@ -0,0 +1,14 @@
+Index: procps-3.2.8/Makefile
+===================================================================
+--- procps-3.2.8.orig/Makefile
++++ procps-3.2.8/Makefile
+@@ -174,7 +174,8 @@ INSTALL := $(BINFILES) $(MANFILES)
+ # want this rule first, use := on ALL, and ALL not filled in yet
+ all: do_all
+
+--include */module.mk
++-include proc/module.mk
++-include ps/module.mk
+
+ do_all: $(ALL)
+
diff --git a/core/procps/procps-3.2.8-linux-ver-init.patch b/core/procps/procps-3.2.8-linux-ver-init.patch
new file mode 100644
index 000000000..6d4039c91
--- /dev/null
+++ b/core/procps/procps-3.2.8-linux-ver-init.patch
@@ -0,0 +1,23 @@
+https://bugs.gentoo.org/303120
+
+make sure the linux version constructor runs before the libproc constructor
+since the latter uses variables setup by the former
+
+fix by Chris Coleman
+
+Index: proc/version.c
+===================================================================
+RCS file: /cvsroot/procps/procps/proc/version.c,v
+retrieving revision 1.7
+diff -u -p -r1.7 version.c
+--- proc/version.c 9 Feb 2003 07:27:16 -0000 1.7
++++ proc/version.c 14 Nov 2010 00:22:44 -0000
+@@ -33,7 +33,7 @@ void display_version(void) {
+
+ int linux_version_code;
+
+-static void init_Linux_version(void) __attribute__((constructor));
++static void init_Linux_version(void) __attribute__((constructor(100)));
+ static void init_Linux_version(void) {
+ static struct utsname uts;
+ int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */
diff --git a/core/procps/procps-3.2.8-setlocale.patch b/core/procps/procps-3.2.8-setlocale.patch
new file mode 100644
index 000000000..c197fd38a
--- /dev/null
+++ b/core/procps/procps-3.2.8-setlocale.patch
@@ -0,0 +1,66 @@
+diff -Nur procps-3.2.8-orig/proc/sysinfo.c procps-3.2.8/proc/sysinfo.c
+--- procps-3.2.8-orig/proc/sysinfo.c 2008-03-24 05:33:43.000000000 +0100
++++ procps-3.2.8/proc/sysinfo.c 2009-12-18 22:50:52.000000000 +0100
+@@ -74,17 +74,19 @@
+ /***********************************************************************/
+ int uptime(double *restrict uptime_secs, double *restrict idle_secs) {
+ double up=0, idle=0;
+- char *restrict savelocale;
++ char *savelocale;
+
+ FILE_TO_BUF(UPTIME_FILE,uptime_fd);
+- savelocale = setlocale(LC_NUMERIC, NULL);
++ savelocale = strdup(setlocale(LC_NUMERIC, NULL));
+ setlocale(LC_NUMERIC,"C");
+ if (sscanf(buf, "%lf %lf", &up, &idle) < 2) {
+ setlocale(LC_NUMERIC,savelocale);
++ free(savelocale);
+ fputs("bad data in " UPTIME_FILE "\n", stderr);
+ return 0;
+ }
+ setlocale(LC_NUMERIC,savelocale);
++ free(savelocale);
+ SET_IF_DESIRED(uptime_secs, up);
+ SET_IF_DESIRED(idle_secs, idle);
+ return up; /* assume never be zero seconds in practice */
+@@ -128,9 +130,9 @@
+ double up_1, up_2, seconds;
+ unsigned long long jiffies;
+ unsigned h;
+- char *restrict savelocale;
++ char *savelocale;
+
+- savelocale = setlocale(LC_NUMERIC, NULL);
++ savelocale = strdup(setlocale(LC_NUMERIC, NULL));
+ setlocale(LC_NUMERIC, "C");
+ do{
+ FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_1);
+@@ -141,6 +143,7 @@
+ /* uptime(&up_2, NULL); */
+ } while((long long)( (up_2-up_1)*1000.0/up_1 )); /* want under 0.1% error */
+ setlocale(LC_NUMERIC, savelocale);
++ free(savelocale);
+ jiffies = user_j + nice_j + sys_j + other_j;
+ seconds = (up_1 + up_2) / 2;
+ h = (unsigned)( (double)jiffies/seconds/smp_num_cpus );
+@@ -303,16 +306,18 @@
+ /***********************************************************************/
+ void loadavg(double *restrict av1, double *restrict av5, double *restrict av15) {
+ double avg_1=0, avg_5=0, avg_15=0;
+- char *restrict savelocale;
++ char *savelocale;
+
+ FILE_TO_BUF(LOADAVG_FILE,loadavg_fd);
+- savelocale = setlocale(LC_NUMERIC, NULL);
++ savelocale = strdup(setlocale(LC_NUMERIC, NULL));
+ setlocale(LC_NUMERIC, "C");
+ if (sscanf(buf, "%lf %lf %lf", &avg_1, &avg_5, &avg_15) < 3) {
+ fputs("bad data in " LOADAVG_FILE "\n", stderr);
++ free(savelocale);
+ exit(1);
+ }
+ setlocale(LC_NUMERIC, savelocale);
++ free(savelocale);
+ SET_IF_DESIRED(av1, avg_1);
+ SET_IF_DESIRED(av5, avg_5);
+ SET_IF_DESIRED(av15, avg_15);
diff --git a/core/procps/procps-3.2.8-threads.patch b/core/procps/procps-3.2.8-threads.patch
new file mode 100644
index 000000000..2491aa4c0
--- /dev/null
+++ b/core/procps/procps-3.2.8-threads.patch
@@ -0,0 +1,49 @@
+diff -up procps-3.2.8/top.c.threads procps-3.2.8/top.c
+--- procps-3.2.8/top.c.threads 2009-10-01 07:14:43.000000000 -0400
++++ procps-3.2.8/top.c 2009-10-05 14:05:00.000000000 -0400
+@@ -1138,6 +1138,7 @@ static proc_t **procs_refresh (proc_t **
+ #define ENTsz sizeof(proc_t)
+ static unsigned savmax = 0; // first time, Bypass: (i)
+ proc_t *ptsk = (proc_t *)-1; // first time, Force: (ii)
++ proc_t *saved_ptsk;
+ unsigned curmax = 0; // every time (jeeze)
+ PROCTAB* PT;
+ static int show_threads_was_enabled = 0; // optimization
+@@ -1172,6 +1173,10 @@ static proc_t **procs_refresh (proc_t **
+ while (curmax < savmax) {
+ proc_t *ttsk;
+ if (unlikely(!(ptsk = readproc(PT, NULL)))) break;
++ if(!show_threads_was_enabled)
++ saved_ptsk = ptsk;
++ else
++ saved_ptsk = NULL;
+ show_threads_was_enabled = 1;
+ while (curmax < savmax) {
+ unsigned idx;
+@@ -1189,7 +1194,7 @@ static proc_t **procs_refresh (proc_t **
+ prochlp(ttsk);
+ ++curmax;
+ }
+- free(ptsk); // readproc() proc_t not used
++ if(!saved_ptsk) free(ptsk); // readproc() proc_t not used
+ }
+ }
+
+@@ -1208,7 +1213,8 @@ static proc_t **procs_refresh (proc_t **
+ else { // show each thread in a process separately
+ while (ptsk) {
+ proc_t *ttsk;
+- if (likely(ptsk = readproc(PT, NULL))) {
++ if (likely(ptsk = readproc(PT, NULL)) ||
++ unlikely(saved_ptsk && (ptsk = saved_ptsk)) ) {
+ show_threads_was_enabled = 1;
+ while (1) {
+ table = alloc_r(table, (curmax + 1) * PTRsz);
+@@ -1216,6 +1222,7 @@ static proc_t **procs_refresh (proc_t **
+ prochlp(ttsk);
+ table[curmax++] = ttsk;
+ }
++ saved_ptsk = NULL;
+ free(ptsk); // readproc() proc_t not used
+ }
+ }
diff --git a/core/procps/sysctl.conf b/core/procps/sysctl.conf
new file mode 100644
index 000000000..e3ebc7bad
--- /dev/null
+++ b/core/procps/sysctl.conf
@@ -0,0 +1,13 @@
+#
+# Kernel sysctl configuration
+#
+
+# Disable packet forwarding
+net.ipv4.ip_forward=0
+
+# Disable the magic-sysrq key (console security issues)
+kernel.sysrq = 0
+
+# Enable TCP SYN Cookie Protection
+net.ipv4.tcp_syncookies = 1
+
diff --git a/core/psmisc/ChangeLog b/core/psmisc/ChangeLog
new file mode 100644
index 000000000..d9fa6dfa5
--- /dev/null
+++ b/core/psmisc/ChangeLog
@@ -0,0 +1,40 @@
+2010-09-06 Eric Belanger <eric@archlinux.org>
+
+ * psmisc 22.13-1
+ * Upstream update
+
+2010-08-03 Eric Belanger <eric@archlinux.org>
+
+ * psmisc 22.12-1
+ * Upstream update
+ * Updated psmisc.checkregs.fix.patch
+
+2010-04-30 Eric Belanger <eric@archlinux.org>
+
+ * psmisc 22.11-1
+ * Upstream update
+
+2010-01-12 Eric Belanger <eric@archlinux.org>
+
+ * psmisc 22.10-1
+ * Upstream update
+
+2009-07-31 Eric Belanger <eric@archlinux.org>
+
+ * psmisc 22.8-1
+ * Upstream update
+
+2009-05-14 Eric Belanger <eric@archlinux.org>
+
+ * psmisc 22.7-1
+ * Upstream update
+
+2009-04-30 Eric Belanger <eric@archlinux.org>
+
+ * psmisc 22.6-2.1
+ * Added peekfd in x86_64 package (close FS#14514)
+
+2008-10-19 Eric Belanger <eric@archlinux.org>
+
+ * Updated url
+ * Added ChangeLog
diff --git a/core/psmisc/PKGBUILD b/core/psmisc/PKGBUILD
new file mode 100644
index 000000000..98e542a3a
--- /dev/null
+++ b/core/psmisc/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 90063 2010-09-07 03:39:08Z eric $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+
+pkgname=psmisc
+pkgver=22.13
+pkgrel=1
+pkgdesc="Miscellaneous procfs tools"
+arch=('i686' 'x86_64')
+url="http://psmisc.sourceforge.net/index.html"
+license=('GPL')
+groups=('base')
+depends=('glibc' 'ncurses')
+changelog=ChangeLog
+source=(http://downloads.sourceforge.net/psmisc/${pkgname}-${pkgver}.tar.gz)
+md5sums=('e2c339e6b65b730042084023784a729e')
+sha1sums=('5d53c8bb5a279176be3515c07d833cdf116dd516')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/core/readline/PKGBUILD b/core/readline/PKGBUILD
new file mode 100644
index 000000000..0ed221910
--- /dev/null
+++ b/core/readline/PKGBUILD
@@ -0,0 +1,59 @@
+# $Id: PKGBUILD 111803 2011-03-01 02:29:23Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=readline
+_basever=6.2
+_patchlevel=001 #prepare for some patches
+pkgver=$_basever.$_patchlevel
+pkgrel=1
+pkgdesc="GNU readline library"
+arch=('i686' 'x86_64')
+url="http://tiswww.case.edu/php/chet/readline/rltop.html"
+license=('GPL')
+depends=('glibc' 'ncurses')
+backup=('etc/inputrc')
+source=(http://ftp.gnu.org/gnu/readline/readline-$_basever.tar.gz
+ inputrc)
+if [ $_patchlevel -gt 00 ]; then
+ for (( p=1; p<=$((10#${_patchlevel})); p++ )); do
+ source=(${source[@]} http://ftp.gnu.org/gnu/readline/readline-$_basever-patches/readline${_basever//./}-$(printf "%03d" $p))
+ done
+fi
+md5sums=('67948acb2ca081f23359d0256e9a271c'
+ '58d54966c1191db45973cb3191ac621a'
+ '83287d52a482f790dfb30ec0a8746669')
+
+build() {
+ cd ${srcdir}/${pkgname}-$_basever
+ for p in ../readline${_basever//./}-*; do
+ [ -e "$p" ] || continue
+ msg "applying patch ${p}"
+ patch -Np0 -i ${p}
+ done
+
+ # Remove RPATH from shared objects (FS#14366)
+ sed -i 's|-Wl,-rpath,$(libdir) ||g' support/shobj-conf
+
+ # build with -fPIC for x86_64 (FS#15634)
+ [ $CARCH == "x86_64" ] && CFLAGS="$CFLAGS -fPIC"
+
+ ./configure --prefix=/usr --libdir=/lib
+ make SHLIB_LIBS=-lncurses
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-$_basever
+ make DESTDIR=${pkgdir} install
+
+ install -Dm644 ${srcdir}/inputrc ${pkgdir}/etc/inputrc
+
+ # FHS recommends only shared libs in /lib
+ install -dm755 $pkgdir/usr/lib
+ mv $pkgdir/lib/*.a $pkgdir/usr/lib
+
+ # to make the linker find the shared lib and fix compile issues
+ cd ${pkgdir}/usr/lib
+ ln -sv /lib/libreadline.so .
+ ln -sv /lib/libhistory.so .
+}
diff --git a/core/readline/inputrc b/core/readline/inputrc
new file mode 100644
index 000000000..fd13a673b
--- /dev/null
+++ b/core/readline/inputrc
@@ -0,0 +1,36 @@
+# do not bell on tab-completion
+#set bell-style none
+
+set meta-flag on
+set input-meta on
+set convert-meta off
+set output-meta on
+
+$if mode=emacs
+
+# for linux console and RH/Debian xterm
+"\e[1~": beginning-of-line
+"\e[4~": end-of-line
+"\e[5~": beginning-of-history
+"\e[6~": end-of-history
+"\e[7~": beginning-of-line
+"\e[3~": delete-char
+"\e[2~": quoted-insert
+"\e[5C": forward-word
+"\e[5D": backward-word
+"\e\e[C": forward-word
+"\e\e[D": backward-word
+"\e[1;5C": forward-word
+"\e[1;5D": backward-word
+
+# for rxvt
+"\e[8~": end-of-line
+
+# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
+"\eOH": beginning-of-line
+"\eOF": end-of-line
+
+# for freebsd console
+"\e[H": beginning-of-line
+"\e[F": end-of-line
+$endif
diff --git a/core/readline/readline.install b/core/readline/readline.install
new file mode 100644
index 000000000..a8ffe80c6
--- /dev/null
+++ b/core/readline/readline.install
@@ -0,0 +1,21 @@
+infodir=usr/share/info
+filelist=(history.info readline.info rluserman.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
diff --git a/core/reiserfsprogs/PKGBUILD b/core/reiserfsprogs/PKGBUILD
new file mode 100644
index 000000000..6b7beb8f6
--- /dev/null
+++ b/core/reiserfsprogs/PKGBUILD
@@ -0,0 +1,29 @@
+# $Id: PKGBUILD 102064 2010-12-04 10:58:12Z allan $
+# Maintainer: Andreas Radke <andyrtr@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=reiserfsprogs
+pkgver=3.6.21
+pkgrel=3
+pkgdesc="Reiserfs utilities"
+arch=('i686' 'x86_64')
+url="http://www.kernel.org/pub/linux/utils/fs/reiserfs/README"
+license=('GPL')
+groups=('base')
+depends=('util-linux-ng>=2.16')
+source=(http://www.kernel.org/pub/linux/utils/fs/reiserfs/reiserfsprogs-${pkgver}.tar.bz2)
+md5sums=('0639cefac8f8150536cfa7531c2aa2d2')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --sbindir=/sbin
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ ln -s reiserfsck "${pkgdir}/sbin/fsck.reiserfs"
+ ln -s mkreiserfs "${pkgdir}/sbin/mkfs.reiserfs"
+}
diff --git a/core/rfkill/60-rfkill.rules b/core/rfkill/60-rfkill.rules
new file mode 100644
index 000000000..bc98a3bef
--- /dev/null
+++ b/core/rfkill/60-rfkill.rules
@@ -0,0 +1 @@
+KERNEL=="rfkill", GROUP="rfkill", MODE="0664"
diff --git a/core/rfkill/PKGBUILD b/core/rfkill/PKGBUILD
new file mode 100644
index 000000000..bf8259e65
--- /dev/null
+++ b/core/rfkill/PKGBUILD
@@ -0,0 +1,38 @@
+# $Id: PKGBUILD 109452 2011-02-09 18:22:15Z stephane $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+# Contributor: Giovanni Scafora <giovanni@archlinux.org>
+
+pkgname=rfkill
+pkgver=0.4
+pkgrel=2
+pkgdesc="A tool for enabling and disabling wireless devices"
+arch=('i686' 'x86_64')
+url="http://linuxwireless.org/en/users/Documentation/rfkill"
+license=('custom')
+depends=('glibc' 'filesystem>=2010.01')
+source=(http://wireless.kernel.org/download/${pkgname}/${pkgname}-${pkgver}.tar.bz2
+ 60-rfkill.rules
+ rfkill.conf.d
+ rfkill.rc.d)
+backup=(etc/conf.d/rfkill)
+md5sums=('727892c0fb35c80ee3849fbe89b45350'
+ '63f9bf9264911242e430867a41e8918c'
+ '398e7cadf023e05e3e0c323aa33575b9'
+ '793f0510e26547eb2632efce7d16e50e')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ # License
+ install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ # Udev rule
+ install -Dm644 "${srcdir}/60-rfkill.rules" "${pkgdir}/lib/udev/rules.d/60-rfkill.rules"
+ # Init script
+ install -Dm644 "${srcdir}/rfkill.conf.d" "${pkgdir}/etc/conf.d/rfkill"
+ install -Dm755 "${srcdir}/rfkill.rc.d" "${pkgdir}/etc/rc.d/rfkill"
+}
diff --git a/core/rfkill/rfkill.conf.d b/core/rfkill/rfkill.conf.d
new file mode 100644
index 000000000..4483da26c
--- /dev/null
+++ b/core/rfkill/rfkill.conf.d
@@ -0,0 +1,20 @@
+#
+# /etc/conf.d/rfkill
+# Configuration for the rfkill startup script
+#
+
+# List of devices to block on startup (space-separated)
+RFKILL_BLOCK=""
+
+# List of devices to unblock on startup (space-separated)
+RFKILL_UNBLOCK="all"
+
+# Supported device names are: all, wifi, bluetooth, umb, wimax, wwan, gps and specific device names like phy0, hci0, ...
+# See "rfkill list" for available devices
+# Examples:
+#
+# Block all bluetooth devices:
+# RFKILL_BLOCK="bluetooth"
+#
+# Unblock the phy0 wifi device and all wwan devices:
+# RFKILL_UNBLOCK="phy0 wwan"
diff --git a/core/rfkill/rfkill.rc.d b/core/rfkill/rfkill.rc.d
new file mode 100755
index 000000000..ce90ee150
--- /dev/null
+++ b/core/rfkill/rfkill.rc.d
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/rfkill
+
+case "$1" in
+ start)
+ for device in ${RFKILL_BLOCK}; do
+ stat_busy "Blocking rfkill device: ${device}"
+ /usr/sbin/rfkill block ${device}
+ if [ $? -eq 0 ]; then
+ stat_done
+ else
+ stat_fail
+ fi
+ done
+ for device in ${RFKILL_UNBLOCK}; do
+ stat_busy "Unblocking rfkill device: ${device}"
+ /usr/sbin/rfkill unblock ${device}
+ if [ $? -eq 0 ]; then
+ stat_done
+ else
+ stat_fail
+ fi
+ done
+ ;;
+ stop)
+ ;;
+ restart)
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/core/rp-pppoe/PKGBUILD b/core/rp-pppoe/PKGBUILD
new file mode 100644
index 000000000..2d701aef0
--- /dev/null
+++ b/core/rp-pppoe/PKGBUILD
@@ -0,0 +1,40 @@
+# $Id: PKGBUILD 77813 2010-04-18 07:47:31Z allan $
+# Contributor: orelien <aurelien.foret@wanadoo.fr>
+# Maintainer:
+
+pkgname=rp-pppoe
+pkgver=3.10
+pkgrel=5
+pkgdesc="Roaring Penguin's Point-to-Point Protocol over Ethernet client"
+arch=('i686' 'x86_64')
+url="http://www.roaringpenguin.com/pppoe/"
+license=('GPL')
+groups=('base')
+depends=('ppp>=2.4.5' 'sh')
+options=('!makeflags')
+backup=(etc/ppp/pppoe.conf etc/ppp/firewall-standalone etc/ppp/firewall-masq etc/ppp/pppoe-server-options)
+source=(http://www.roaringpenguin.com/files/download/rp-pppoe-$pkgver.tar.gz adsl)
+install=rp-pppoe.install
+md5sums=('d58a13cc4185bca6121a606ff456dec0'
+ 'adace1ad441aa88dcb3db52fb7f9c97f')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver/src
+ ./configure --prefix=/usr --enable-plugin=/ppp-2.4.4
+ make || return 1
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver/src
+ make DESTDIR=$pkgdir install
+
+ #moving .so files to /usr/lib according to FS#13876
+ mkdir -p ${pkgdir}/usr/lib/rp-pppoe
+ mv ${pkgdir}/etc/ppp/plugins/rp-pppoe.so ${pkgdir}/usr/lib/rp-pppoe/
+ #not necessary after moving the plugin
+ rm -rf ${pkgdir}/etc/ppp/plugins
+ #changing config to the new path
+ #sed -i 's/LINUX_PLUGIN=/LINUX_PLUGIN=\/usr\/lib\/rp-pppoe\/rp-pppoe.so/g' ${pkgdir}/etc/ppp/pppoe.conf
+
+ install -Dm755 $srcdir/adsl $pkgdir/etc/rc.d/adsl
+}
diff --git a/core/rp-pppoe/adsl b/core/rp-pppoe/adsl
new file mode 100755
index 000000000..33bd91839
--- /dev/null
+++ b/core/rp-pppoe/adsl
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting ADSL Connection"
+ /usr/sbin/pppoe-start &>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon adsl
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping ADSL Connection"
+ /usr/sbin/pppoe-stop &>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon adsl
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/rp-pppoe/rp-pppoe.install b/core/rp-pppoe/rp-pppoe.install
new file mode 100644
index 000000000..1d4bccce2
--- /dev/null
+++ b/core/rp-pppoe/rp-pppoe.install
@@ -0,0 +1,12 @@
+#arg 1: the new package version
+post_install() {
+echo ">>> The kernel-mode plugin has a new place."
+echo ">>> It's now located under /usr/lib/rp-pppoe/rp-pppoe.so"
+echo ">>> Change LINUX_PLUGIN to the new path in your /etc/ppp/pppoe.conf"
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install $1
+}
diff --git a/core/rpcbind/PKGBUILD b/core/rpcbind/PKGBUILD
new file mode 100644
index 000000000..9120c7d3c
--- /dev/null
+++ b/core/rpcbind/PKGBUILD
@@ -0,0 +1,37 @@
+# $Id: PKGBUILD 103509 2010-12-20 18:40:07Z andyrtr $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+
+pkgname=rpcbind
+pkgver=0.2.0
+pkgrel=3
+pkgdesc="portmap replacement which supports RPC over various protocols"
+arch=(i686 x86_64)
+depends=('bash' 'glibc' 'libtirpc')
+url="http://rpcbind.sourceforge.net"
+license=('custom')
+replaces=('portmap')
+source=(http://downloads.sourceforge.net/sourceforge/rpcbind/rpcbind-0.2.0.tar.bz2
+ rpcbind-sunrpc.patch
+ rpcbind)
+md5sums=('1a77ddb1aaea8099ab19c351eeb26316'
+ 'c02ac36a98baac70b8a26190524b7b73'
+ '78a963654f57cbb209e228884767836e')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ # patch for iana services file
+ patch -Np1 -i ../rpcbind-sunrpc.patch
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install
+ # install missing man page - https://bugs.archlinux.org/task/21271
+ install -m644 man/rpcinfo.8 $pkgdir/usr/share/man/man8/
+ # install daemon
+ install -D -m755 $srcdir/rpcbind $pkgdir/etc/rc.d/rpcbind
+ # install license
+ install -D -m644 COPYING $pkgdir/usr/share/licenses/rpcbind/COPYING
+}
diff --git a/core/rpcbind/rpcbind b/core/rpcbind/rpcbind
new file mode 100755
index 000000000..87c5b50da
--- /dev/null
+++ b/core/rpcbind/rpcbind
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID="$(pidof -o %PPID /usr/bin/rpcbind)"
+case "$1" in
+ start)
+ stat_busy "Starting rpcbind"
+ [ -z "$PID" ] && /usr/bin/rpcbind &>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ PID=$(pidof -o %PPID /usr/bin/rpcbind)
+ echo $PID > /var/run/rpcbind.pid
+ add_daemon rpcbind
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping rpcbind"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm /var/run/rpcbind.pid
+ rm_daemon rpcbind
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/rpcbind/rpcbind-sunrpc.patch b/core/rpcbind/rpcbind-sunrpc.patch
new file mode 100644
index 000000000..76cf54ba9
--- /dev/null
+++ b/core/rpcbind/rpcbind-sunrpc.patch
@@ -0,0 +1,22 @@
+--- rpcbind-0.1.7/src/rpcbind.c.orig 2008-11-19 14:17:34.000000000 +0100
++++ rpcbind-0.1.7/src/rpcbind.c 2010-01-07 13:03:37.416632894 +0100
+@@ -114,7 +114,7 @@
+ char *udp_uaddr; /* Universal UDP address */
+ char *tcp_uaddr; /* Universal TCP address */
+ #endif
+-static char servname[] = "rpcbind";
++static char servname[] = "sunrpc";
+ static char superuser[] = "superuser";
+
+ int main __P((int, char *[]));
+--- rpcbind-0.1.7/src/rpcinfo.c~ 2010-01-08 16:14:24.592156602 +0000
++++ rpcbind-0.1.7/src/rpcinfo.c 2010-01-08 16:14:31.578838609 +0000
+@@ -633,7 +633,7 @@
+ {
+ memset (&hints, 0, sizeof hints);
+ hints.ai_family = AF_INET;
+- if ((error = getaddrinfo (host, "rpcbind", &hints, &res)) != 0 &&
++ if ((error = getaddrinfo (host, "sunrpc", &hints, &res)) != 0 &&
+ (error = getaddrinfo (host, "portmapper", &hints, &res)) != 0)
+ {
+ fprintf (stderr, "rpcinfo: %s: %s\n",
diff --git a/core/run-parts/PKGBUILD b/core/run-parts/PKGBUILD
new file mode 100644
index 000000000..4de6f4b41
--- /dev/null
+++ b/core/run-parts/PKGBUILD
@@ -0,0 +1,25 @@
+# $Id: PKGBUILD 100361 2010-11-23 00:00:38Z pierre $
+# Maintainer: Pierre Schmitz <pierre@archlinux.de>
+
+pkgname=run-parts
+pkgver=3.4.1
+pkgrel=1
+pkgdesc='run scripts or programs in a directory'
+arch=('i686' 'x86_64')
+url='http://packages.qa.debian.org/d/debianutils.html'
+license=('GPL')
+depends=('glibc')
+source=("ftp://ftp.archlinux.org/other/run-parts/debianutils_${pkgver}.tar.gz")
+md5sums=('d488563ad7ea356d83f848becb1a3a4a')
+
+build() {
+ cd $srcdir/debianutils-$pkgver
+ ./configure --prefix=/usr
+ make run-parts
+}
+
+package() {
+ cd $srcdir/debianutils-$pkgver
+ install -D -m755 run-parts $pkgdir/usr/bin/run-parts
+ install -D -m644 run-parts.8 $pkgdir/usr/share/man/man8/run-parts.8
+}
diff --git a/core/sdparm/PKGBUILD b/core/sdparm/PKGBUILD
new file mode 100644
index 000000000..f1ff5950a
--- /dev/null
+++ b/core/sdparm/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 99522 2010-11-14 22:33:34Z andrea $
+# Maintainer:
+# Contributor: Giovanni Scafora <giovanni@archlinux.org>
+# Contributor: grimi@poczta.fm
+
+pkgname=sdparm
+pkgver=1.06
+pkgrel=1
+pkgdesc="An utility similar to hdparm but for SCSI devices"
+arch=('i686' 'x86_64')
+url="http://sg.danny.cz/sg/sdparm.html"
+license=('BSD')
+depends=('glibc')
+source=("http://sg.danny.cz/sg/p/${pkgname}-${pkgver}.tgz")
+md5sums=('5e19913658bb4f9849ddd909e0f47cde')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir}/ install
+
+ install -Dm644 COPYING $pkgdir/usr/share/licenses/${pkgname}/LICENSE
+}
diff --git a/core/sed/PKGBUILD b/core/sed/PKGBUILD
new file mode 100644
index 000000000..e6e0000a3
--- /dev/null
+++ b/core/sed/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 100052 2010-11-20 03:28:20Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=sed
+pkgver=4.2.1
+pkgrel=3
+pkgdesc="GNU stream editor"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/sed"
+license=('GPL3')
+groups=('base')
+depends=('acl' 'sh')
+makedepends=('gettext')
+install=sed.install
+source=(ftp://ftp.gnu.org/pub/gnu/sed/${pkgname}-${pkgver}.tar.gz)
+md5sums=('f0fd4d7da574d4707e442285fd2d3b86')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --bindir=/bin --without-included-regex
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR=${pkgdir} install
+}
diff --git a/core/sed/sed.install b/core/sed/sed.install
new file mode 100644
index 000000000..c0524038b
--- /dev/null
+++ b/core/sed/sed.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(sed.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/shadow/PKGBUILD b/core/shadow/PKGBUILD
new file mode 100644
index 000000000..738acfdf9
--- /dev/null
+++ b/core/shadow/PKGBUILD
@@ -0,0 +1,98 @@
+# $Id: PKGBUILD 111984 2011-03-02 21:59:18Z eric $
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+
+pkgname=shadow
+pkgver=4.1.4.3
+pkgrel=1
+pkgdesc="Shadow password file utilities"
+arch=('i686' 'x86_64')
+url='http://pkg-shadow.alioth.debian.org/'
+license=('custom')
+groups=('base')
+depends=('bash' 'pam')
+backup=(etc/login.defs
+ etc/pam.d/{chage,login,passwd,shadow,useradd,usermod,userdel}
+ etc/pam.d/{chpasswd,newusers,groupadd,groupdel,groupmod}
+ etc/pam.d/{chfn,chgpasswd,groupmems,chsh}
+ etc/default/useradd)
+options=('!libtool')
+install=shadow.install
+source=(ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-$pkgver.tar.bz2
+ useradd.defaults login passwd chgpasswd chpasswd newusers defaults.pam
+ login.defs adduser shadow.cron.daily xstrdup.patch shadow-4.1.4.2-groupmod-pam-check.patch)
+md5sums=('b8608d8294ac88974f27b20f991c0e79' 'beb64d09256ea46a4d96a783f096447f'\
+ 'bf137fac19884d71dc55c24b6d08e16c' 'b84204ab731bd02dca49d0637d44ebec'\
+ '65e9ebce249a5b9ed021e2790452b9e1' '453a98456b297d2a69ca7e9b5f40d10b'\
+ '453a98456b297d2a69ca7e9b5f40d10b' 'a31374fef2cba0ca34dfc7078e2969e4'\
+ 'fad9a7116366f7775b1099290be840da' '6ce67e423ee19c87ae64f661310b2408'\
+ '1d64b4113e1d402746d9dd65f28a2c6f' '0eebe9d13065bec4b5d7ccf3bf46c509'\
+ '7b747f7dca38b0b6e8ee56434378baae')
+sha1sums=('ad9b85b5531ce8e68f4695efc4ac53ba7266269e' '9ae93de5987dd0ae428f0cc1a5a5a5cd53583f19'\
+ '0b2d98a0ee3bfde8551ade48d4d35cc20ec702a1' '6f183bc7709b0a8d20ad17481a4ad025cf6e5056'\
+ '4ad0e059406a305c8640ed30d93c2a1f62c2f4ad' 'd66096ed9477bd7242e8d2cc28eaa23170269788'\
+ 'd66096ed9477bd7242e8d2cc28eaa23170269788' '0e56fed7fc93572c6bf0d8f3b099166558bb46f1'\
+ 'fceb6defbf959f9bee5598e89378a49297968d1a' '78ec184a499f9708adcfcf0b7a3b22a60bf39f91'\
+ '5d83ba7e11c765c951867cbe00b0ae7ff57148fa' '6010fffeed1fc6673ad9875492e1193b1a847b53'\
+ '5823f38c0085b27e7e4327ab17ecc13563a43650')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ #Ugh, force this to build shared libraries, for god's sake
+ sed -i "s/noinst_LTLIBRARIES/lib_LTLIBRARIES/g" lib/Makefile.am
+ libtoolize
+ autoreconf
+ export LDFLAGS="$LDFLAGS -lcrypt"
+
+ patch -Np1 -i "$srcdir/xstrdup.patch"
+ patch -Np1 -i "$srcdir/shadow-4.1.4.2-groupmod-pam-check.patch"
+
+ # supress etc/pam.d/*, we provide our own
+ sed -i '/^SUBDIRS/s/pam.d//' etc/Makefile.in
+
+ ./configure \
+ --prefix=/usr --libdir=/lib \
+ --mandir=/usr/share/man --sysconfdir=/etc \
+ --enable-shared --disable-static \
+ --with-libpam --without-selinux
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+
+ # license
+ install -Dm644 COPYING "$pkgdir/usr/share/licenses/shadow/COPYING"
+
+ # interactive useradd
+ install -Dm755 "$srcdir/adduser" "$pkgdir/usr/sbin/adduser"
+
+ # useradd defaults
+ install -Dm644 "$srcdir/useradd.defaults" "$pkgdir/etc/default/useradd"
+
+ # cron job
+ install -Dm744 "$srcdir/shadow.cron.daily" "$pkgdir/etc/cron.daily/shadow"
+
+ # login.defs
+ install -Dm644 "$srcdir/login.defs" "$pkgdir/etc/login.defs"
+
+ # PAM config - cutsom
+ install -Dm644 "$srcdir/login" "$pkgdir/etc/pam.d/login"
+ install -Dm644 "$srcdir/passwd" "$pkgdir/etc/pam.d/passwd"
+ install -Dm644 "$srcdir/chgpasswd" "$pkgdir/etc/pam.d/chgpasswd"
+ install -Dm644 "$srcdir/chpasswd" "$pkgdir/etc/pam.d/chpasswd"
+ install -Dm644 "$srcdir/newusers" "$pkgdir/etc/pam.d/newusers"
+ # PAM config - from tarball
+ install -Dm644 etc/pam.d/groupmems "$pkgdir/etc/pam.d/groupmems"
+
+ # we use the 'useradd' PAM file for other similar utilities
+ for file in chage chfn chsh groupadd groupdel groupmod shadow \
+ useradd usermod userdel; do
+ install -Dm644 "$srcdir/defaults.pam" "$pkgdir/etc/pam.d/$file"
+ done
+
+ # Remove su - using su from coreutils instead
+ rm -v "$pkgdir/bin/su"
+ find "$pkgdir/usr/share/man" -name 'su.1' -exec rm -v {} \;
+}
diff --git a/core/shadow/adduser b/core/shadow/adduser
new file mode 100644
index 000000000..a5d7fd4fa
--- /dev/null
+++ b/core/shadow/adduser
@@ -0,0 +1,399 @@
+#!/bin/bash
+#
+# Copyright 1995 Hrvoje Dogan, Croatia.
+# Copyright 2002, 2003, 2004 Stuart Winter, West Midlands, England, UK.
+# Copyright 2004 Slackware Linux, Inc., Concord, CA, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+#
+#
+##########################################################################
+# Program: /usr/sbin/adduser
+# Purpose: Interactive front end to /usr/sbin/useradd for Slackware Linux
+# Author : Stuart Winter <stuart@polplex.co.uk>
+# Based on the original Slackware adduser by Hrvoje Dogan
+# with modifications by Patrick Volkerding
+# Version: 1.09
+##########################################################################
+# Usage..: adduser [<new_user_name>]
+##########################################################################
+# History #
+###########
+# v1.09 - 07/06/04
+# * Added standard Slackware script licence to the head of this file.
+# v1.08 - 25/04/04
+# * Disallow user names that begin with a numeric because useradd
+# (from shadow v4.03) does not allow them. <sw>
+# v1.07 - 07/03/03
+# * When supplying a null string for the uid (meaning 'Choose next available'),
+# if there were file names in the range 'a-z' in the pwd then the
+# egrep command considered these files rather than the null string.
+# The egrep expression is now in quotes.
+# Reported & fixed by Vadim O. Ustiansky <sw>
+# v1.06 - 31/03/03
+# * Ask to chown user.group the home directory if it already exists.
+# This helps reduce later confusion when adding users whose home dir
+# already exists (mounted partition for example) and is owned
+# by a user other than the user to which the directory is being
+# assigned as home. Default is not to chown.
+# Brought to my attention by mRgOBLIN. <sw>
+# v1.05 - 04/01/03
+# * Advise & prevent users from creating logins with '.' characters
+# in the user name. <sw>
+# * Made pending account creation info look neater <sw>
+# v1.04 - 09/06/02
+# * Catered for shadow-4.0.3's 'useradd' binary that no longer
+# will let you create a user that has any uppercase chars in it
+# This was reported on the userlocal.org forums
+# by 'xcp' - thanks. <sw,pjv>
+# v1.03 - 20/05/02
+# * Support 'broken' (null lines in) /etc/passwd and
+# /etc/group files <sw>
+# * For recycling UIDs (default still 'off'), we now look in
+# /etc/login.defs for the UID_MIN value and use it
+# If not found then default to 1000 <sw>
+# v1.02 - 10/04/02
+# * Fix user-specified UID bug. <pjv>
+# v1.01 - 23/03/02
+# * Match Slackware indenting style, simplify. <pjv>
+# v1.00 - 22/03/02
+# * Created
+#######################################################################
+
+# Path to files
+pfile=/etc/passwd
+gfile=/etc/group
+sfile=/etc/shells
+
+# Paths to binaries
+useradd=/usr/sbin/useradd
+chfn=/usr/bin/chfn
+passwd=/usr/bin/passwd
+
+# Defaults
+defhome=/home
+defshell=/bin/bash
+defgroup=users
+
+# Determine what the minimum UID is (for UID recycling)
+# (we ignore it if it's not at the beginning of the line (i.e. commented out with #))
+export recycleUIDMIN="$(grep ^UID_MIN /etc/login.defs | awk '{print $2}' 2>/dev/null)"
+# If we couldn't find it, set it to the default of 1000
+if [ -z "$recycleUIDMIN" ]; then
+ export recycleUIDMIN=1000 # this is the default from Slackware's /etc/login.defs
+fi
+
+
+# This setting enables the 'recycling' of older unused UIDs.
+# When you userdel a user, it removes it from passwd and shadow but it will
+# never get used again unless you specify it expliticly -- useradd (appears to) just
+# look at the last line in passwd and increment the uid. I like the idea of
+# recycling uids but you may have very good reasons not to (old forgotten
+# confidential files still on the system could then be owned by this new user).
+# We'll set this to no because this is what the original adduser shell script
+# did and it's what users expect.
+recycleuids=no
+
+# Function to read keyboard input.
+# bash1 is broken (even ash will take read -ep!), so we work around
+# it (even though bash1 is no longer supported on Slackware).
+function get_input() {
+ local output
+ if [ "`echo $BASH_VERSION | cut -b1`" = "1" ]; then
+ echo -n "${1} " >&2 # fudge for use with bash v1
+ read output
+ else # this should work with any other /bin/sh
+ read -ep "${1} " output
+ fi
+ echo $output
+}
+
+# Function to display the account info
+function display () {
+ local goose
+ goose="$(echo $2 | cut -d ' ' -f 2-)" # lop off the prefixed argument useradd needs
+ echo -n "$1 "
+ # If it's null then display the 'other' information
+ if [ -z "$goose" -a ! -z "$3" ]; then
+ echo "$3"
+ else
+ echo "$goose"
+ fi
+}
+
+# Function to check whether groups exist in the /etc/group file
+function check_group () {
+ local got_error group
+ if [ ! -z "$@" ]; then
+ for group in $@ ; do
+ local uid_not_named="" uid_not_num=""
+ grep -v "$^" $gfile | awk -F: '{print $1}' | grep "^${group}$" >/dev/null 2>&1 || uid_not_named=yes
+ grep -v "$^" $gfile | awk -F: '{print $3}' | grep "^${group}$" >/dev/null 2>&1 || uid_not_num=yes
+ if [ ! -z "$uid_not_named" -a ! -z "$uid_not_num" ]; then
+ echo "- Group '$group' does not exist"
+ got_error=yes
+ fi
+ done
+ fi
+ # Return exit code of 1 if at least one of the groups didn't exist
+ if [ ! -z "$got_error" ]; then
+ return 1
+ fi
+}
+
+#: Read the login name for the new user :#
+#
+# Remember that most Mail Transfer Agents are case independant, so having
+# 'uSer' and 'user' may cause confusion/things to break. Because of this,
+# useradd from shadow-4.0.3 no longer accepts usernames containing uppercase,
+# and we must reject them, too.
+
+# Set the login variable to the command line param
+echo
+LOGIN="$1"
+needinput=yes
+while [ ! -z $needinput ]; do
+ if [ -z "$LOGIN" ]; then
+ while [ -z "$LOGIN" ]; do LOGIN="$(get_input "Login name for new user []:")" ; done
+ fi
+ grep "^${LOGIN}:" $pfile >/dev/null 2>&1 # ensure it's not already used
+ if [ $? -eq 0 ]; then
+ echo "- User '$LOGIN' already exists; please choose another"
+ unset LOGIN
+ elif [ ! -z "$( echo $LOGIN | grep "^[0-9]" )" ]; then
+ echo "- User names cannot begin with a number; please choose another"
+ unset LOGIN
+ elif [ ! "$LOGIN" = "`echo $LOGIN | tr A-Z a-z`" ]; then # useradd does not allow uppercase
+ echo "- User '$LOGIN' contains illegal characters (uppercase); please choose another"
+ unset LOGIN
+ elif [ ! -z "$( echo $LOGIN | grep '\.' )" ]; then
+ echo "- User '$LOGIN' contains illegal characters (period/dot); please choose another"
+ unset LOGIN
+ else
+ unset needinput
+ fi
+done
+
+# Display the user name passed from the shell if it hasn't changed
+if [ "$1" = "$LOGIN" ]; then
+ echo "Login name for new user: $LOGIN"
+fi
+
+#: Get the UID for the user & ensure it's not already in use :#
+#
+# Whilst we _can_ allow users with identical UIDs, it's not a 'good thing' because
+# when you change password for the uid, it finds the first match in /etc/passwd
+# which isn't necessarily the correct user
+#
+echo
+needinput=yes
+while [ ! -z "$needinput" ]; do
+ _UID="$(get_input "User ID ('UID') [ defaults to next available ]:")"
+ grep -v "^$" $pfile | awk -F: '{print $3}' | grep "^${_UID}$" >/dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ echo "- That UID is already in use; please choose another"
+ elif [ ! -z "$(echo $_UID | egrep '[A-Za-z]')" ]; then
+ echo "- UIDs are numerics only"
+ else
+ unset needinput
+ fi
+done
+# If we were given a UID, then syntax up the variable to pass to useradd
+if [ ! -z "$_UID" ]; then
+ U_ID="-u ${_UID}"
+else
+ # Will we be recycling UIDs?
+ if [ "$recycleuids" = "yes" ]; then
+ U_ID="-u $(awk -F: '{uid[$3]=1} END { for (i=ENVIRON["recycleUIDMIN"];i in uid;i++);print i}' $pfile)"
+ fi
+fi
+
+#: Get the initial group for the user & ensure it exists :#
+#
+# We check /etc/group for both the text version and the group ID number
+echo
+needinput=yes
+while [ ! -z "$needinput" ]; do
+ GID="$(get_input "Initial group [ ${defgroup} ]:")"
+ check_group "$GID"
+ if [ $? -gt 0 ]; then
+ echo "- Please choose another"
+ else
+ unset needinput
+ fi
+done
+# Syntax the variable ready for useradd
+if [ -z "$GID" ]; then
+ GID="-g ${defgroup}"
+else
+ GID="-g ${GID}"
+fi
+
+#: Get additional groups for the user :#
+#
+echo
+needinput=yes
+while [ ! -z "$needinput" ]; do
+ AGID="$(get_input "Additional groups (comma separated) []:")"
+ AGID="$(echo "$AGID" | tr -d ' ' | tr , ' ')" # fix up for parsing
+ if [ ! -z "$AGID" ]; then
+ check_group "$AGID" # check all groups at once (treated as N # of params)
+ if [ $? -gt 0 ]; then
+ echo "- Please re-enter the group(s)"
+ else
+ unset needinput # we found all groups specified
+ AGID="-G $(echo "$AGID" | tr ' ' ,)"
+ fi
+ else
+ unset needinput # we don't *have* to have additional groups
+ fi
+done
+
+#: Get the new user's home dir :#
+#
+echo
+needinput=yes
+while [ ! -z "$needinput" ]; do
+ HME="$(get_input "Home directory [ ${defhome}/${LOGIN} ]")"
+ if [ -z "$HME" ]; then
+ HME="${defhome}/${LOGIN}"
+ fi
+ # Warn the user if the home dir already exists
+ if [ -d "$HME" ]; then
+ echo "- Warning: '$HME' already exists !"
+ getyn="$(get_input " Do you wish to change the home directory path ? (Y/n) ")"
+ if [ "$(echo $getyn | grep -i "n")" ]; then
+ unset needinput
+ # You're most likely going to only do this if you have the dir *mounted* for this user's $HOME
+ getyn="$(get_input " Do you want to chown $LOGIN.$( echo $GID | awk '{print $2}') $HME ? (y/N) ")"
+ if [ "$(echo $getyn | grep -i "y")" ]; then
+ CHOWNHOMEDIR=$HME # set this to the home directory
+ fi
+ fi
+ else
+ unset needinput
+ fi
+done
+HME="-d ${HME}"
+
+#: Get the new user's shell :#
+echo
+needinput=yes
+while [ ! -z "$needinput" ]; do
+ unset got_error
+ SHL="$(get_input "Shell [ ${defshell} ]")"
+ if [ -z "$SHL" ]; then
+ SHL="${defshell}"
+ fi
+ # Warn the user if the shell doesn't exist in /etc/shells or as a file
+ if [ -z "$(grep "^${SHL}$" $sfile)" ]; then
+ echo "- Warning: ${SHL} is not in ${sfile} (potential problem using FTP)"
+ got_error=yes
+ fi
+ if [ ! -f "$SHL" ]; then
+ echo "- Warning: ${SHL} does not exist as a file"
+ got_error=yes
+ fi
+ if [ ! -z "$got_error" ]; then
+ getyn="$(get_input " Do you wish to change the shell ? (Y/n) ")"
+ if [ "$(echo $getyn | grep -i "n")" ]; then
+ unset needinput
+ fi
+ else
+ unset needinput
+ fi
+done
+SHL="-s ${SHL}"
+
+#: Get the expiry date :#
+echo
+needinput=yes
+while [ ! -z "$needinput" ]; do
+ EXP="$(get_input "Expiry date (YYYY-MM-DD) []:")"
+ if [ ! -z "$EXP" ]; then
+ # Check to see whether the expiry date is in the valid format
+ if [ -z "$(echo "$EXP" | grep "^[[:digit:]]\{4\}[-]\?[[:digit:]]\{2\}[-]\?[[:digit:]]\{2\}$")" ]; then
+ echo "- That is not a valid expiration date"
+ else
+ unset needinput
+ EXP="-e ${EXP}"
+ fi
+ else
+ unset needinput
+ fi
+done
+
+# Display the info about the new impending account
+echo
+echo "New account will be created as follows:"
+echo
+echo "---------------------------------------"
+display "Login name.......: " "$LOGIN"
+display "UID..............: " "$_UID" "[ Next available ]"
+display "Initial group....: " "$GID"
+display "Additional groups: " "$AGID" "[ None ]"
+display "Home directory...: " "$HME"
+display "Shell............: " "$SHL"
+display "Expiry date......: " "$EXP" "[ Never ]"
+echo
+
+echo "This is it... if you want to bail out, hit Control-C. Otherwise, press"
+echo "ENTER to go ahead and make the account."
+read junk
+
+echo
+echo "Creating new account..."
+echo
+echo
+
+# Add the account to the system
+CMD="$useradd "$HME" -m "$EXP" "$U_ID" "$GID" "$AGID" "$SHL" "$LOGIN""
+$CMD
+
+if [ $? -gt 0 ]; then
+ echo "- Error running useradd command -- account not created!"
+ echo "(cmd: $CMD)"
+ exit 1
+fi
+
+# chown the home dir ? We can only do this once the useradd has
+# completed otherwise the user name doesn't exist.
+if [ ! -z "${CHOWNHOMEDIR}" ]; then
+ chown "$LOGIN"."$( echo $GID | awk '{print $2}')" "${CHOWNHOMEDIR}"
+fi
+
+# Set the finger information
+$chfn "$LOGIN"
+if [ $? -gt 0 ]; then
+ echo "- Warning: an error occurred while setting finger information"
+fi
+
+# Set a password
+$passwd "$LOGIN"
+if [ $? -gt 0 ]; then
+ echo "* WARNING: An error occured while setting the password for"
+ echo " this account. Please manually investigate this *"
+ exit 1
+fi
+
+echo
+echo
+echo "Account setup complete."
+exit 0
+
diff --git a/core/shadow/chage b/core/shadow/chage
new file mode 100644
index 000000000..a7bf8a4a5
--- /dev/null
+++ b/core/shadow/chage
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth required pam_unix.so
+account required pam_unix.so
+session required pam_unix.so
+password required pam_permit.so
diff --git a/core/shadow/chgpasswd b/core/shadow/chgpasswd
new file mode 100644
index 000000000..8f49f5cc8
--- /dev/null
+++ b/core/shadow/chgpasswd
@@ -0,0 +1,4 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+account required pam_permit.so
+password include system-auth
diff --git a/core/shadow/chpasswd b/core/shadow/chpasswd
new file mode 100644
index 000000000..bc14857dc
--- /dev/null
+++ b/core/shadow/chpasswd
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth required pam_unix.so
+account required pam_unix.so
+session required pam_unix.so
+password required pam_unix.so md5 shadow
diff --git a/core/shadow/chsh b/core/shadow/chsh
new file mode 100644
index 000000000..a7bf8a4a5
--- /dev/null
+++ b/core/shadow/chsh
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth required pam_unix.so
+account required pam_unix.so
+session required pam_unix.so
+password required pam_permit.so
diff --git a/core/shadow/defaults.pam b/core/shadow/defaults.pam
new file mode 100644
index 000000000..a7bf8a4a5
--- /dev/null
+++ b/core/shadow/defaults.pam
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth required pam_unix.so
+account required pam_unix.so
+session required pam_unix.so
+password required pam_permit.so
diff --git a/core/shadow/login b/core/shadow/login
new file mode 100644
index 000000000..51ff96a4a
--- /dev/null
+++ b/core/shadow/login
@@ -0,0 +1,20 @@
+#%PAM-1.0
+auth required pam_securetty.so
+auth requisite pam_nologin.so
+auth required pam_unix.so nullok
+auth required pam_tally.so onerr=succeed file=/var/log/faillog
+# use this to lockout accounts for 10 minutes after 3 failed attempts
+#auth required pam_tally.so deny=2 unlock_time=600 onerr=succeed file=/var/log/faillog
+account required pam_access.so
+account required pam_time.so
+account required pam_unix.so
+#password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
+#password required pam_unix.so md5 shadow use_authtok
+session required pam_unix.so
+session required pam_env.so
+session required pam_motd.so
+session required pam_limits.so
+session optional pam_mail.so dir=/var/spool/mail standard
+session optional pam_lastlog.so
+session optional pam_loginuid.so
+-session optional pam_ck_connector.so nox11
diff --git a/core/shadow/login.defs b/core/shadow/login.defs
new file mode 100644
index 000000000..653e14e4f
--- /dev/null
+++ b/core/shadow/login.defs
@@ -0,0 +1,218 @@
+#
+# /etc/login.defs - Configuration control definitions for the login package.
+#
+# Three items must be defined: MAIL_DIR, ENV_SUPATH, and ENV_PATH.
+# If unspecified, some arbitrary (and possibly incorrect) value will
+# be assumed. All other items are optional - if not specified then
+# the described action or option will be inhibited.
+#
+# Comment lines (lines beginning with "#") and blank lines are ignored.
+#
+# Modified for Linux. --marekm
+
+#
+# Delay in seconds before being allowed another attempt after a login failure
+#
+FAIL_DELAY 3
+
+#
+# Enable display of unknown usernames when login failures are recorded.
+#
+LOG_UNKFAIL_ENAB no
+
+#
+# Enable logging of successful logins
+#
+LOG_OK_LOGINS no
+
+#
+# Enable "syslog" logging of su activity - in addition to sulog file logging.
+# SYSLOG_SG_ENAB does the same for newgrp and sg.
+#
+SYSLOG_SU_ENAB yes
+SYSLOG_SG_ENAB yes
+
+#
+# If defined, either full pathname of a file containing device names or
+# a ":" delimited list of device names. Root logins will be allowed only
+# upon these devices.
+#
+CONSOLE /etc/securetty
+#CONSOLE console:tty01:tty02:tty03:tty04
+
+#
+# If defined, all su activity is logged to this file.
+#
+#SULOG_FILE /var/log/sulog
+
+#
+# If defined, file which maps tty line to TERM environment parameter.
+# Each line of the file is in a format something like "vt100 tty01".
+#
+#TTYTYPE_FILE /etc/ttytype
+
+#
+# If defined, the command name to display when running "su -". For
+# example, if this is defined as "su" then a "ps" will display the
+# command is "-su". If not defined, then "ps" would display the
+# name of the shell actually being run, e.g. something like "-sh".
+#
+SU_NAME su
+
+#
+# *REQUIRED*
+# Directory where mailboxes reside, _or_ name of file, relative to the
+# home directory. If you _do_ define both, MAIL_DIR takes precedence.
+# QMAIL_DIR is for Qmail
+#
+#QMAIL_DIR Maildir
+MAIL_DIR /var/spool/mail
+
+#
+# If defined, file which inhibits all the usual chatter during the login
+# sequence. If a full pathname, then hushed mode will be enabled if the
+# user's name or shell are found in the file. If not a full pathname, then
+# hushed mode will be enabled if the file exists in the user's home directory.
+#
+HUSHLOGIN_FILE .hushlogin
+#HUSHLOGIN_FILE /etc/hushlogins
+
+#
+# *REQUIRED* The default PATH settings, for superuser and normal users.
+#
+# (they are minimal, add the rest in the shell startup files)
+ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ENV_PATH PATH=/bin:/usr/bin
+
+#
+# Terminal permissions
+#
+# TTYGROUP Login tty will be assigned this group ownership.
+# TTYPERM Login tty will be set to this permission.
+#
+# If you have a "write" program which is "setgid" to a special group
+# which owns the terminals, define TTYGROUP to the group number and
+# TTYPERM to 0620. Otherwise leave TTYGROUP commented out and assign
+# TTYPERM to either 622 or 600.
+#
+TTYGROUP tty
+TTYPERM 0600
+
+#
+# Login configuration initializations:
+#
+# ERASECHAR Terminal ERASE character ('\010' = backspace).
+# KILLCHAR Terminal KILL character ('\025' = CTRL/U).
+# UMASK Default "umask" value.
+#
+# The ERASECHAR and KILLCHAR are used only on System V machines.
+# The ULIMIT is used only if the system supports it.
+# (now it works with setrlimit too; ulimit is in 512-byte units)
+#
+# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
+#
+ERASECHAR 0177
+KILLCHAR 025
+UMASK 077
+
+#
+# Password aging controls:
+#
+# PASS_MAX_DAYS Maximum number of days a password may be used.
+# PASS_MIN_DAYS Minimum number of days allowed between password changes.
+# PASS_WARN_AGE Number of days warning given before a password expires.
+#
+PASS_MAX_DAYS 99999
+PASS_MIN_DAYS 0
+PASS_WARN_AGE 7
+
+#
+# Min/max values for automatic uid selection in useradd
+#
+UID_MIN 1000
+UID_MAX 60000
+# System accounts
+SYS_UID_MIN 500
+SYS_UID_MAX 999
+
+#
+# Min/max values for automatic gid selection in groupadd
+#
+GID_MIN 1000
+GID_MAX 60000
+# System accounts
+SYS_GID_MIN 500
+SYS_GID_MAX 999
+
+#
+# Max number of login retries if password is bad
+#
+LOGIN_RETRIES 5
+
+#
+# Max time in seconds for login
+#
+LOGIN_TIMEOUT 60
+
+#
+# Which fields may be changed by regular users using chfn - use
+# any combination of letters "frwh" (full name, room number, work
+# phone, home phone). If not defined, no changes are allowed.
+# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
+#
+CHFN_RESTRICT rwh
+
+#
+# List of groups to add to the user's supplementary group set
+# when logging in on the console (as determined by the CONSOLE
+# setting). Default is none.
+#
+# Use with caution - it is possible for users to gain permanent
+# access to these groups, even when not logged in on the console.
+# How to do it is left as an exercise for the reader...
+#
+#CONSOLE_GROUPS floppy:audio:cdrom
+
+#
+# Should login be allowed if we can't cd to the home directory?
+# Default in no.
+#
+DEFAULT_HOME yes
+
+#
+# If defined, this command is run when removing a user.
+# It should remove any at/cron/print jobs etc. owned by
+# the user to be removed (passed as the first argument).
+#
+#USERDEL_CMD /usr/sbin/userdel_local
+
+#
+# When prompting for password without echo, getpass() can optionally
+# display a random number (in the range 1 to GETPASS_ASTERISKS) of '*'
+# characters for each character typed. This feature is designed to
+# confuse people looking over your shoulder when you enter a password :-).
+# Also, the new getpass() accepts both Backspace (8) and Delete (127)
+# keys to delete previous character (to cope with different terminal
+# types), Control-U to delete all characters, and beeps when there are
+# no more characters to delete, or too many characters entered.
+#
+# Setting GETPASS_ASTERISKS to 1 results in more traditional behaviour -
+# exactly one '*' displayed for each character typed.
+#
+# Setting GETPASS_ASTERISKS to 0 disables the '*' characters (Backspace,
+# Delete, Control-U and beep continue to work as described above).
+#
+# Setting GETPASS_ASTERISKS to -1 reverts to the traditional getpass()
+# without any new features. This is the default.
+#
+#GETPASS_ASTERISKS 1
+
+#
+# Enable setting of the umask group bits to be the same as owner bits
+# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
+# the same as gid, and username is the same as the primary group name.
+#
+# This also enables userdel to remove user groups if no members exist.
+#
+USERGROUPS_ENAB yes
+
diff --git a/core/shadow/newusers b/core/shadow/newusers
new file mode 100644
index 000000000..bc14857dc
--- /dev/null
+++ b/core/shadow/newusers
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth required pam_unix.so
+account required pam_unix.so
+session required pam_unix.so
+password required pam_unix.so md5 shadow
diff --git a/core/shadow/passwd b/core/shadow/passwd
new file mode 100644
index 000000000..1ffd1bdd8
--- /dev/null
+++ b/core/shadow/passwd
@@ -0,0 +1,4 @@
+#%PAM-1.0
+#password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
+#password required pam_unix.so md5 shadow use_authtok
+password required pam_unix.so md5 shadow nullok
diff --git a/core/shadow/shadow b/core/shadow/shadow
new file mode 100644
index 000000000..a7bf8a4a5
--- /dev/null
+++ b/core/shadow/shadow
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth required pam_unix.so
+account required pam_unix.so
+session required pam_unix.so
+password required pam_permit.so
diff --git a/core/shadow/shadow-4.1.4.2-groupmod-pam-check.patch b/core/shadow/shadow-4.1.4.2-groupmod-pam-check.patch
new file mode 100644
index 000000000..f25c4e10f
--- /dev/null
+++ b/core/shadow/shadow-4.1.4.2-groupmod-pam-check.patch
@@ -0,0 +1,21 @@
+http://bugs.gentoo.org/300790
+http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2009-November/007850.html
+
+2009-11-05 Nicolas François <nicolas.francois@centraliens.net>
+
+ * NEWS, src/groupmod.c: Fixed groupmod when configured with
+ --enable-account-tools-setuid.
+
+diff --git a/src/groupmod.c b/src/groupmod.c
+index 4205df2..da6d77f 100644
+--- a/src/groupmod.c
++++ b/src/groupmod.c
+@@ -724,7 +724,7 @@ int main (int argc, char **argv)
+ {
+ struct passwd *pampw;
+ pampw = getpwuid (getuid ()); /* local, no need for xgetpwuid */
+- if (NULL == pamh) {
++ if (NULL == pampw) {
+ fprintf (stderr,
+ _("%s: Cannot determine your user name.\n"),
+ Prog);
diff --git a/core/shadow/shadow.cron.daily b/core/shadow/shadow.cron.daily
new file mode 100755
index 000000000..1931a793e
--- /dev/null
+++ b/core/shadow/shadow.cron.daily
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Verify integrity of password and group files
+/usr/sbin/pwck -r
+/usr/sbin/grpck -r
+
diff --git a/core/shadow/shadow.install b/core/shadow/shadow.install
new file mode 100644
index 000000000..c1bd1066b
--- /dev/null
+++ b/core/shadow/shadow.install
@@ -0,0 +1,8 @@
+post_upgrade() {
+ grpck -r &>/dev/null
+ if [ $? -eq 2 ]; then
+ echo "Fixing gshadow file ..."
+ while :; do echo "y"; done | grpck &>/dev/null
+ fi
+ return 0
+}
diff --git a/core/shadow/useradd.defaults b/core/shadow/useradd.defaults
new file mode 100644
index 000000000..b800b1777
--- /dev/null
+++ b/core/shadow/useradd.defaults
@@ -0,0 +1,9 @@
+# useradd defaults file for ArchLinux
+# original changes by TomK
+GROUP=100
+HOME=/home
+INACTIVE=-1
+EXPIRE=
+SHELL=/bin/bash
+SKEL=/etc/skel
+CREATE_MAIL_SPOOL=no
diff --git a/core/shadow/xstrdup.patch b/core/shadow/xstrdup.patch
new file mode 100644
index 000000000..bce434264
--- /dev/null
+++ b/core/shadow/xstrdup.patch
@@ -0,0 +1,9 @@
+--- shadow-4.1.2.1/libmisc/xmalloc.c 2008-08-30 21:55:44.000000000 -0500
++++ shadow-4.1.2.1/libmisc/xmalloc.c.new 2008-08-30 21:55:36.000000000 -0500
+@@ -61,5 +61,6 @@
+
+ char *xstrdup (const char *str)
+ {
++ if(str == NULL) return NULL;
+ return strcpy (xmalloc (strlen (str) + 1), str);
+ }
diff --git a/core/sqlite3/PKGBUILD b/core/sqlite3/PKGBUILD
new file mode 100644
index 000000000..c2155562a
--- /dev/null
+++ b/core/sqlite3/PKGBUILD
@@ -0,0 +1,93 @@
+# $Id: PKGBUILD 108579 2011-02-01 18:59:24Z andyrtr $
+# Maintainer: Andreas Radke <andyrtr@archlinux.org>
+# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
+
+pkgbase="sqlite3"
+pkgname=('sqlite3' 'sqlite3-tcl' 'sqlite3-doc')
+_amalgamationver=3070500
+_amalgamationver2=${_amalgamationver/00/}
+pkgver=${_amalgamationver2//0/.}
+pkgrel=1
+pkgdesc="A C library that implements an SQL database engine"
+arch=('i686' 'x86_64')
+license=('custom')
+url="http://www.sqlite.org/"
+makedepends=('tcl' 'readline>=6.0.00')
+source=( #http://www.sqlite.org/sqlite-src-${_amalgamationver}.zip - # the no more recommended ZIP archive of the complete source tree for SQLite - Makefile and configure script in this tarball are not supported
+ http://www.sqlite.org/sqlite-autoconf-$_amalgamationver.tar.gz # tarball containing the amalgamation for SQLite 3.7.5 together with an configure script and makefile for building it.
+ http://www.sqlite.org/sqlite-tea-$_amalgamationver.tar.gz # tarball of the amalgamation together with a Tcl Extension Architecture (TEA) compatible configure script and makefile
+ http://www.sqlite.org/sqlite-doc-${_amalgamationver}.zip
+ license.txt)
+options=('!libtool' '!emptydirs')
+md5sums=('a9604a82613ade2e7f4c303f233e477f'
+ '3413e8cfb7990e39260bf45dca017bf0'
+ '74f9b304143a76e3da8c0063888770ee'
+ 'c1cdbc5544034d9012e421e75a5e4890')
+
+build() {
+# cd ${srcdir}/sqlite-src-${_amalgamationver}
+# export LTLINK_EXTRAS="-ldl"
+# export CFLAGS="$CFLAGS -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_SECURE_DELETE"
+# ./configure --prefix=/usr \
+# --enable-threadsafe \
+# --enable-cross-thread-connections \
+# --disable-static \
+# --enable-load-extension
+
+ # rpath removal
+# sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+# sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+
+# make
+
+ export CFLAGS="$CFLAGS -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_SECURE_DELETE"
+
+ # build sqlite
+ cd "$srcdir"/sqlite-autoconf-$_amalgamationver
+ ./configure --prefix=/usr \
+ --disable-static
+ make
+
+ # build the tcl extension
+ cd "$srcdir"/sqlite-tea-$_amalgamationver
+ ./configure --prefix=/usr \
+ --with-system-sqlite
+ make
+
+}
+
+package_sqlite3() {
+
+ pkgdesc="A C library that implements an SQL database engine"
+ depends=('readline>=6.0.00')
+ conflicts=('sqlite')
+ replaces=('sqlite')
+
+# cd ${srcdir}/sqlite-src-${_amalgamationver}
+# make DESTDIR=${pkgdir} install
+# install -Dm0644 sqlite3.1 ${pkgdir}/usr/share/man/man1/sqlite3.1
+
+ cd ${srcdir}/sqlite-autoconf-$_amalgamationver
+ make DESTDIR=${pkgdir} install
+
+ # license
+ install -D -m644 ${srcdir}/license.txt ${pkgdir}/usr/share/licenses/${pkgname}/license.txt
+}
+
+package_sqlite3-tcl() {
+
+ pkgdesc="sqlite3 Tcl Extension Architecture (TEA)"
+ depends=('sqlite3>=3.7.5')
+
+ cd ${srcdir}/sqlite-tea-$_amalgamationver
+ make DESTDIR=${pkgdir} install
+}
+
+package_sqlite3-doc() {
+ pkgdesc="most of the static HTML files that comprise this website, including all of the SQL Syntax and the C/C++ interface specs and other miscellaneous documentation"
+ #arch=('any') - not yet supported
+
+ cd ${srcdir}/sqlite-doc-${_amalgamationver}
+ mkdir -p ${pkgdir}/usr/share/doc/${pkgbase}
+ cp -R * ${pkgdir}/usr/share/doc/${pkgbase}/
+}
diff --git a/core/sqlite3/license.txt b/core/sqlite3/license.txt
new file mode 100644
index 000000000..118c5d5e6
--- /dev/null
+++ b/core/sqlite3/license.txt
@@ -0,0 +1,33 @@
+SQLite Copyright
+SQLite is in the
+Public Domain
+
+
+All of the deliverable code in SQLite has been dedicated to the public domain by the authors. All code authors, and representatives of the companies they work for, have signed affidavits dedicating their contributions to the public domain and originals of those signed affidavits are stored in a firesafe at the main offices of Hwaci. Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original SQLite code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
+
+The previous paragraph applies to the deliverable code in SQLite - those parts of the SQLite library that you actually bundle and ship with a larger application. Portions of the documentation and some code used as part of the build process might fall under other licenses. The details here are unclear. We do not worry about the licensing of the documentation and build code so much because none of these things are part of the core deliverable SQLite library.
+
+All of the deliverable code in SQLite has been written from scratch. No code has been taken from other projects or from the open internet. Every line of code can be traced back to its original author, and all of those authors have public domain dedications on file. So the SQLite code base is clean and is uncontaminated with licensed code from other projects.
+Obtaining An Explicit License To Use SQLite
+
+Even though SQLite is in the public domain and does not require a license, some users want to obtain a license anyway. Some reasons for obtaining a license include:
+You are using SQLite in a jurisdiction that does not recognize the public domain.
+You are using SQLite in a jurisdiction that does not recognize the right of an author to dedicate their work to the public domain.
+You want to hold a tangible legal document as evidence that you have the legal right to use and distribute SQLite.
+Your legal department tells you that you have to purchase a license.
+
+If you feel like you really have to purchase a license for SQLite, Hwaci, the company that employs the architect and principal developers of SQLite, will sell you one.
+Contributed Code
+
+In order to keep SQLite completely free and unencumbered by copyright, all new contributors to the SQLite code base are asked to dedicate their contributions to the public domain. If you want to send a patch or enhancement for possible inclusion in the SQLite source tree, please accompany the patch with the following statement:
+The author or authors of this code dedicate any and all copyright interest in this code to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this code under copyright law.
+
+We are not able to accept patches or changes to SQLite that are not accompanied by a statement such as the above. In addition, if you make changes or enhancements as an employee, then a simple statement such as the above is insufficient. You must also send by surface mail a copyright release signed by a company officer. A signed original of the copyright release should be mailed to:
+Hwaci
+6200 Maple Cove Lane
+Charlotte, NC 28269
+USA
+
+A template copyright release is available in PDF or HTML. You can use this release to make future changes.
+
+see http://www.sqlite.org/copyright.html \ No newline at end of file
diff --git a/core/sudo/PKGBUILD b/core/sudo/PKGBUILD
new file mode 100644
index 000000000..7281b56b0
--- /dev/null
+++ b/core/sudo/PKGBUILD
@@ -0,0 +1,52 @@
+# $Id: PKGBUILD 113374 2011-03-08 13:08:35Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
+
+pkgname=sudo
+_ver=1.8.0
+pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
+pkgrel=4
+pkgdesc="Give certain users the ability to run some commands as root"
+arch=('i686' 'x86_64')
+url="http://www.sudo.ws/sudo/"
+license=('custom')
+depends=('glibc' 'pam')
+backup=('etc/sudoers' 'etc/pam.d/sudo')
+source=(ftp://ftp.sudo.ws/pub/sudo/$pkgname-$_ver.tar.gz
+ sudo_l.patch
+ sudo_validate_exitval.patch
+ sudo_noninteractive.patch
+ sudo.pam)
+options=('!libtool' '!makeflags')
+md5sums=('fa0a35330691af14cb1869f64a65aebc'
+ '29656b2f2365e14fa0f8eb94e61f3690'
+ '4751aa5557fe43fd8e03e0c7b5affcfc'
+ '47d152ade2c9a726684fa1227e46bfe3'
+ '4e7ad4ec8f2fe6a40e12bcb2c0b256e3')
+
+build() {
+ cd $srcdir/$pkgname-$_ver
+
+ # http://www.sudo.ws/bugs/show_bug.cgi?id=474
+ patch -Np1 -i $srcdir/sudo_l.patch
+
+ # http://www.sudo.ws/bugs/show_bug.cgi?id=479
+ patch -Np1 -i $srcdir/sudo_validate_exitval.patch
+
+ # http://www.sudo.ws/bugs/show_bug.cgi?id=478
+ patch -Np1 -i $srcdir/sudo_noninteractive.patch
+
+ ./configure --prefix=/usr --with-pam --libexecdir=/usr/lib \
+ --with-env-editor --with-all-insults --with-logfac=auth
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$_ver
+ install -dm755 $pkgdir/var/lib
+
+ make DESTDIR=$pkgdir install
+ install -Dm644 $srcdir/sudo.pam $pkgdir/etc/pam.d/sudo
+
+ install -Dm644 doc/LICENSE $pkgdir/usr/share/licenses/sudo/LICENSE
+}
diff --git a/core/sudo/sudo.pam b/core/sudo/sudo.pam
new file mode 100644
index 000000000..4e586cd22
--- /dev/null
+++ b/core/sudo/sudo.pam
@@ -0,0 +1,3 @@
+#%PAM-1.0
+auth required pam_unix.so
+auth required pam_nologin.so
diff --git a/core/sudo/sudo_l.patch b/core/sudo/sudo_l.patch
new file mode 100644
index 000000000..2115ed760
--- /dev/null
+++ b/core/sudo/sudo_l.patch
@@ -0,0 +1,21 @@
+diff -r df1bb67fb168 plugins/sudoers/sudo_nss.c
+--- a/plugins/sudoers/sudo_nss.c Wed Mar 02 12:39:11 2011 -0500
++++ b/plugins/sudoers/sudo_nss.c Thu Mar 03 09:37:48 2011 -0500
+@@ -309,6 +309,7 @@
+ /*
+ * Check user_cmnd against sudoers and print the matching entry if the
+ * command is allowed.
++ * Returns TRUE if the command is allowed, else FALSE.
+ */
+ int
+ display_cmnd(struct sudo_nss_list *snl, struct passwd *pw)
+@@ -320,7 +321,7 @@
+
+ tq_foreach_fwd(snl, nss) {
+ if (nss->display_cmnd(nss, pw) == 0)
+- return 0;
++ return TRUE;
+ }
+- return 1;
++ return FALSE;
+ }
diff --git a/core/sudo/sudo_noninteractive.patch b/core/sudo/sudo_noninteractive.patch
new file mode 100644
index 000000000..c0c4c4515
--- /dev/null
+++ b/core/sudo/sudo_noninteractive.patch
@@ -0,0 +1,15 @@
+diff -r fc3dd3be67e9 plugins/sudoers/sudoers.c
+--- a/plugins/sudoers/sudoers.c Sat Mar 05 15:34:30 2011 -0500
++++ b/plugins/sudoers/sudoers.c Sun Mar 06 15:35:39 2011 -0500
+@@ -1172,6 +1172,11 @@
+ SET(flags, MODE_IGNORE_TICKET);
+ continue;
+ }
++ if (MATCHES(*cur, "noninteractive=")) {
++ if (atobool(*cur + sizeof("noninteractive=") - 1) == TRUE)
++ SET(flags, MODE_NONINTERACTIVE);
++ continue;
++ }
+ if (MATCHES(*cur, "sudoedit=")) {
+ if (atobool(*cur + sizeof("sudoedit=") - 1) == TRUE)
+ SET(flags, MODE_EDIT);
diff --git a/core/sudo/sudo_validate_exitval.patch b/core/sudo/sudo_validate_exitval.patch
new file mode 100644
index 000000000..ccda68921
--- /dev/null
+++ b/core/sudo/sudo_validate_exitval.patch
@@ -0,0 +1,15 @@
+diff -r 172f29597bd2 plugins/sudoers/sudoers.c
+--- a/plugins/sudoers/sudoers.c Sun Mar 06 15:38:02 2011 -0500
++++ b/plugins/sudoers/sudoers.c Sun Mar 06 15:52:06 2011 -0500
+@@ -546,8 +546,10 @@
+ if (def_group_plugin)
+ group_plugin_unload();
+
+- if (ISSET(sudo_mode, (MODE_VALIDATE|MODE_CHECK|MODE_LIST)))
++ if (ISSET(sudo_mode, (MODE_VALIDATE|MODE_CHECK|MODE_LIST))) {
++ rval = TRUE;
+ goto done;
++ }
+
+ /*
+ * Set umask based on sudoers.
diff --git a/core/sysfsutils/PKGBUILD b/core/sysfsutils/PKGBUILD
new file mode 100644
index 000000000..9749d29b4
--- /dev/null
+++ b/core/sysfsutils/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 108847 2011-02-04 11:49:39Z stephane $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+
+pkgname=sysfsutils
+pkgver=2.1.0
+pkgrel=6
+pkgdesc="System Utilities Based on Sysfs"
+arch=(i686 x86_64)
+license=('GPL' 'LGPL')
+url="http://linux-diag.sourceforge.net/Sysfsutils.html"
+groups=('base')
+depends=('glibc')
+source=(http://downloads.sourceforge.net/sourceforge/linux-diag/${pkgname}-${pkgver}.tar.gz)
+md5sums=('14e7dcd0436d2f49aa403f67e1ef7ddc')
+options=(!libtool)
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --mandir=/usr/share/man
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ cd "${pkgdir}"
+ mkdir -v lib
+ mv -v usr/lib/libsysfs.so.2* lib/
+ ln -svf ../../lib/libsysfs.so.2 usr/lib/libsysfs.so
+}
diff --git a/core/syslinux/PKGBUILD b/core/syslinux/PKGBUILD
new file mode 100644
index 000000000..bfbd1f2c9
--- /dev/null
+++ b/core/syslinux/PKGBUILD
@@ -0,0 +1,49 @@
+# $Id: PKGBUILD 112767 2011-03-06 16:24:51Z thomas $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+
+pkgname=syslinux
+pkgver=4.03
+pkgrel=4
+arch=('i686' 'x86_64')
+pkgdesc="Collection of boot loaders that boot from FAT, ext2/3/4 and btrfs filesystems, from CDs and via PXE"
+url="http://syslinux.zytor.com/"
+license=('GPL2')
+depends=('perl' 'glibc')
+optdepends=('perl-passwd-md5: For md5pass'
+ 'perl-digest-sha1: For sha1pass'
+ 'mtools: For mkdiskimage and syslinux'
+ )
+makedepends=('nasm')
+backup=('boot/syslinux/syslinux.cfg')
+install=syslinux.install
+source=(http://www.kernel.org/pub/linux/utils/boot/syslinux/$pkgname-${pkgver}.tar.bz2
+ syslinux-dont-build-dos-windows-targets.patch
+ syslinux.cfg
+ syslinux-install_update)
+sha256sums=('c65567e324f9d1f7f794ae8f9578a0292bbd47d7b8d895a004d2f0152d0bda38'
+ '7e9301e37113d8bcddadc3a7d2fd6f3f433ef20ef6fa6df9fe9e256fa8868753'
+ 'b4ba8f9daa67ec35da6e05adb610469bc8c4facf488468c1ec3e5860ba75313d'
+ '49573a3b65362326c8b1e9bfa49e83225e0bf9d3710454de4070abc9481c614c')
+
+build() {
+ # Do not try to build syslinux with our default LDFLAGS, it will fail
+ unset LDFLAGS
+ cd "$srcdir"/$pkgname-${pkgver}
+ # Do not try to build the Windows or DOS installers
+ patch -p1 -i "$srcdir"/syslinux-dont-build-dos-windows-targets.patch
+ # Fix FHS manpage path
+ sed 's|/usr/man|/usr/share/man|g' -i MCONFIG
+ make
+}
+
+package() {
+ cd "$srcdir"/$pkgname-${pkgver}
+ make INSTALLROOT="$pkgdir" AUXDIR=/usr/lib/syslinux install
+
+ # Install the default configuration
+ install -D -m644 "$srcdir"/syslinux.cfg "$pkgdir"/boot/syslinux/syslinux.cfg
+ # Install the installation and update script
+ # This script is maintained at git://gist.github.com/772138.git
+ install -D -m755 "$srcdir"/syslinux-install_update "$pkgdir"/usr/sbin/syslinux-install_update
+}
diff --git a/core/syslinux/syslinux-dont-build-dos-windows-targets.patch b/core/syslinux/syslinux-dont-build-dos-windows-targets.patch
new file mode 100644
index 000000000..2bac55185
--- /dev/null
+++ b/core/syslinux/syslinux-dont-build-dos-windows-targets.patch
@@ -0,0 +1,12 @@
+diff -Nur syslinux-4.02.orig//Makefile syslinux-4.02//Makefile
+--- syslinux-4.02.orig//Makefile 2010-07-21 21:33:13.000000000 +0200
++++ syslinux-4.02//Makefile 2010-07-22 11:14:03.325522937 +0200
+@@ -55,7 +55,7 @@
+ # files that depend only on the B phase, but may have to be regenerated
+ # for "make installer".
+ BSUBDIRS = codepage com32 lzo core memdisk modules mbr memdump gpxe sample \
+- libinstaller dos win32 win64 dosutil
++ libinstaller
+ ITARGET =
+ IOBJECTS = $(ITARGET) \
+ utils/gethostip utils/isohybrid utils/mkdiskimage \
diff --git a/core/syslinux/syslinux-install_update b/core/syslinux/syslinux-install_update
new file mode 100644
index 000000000..f7cd123e1
--- /dev/null
+++ b/core/syslinux/syslinux-install_update
@@ -0,0 +1,459 @@
+#!/bin/bash
+#
+# Sylinux Installer / Updater Scripts
+# Copyright (C) 2011 Matthew Gyurgyik <pyther@pyther.net>
+#
+# This program is free software; you can redistribute it and/or
+# modify it 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.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+#-----------------
+# Exit Codes:
+# 1 - get_boot_device or other function failed
+# 2 - install/update failed
+# 3 - set_active failed
+# 4 - install_mbr failed
+#
+shopt -s nullglob
+
+libpath="/usr/lib/syslinux"
+bootpath="/boot/syslinux"
+extlinux="/sbin/extlinux"
+
+autoupdate_file=/boot/syslinux/SYSLINUX_AUTOUPDATE
+com32_files=(menu.c32 vesamenu.c32 chain.c32 hdt.c32 reboot.c32 poweroff.com)
+pciids_file=/usr/share/hwdata/pci.ids
+
+## Helper functions ##
+# Taken from libui-sh
+# $1 needle
+# $2 set (array) haystack
+check_is_in() {
+ local needle="$1" element
+ shift
+ for element; do
+ [[ $element = $needle ]] && return 0
+ done
+ return 1
+}
+
+# return true when blockdevice is an md raid, otherwise return a unset value
+# get all devices that are part of raid device $1
+device_is_raid() {
+ [[ $1 && -f /proc/mdstat ]] || return 1
+ local devmajor=$(stat -c %t "$1")
+ (( devmajor == 9 ))
+}
+
+mdraid_all_slaves() {
+ local slave slaves
+ for slave in /sys/class/block/${1##*/}/slaves/*; do
+ source "$slave/uevent"
+ slaves="$slaves/dev/$DEVNAME "
+ unset DEVNAME
+ done
+ echo $slaves
+}
+
+# Check /sys/block to see if device is partitioned
+# If we have a partitioned block device (sda1) /sys/block/sda1/dev will not exist
+# However, if we have an unpartitioned block device (sda) /sys/block/sda/dev will exist
+dev_is_part() {
+ # $1 - blockdevice
+ local dev=$1
+
+ # If block device uevent file should be found
+ # If a partition is passed in path shouldn't exist
+ if [[ $dev = *cciss* ]]; then
+ [[ -f /sys/block/cciss\!${dev##*/}/dev ]] && return 1
+ elif [[ $dev = *ida* ]]; then
+ [[ -f /sys/block/ida\!${dev##*/}/dev ]] && return 1
+ else
+ [[ -f /sys/block/${dev##*/}/dev ]] && return 1
+ fi
+
+ return 0
+}
+
+# If EFI PART is present in the first 8 bytes then it must be a GPT disk
+device_is_gpt() {
+ local partsig=$(dd if="$1" skip=64 bs=8 count=1 2>/dev/null)
+ [[ $partsig = "EFI PART" ]]
+}
+
+clear_gpt_attr2() {
+ # $1 - Block Device, no partitions
+ local disk=$1
+
+ # Special Exception for cciss controllers
+ if [[ $disk = *cciss* ]]; then
+ for part in /dev/cciss/${disk##*/}*p*; do
+ local partnum="${part##*[[:alpha:]]}"
+ sgdisk "$disk" --attributes="$partnum":clear:2 &>/dev/null
+ done
+ # Smart 2 Controllers
+ elif [[ $disk = *ida* ]]; then
+ for part in /dev/ida/${disk##*/}*p*; do
+ local partnum="${part##*[[:alpha:]]}"
+ sgdisk "$disk" --attributes="$partnum":clear:2 &>/dev/null
+ done
+ else
+ for part in /sys/block/${disk##*/}/${disk##*/}*; do
+ local partnum="${part##*[[:alpha:]]}"
+ sgdisk "$disk" --attributes="$partnum":clear:2 &>/dev/null
+ done
+ fi
+ return 0
+}
+
+usage() {
+cat << EOF
+usage: $0 options
+
+This script will install or upgrade Syslinux
+
+OPTIONS:
+ -h Show this message
+ -i Install Syslinux
+ -u Update Syslinux
+ -a Set Boot flag on boot partiton
+ -m Install Syslinux MBR
+ -s Updates Syslinux if /boot/syslinux/SYSLINUX_AUTOUPDATE exists
+
+ Arguments Required:
+ -c Chroot install (ex: -c /mnt)
+
+Example Usage: syslinux-install_update.sh -i -a -m (install, set boot flag, install mbr)
+ syslinux-install_update.sh -u (update)
+EOF
+}
+
+# Trys to find the partition that /boot resides on
+# This will either be on /boot or / (root)
+getBoot() {
+ if [[ ! -d "$bootpath" ]]; then
+ echo "Could not find $bootpath"
+ echo "Is boot mounted? Is Syslinux installed?"
+ exit 1
+ fi
+
+ syslinux_fs=(ext2 ext3 ext4 btrfs vfat)
+
+ # Use DATA from findmnt see rc.sysint for more info
+ if [[ -f /proc/self/mountinfo ]]; then
+ read rootdev rootfs < <(findmnt -run -t noautofs -o SOURCE,FSTYPE "$CHROOT/")
+ read bootdev bootfs < <(findmnt -run -t noautofs -o SOURCE,FSTYPE "$CHROOT/boot")
+ else
+ echo "Could not find /proc/self/mountinfo"
+ echo "Are you running a kernel greater than 2.6.24?"
+ exit 1
+ fi
+
+ if [[ $bootfs ]]; then
+ if ! check_is_in "$bootfs" "${syslinux_fs[@]}"; then
+ echo "/boot file system is not supported by Syslinux"
+ exit 1
+ fi
+ boot="boot"
+ bootpart="$bootdev"
+ elif [[ $rootfs ]]; then
+ if ! check_is_in "$rootfs" "${syslinux_fs[@]}"; then
+ echo "/ (root) file system is not supported by Syslinux"
+ exit 1
+ fi
+ boot="root"
+ bootpart="$rootdev"
+ else
+ echo "Could not find filesystem on / (root) or /boot."
+ exit 1
+ fi
+}
+
+# We store the partition table type either gpt or mbr in var ptb
+# In rare cases a user could have one raid disk using mbr and another using gpt
+# In such cases we accept that the output may be incomplete
+
+# Calls get_ptb() for $bootpart or for all device in RAID
+declare -A bootdevs
+get_boot_devices() {
+ if device_is_raid "$bootpart"; then
+ slaves=$(mdraid_all_slaves "$bootpart")
+
+ for slave in ${slaves[@]}; do
+ local disk="${slave%%[[:digit:]]*}"
+ device_is_gpt "$disk" && local ptb="GPT" || local ptb="MBR"
+ bootdevs[$slave]="$ptb"
+ done
+ else
+ local disk="${bootpart%%[[:digit:]]*}"
+ device_is_gpt "$disk" && local ptb="GPT" || local ptb="MBR"
+ bootdevs[$bootpart]="$ptb"
+ fi
+}
+
+# Function Assumes the boot partition should be marked as active
+# All other partitions should not have the boot flag set
+set_active() {
+ # If any bootdev is a block device without partitions bail
+ # we want to set the boot flag on partitioned disk
+ for dev in "${!bootdevs[@]}"; do
+ dev_is_part $dev || { echo "$dev - is a block device. Aborting set_active!"; return 1; }
+ done
+
+ # Clear BIOS Bootable Legacy Attribute for GPT drives
+ # In rare cases where a RAID device has slaves on the same block device
+ # Attribute 2 will be cleared for each partition multiple times
+ for dev in "${!bootdevs[@]}"; do
+ local ptb="${bootdevs[$dev]}"
+ if [[ "$ptb" = GPT ]]; then
+ local disk="${dev%%[[:digit:]]*}" #ex: /dev/sda
+ clear_gpt_attr2 "$disk"
+ fi
+ done
+
+ # Set the boot flag on bootdevs (generated from get_boot_devices)
+ for part in "${!bootdevs[@]}"; do
+ local ptb="${bootdevs[$part]}"
+ local partnum="${part##*[[:alpha:]]}"
+ case "$part" in
+ *[[:digit:]]p[[:digit:]]*)
+ local disk="${part%%p$partnum}" # get everything before p1
+ ;;
+ *)
+ local disk="${part%%[[:digit:]]*}"
+ ;;
+ esac
+
+ if [[ "$ptb" = MBR ]]; then
+ if sfdisk "$disk" -A "$partnum" &>/dev/null; then
+ echo "Boot Flag Set - $part"
+ else
+ echo "FAILED to Set the boot flag on $part"
+ exit 3
+ fi
+ elif [[ "$ptb" = GPT ]]; then
+ if sgdisk "$disk" --attributes="$partnum":set:2 &>/dev/null; then
+ echo "Attribute Legacy Bios Bootable Set - $part"
+ else
+ echo "FAILED to set attribute Legacy BIOS Bootable on $part"
+ exit 3
+ fi
+ fi
+ done
+ return 0
+}
+
+install_mbr() {
+ # If any bootdev is a block device without partitions bail
+ # we want to install the mbr to a partitioned disk
+ for dev in "${!bootdevs[@]}"; do
+ dev_is_part "$dev" || { echo "$dev - is a block device. Aborting MBR install"; return 1; }
+ done
+
+ for part in "${!bootdevs[@]}"; do
+ local partnum="${part##*[[:alpha:]]}"
+ case "$part" in
+ *[[:digit:]]p[[:digit:]]*)
+ local disk="${part%%p$partnum}" # get everything before p1
+ ;;
+ *)
+ local disk="${part%%[[:digit:]]*}"
+ ;;
+ esac
+ local ptb="${bootdevs[$part]}"
+
+ # We want to install to the root of the block device
+ # If the device is a partition - ABORT!
+ dev_is_part "$disk" && \
+ { echo "ABORT! MBR installation to partition ($disk)!"; exit 4;}
+
+ if [[ "$ptb" = MBR ]]; then
+ mbrfile="$libpath/mbr.bin"
+ elif [[ "$ptb" = GPT ]]; then
+ mbrfile="$libpath/gptmbr.bin"
+ fi
+
+ if dd bs=440 count=1 conv=notrunc if="$mbrfile" of="$disk" &> /dev/null; then
+ echo "Installed MBR ($mbrfile) to $disk"
+ else
+ echo "Error Installing MBR ($mbrfile) to $disk"
+ exit 4
+ fi
+ done
+ return 0
+}
+
+_install() {
+ # Copy files to /boot
+ for file in "${com32_files[@]}"; do
+ # Symlink files even if links exist
+ if [[ "$boot" = root ]]; then
+ ln -s "${libpath#$CHROOT}/$file" "$bootpath/$file" &> /dev/null
+ elif [[ "$boot" = boot ]]; then
+ cp "$libpath/$file" "$bootpath/$file"
+ fi
+ done
+
+ # Copy / Symlink pci.ids if we copy the com32 module and if pci.ids exists in the FS
+ if check_is_in "hdt.c32" "${com32_files[@]}" && [[ -f $pciids_file ]]; then
+ if [[ "$boot" = root ]]; then
+ ln -s "$pciids_file" "$bootpath/pci.ids" &> /dev/null
+ elif [[ "$boot" = boot ]]; then
+ cp "$pciids_file" "$bootpath/pci.ids" &> /dev/null
+ fi
+ fi
+
+ if device_is_raid "$bootpart"; then
+ echo "Detected RAID on /boot - installing Syslinux with --raid"
+ "$extlinux" --install "$bootpath" -r > /dev/null 2>&1
+ else
+ "$extlinux" --install "$bootpath" > /dev/null 2>&1
+ fi
+
+ if (( $? )); then
+ echo "Syslinux install failed"
+ exit 2
+ else
+ echo "Syslinux install successful"
+ fi
+
+ touch "$CHROOT/$autoupdate_file"
+}
+
+update() {
+ # Update any com and c32 files in /boot
+ if [[ "$boot" = boot ]]; then
+ for file in "$bootpath"/*.{c32,com}; do
+ file=$(basename "$file")
+ cp "$libpath/$file" "$bootpath/$file" &> /dev/null
+ done
+ if [[ -f "$bootpath/pci.ids" ]]; then
+ cp "$pciids_file" "$bootpath/pci.ids" &> /dev/null
+ fi
+ fi
+
+ if device_is_raid $bootpart; then
+ echo "Detected RAID on /boot - installing Syslinux with --raid"
+ "$extlinux" --update "$bootpath" -r &> /dev/null
+ else
+ "$extlinux" --update "$bootpath" &> /dev/null
+ fi
+
+ if (($?)); then
+ echo "Syslinux update failed"
+ exit 2
+ else
+ echo "Syslinux update successful"
+ fi
+}
+
+# Make sure only root can run our script
+if (( $(id -u) != 0 )); then
+ echo "This script must be run as root" 1>&2
+ exit 1
+fi
+
+if (( $# == 0 )); then
+ usage
+ exit 1
+fi
+
+while getopts "c:uihmas" opt; do
+ case $opt in
+ c)
+ CHROOT=$(readlink -e "$OPTARG")
+ if [[ -z $CHROOT ]]; then
+ echo "error: chroot path ``$OPTARG does not exist";
+ exit 1
+ fi
+ ;;
+ h)
+ usage
+ exit 0
+ ;;
+ i)
+ INSTALL="True"
+ ;;
+ u)
+ UPDATE="True"
+ ;;
+ m)
+ MBR="True"
+ ;;
+ a)
+ SET_ACTIVE="True"
+ ;;
+ s)
+ # If AUTOUPDATE_FILE does not exist exit the script
+ if [[ -f $autoupdate_file ]]; then
+ UPDATE="True"
+ else
+ exit 0
+ fi
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+# Display Usage Information if both Install and Update are passed
+if [[ $INSTALL && $UPDATE ]]; then
+ usage
+ exit 1
+fi
+
+# If a chroot dir is path set variables to reflect chroot
+if [[ "$CHROOT" ]]; then
+ libpath="$CHROOT$libpath"
+ bootpath="$CHROOT$bootpath"
+ extlinux="$CHROOT$extlinux"
+fi
+
+# Exit if no /boot path exists
+if ( f=("$bootpath"/*); (( ! ${#f[@]} )) ); then
+ echo "Error: $bootpath is empty!"
+ echo "Is /boot mounted?"
+ exit 1
+fi
+
+# Get the boot device if any of these options are passed
+if [[ $INSTALL || $UPDATE || $SET_ACTIVE || $MBR ]]; then
+ getBoot
+fi
+
+# Install or Update
+if [[ $INSTALL ]]; then
+ _install || exit
+elif [[ $UPDATE ]]; then
+ update || exit
+fi
+
+
+# SET_ACTIVE and MBR
+if [[ $SET_ACTIVE ]] || [[ $MBR ]]; then
+ get_boot_devices
+
+ if [[ $SET_ACTIVE ]]; then
+ set_active || exit
+ fi
+
+ if [[ $MBR ]]; then
+ install_mbr || exit
+ fi
+fi
+
+exit 0
+
+# vim: set et sw=4:
diff --git a/core/syslinux/syslinux.cfg b/core/syslinux/syslinux.cfg
new file mode 100644
index 000000000..2212283a8
--- /dev/null
+++ b/core/syslinux/syslinux.cfg
@@ -0,0 +1,79 @@
+# Config file for Syslinux -
+# /boot/syslinux/syslinux.cfg
+#
+# Comboot modules:
+# * menu.c32 - provides a text menu
+# * vesamenu.c32 - provides a graphical menu
+# * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
+# * hdt.c32 - hardware detection tool
+# * reboot.c32 - reboots the system
+# * poweroff.com - shutdown the system
+#
+# To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
+# If /usr and /boot are on the same file system, symlink the files instead
+# of copying them.
+#
+# If you do not use a menu, a 'boot:' prompt will be shown and the system
+# will boot automatically after 5 seconds.
+#
+# Please review the wiki: https://wiki.archlinux.org/index.php/Syslinux
+# The wiki provides further configuration examples
+
+DEFAULT arch
+PROMPT 0 # Change to 1 if you do not want to use a menu
+TIMEOUT 50
+# You can create syslinux keymaps with the keytab-lilo tool
+#KBDMAP de.ktl
+
+# Menu Configuration
+# Either menu.c32 or vesamenu32.c32 must be copied to /boot/syslinux
+UI menu.c32
+#UI vesamenu.c32
+
+# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
+MENU TITLE Arch Linux
+#MENU BACKGROUND splash.png
+MENU COLOR border 30;44 #40ffffff #a0000000 std
+MENU COLOR title 1;36;44 #9033ccff #a0000000 std
+MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
+MENU COLOR unsel 37;44 #50ffffff #a0000000 std
+MENU COLOR help 37;40 #c0ffffff #a0000000 std
+MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
+MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
+MENU COLOR msg07 37;40 #90ffffff #a0000000 std
+MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
+
+# boot sections follow
+#
+# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
+#
+#-*
+
+LABEL arch
+ MENU LABEL Arch Linux
+ LINUX ../vmlinuz26
+ APPEND root=/dev/sda3 ro
+ INITRD ../kernel26.img
+
+LABEL archfallback
+ MENU LABEL Arch Linux Fallback
+ LINUX ../vmlinuz26
+ APPEND root=/dev/sda3 ro
+ INITRD ../kernel26-fallback.img
+
+#LABEL windows
+# MENU LABEL Windows
+# COM32 chain.c32
+# APPEND hd0 1
+
+LABEL hdt
+ MENU LABEL HDT (Hardware Detection Tool)
+ COM32 hdt.c32
+
+LABEL reboot
+ MENU LABEL Reboot
+ COM32 reboot.c32
+
+LABEL off
+ MENU LABEL Power Off
+ COMBOOT poweroff.com
diff --git a/core/syslinux/syslinux.install b/core/syslinux/syslinux.install
new file mode 100644
index 000000000..0dc0ece36
--- /dev/null
+++ b/core/syslinux/syslinux.install
@@ -0,0 +1,13 @@
+post_install() {
+ echo "==> If you want to use syslinux as your bootloader"
+ echo "==> edit /boot/syslinux/syslinux.cfg and run"
+ echo "==> # /usr/sbin/syslinux-install_update -i -a -m"
+ echo "==> to install it."
+}
+
+post_upgrade() {
+ # auto-update syslinux if /boot/syslinux/SYSLINUX_AUTOUPDATE exists
+ /usr/sbin/syslinux-install_update -s
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/core/syslog-ng/PKGBUILD b/core/syslog-ng/PKGBUILD
new file mode 100644
index 000000000..3f55ee147
--- /dev/null
+++ b/core/syslog-ng/PKGBUILD
@@ -0,0 +1,45 @@
+# $Id: PKGBUILD 109435 2011-02-09 17:44:22Z eric $
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=syslog-ng
+pkgver=3.2.2
+pkgrel=1
+pkgdesc="Next-generation syslogd with advanced networking and filtering capabilities"
+arch=('i686' 'x86_64')
+license=('GPL2')
+groups=('base')
+url="http://www.balabit.com/network-security/syslog-ng/"
+depends=('glib2' 'eventlog' 'tcp_wrappers' 'openssl' 'libcap')
+makedepends=('flex' 'pkg-config')
+optdepends=('logrotate: for rotating log files')
+provides=('logger')
+options=('!libtool')
+backup=('etc/syslog-ng/modules.conf' 'etc/syslog-ng/scl.conf' 'etc/syslog-ng/syslog-ng.conf' 'etc/logrotate.d/syslog-ng')
+source=(http://www.balabit.com/downloads/files/syslog-ng/sources/${pkgver}/source/${pkgname}_${pkgver}.tar.gz
+ syslog-ng.conf
+ syslog-ng.logrotate
+ syslog-ng.rc)
+md5sums=('ed8ebe559d52a63fb61e3e2db566643f' '344dddfff946300f5576b13a7e8ea19f'\
+ '735636090be4582885974542d2a75855' '9bd98250cfa49e13fa3fa731b6040549')
+sha1sums=('3a340f8e72b460cc0bc1ec1d4c86b74678912dd6' 'b9eb8c61f7cccda543fc5c97fe1d40a8d15e713f'\
+ 'ac997b25d7d8e69e66782d3771a0e12aff55ae7f' '65ba6f0b92b8acc8ec97bb381762f5fbef4d1beb')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ ./configure --prefix=/usr --sysconfdir=/etc/syslog-ng \
+ --libexecdir=/usr/lib --localstatedir=/var/lib/syslog-ng \
+ --enable-tcp-wrapper \
+ --with-pidfile-dir=/var/run \
+ --disable-spoof-source
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+ install -dm755 "$pkgdir/var/lib/syslog-ng" "$pkgdir/etc/syslog-ng/patterndb.d"
+ install -Dm644 "$srcdir/syslog-ng.conf" "$pkgdir/etc/syslog-ng/syslog-ng.conf"
+ install -Dm644 "$srcdir/syslog-ng.logrotate" "$pkgdir/etc/logrotate.d/syslog-ng"
+ install -Dm755 "$srcdir/syslog-ng.rc" "$pkgdir/etc/rc.d/syslog-ng"
+}
diff --git a/core/syslog-ng/syslog-ng.conf b/core/syslog-ng/syslog-ng.conf
new file mode 100644
index 000000000..6e3362681
--- /dev/null
+++ b/core/syslog-ng/syslog-ng.conf
@@ -0,0 +1,92 @@
+@version: 3.2
+#
+# /etc/syslog-ng/syslog-ng.conf
+#
+
+options {
+ stats_freq (0);
+ flush_lines (0);
+ time_reopen (10);
+ log_fifo_size (1000);
+ long_hostnames(off);
+ use_dns (no);
+ use_fqdn (no);
+ create_dirs (no);
+ keep_hostname (yes);
+ perm(0640);
+ group("log");
+};
+
+source src {
+ unix-dgram("/dev/log");
+ internal();
+ file("/proc/kmsg");
+};
+
+destination d_authlog { file("/var/log/auth.log"); };
+destination d_syslog { file("/var/log/syslog.log"); };
+destination d_cron { file("/var/log/crond.log"); };
+destination d_daemon { file("/var/log/daemon.log"); };
+destination d_kernel { file("/var/log/kernel.log"); };
+destination d_lpr { file("/var/log/lpr.log"); };
+destination d_user { file("/var/log/user.log"); };
+destination d_uucp { file("/var/log/uucp.log"); };
+destination d_mail { file("/var/log/mail.log"); };
+destination d_news { file("/var/log/news.log"); };
+destination d_ppp { file("/var/log/ppp.log"); };
+destination d_debug { file("/var/log/debug.log"); };
+destination d_messages { file("/var/log/messages.log"); };
+destination d_errors { file("/var/log/errors.log"); };
+destination d_everything { file("/var/log/everything.log"); };
+destination d_iptables { file("/var/log/iptables.log"); };
+destination d_acpid { file("/var/log/acpid.log"); };
+destination d_console { usertty("root"); };
+
+# Log everything to tty12
+destination console_all { file("/dev/tty12"); };
+
+filter f_auth { facility(auth); };
+filter f_authpriv { facility(auth, authpriv); };
+filter f_syslog { program(syslog-ng); };
+filter f_cron { facility(cron); };
+filter f_daemon { facility(daemon); };
+filter f_kernel { facility(kern) and not filter(f_iptables); };
+filter f_lpr { facility(lpr); };
+filter f_mail { facility(mail); };
+filter f_news { facility(news); };
+filter f_user { facility(user); };
+filter f_uucp { facility(uucp); };
+filter f_ppp { facility(local2); };
+filter f_debug { not facility(auth, authpriv, news, mail); };
+filter f_messages { level(info..warn) and not facility(auth, authpriv, mail, news, cron) and not program(syslog-ng) and not filter(f_iptables); };
+filter f_everything { level(debug..emerg) and not facility(auth, authpriv); };
+filter f_emergency { level(emerg); };
+filter f_info { level(info); };
+filter f_notice { level(notice); };
+filter f_warn { level(warn); };
+filter f_crit { level(crit); };
+filter f_err { level(err); };
+filter f_iptables { match("IN=" value("MESSAGE")) and match("OUT=" value("MESSAGE")); };
+filter f_acpid { program("acpid"); };
+
+log { source(src); filter(f_acpid); destination(d_acpid); };
+log { source(src); filter(f_authpriv); destination(d_authlog); };
+log { source(src); filter(f_syslog); destination(d_syslog); };
+log { source(src); filter(f_cron); destination(d_cron); };
+log { source(src); filter(f_daemon); destination(d_daemon); };
+log { source(src); filter(f_kernel); destination(d_kernel); };
+log { source(src); filter(f_lpr); destination(d_lpr); };
+log { source(src); filter(f_mail); destination(d_mail); };
+log { source(src); filter(f_news); destination(d_news); };
+log { source(src); filter(f_ppp); destination(d_ppp); };
+log { source(src); filter(f_user); destination(d_user); };
+log { source(src); filter(f_uucp); destination(d_uucp); };
+#log { source(src); filter(f_debug); destination(d_debug); };
+log { source(src); filter(f_messages); destination(d_messages); };
+log { source(src); filter(f_err); destination(d_errors); };
+log { source(src); filter(f_emergency); destination(d_console); };
+log { source(src); filter(f_everything); destination(d_everything); };
+log { source(src); filter(f_iptables); destination(d_iptables); };
+
+# Log everything to tty12
+#log { source(src); destination(console_all); };
diff --git a/core/syslog-ng/syslog-ng.logrotate b/core/syslog-ng/syslog-ng.logrotate
new file mode 100644
index 000000000..e0e6929f2
--- /dev/null
+++ b/core/syslog-ng/syslog-ng.logrotate
@@ -0,0 +1,7 @@
+/var/log/messages.log /var/log/auth.log /var/log/mail.log /var/log/kernel.log /var/log/errors.log /var/log/daemon.log /var/log/user.log /var/log/iptables.log /var/log/everything.log /var/log/syslog.log /var/log/acpid.log /var/log/crond.log /var/log/lpr.log /var/log/uucp.log /var/log/news.log /var/log/ppp.log /var/log/debug.log {
+ missingok
+ sharedscripts
+ postrotate
+ /bin/kill -HUP `cat /var/run/syslog-ng.pid 2>/dev/null` 2> /dev/null || true
+ endscript
+}
diff --git a/core/syslog-ng/syslog-ng.rc b/core/syslog-ng/syslog-ng.rc
new file mode 100755
index 000000000..f9d14c7f6
--- /dev/null
+++ b/core/syslog-ng/syslog-ng.rc
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/syslog-ng`
+case "$1" in
+ start)
+ stat_busy "Starting Syslog-NG"
+ [ -z "$PID" ] && /usr/sbin/syslog-ng
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon syslog-ng
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Syslog-NG"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm -f /var/run/syslog-ng.pid
+# Removing stale syslog-ng.persist file. It's new location, as of 2.0.6-1, is /var/lib/syslog-ng/
+ rm -f /var/syslog-ng.persist
+ rm_daemon syslog-ng
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/sysvinit/PKGBUILD b/core/sysvinit/PKGBUILD
new file mode 100644
index 000000000..308393932
--- /dev/null
+++ b/core/sysvinit/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 92996 2010-10-02 19:26:38Z eric $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=sysvinit
+pkgver=2.88
+pkgrel=2
+pkgdesc="Linux System V Init"
+arch=('i686' 'x86_64')
+url="http://savannah.nongnu.org/projects/sysvinit"
+license=('GPL')
+groups=('base')
+depends=('shadow' 'util-linux' 'coreutils' 'glibc' 'awk')
+install=sysvinit.install
+source=(http://download.savannah.gnu.org/releases/sysvinit/${pkgname}-${pkgver}dsf.tar.bz2)
+md5sums=('6eda8a97b86e0a6f59dabbf25202aa6f')
+sha1sums=('f2ca149df1314a91f3007cccd7a0aa47d990de26')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}dsf"
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}dsf"
+ make ROOT="${pkgdir}" install
+}
diff --git a/core/sysvinit/sysvinit.install b/core/sysvinit/sysvinit.install
new file mode 100644
index 000000000..2f0e62e74
--- /dev/null
+++ b/core/sysvinit/sysvinit.install
@@ -0,0 +1,3 @@
+post_upgrade() {
+ [ -x sbin/init ] && sbin/init u
+}
diff --git a/core/tar/PKGBUILD b/core/tar/PKGBUILD
new file mode 100644
index 000000000..de8610670
--- /dev/null
+++ b/core/tar/PKGBUILD
@@ -0,0 +1,33 @@
+# $Id: PKGBUILD 114404 2011-03-13 10:37:30Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=tar
+pkgver=1.26
+pkgrel=1
+pkgdesc="Utility used to store, backup, and transport files"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/tar/tar.html"
+license=('GPL3')
+groups=('base')
+depends=('glibc' 'sh')
+options=('!emptydirs')
+install=tar.install
+source=(ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
+ tar.1)
+md5sums=('0ced6f20b9fa1bea588005b5ad4b52c1'
+ 'e0538778516a284e3558c454b2576c2f')
+
+build() {
+ cd ${srcdir}/$pkgname-$pkgver
+
+ ./configure --prefix=/usr --libexecdir=/usr/lib/tar --bindir=/bin
+ make
+ make check
+}
+
+package() {
+ cd ${srcdir}/$pkgname-$pkgver
+ make DESTDIR=${pkgdir} install
+ install -Dm644 ${srcdir}/tar.1 ${pkgdir}/usr/share/man/man1/tar.1
+}
diff --git a/core/tar/tar.1 b/core/tar/tar.1
new file mode 100644
index 000000000..872c8dcec
--- /dev/null
+++ b/core/tar/tar.1
@@ -0,0 +1,364 @@
+.\" generated by script on Wed Mar 10 17:01:09 2010
+.Dd Mar 10, 2010
+.Dt TAR 1
+.Sh NAME
+.Nm tar
+.Nd The GNU version of the tar archiving utility
+.Sh SYNOPSIS
+.Nm tar
+.Oo Fl Oc Cm A Fl \-catenate \-concatenate Cm \||\| c Fl \-create Cm \||\| d Fl \-diff \-compare Cm \||\| Fl \-delete Cm \||\| r Fl \-append Cm \||\| t Fl \-list Cm \||\| Fl \-test\-label Cm \||\| u Fl \-update Cm \||\| x Fl \-extract \-get
+.Op Ar options
+.Op Ar pathname ...
+.Sh DESCRIPTION
+.Nm Tar
+stores and extracts files from a tape or disk archive.
+.Pp
+The first argument to
+tar
+should be a function; either one of the letters
+.Cm Acdrtux ,
+or one of the long function names.
+A function letter need not be prefixed with ``\-'', and may be combined
+with other single-letter options.
+A long function name must be prefixed with
+.Cm \\-\\- .
+Some options take a parameter; with the single-letter form
+these must be given as separate arguments.
+With the long form, they may be given by appending
+.Cm = Ns Ar value
+to the option.
+.Sh FUNCTION LETTERS
+Main operation mode:
+.Bl -tag -width flag
+.It Fl A , Fl \-catenate , Fl \-concatenate
+append tar files to an archive
+.It Fl c , Fl \-create
+create a new archive
+.It Fl d , Fl \-diff , Fl \-compare
+find differences between archive and file system
+.It Fl \-delete
+delete from the archive (not on mag tapes!)
+.It Fl r , Fl \-append
+append files to the end of an archive
+.It Fl t , Fl \-list
+list the contents of an archive
+.It Fl \-test\-label
+test the archive volume label and exit
+.It Fl u , Fl \-update
+only append files newer than copy in archive
+.It Fl x , Fl \-extract , Fl \-get
+extract files from an archive
+.El
+.Sh OTHER OPTIONS
+Operation modifiers:
+.Bl -tag -width flag
+.It \-[0\-7][lmh]
+specify drive and density
+.It Fl a , Fl \-auto\-compress
+use archive suffix to determine the compression program
+.It Fl \-add\-file Ns \= Ns Ar FILE
+add given FILE to the archive (useful if its name starts with a dash)
+.It Fl \-anchored
+patterns match file name start
+.It Fl \-no\-anchored
+patterns match after any `/' (default for exclusion)
+.It Fl \-atime\-preserve
+preserve access times on dumped files, either by restoring the times
+.It Fl \-no\-auto\-compress
+do not use archive suffix to determine the compression program
+.It Fl b , Fl \-blocking\-factor Ar BLOCKS
+BLOCKS x 512 bytes per record
+.It Fl B , Fl \-read\-full\-records
+reblock as we read (for 4.2BSD pipes)
+.It Fl \-backup
+backup before removal, choose version CONTROL
+.It Fl C , Fl \-directory Ar DIR
+change to directory DIR
+.It Fl \-check\-device
+check device numbers when creating incremental archives (default)
+.It Fl \-no\-check\-device
+do not check device numbers when creating incremental archives
+.It Fl \-checkpoint
+display progress messages every NUMBERth record (default 10)
+.It Fl \-checkpoint\-action Ns \= Ns Ar ACTION
+execute ACTION on each checkpoint
+.It Fl \-delay\-directory\-restore
+delay setting modification times and permissions of extracted
+.It Fl \-no\-delay\-directory\-restore
+cancel the effect of --delay-directory-restore option
+.It Fl \-exclude Ns \= Ns Ar PATTERN
+exclude files, given as a PATTERN
+.It Fl \-exclude\-backups
+exclude backup and lock files
+.It Fl \-exclude\-caches
+exclude contents of directories containing CACHEDIR.TAG,
+.It Fl \-exclude\-caches\-all
+exclude directories containing CACHEDIR.TAG
+.It Fl \-exclude\-caches\-under
+exclude everything under directories containing CACHEDIR.TAG
+.It Fl \-exclude\-tag Ns \= Ns Ar FILE
+exclude contents of directories containing FILE, except
+.It Fl \-exclude\-tag\-all Ns \= Ns Ar FILE
+exclude directories containing FILE
+.It Fl \-exclude\-tag\-under Ns \= Ns Ar FILE
+exclude everything under directories containing FILE
+.It Fl \-exclude\-vcs
+exclude version control system directories
+.It Fl f , Fl \-file Ar ARCHIVE
+use archive file or device ARCHIVE
+.It Fl F , Fl \-info\-script , Fl \-new\-volume\-script Ar NAME
+run script at end of each tape (implies -M)
+.It Fl \-force\-local
+archive file is local even if it has a colon
+.It Fl g , Fl \-listed\-incremental Ar FILE
+handle new GNU-format incremental backup
+.It Fl G , Fl \-incremental
+handle old GNU-format incremental backup
+.It Fl \-group Ns \= Ns Ar NAME
+force NAME as group for added files
+.It Fl h , Fl \-dereference
+follow symlinks; archive and dump the files they point to
+.It Fl H , Fl \-format Ar FORMAT
+create archive of the given formatFORMAT is one of the following:
+.Bl -tag -width flag
+.It Fl \-format=gnu
+GNU tar 1.13.x format
+.It Fl \-format=oldgnu
+GNU format as per tar <= 1.12
+.It Fl \-format=pax
+POSIX 1003.1-2001 (pax) format
+.It Fl \-format=posix
+same as pax
+.It Fl \-format=ustar
+POSIX 1003.1-1988 (ustar) format
+.It Fl \-format=v7
+old V7 tar format
+.El
+.It Fl \-hard\-dereference
+follow hard links; archive and dump the files they refer to
+.It Fl i , Fl \-ignore\-zeros
+ignore zeroed blocks in archive (means EOF)
+.It Fl I , Fl \-use\-compress\-program Ar PROG
+filter through PROG (must accept -d)
+.It Fl \-ignore\-case
+ignore case
+.It Fl \-no\-ignore\-case
+case sensitive matching (default)
+.It Fl \-ignore\-command\-error
+ignore exit codes of children
+.It Fl \-no\-ignore\-command\-error
+treat non-zero exit codes of children as error
+.It Fl \-ignore\-failed\-read
+do not exit with nonzero on unreadable files
+.It Fl \-index\-file Ns \= Ns Ar FILE
+send verbose output to FILE
+.It Fl j , Fl \-bzip2
+
+.It Fl J , Fl \-xz
+
+.It Fl k , Fl \-keep\-old\-files
+don't replace existing files when extracting
+.It Fl K , Fl \-starting\-file Ar MEMBER-NAME
+begin at member MEMBER-NAME in the archive
+.It Fl \-keep\-newer\-files
+don't replace existing files that are newer than their archive copies
+.It Fl l , Fl \-check\-links
+print a message if not all links are dumped
+.It Fl L , Fl \-tape\-length Ar NUMBER
+change tape after writing NUMBER x 1024 bytes
+.It Fl \-level Ns \= Ns Ar NUMBER
+dump level for created listed-incremental archive
+.It Fl \-lzip
+
+.It Fl \-lzma
+
+.It Fl \-lzop
+
+.It Fl m , Fl \-touch
+don't extract file modified time
+.It Fl M , Fl \-multi\-volume
+create/list/extract multi-volume archive
+.It Fl \-mode Ns \= Ns Ar CHANGES
+force (symbolic) mode CHANGES for added files
+.It Fl \-mtime Ns \= Ns Ar DATE-OR-FILE
+set mtime for added files from DATE-OR-FILE
+.It Fl n , Fl \-seek
+archive is seekable
+.It Fl N , Fl \-newer , Fl \-after\-date Ar DATE-OR-FILE
+only store files newer than DATE-OR-FILE
+.It Fl \-newer\-mtime Ns \= Ns Ar DATE
+compare date and time when data changed only
+.It Fl \-null
+-T reads null-terminated names, disable -C
+.It Fl \-no\-null
+disable the effect of the previous --null option
+.It Fl \-numeric\-owner
+always use numbers for user/group names
+.It Fl O , Fl \-to\-stdout
+extract files to standard output
+.It Fl \-occurrence
+process only the NUMBERth occurrence of each file in the archive;
+.It Fl \-old\-archive , Fl \-portability
+same as --format=v7
+.It Fl \-one\-file\-system
+stay in local file system when creating archive
+.It Fl \-overwrite
+overwrite existing files when extracting
+.It Fl \-overwrite\-dir
+overwrite metadata of existing directories when extracting (default)
+.It Fl \-no\-overwrite\-dir
+preserve metadata of existing directories
+.It Fl \-owner Ns \= Ns Ar NAME
+force NAME as owner for added files
+.It Fl p , Fl \-preserve\-permissions , Fl \-same\-permissions
+extract information about file permissions (default for superuser)
+.It Fl P , Fl \-absolute\-names
+don't strip leading `/'s from file names
+.It Fl \-pax\-option Ns \= Ns Ar keyword[[:]=value][,keyword[[:]=value]]...
+control pax keywords
+.It Fl \-posix
+same as --format=posix
+.It Fl \-preserve
+same as both -p and -s
+.It Fl \-quote\-chars Ns \= Ns Ar STRING
+additionally quote characters from STRING
+.It Fl \-no\-quote\-chars Ns \= Ns Ar STRING
+disable quoting for characters from STRING
+.It Fl \-quoting\-style Ns \= Ns Ar STYLE
+set name quoting style; see below for valid STYLE values
+.It Fl R , Fl \-block\-number
+show block number within archive with each message
+.It Fl \-record\-size Ns \= Ns Ar NUMBER
+NUMBER of bytes per record, multiple of 512
+.It Fl \-recursion
+recurse into directories (default)
+.It Fl \-no\-recursion
+avoid descending automatically in directories
+.It Fl \-recursive\-unlink
+empty hierarchies prior to extracting directory
+.It Fl \-remove\-files
+remove files after adding them to the archive
+.It Fl \-restrict
+disable use of some potentially harmful options
+.It Fl \-rmt\-command Ns \= Ns Ar COMMAND
+use given rmt COMMAND instead of rmt
+.It Fl \-rsh\-command Ns \= Ns Ar COMMAND
+use remote COMMAND instead of rsh
+.It Fl s , Fl \-preserve\-order , Fl \-same\-order
+sort names to extract to match archive
+.It Fl S , Fl \-sparse
+handle sparse files efficiently
+.It Fl \-same\-owner
+try extracting files with the same ownership as exists in the archive (default for superuser)
+.It Fl \-no\-same\-owner
+extract files as yourself (default for ordinary users)
+.It Fl \-no\-same\-permissions
+apply the user's umask when extracting permissions from the archive (default for ordinary users)
+.It Fl \-no\-seek
+archive is not seekable
+.It Fl \-show\-defaults
+show tar defaults
+.It Fl \-show\-omitted\-dirs
+when listing or extracting, list each directory that does not match search criteria
+.It Fl \-show\-transformed\-names , Fl \-show\-stored\-names
+show file or archive names after transformation
+.It Fl \-sparse\-version Ns \= Ns Ar MAJOR[.MINOR]
+set version of the sparse format to use (implies --sparse)
+.It Fl \-strip\-components Ns \= Ns Ar NUMBER
+strip NUMBER leading components from file names on extraction
+.It Fl \-suffix Ns \= Ns Ar STRING
+backup before removal, override usual suffix ('~' unless overridden by environment variable SIMPLE_BACKUP_SUFFIX)
+.It Fl T , Fl \-files\-from Ar FILE
+get names to extract or create from FILE
+.It Fl \-to\-command Ns \= Ns Ar COMMAND
+pipe extracted files to another program
+.It Fl \-totals
+print total bytes after processing the archive;
+.It Fl \-transform , Fl \-xform Ar EXPRESSION
+use sed replace EXPRESSION to transform file names
+.It Fl U , Fl \-unlink\-first
+remove each file prior to extracting over it
+.It Fl \-unquote
+unquote filenames read with -T (default)
+.It Fl \-no\-unquote
+do not unquote filenames read with -T
+.It Fl \-utc
+print file modification dates in UTC
+.It Fl v , Fl \-verbose
+verbosely list files processed
+.It Fl V , Fl \-label Ar TEXT
+create archive with volume name TEXT; at list/extract time, use TEXT as a globbing pattern for volume name
+.It Fl \-volno\-file Ns \= Ns Ar FILE
+use/update the volume number in FILE
+.It Fl w , Fl \-interactive , Fl \-confirmation
+ask for confirmation for every action
+.It Fl W , Fl \-verify
+attempt to verify the archive after writing it
+.It Fl \-warning Ns \= Ns Ar KEYWORD
+warning control
+.It Fl \-wildcards
+use wildcards (default for exclusion)
+.It Fl \-wildcards\-match\-slash
+wildcards match `/' (default for exclusion)
+.It Fl \-no\-wildcards\-match\-slash
+wildcards do not match `/'
+.It Fl \-no\-wildcards
+verbatim string matching
+.It Fl X , Fl \-exclude\-from Ar FILE
+exclude patterns listed in FILE
+.It Fl z , Fl \-gzip , Fl \-gunzip Fl \-ungzip
+
+.It Fl Z , Fl \-compress , Fl \-uncompress
+
+.El
+.Sh ENVIRONMENT
+The behavior of tar is controlled by the following environment variables,
+among others:
+.Bl -tag -width Ds
+.It Ev SIMPLE_BACKUP_SUFFIX
+Backup prefix to use when extracting, if
+.Fl \-suffix
+is not specified.
+The backup suffix defaults to `~' if neither is specified.
+.It Ev TAR_OPTIONS
+Options to prepend to those specified on the command line, separated by
+whitespace. Embedded backslashes may be used to escape whitespace or
+backslashes within an option.
+.It Ev TAPE
+Device or file to use for the archive if
+.Fl \-file
+is not specified.
+If this environment variable is unset, use stdin or stdout instead.
+.El
+.Sh EXAMPLES
+Create archive.tar from files foo and bar.
+.Bd -literal -offset indent -compact
+tar \-cf archive.tar foo bar
+.Ed
+List all files in archive.tar verbosely.
+.Bd -literal -offset indent -compact
+tar \-tvf archive.tar
+.Ed
+Extract all files from archive.tar.
+.Bd -literal -offset indent -compact
+tar \-xf archive.tar
+.Ed
+.Sh SEE ALSO
+.\" libarchive
+.Xr tar 5 ,
+.\" man-pages
+.Xr symlink 7 ,
+.Xr rmt 8
+.Sh HISTORY
+The
+.Nm tar
+command appeared in
+.At v7 .
+.Sh BUGS
+The GNU folks, in general, abhor man pages, and create info documents instead.
+Unfortunately, the info document describing tar is licensed under the GFDL with
+invariant cover texts, which makes it impossible to include any text
+from that document in this man page.
+Most of the text in this document was automatically extracted from the usage
+text in the source.
+It may not completely describe all features of the program.
diff --git a/core/tar/tar.install b/core/tar/tar.install
new file mode 100644
index 000000000..8de1f9766
--- /dev/null
+++ b/core/tar/tar.install
@@ -0,0 +1,21 @@
+infodir=usr/share/info
+filelist=(tar.info tar.info-1 tar.info-2)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
diff --git a/core/tcp_wrappers/01_all_redhat-bug11881.patch b/core/tcp_wrappers/01_all_redhat-bug11881.patch
new file mode 100644
index 000000000..0c869b4a4
--- /dev/null
+++ b/core/tcp_wrappers/01_all_redhat-bug11881.patch
@@ -0,0 +1,35 @@
+--- tcp_wrappers_7.6/tcpd.c.bug11881 Thu Jul 27 15:39:27 2000
++++ tcp_wrappers_7.6/tcpd.c Thu Jul 27 15:41:54 2000
+@@ -60,10 +60,10 @@
+ */
+
+ if (argv[0][0] == '/') {
+- strcpy(path, argv[0]);
++ strncpy(path, argv[0], sizeof(path));
+ argv[0] = strrchr(argv[0], '/') + 1;
+ } else {
+- sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]);
++ snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]);
+ }
+
+ /*
+--- tcp_wrappers_7.6/eval.c.bug11881 Thu Jul 27 15:39:53 2000
++++ tcp_wrappers_7.6/eval.c Thu Jul 27 15:40:51 2000
+@@ -111,7 +111,7 @@
+ return (hostinfo);
+ #endif
+ if (STR_NE(eval_user(request), unknown)) {
+- sprintf(both, "%s@%s", request->user, hostinfo);
++ snprintf(both, sizeof(both), "%s@%s", request->user, hostinfo);
+ return (both);
+ } else {
+ return (hostinfo);
+@@ -128,7 +128,7 @@
+ char *daemon = eval_daemon(request);
+
+ if (STR_NE(host, unknown)) {
+- sprintf(both, "%s@%s", daemon, host);
++ snprintf(both, sizeof(both), "%s@%s", daemon, host);
+ return (both);
+ } else {
+ return (daemon);
diff --git a/core/tcp_wrappers/02_all_redhat-bug17795.patch b/core/tcp_wrappers/02_all_redhat-bug17795.patch
new file mode 100644
index 000000000..ff0ec455b
--- /dev/null
+++ b/core/tcp_wrappers/02_all_redhat-bug17795.patch
@@ -0,0 +1,49 @@
+--- hosts_access.c Wed Feb 12 03:13:23 1997
++++ hosts_access.c Wed Jul 19 08:37:02 2000
+@@ -240,6 +255,26 @@
+ }
+ }
+
++/* hostfile_match - look up host patterns from file */
++
++static int hostfile_match(path, host)
++char *path;
++struct hosts_info *host;
++{
++ char tok[BUFSIZ];
++ int match = NO;
++ FILE *fp;
++
++ if ((fp = fopen(path, "r")) != 0) {
++ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
++ /* void */ ;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", path);
++ }
++ return (match);
++}
++
+ /* host_match - match host name and/or address against pattern */
+
+ static int host_match(tok, host)
+@@ -267,6 +302,8 @@
+ tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */
+ return (NO);
+ #endif
++ } else if (tok[0] == '/') { /* /file hack */
++ return (hostfile_match(tok, host));
+ } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */
+ char *name = eval_hostname(host);
+ return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
+--- hosts_access.5 2003-08-03 19:09:56.000000000 +0000
++++ hosts_access.5 2003-08-03 19:13:32.000000000 +0000
+@@ -91,0 +92,7 @@
++.IP \(bu
++A string that begins with a `/\' character is treated as a file
++name. A host name or address is matched if it matches any host name
++or address pattern listed in the named file. The file format is
++zero or more lines with zero or more host name or address patterns
++separated by whitespace. A file name pattern can be used anywhere
++a host name or address pattern can be used.
+
diff --git a/core/tcp_wrappers/03_all_wildcard.patch b/core/tcp_wrappers/03_all_wildcard.patch
new file mode 100644
index 000000000..44eec476e
--- /dev/null
+++ b/core/tcp_wrappers/03_all_wildcard.patch
@@ -0,0 +1,93 @@
+--- /tmp/hosts_access.c 2003-08-03 22:18:00.000000000 +0000
++++ hosts_access.c 2003-08-03 22:39:44.000000000 +0000
+@@ -289,6 +289,17 @@
+ {
+ int n;
+
++#ifndef DISABLE_WILDCARD_MATCHING
++ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */
++ /* we must convert the both to lowercase as match_pattern_ylo is case-sensitive */
++ for (n = 0; n < strlen(tok); n++)
++ tok[n] = isupper(tok[n]) ? tolower(tok[n]) : tok[n];
++ for (n = 0; n < strlen(string); n++)
++ string[n] = isupper(string[n]) ? tolower(string[n]) : string[n];
++ return (match_pattern_ylo(string,tok));
++ } else
++#endif
++
+ if (tok[0] == '.') { /* suffix */
+ n = strlen(string) - strlen(tok);
+ return (n > 0 && STR_EQ(tok, string + n));
+@@ -329,3 +340,72 @@
+ }
+ return ((addr & mask) == net);
+ }
++
++#ifndef DISABLE_WILDCARD_MATCHING
++/* Note: this feature has been adapted in a pretty straightforward way
++ from Tatu Ylonen's last SSH version under free license by
++ Pekka Savola <pekkas@netcore.fi>.
++
++ Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
++*/
++
++/* Returns true if the given string matches the pattern (which may contain
++ ? and * as wildcards), and zero if it does not match. */
++
++int match_pattern_ylo(const char *s, const char *pattern)
++{
++ while (1)
++ {
++ /* If at end of pattern, accept if also at end of string. */
++ if (!*pattern)
++ return !*s;
++
++ /* Process '*'. */
++ if (*pattern == '*')
++ {
++ /* Skip the asterisk. */
++ pattern++;
++
++ /* If at end of pattern, accept immediately. */
++ if (!*pattern)
++ return 1;
++
++ /* If next character in pattern is known, optimize. */
++ if (*pattern != '?' && *pattern != '*')
++ {
++ /* Look instances of the next character in pattern, and try
++ to match starting from those. */
++ for (; *s; s++)
++ if (*s == *pattern &&
++ match_pattern_ylo(s + 1, pattern + 1))
++ return 1;
++ /* Failed. */
++ return 0;
++ }
++
++ /* Move ahead one character at a time and try to match at each
++ position. */
++ for (; *s; s++)
++ if (match_pattern_ylo(s, pattern))
++ return 1;
++ /* Failed. */
++ return 0;
++ }
++
++ /* There must be at least one more character in the string. If we are
++ at the end, fail. */
++ if (!*s)
++ return 0;
++
++ /* Check if the next character of the string is acceptable. */
++ if (*pattern != '?' && *pattern != *s)
++ return 0;
++
++ /* Move to the next character, both in string and in pattern. */
++ s++;
++ pattern++;
++ }
++ /*NOTREACHED*/
++}
++#endif /* DISABLE_WILDCARD_MATCHING */
++
diff --git a/core/tcp_wrappers/04_all_fixgethostbyname.patch b/core/tcp_wrappers/04_all_fixgethostbyname.patch
new file mode 100644
index 000000000..57c7acf78
--- /dev/null
+++ b/core/tcp_wrappers/04_all_fixgethostbyname.patch
@@ -0,0 +1,27 @@
+--- tcp_wrappers_7.6/socket.c.fixgethostbyname Fri Mar 21 13:27:25 1997
++++ tcp_wrappers_7.6/socket.c Mon Feb 5 14:09:40 2001
+@@ -52,7 +52,8 @@
+ char *name;
+ {
+ char dot_name[MAXHOSTNAMELEN + 1];
+-
++ struct hostent *hp;
++
+ /*
+ * Don't append dots to unqualified names. Such names are likely to come
+ * from local hosts files or from NIS.
+@@ -61,8 +62,12 @@
+ if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) {
+ return (gethostbyname(name));
+ } else {
+- sprintf(dot_name, "%s.", name);
+- return (gethostbyname(dot_name));
++ sprintf(dot_name, "%s.", name);
++ hp = gethostbyname(dot_name);
++ if (hp)
++ return hp;
++ else
++ return (gethostbyname(name));
+ }
+ }
+
diff --git a/core/tcp_wrappers/07_all_sig.patch b/core/tcp_wrappers/07_all_sig.patch
new file mode 100644
index 000000000..e7341a0bc
--- /dev/null
+++ b/core/tcp_wrappers/07_all_sig.patch
@@ -0,0 +1,39 @@
+--- tcp_wrappers_7.6/hosts_access.c.sig 2003-02-10 16:18:31.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.c 2003-02-10 16:50:38.000000000 +0100
+@@ -66,6 +66,7 @@
+
+ #define YES 1
+ #define NO 0
++#define ERR -1
+
+ /*
+ * These variables are globally visible so that they can be redirected in
+@@ -106,7 +107,6 @@
+ struct request_info *request;
+ {
+ int verdict;
+-
+ /*
+ * If the (daemon, client) pair is matched by an entry in the file
+ * /etc/hosts.allow, access is granted. Otherwise, if the (daemon,
+@@ -129,9 +129,9 @@
+ return (verdict == AC_PERMIT);
+ if (table_match(hosts_allow_table, request))
+ return (YES);
+- if (table_match(hosts_deny_table, request))
+- return (NO);
+- return (YES);
++ if (table_match(hosts_deny_table, request) == NO)
++ return (YES);
++ return (NO);
+ }
+
+ /* table_match - match table entries with (daemon, client) pair */
+@@ -175,6 +175,7 @@
+ (void) fclose(fp);
+ } else if (errno != ENOENT) {
+ tcpd_warn("cannot open %s: %m", table);
++ match = ERR;
+ }
+ if (match) {
+ if (hosts_access_verbose > 1)
diff --git a/core/tcp_wrappers/08_all_strerror.patch b/core/tcp_wrappers/08_all_strerror.patch
new file mode 100644
index 000000000..426791a8f
--- /dev/null
+++ b/core/tcp_wrappers/08_all_strerror.patch
@@ -0,0 +1,27 @@
+--- tcp-wrappers-7.6/percent_m.c
++++ tcp-wrappers-7.6/percent_m.c
+@@ -13,7 +13,7 @@
+ #include <string.h>
+
+ extern int errno;
+-#ifndef SYS_ERRLIST_DEFINED
++#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ #endif
+@@ -29,11 +29,15 @@
+
+ while (*bp = *cp)
+ if (*cp == '%' && cp[1] == 'm') {
++#ifdef HAVE_STRERROR
++ strcpy(bp, strerror(errno));
++#else
+ if (errno < sys_nerr && errno > 0) {
+ strcpy(bp, sys_errlist[errno]);
+ } else {
+ sprintf(bp, "Unknown error %d", errno);
+ }
++#endif
+ bp += strlen(bp);
+ cp += 2;
+ } else {
diff --git a/core/tcp_wrappers/09_all_gcc-3.4.patch b/core/tcp_wrappers/09_all_gcc-3.4.patch
new file mode 100644
index 000000000..30d105915
--- /dev/null
+++ b/core/tcp_wrappers/09_all_gcc-3.4.patch
@@ -0,0 +1,12 @@
+diff -udrN tcp_wrappers_7.6/scaffold.c tcp_wrappers_7.6_modified/scaffold.c
+--- tcp_wrappers_7.6/scaffold.c 2004-04-20 23:35:41.971925008 +0000
++++ tcp_wrappers_7.6_modified/scaffold.c 2004-04-20 23:44:28.553872384 +0000
+@@ -25,7 +25,7 @@
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+ #endif
+
+-extern char *malloc();
++
+
+ /* Application-specific. */
+
diff --git a/core/tcp_wrappers/10_all_more-headers.patch b/core/tcp_wrappers/10_all_more-headers.patch
new file mode 100644
index 000000000..7a43c6ceb
--- /dev/null
+++ b/core/tcp_wrappers/10_all_more-headers.patch
@@ -0,0 +1,209 @@
+--- tcp_wrappers_7.6/options.c
++++ tcp_wrappers_7.6/options.c
+@@ -34,6 +34,8 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+--- tcp_wrappers_7.6/safe_finger.c
++++ tcp_wrappers_7.6/safe_finger.c
+@@ -20,6 +20,10 @@
+
+ /* System libraries */
+
++#include <unistd.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <sys/wait.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <signal.h>
+@@ -27,7 +31,7 @@
+ #include <ctype.h>
+ #include <pwd.h>
+
+-extern void exit();
++int pipe_stdin(char **argv);
+
+ /* Local stuff */
+
+--- tcp_wrappers_7.6/scaffold.c
++++ tcp_wrappers_7.6/scaffold.c
+@@ -10,6 +10,7 @@
+
+ /* System libraries. */
+
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+--- tcp_wrappers_7.6/shell_cmd.c
++++ tcp_wrappers_7.6/shell_cmd.c
+@@ -14,6 +14,10 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
++#include <fcntl.h>
++#include <sys/wait.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <signal.h>
+@@ -25,8 +25,6 @@
+ #include <syslog.h>
+ #include <string.h>
+
+-extern void exit();
+-
+ /* Local stuff. */
+
+ #include "tcpd.h"
+--- tcp_wrappers_7.6/tcpdchk.c
++++ tcp_wrappers_7.6/tcpdchk.c
+@@ -20,6 +20,8 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #ifdef INET6
+@@ -35,11 +36,6 @@
+ #include <netdb.h>
+ #include <string.h>
+
+-extern int errno;
+-extern void exit();
+-extern int optind;
+-extern char *optarg;
+-
+ #ifndef INADDR_NONE
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+ #endif
+--- tcp_wrappers_7.6/clean_exit.c
++++ tcp_wrappers_7.6/clean_exit.c
+@@ -13,8 +13,8 @@
+ #endif
+
+ #include <stdio.h>
+-
+-extern void exit();
++#include <unistd.h>
++#include <stdlib.h>
+
+ #include "tcpd.h"
+
+--- tcp_wrappers_7.6/hosts_access.c
++++ tcp_wrappers_7.6/hosts_access.c
+@@ -23,6 +23,7 @@
+
+ /* System libraries. */
+
++#include <stdlib.h>
+ #include <sys/types.h>
+ #ifdef INT32_T
+ typedef uint32_t u_int32_t;
+@@ -43,8 +44,7 @@
+ #include <netdb.h>
+ #endif
+
+-extern char *fgets();
+-extern int errno;
++int match_pattern_ylo(const char *s, const char *pattern);
+
+ #ifndef INADDR_NONE
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+--- tcp_wrappers_7.6/inetcf.c
++++ tcp_wrappers_7.6/inetcf.c
+@@ -9,15 +9,14 @@
+ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23";
+ #endif
+
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+
+-extern int errno;
+-extern void exit();
+-
++#include "scaffold.h"
+ #include "tcpd.h"
+ #include "inetcf.h"
+
+--- tcp_wrappers_7.6/percent_x.c
++++ tcp_wrappers_7.6/percent_x.c
+@@ -16,12 +16,12 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+
+-extern void exit();
+-
+ /* Local stuff. */
+
+ #include "tcpd.h"
+--- tcp_wrappers_7.6/rfc931.c
++++ tcp_wrappers_7.6/rfc931.c
+@@ -15,6 +15,7 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <sys/types.h>
+--- tcp_wrappers_7.6/tcpd.c
++++ tcp_wrappers_7.6/tcpd.c
+@@ -16,6 +16,7 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+--- tcp_wrappers_7.6/tcpdmatch.c
++++ tcp_wrappers_7.6/tcpdmatch.c
+@@ -19,6 +19,8 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+@@ -30,9 +32,6 @@
+ #include <setjmp.h>
+ #include <string.h>
+
+-extern void exit();
+-extern int optind;
+-extern char *optarg;
+
+ #ifndef INADDR_NONE
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+--- tcp_wrappers_7.6/update.c
++++ tcp_wrappers_7.6/update.c
+@@ -19,6 +19,7 @@
+
+ /* System libraries */
+
++#include <unistd.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
diff --git a/core/tcp_wrappers/11_inet6_fixes.patch b/core/tcp_wrappers/11_inet6_fixes.patch
new file mode 100644
index 000000000..a2c7d99a5
--- /dev/null
+++ b/core/tcp_wrappers/11_inet6_fixes.patch
@@ -0,0 +1,41 @@
+--- Makefile.old 2009-10-28 10:37:40.138328073 +0100
++++ Makefile 2009-10-28 10:37:57.014326831 +0100
+@@ -154,7 +154,7 @@
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
+ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
+- EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
++ EXTRA_CFLAGS="-DINET6 -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
+
+ gnu:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+--- tcpd.h.old 2009-10-28 10:48:19.285326834 +0100
++++ tcpd.h 2009-10-28 10:47:32.951325793 +0100
+@@ -91,7 +91,11 @@
+
+ extern void shell_cmd __P((char *)); /* execute shell command */
+ extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
++#ifdef INET6
++extern void rfc931 __P((struct sockaddr *, struct sockaddr *, char *)); /* client name from RFC 931 daemon */
++#else
+ extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
++#endif
+ extern void clean_exit __P((struct request_info *)); /* clean up and exit */
+ extern void refuse __P((struct request_info *)); /* clean up and exit */
+ extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */
+--- scaffold.c.old 2009-10-28 10:50:13.584449353 +0100
++++ scaffold.c 2009-10-28 10:52:53.765443023 +0100
+@@ -182,8 +237,13 @@
+ /* ARGSUSED */
+
+ void rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
+ struct sockaddr_in *rmt_sin;
+ struct sockaddr_in *our_sin;
++#endif
+ char *dest;
+ {
+ strcpy(dest, unknown);
diff --git a/core/tcp_wrappers/PKGBUILD b/core/tcp_wrappers/PKGBUILD
new file mode 100644
index 000000000..9373e9239
--- /dev/null
+++ b/core/tcp_wrappers/PKGBUILD
@@ -0,0 +1,74 @@
+# $Id: PKGBUILD 89099 2010-08-29 11:15:05Z tpowa $
+# Maintainer: judd <jvinet@zeroflux.org>
+pkgname=tcp_wrappers
+pkgver=7.6
+pkgrel=12
+pkgdesc="Monitors and Controls incoming TCP connections"
+arch=(i686 x86_64)
+url="ftp://ftp.porcupine.org/pub/security/index.html"
+license=('custom')
+groups=('base')
+backup=(etc/hosts.allow etc/hosts.deny)
+depends=('bash' 'glibc')
+source=(ftp://ftp.porcupine.org/pub/security/${pkgname}_$pkgver.tar.gz
+ hosts.allow
+ hosts.deny
+ try-from.8
+ safe_finger.8
+ shared_lib_plus_plus-1.patch
+ 01_all_redhat-bug11881.patch
+ 02_all_redhat-bug17795.patch
+ 03_all_wildcard.patch
+ 04_all_fixgethostbyname.patch
+ 07_all_sig.patch
+ 08_all_strerror.patch
+ 09_all_gcc-3.4.patch
+ 10_all_more-headers.patch
+ 11_inet6_fixes.patch
+ tcp-wrappers-7.6-ipv6-1.14.patch)
+md5sums=('e6fa25f71226d090f34de3f6b122fb5a'
+ '32cfeeed797161034f62bb45f3167baa'
+ 'e4743ca604a1749c7312f9283b4bb0d1'
+ '4a8f40f9a69f0848df92b232072e8561'
+ '1a6d7b11abb1fd69ace775d02a1c72cf'
+ '99345104130b91cb151af9d87eee1449'
+ 'e7ac7ae271703eacf175d597d329e11a'
+ '2790301fbf1b4711e75d5b799b6d4ac8'
+ 'd286da9fca993f8afa89631133312151'
+ '97d4d81faaecf0958eeb52c45df71e34'
+ '374b8179b8d5c71979008c6a775d658e'
+ '801292cacf14a92e2784b925e72a1db1'
+ '0978932f49aae33834a46e189ace7d77'
+ '68b1c7f82fed60b446b00f6de27c3b9f'
+ 'bd0af9dedcacd594e0715de800fc1b57'
+ '9154c38e3fb69d12b5bfb2fc5284314f')
+
+build() {
+ cd $srcdir/${pkgname}_$pkgver
+ # add gentoo / fedora / redhat patches
+ patch -Np1 -i ../shared_lib_plus_plus-1.patch
+ patch -Np1 -i ../01_all_redhat-bug11881.patch
+ patch -Np0 -i ../02_all_redhat-bug17795.patch
+ patch -Np0 -i ../03_all_wildcard.patch
+ patch -Np1 -i ../04_all_fixgethostbyname.patch
+ patch -Np1 -i ../07_all_sig.patch
+ patch -Np1 -i ../09_all_gcc-3.4.patch
+ patch -Np1 -i ../10_all_more-headers.patch
+ patch -Np0 -i ../11_inet6_fixes.patch
+ patch -Np2 -i ../tcp-wrappers-7.6-ipv6-1.14.patch
+
+ make REAL_DAEMON_DIR=/usr/sbin STYLE=-DPROCESS_OPTIONS linux
+ # dumb makefile
+ mkdir -p $pkgdir/usr/{include,lib,sbin}
+ mkdir -p $pkgdir/usr/share/man/man{3,5,8}
+ make DESTDIR=$pkgdir install
+ install -D -m644 ../hosts.allow $pkgdir/etc/hosts.allow
+ install -D -m644 ../hosts.deny $pkgdir/etc/hosts.deny
+ # add manpage symlinks for hosts.deny and hosts.allow
+ cd $pkgdir/usr/share/man/man5
+ ln -s hosts_access.5.gz hosts.allow.5.gz
+ ln -s hosts_access.5.gz hosts.deny.5.gz
+ # install license
+ mkdir -p $pkgdir/usr/share/licenses/$pkgname
+ install -m644 $srcdir/${pkgname}_$pkgver/DISCLAIMER $pkgdir/usr/share/licenses/$pkgname/license.txt
+}
diff --git a/core/tcp_wrappers/hosts.allow b/core/tcp_wrappers/hosts.allow
new file mode 100644
index 000000000..e5c035d65
--- /dev/null
+++ b/core/tcp_wrappers/hosts.allow
@@ -0,0 +1,5 @@
+#
+# /etc/hosts.allow
+#
+
+# End of file
diff --git a/core/tcp_wrappers/hosts.deny b/core/tcp_wrappers/hosts.deny
new file mode 100644
index 000000000..cbb00b29d
--- /dev/null
+++ b/core/tcp_wrappers/hosts.deny
@@ -0,0 +1,7 @@
+#
+# /etc/hosts.deny
+#
+
+ALL: ALL
+
+# End of file
diff --git a/core/tcp_wrappers/safe_finger.8 b/core/tcp_wrappers/safe_finger.8
new file mode 100644
index 000000000..875616b9e
--- /dev/null
+++ b/core/tcp_wrappers/safe_finger.8
@@ -0,0 +1,34 @@
+.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+safe_finger \- finger client wrapper that protects against nasty stuff
+from finger servers
+.SH SYNOPSIS
+.B safe_finger [finger_options]
+.SH DESCRIPTION
+The
+.B safe_finger
+command protects against nasty stuff from finger servers. Use this
+program for automatic reverse finger probes from the
+.B tcp_wrapper
+.B (tcpd)
+, not the raw finger command. The
+.B safe_finger
+command makes sure that the finger client is not run with root
+privileges. It also runs the finger client with a defined PATH
+environment.
+.B safe_finger
+will also protect you from problems caused by the output of some
+finger servers. The problem: some programs may react to stuff in
+the first column. Other programs may get upset by thrash anywhere
+on a line. File systems may fill up as the finger server keeps
+sending data. Text editors may bomb out on extremely long lines.
+The finger server may take forever because it is somehow wedged.
+.B safe_finger
+takes care of all this badness.
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/core/tcp_wrappers/shared_lib_plus_plus-1.patch b/core/tcp_wrappers/shared_lib_plus_plus-1.patch
new file mode 100644
index 000000000..b714899a0
--- /dev/null
+++ b/core/tcp_wrappers/shared_lib_plus_plus-1.patch
@@ -0,0 +1,784 @@
+diff -Naur tcp_wrappers_7.6/Makefile tcp_wrappers_7.6.gimli/Makefile
+--- tcp_wrappers_7.6/Makefile 1997-03-21 12:27:21.000000000 -0600
++++ tcp_wrappers_7.6.gimli/Makefile 2002-07-15 16:07:21.000000000 -0500
+@@ -1,5 +1,10 @@
++GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
++
+ # @(#) Makefile 1.23 97/03/21 19:27:20
+
++# unset the HOSTNAME environment variable
++HOSTNAME =
++
+ what:
+ @echo
+ @echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:"
+@@ -19,7 +24,7 @@
+ @echo " generic (most bsd-ish systems with sys5 compatibility)"
+ @echo " 386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543"
+ @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
+- @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
++ @echo " linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
+ @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
+ @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
+ @echo " uts215 uxp"
+@@ -43,8 +48,8 @@
+ # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx
+ #REAL_DAEMON_DIR=/usr/etc
+ #
+-# SysV.4 Solaris 2.x OSF AIX
+-#REAL_DAEMON_DIR=/usr/sbin
++# SysV.4 Solaris 2.x OSF AIX Linux
++REAL_DAEMON_DIR=/usr/sbin
+ #
+ # BSD 4.4
+ #REAL_DAEMON_DIR=/usr/libexec
+@@ -141,10 +146,21 @@
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+ EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
+
++ifneq ($(GLIBC),0)
++MYLIB=-lnsl
++endif
++
+ linux:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
+- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
++ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
++
++gnu:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
++ EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT"
+
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -391,7 +407,7 @@
+ # the ones provided with this source distribution. The environ.c module
+ # implements setenv(), getenv(), and putenv().
+
+-AUX_OBJ= setenv.o
++#AUX_OBJ= setenv.o
+ #AUX_OBJ= environ.o
+ #AUX_OBJ= environ.o strcasecmp.o
+
+@@ -454,7 +470,8 @@
+ # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work
+ # around this. The workaround does no harm on other Solaris versions.
+
+-BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
++BUGS =
++#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
+ #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG
+ #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG
+
+@@ -464,7 +481,7 @@
+ # If your system supports NIS or YP-style netgroups, enable the following
+ # macro definition. Netgroups are used only for host access control.
+ #
+-#NETGROUP= -DNETGROUP
++NETGROUP= -DNETGROUP
+
+ ###############################################################
+ # System dependencies: whether or not your system has vsyslog()
+@@ -491,7 +508,7 @@
+ # Uncomment the next definition to turn on the language extensions
+ # (examples: allow, deny, banners, twist and spawn).
+ #
+-#STYLE = -DPROCESS_OPTIONS # Enable language extensions.
++STYLE = -DPROCESS_OPTIONS # Enable language extensions.
+
+ ################################################################
+ # Optional: Changing the default disposition of logfile records
+@@ -514,7 +531,7 @@
+ #
+ # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
+
+-FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use
++FACILITY= LOG_DAEMON # LOG_MAIL is what most sendmail daemons use
+
+ # The syslog priority at which successful connections are logged.
+
+@@ -610,7 +627,7 @@
+ # Paranoid mode implies hostname lookup. In order to disable hostname
+ # lookups altogether, see the next section.
+
+-PARANOID= -DPARANOID
++#PARANOID= -DPARANOID
+
+ ########################################
+ # Optional: turning off hostname lookups
+@@ -623,7 +640,7 @@
+ # In order to perform selective hostname lookups, disable paranoid
+ # mode (see previous section) and comment out the following definition.
+
+-HOSTNAME= -DALWAYS_HOSTNAME
++#HOSTNAME= -DALWAYS_HOSTNAME
+
+ #############################################
+ # Optional: Turning on host ADDRESS checking
+@@ -649,28 +666,46 @@
+ # source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
+ # Solaris 2.x, and Linux. See your system documentation for details.
+ #
+-# KILL_OPT= -DKILL_IP_OPTIONS
++KILL_OPT= -DKILL_IP_OPTIONS
+
+ ## End configuration options
+ ############################
+
+ # Protection against weird shells or weird make programs.
+
++CC = gcc
+ SHELL = /bin/sh
+-.c.o:; $(CC) $(CFLAGS) -c $*.c
++.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c
++
++SOMAJOR = 0
++SOMINOR = 7.6
++
++LIB = libwrap.a
++SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
++SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR)
++SHLIBSO = shared/libwrap.so
++SHLIBFLAGS = -Lshared -lwrap
+
+-CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
++shared/%.o: %.c
++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
++
++CFLAGS = -O2 -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
+ $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+ $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
+ $(VSYSLOG) $(HOSTNAME)
+
++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
++SHCFLAGS = -fPIC -shared -D_REENTRANT
++
+ LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
+ hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
+ $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
+ update.o misc.o diag.o percent_m.o myvsyslog.o
+
++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
++
+ FROM_OBJ= fromhost.o
+
+ KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
+@@ -684,46 +719,80 @@
+ refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
+ scaffold.h tcpdmatch.8 README.NIS
+
+-LIB = libwrap.a
+-
+-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+
+ config-check:
+ @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
+- @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
+- if cmp cflags /tmp/cflags.$$$$ ; \
+- then rm /tmp/cflags.$$$$ ; \
+- else mv /tmp/cflags.$$$$ cflags ; \
++ @set +e; echo $(CFLAGS) >cflags.new ; \
++ if cmp cflags cflags.new ; \
++ then rm cflags.new ; \
++ else mv cflags.new cflags ; \
+ fi >/dev/null 2>/dev/null
++ @if [ ! -d shared ]; then mkdir shared; fi
+
+ $(LIB): $(LIB_OBJ)
+ rm -f $(LIB)
+ $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
+ -$(RANLIB) $(LIB)
+
+-tcpd: tcpd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
++$(SHLIB): $(SHLIB_OBJ)
++ rm -f $(SHLIB)
++ $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++ ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ)
++ ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
++
++tcpd: tcpd.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+
+-miscd: miscd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
++miscd: miscd.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS)
+
+-safe_finger: safe_finger.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
++safe_finger: safe_finger.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+
+-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+
+-try-from: try-from.o fakelog.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
++try-from: try-from.o fakelog.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+
+-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
++
++install: install-lib install-bin install-dev
++
++install-lib:
++ install -o root -g root -m 0755 $(SHLIB) ${DESTDIR}/usr/lib/
++ ln -sf $(notdir $(SHLIB)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSOMAJ))
++ ln -sf $(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO))
++
++install-bin:
++ install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/
++ install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/
++ install -o root -g root -m 0644 try-from.8 ${DESTDIR}/usr/share/man/man8/
++ install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/
++ install -o root -g root -m 0644 safe_finger.8 ${DESTDIR}/usr/share/man/man8/
++ install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/
++ install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/
++
++install-dev:
++ install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/
++ install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/
++ install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/
++ ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3
++ ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3
++ ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3
+
+ shar: $(KIT)
+ @shar $(KIT)
+@@ -739,7 +808,8 @@
+
+ clean:
+ rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
+- cflags
++ cflags libwrap*.so*
++ rm -rf shared
+
+ tidy: clean
+ chmod -R a+r .
+@@ -885,5 +955,6 @@
+ update.o: mystdarg.h
+ update.o: tcpd.h
+ vfprintf.o: cflags
++weak_symbols.o: tcpd.h
+ workarounds.o: cflags
+ workarounds.o: tcpd.h
+diff -Naur tcp_wrappers_7.6/hosts_access.3 tcp_wrappers_7.6.gimli/hosts_access.3
+--- tcp_wrappers_7.6/hosts_access.3 1996-02-11 10:01:27.000000000 -0600
++++ tcp_wrappers_7.6.gimli/hosts_access.3 2002-01-07 08:50:19.000000000 -0600
+@@ -3,7 +3,7 @@
+ hosts_access, hosts_ctl, request_init, request_set \- access control library
+ .SH SYNOPSIS
+ .nf
+-#include "tcpd.h"
++#include <tcpd.h>
+
+ extern int allow_severity;
+ extern int deny_severity;
+diff -Naur tcp_wrappers_7.6/hosts_options.5 tcp_wrappers_7.6.gimli/hosts_options.5
+--- tcp_wrappers_7.6/hosts_options.5 1994-12-28 10:42:29.000000000 -0600
++++ tcp_wrappers_7.6.gimli/hosts_options.5 2002-01-07 08:50:19.000000000 -0600
+@@ -58,12 +58,12 @@
+ Execute, in a child process, the specified shell command, after
+ performing the %<letter> expansions described in the hosts_access(5)
+ manual page. The command is executed with stdin, stdout and stderr
+-connected to the null device, so that it won\'t mess up the
++connected to the null device, so that it won't mess up the
+ conversation with the client host. Example:
+ .sp
+ .nf
+ .ti +3
+-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
+ .fi
+ .sp
+ executes, in a background child process, the shell command "safe_finger
+diff -Naur tcp_wrappers_7.6/options.c tcp_wrappers_7.6.gimli/options.c
+--- tcp_wrappers_7.6/options.c 1996-02-11 10:01:32.000000000 -0600
++++ tcp_wrappers_7.6.gimli/options.c 2002-01-07 08:50:19.000000000 -0600
+@@ -473,6 +473,9 @@
+ #ifdef LOG_CRON
+ "cron", LOG_CRON,
+ #endif
++#ifdef LOG_FTP
++ "ftp", LOG_FTP,
++#endif
+ #ifdef LOG_LOCAL0
+ "local0", LOG_LOCAL0,
+ #endif
+diff -Naur tcp_wrappers_7.6/percent_m.c tcp_wrappers_7.6.gimli/percent_m.c
+--- tcp_wrappers_7.6/percent_m.c 1994-12-28 10:42:37.000000000 -0600
++++ tcp_wrappers_7.6.gimli/percent_m.c 2002-01-07 08:50:19.000000000 -0600
+@@ -13,7 +13,7 @@
+ #include <string.h>
+
+ extern int errno;
+-#ifndef SYS_ERRLIST_DEFINED
++#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ #endif
+@@ -29,11 +29,15 @@
+
+ while (*bp = *cp)
+ if (*cp == '%' && cp[1] == 'm') {
++#ifdef HAVE_STRERROR
++ strcpy(bp, strerror(errno));
++#else
+ if (errno < sys_nerr && errno > 0) {
+ strcpy(bp, sys_errlist[errno]);
+ } else {
+ sprintf(bp, "Unknown error %d", errno);
+ }
++#endif
+ bp += strlen(bp);
+ cp += 2;
+ } else {
+diff -Naur tcp_wrappers_7.6/rfc931.c tcp_wrappers_7.6.gimli/rfc931.c
+--- tcp_wrappers_7.6/rfc931.c 1995-01-02 09:11:34.000000000 -0600
++++ tcp_wrappers_7.6.gimli/rfc931.c 2002-01-07 08:50:19.000000000 -0600
+@@ -33,7 +33,7 @@
+
+ int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
+
+-static jmp_buf timebuf;
++static sigjmp_buf timebuf;
+
+ /* fsocket - open stdio stream on top of socket */
+
+@@ -62,7 +62,7 @@
+ static void timeout(sig)
+ int sig;
+ {
+- longjmp(timebuf, sig);
++ siglongjmp(timebuf, sig);
+ }
+
+ /* rfc931 - return remote user name, given socket structures */
+@@ -99,7 +99,7 @@
+ * Set up a timer so we won't get stuck while waiting for the server.
+ */
+
+- if (setjmp(timebuf) == 0) {
++ if (sigsetjmp(timebuf,1) == 0) {
+ signal(SIGALRM, timeout);
+ alarm(rfc931_timeout);
+
+diff -Naur tcp_wrappers_7.6/safe_finger.8 tcp_wrappers_7.6.gimli/safe_finger.8
+--- tcp_wrappers_7.6/safe_finger.8 1969-12-31 18:00:00.000000000 -0600
++++ tcp_wrappers_7.6.gimli/safe_finger.8 2002-01-07 08:50:19.000000000 -0600
+@@ -0,0 +1,34 @@
++.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
++.SH NAME
++safe_finger \- finger client wrapper that protects against nasty stuff
++from finger servers
++.SH SYNOPSIS
++.B safe_finger [finger_options]
++.SH DESCRIPTION
++The
++.B safe_finger
++command protects against nasty stuff from finger servers. Use this
++program for automatic reverse finger probes from the
++.B tcp_wrapper
++.B (tcpd)
++, not the raw finger command. The
++.B safe_finger
++command makes sure that the finger client is not run with root
++privileges. It also runs the finger client with a defined PATH
++environment.
++.B safe_finger
++will also protect you from problems caused by the output of some
++finger servers. The problem: some programs may react to stuff in
++the first column. Other programs may get upset by thrash anywhere
++on a line. File systems may fill up as the finger server keeps
++sending data. Text editors may bomb out on extremely long lines.
++The finger server may take forever because it is somehow wedged.
++.B safe_finger
++takes care of all this badness.
++.SH SEE ALSO
++.BR hosts_access (5),
++.BR hosts_options (5),
++.BR tcpd (8)
++.SH AUTHOR
++Wietse Venema, Eindhoven University of Technology, The Netherlands.
++
+diff -Naur tcp_wrappers_7.6/safe_finger.c tcp_wrappers_7.6.gimli/safe_finger.c
+--- tcp_wrappers_7.6/safe_finger.c 1994-12-28 10:42:42.000000000 -0600
++++ tcp_wrappers_7.6.gimli/safe_finger.c 2002-01-07 08:50:19.000000000 -0600
+@@ -26,21 +26,24 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <pwd.h>
++#include <syslog.h>
+
+ extern void exit();
+
+ /* Local stuff */
+
+-char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
++char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
+
+ #define TIME_LIMIT 60 /* Do not keep listinging forever */
+ #define INPUT_LENGTH 100000 /* Do not keep listinging forever */
+ #define LINE_LENGTH 128 /* Editors can choke on long lines */
+ #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */
+ #define UNPRIV_NAME "nobody" /* Preferred privilege level */
+-#define UNPRIV_UGID 32767 /* Default uid and gid */
++#define UNPRIV_UGID 65534 /* Default uid and gid */
+
+ int finger_pid;
++int allow_severity = SEVERITY;
++int deny_severity = LOG_WARNING;
+
+ void cleanup(sig)
+ int sig;
+diff -Naur tcp_wrappers_7.6/scaffold.c tcp_wrappers_7.6.gimli/scaffold.c
+--- tcp_wrappers_7.6/scaffold.c 1997-03-21 12:27:24.000000000 -0600
++++ tcp_wrappers_7.6.gimli/scaffold.c 2002-01-07 08:50:19.000000000 -0600
+@@ -180,10 +180,12 @@
+
+ /* ARGSUSED */
+
+-void rfc931(request)
+-struct request_info *request;
++void rfc931(rmt_sin, our_sin, dest)
++struct sockaddr_in *rmt_sin;
++struct sockaddr_in *our_sin;
++char *dest;
+ {
+- strcpy(request->user, unknown);
++ strcpy(dest, unknown);
+ }
+
+ /* check_path - examine accessibility */
+diff -Naur tcp_wrappers_7.6/tcpd.8 tcp_wrappers_7.6.gimli/tcpd.8
+--- tcp_wrappers_7.6/tcpd.8 1996-02-21 09:39:16.000000000 -0600
++++ tcp_wrappers_7.6.gimli/tcpd.8 2002-01-07 08:50:19.000000000 -0600
+@@ -94,7 +94,7 @@
+ .PP
+ The example assumes that the network daemons live in /usr/etc. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, or have
+-no `in.\' prefix to their name.
++no `in.' prefix to their name.
+ .SH EXAMPLE 2
+ This example applies when \fItcpd\fR expects that the network daemons
+ are left in their original place.
+@@ -110,26 +110,26 @@
+ becomes:
+ .sp
+ .ti +5
+-finger stream tcp nowait nobody /some/where/tcpd in.fingerd
++finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd
+ .sp
+ .fi
+ .PP
+ The example assumes that the network daemons live in /usr/etc. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, the
+-daemons have no `in.\' prefix to their name, or there is no userid
++daemons have no `in.' prefix to their name, or there is no userid
+ field in the inetd configuration file.
+ .PP
+ Similar changes will be needed for the other services that are to be
+-covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8)
++covered by \fItcpd\fR. Send a `kill -HUP' to the \fIinetd\fR(8)
+ process to make the changes effective. AIX users may also have to
+-execute the `inetimp\' command.
++execute the `inetimp' command.
+ .SH EXAMPLE 3
+ In the case of daemons that do not live in a common directory ("secret"
+ or otherwise), edit the \fIinetd\fR configuration file so that it
+ specifies an absolute path name for the process name field. For example:
+ .nf
+ .sp
+- ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd
++ ntalk dgram udp wait root /usr/sbin/tcpd /usr/sbin/in.ntalkd
+ .sp
+ .fi
+ .PP
+diff -Naur tcp_wrappers_7.6/tcpd.h tcp_wrappers_7.6.gimli/tcpd.h
+--- tcp_wrappers_7.6/tcpd.h 1996-03-19 09:22:25.000000000 -0600
++++ tcp_wrappers_7.6.gimli/tcpd.h 2002-01-07 08:50:19.000000000 -0600
+@@ -4,6 +4,25 @@
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
++#ifndef _TCPWRAPPERS_TCPD_H
++#define _TCPWRAPPERS_TCPD_H
++
++/* someone else may have defined this */
++#undef __P
++
++/* use prototypes if we have an ANSI C compiler or are using C++ */
++#if defined(__STDC__) || defined(__cplusplus)
++#define __P(args) args
++#else
++#define __P(args) ()
++#endif
++
++/* Need definitions of struct sockaddr_in and FILE. */
++#include <netinet/in.h>
++#include <stdio.h>
++
++__BEGIN_DECLS
++
+ /* Structure to describe one communications endpoint. */
+
+ #define STRING_LENGTH 128 /* hosts, users, processes */
+@@ -25,10 +44,10 @@
+ char pid[10]; /* access via eval_pid(request) */
+ struct host_info client[1]; /* client endpoint info */
+ struct host_info server[1]; /* server endpoint info */
+- void (*sink) (); /* datagram sink function or 0 */
+- void (*hostname) (); /* address to printable hostname */
+- void (*hostaddr) (); /* address to printable address */
+- void (*cleanup) (); /* cleanup function or 0 */
++ void (*sink) __P((int)); /* datagram sink function or 0 */
++ void (*hostname) __P((struct host_info *)); /* address to printable hostname */
++ void (*hostaddr) __P((struct host_info *)); /* address to printable address */
++ void (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
+ struct netconfig *config; /* netdir handle */
+ };
+
+@@ -61,25 +80,30 @@
+ /* Global functions. */
+
+ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
+-extern void fromhost(); /* get/validate client host info */
++extern void fromhost __P((struct request_info *)); /* get/validate client host info */
+ #else
+ #define fromhost sock_host /* no TLI support needed */
+ #endif
+
+-extern int hosts_access(); /* access control */
+-extern void shell_cmd(); /* execute shell command */
+-extern char *percent_x(); /* do %<char> expansion */
+-extern void rfc931(); /* client name from RFC 931 daemon */
+-extern void clean_exit(); /* clean up and exit */
+-extern void refuse(); /* clean up and exit */
+-extern char *xgets(); /* fgets() on steroids */
+-extern char *split_at(); /* strchr() and split */
+-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */
++extern void shell_cmd __P((char *)); /* execute shell command */
++extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
++extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
++extern void clean_exit __P((struct request_info *)); /* clean up and exit */
++extern void refuse __P((struct request_info *)); /* clean up and exit */
++extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */
++extern char *split_at __P((char *, int)); /* strchr() and split */
++extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
+
+ /* Global variables. */
+
++#ifdef HAVE_WEAKSYMS
++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
++#else
+ extern int allow_severity; /* for connection logging */
+ extern int deny_severity; /* for connection logging */
++#endif
++
+ extern char *hosts_allow_table; /* for verification mode redirection */
+ extern char *hosts_deny_table; /* for verification mode redirection */
+ extern int hosts_access_verbose; /* for verbose matching mode */
+@@ -92,9 +116,14 @@
+ */
+
+ #ifdef __STDC__
++extern int hosts_access(struct request_info *request);
++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
++ char *client_user);
+ extern struct request_info *request_init(struct request_info *,...);
+ extern struct request_info *request_set(struct request_info *,...);
+ #else
++extern int hosts_access();
++extern int hosts_ctl();
+ extern struct request_info *request_init(); /* initialize request */
+ extern struct request_info *request_set(); /* update request structure */
+ #endif
+@@ -117,27 +146,31 @@
+ * host_info structures serve as caches for the lookup results.
+ */
+
+-extern char *eval_user(); /* client user */
+-extern char *eval_hostname(); /* printable hostname */
+-extern char *eval_hostaddr(); /* printable host address */
+-extern char *eval_hostinfo(); /* host name or address */
+-extern char *eval_client(); /* whatever is available */
+-extern char *eval_server(); /* whatever is available */
++extern char *eval_user __P((struct request_info *)); /* client user */
++extern char *eval_hostname __P((struct host_info *)); /* printable hostname */
++extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */
++extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */
++extern char *eval_client __P((struct request_info *)); /* whatever is available */
++extern char *eval_server __P((struct request_info *)); /* whatever is available */
+ #define eval_daemon(r) ((r)->daemon) /* daemon process name */
+ #define eval_pid(r) ((r)->pid) /* process id */
+
+ /* Socket-specific methods, including DNS hostname lookups. */
+
+-extern void sock_host(); /* look up endpoint addresses */
+-extern void sock_hostname(); /* translate address to hostname */
+-extern void sock_hostaddr(); /* address to printable address */
++/* look up endpoint addresses */
++extern void sock_host __P((struct request_info *));
++/* translate address to hostname */
++extern void sock_hostname __P((struct host_info *));
++/* address to printable address */
++extern void sock_hostaddr __P((struct host_info *));
++
+ #define sock_methods(r) \
+ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
+
+ /* The System V Transport-Level Interface (TLI) interface. */
+
+ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
+-extern void tli_host(); /* look up endpoint addresses etc. */
++extern void tli_host __P((struct request_info *)); /* look up endpoint addresses etc. */
+ #endif
+
+ /*
+@@ -178,7 +211,7 @@
+ * behavior.
+ */
+
+-extern void process_options(); /* execute options */
++extern void process_options __P((char *, struct request_info *)); /* execute options */
+ extern int dry_run; /* verification flag */
+
+ /* Bug workarounds. */
+@@ -217,3 +250,7 @@
+ #define strtok my_strtok
+ extern char *my_strtok();
+ #endif
++
++__END_DECLS
++
++#endif /* tcpd.h */
+diff -Naur tcp_wrappers_7.6/tcpdchk.c tcp_wrappers_7.6.gimli/tcpdchk.c
+--- tcp_wrappers_7.6/tcpdchk.c 1997-02-11 19:13:25.000000000 -0600
++++ tcp_wrappers_7.6.gimli/tcpdchk.c 2002-01-07 08:50:19.000000000 -0600
+@@ -350,6 +350,8 @@
+ {
+ if (pat[0] == '@') {
+ tcpd_warn("%s: daemon name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: daemon name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: daemon name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -382,6 +384,8 @@
+ {
+ if (pat[0] == '@') { /* @netgroup */
+ tcpd_warn("%s: user name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: user name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: user name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -402,8 +406,13 @@
+ static int check_host(pat)
+ char *pat;
+ {
++ char buf[BUFSIZ];
+ char *mask;
+ int addr_count = 1;
++ FILE *fp;
++ struct tcpd_context saved_context;
++ char *cp;
++ char *wsp = " \t\r\n";
+
+ if (pat[0] == '@') { /* @netgroup */
+ #ifdef NO_NETGRENT
+@@ -422,6 +431,21 @@
+ tcpd_warn("netgroup support disabled");
+ #endif
+ #endif
++ } else if (pat[0] == '/') { /* /path/name */
++ if ((fp = fopen(pat, "r")) != 0) {
++ saved_context = tcpd_context;
++ tcpd_context.file = pat;
++ tcpd_context.line = 0;
++ while (fgets(buf, sizeof(buf), fp)) {
++ tcpd_context.line++;
++ for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
++ check_host(cp);
++ }
++ tcpd_context = saved_context;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", pat);
++ }
+ } else if (mask = split_at(pat, '/')) { /* network/netmask */
+ if (dot_quad_addr(pat) == INADDR_NONE
+ || dot_quad_addr(mask) == INADDR_NONE)
+diff -Naur tcp_wrappers_7.6/try-from.8 tcp_wrappers_7.6.gimli/try-from.8
+--- tcp_wrappers_7.6/try-from.8 1969-12-31 18:00:00.000000000 -0600
++++ tcp_wrappers_7.6.gimli/try-from.8 2002-01-07 08:50:19.000000000 -0600
+@@ -0,0 +1,28 @@
++.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
++.SH NAME
++try-from \- test program for the tcp_wrapper
++.SH SYNOPSIS
++.B try-from
++.SH DESCRIPTION
++The
++.B try-from
++command can be called via a remote shell command to find out
++if the hostname and address are properly recognized
++by the
++.B tcp_wrapper
++library, if username lookup works, and (SysV only) if the TLI
++on top of IP heuristics work. Diagnostics are reported through
++.BR syslog (3)
++and redirected to stderr.
++
++Example:
++
++rsh host /some/where/try-from
++
++.SH SEE ALSO
++.BR hosts_access (5),
++.BR hosts_options (5),
++.BR tcpd (8)
++.SH AUTHOR
++Wietse Venema, Eindhoven University of Technology, The Netherlands.
++
+diff -Naur tcp_wrappers_7.6/weak_symbols.c tcp_wrappers_7.6.gimli/weak_symbols.c
+--- tcp_wrappers_7.6/weak_symbols.c 1969-12-31 18:00:00.000000000 -0600
++++ tcp_wrappers_7.6.gimli/weak_symbols.c 2002-01-07 08:50:19.000000000 -0600
+@@ -0,0 +1,11 @@
++ /*
++ * @(#) weak_symbols.h 1.5 99/12/29 23:50
++ *
++ * Author: Anthony Towns <ajt@debian.org>
++ */
++
++#ifdef HAVE_WEAKSYMS
++#include <syslog.h>
++int deny_severity = LOG_WARNING;
++int allow_severity = SEVERITY;
++#endif
diff --git a/core/tcp_wrappers/tcp-wrappers-7.6-ipv6-1.14.patch b/core/tcp_wrappers/tcp-wrappers-7.6-ipv6-1.14.patch
new file mode 100644
index 000000000..c1593d051
--- /dev/null
+++ b/core/tcp_wrappers/tcp-wrappers-7.6-ipv6-1.14.patch
@@ -0,0 +1,1233 @@
+;; IPv6 patch for tcp_wrappers_7.6 1.14
+;; Dec 29, 2001 by Hajimu UMEMOTO <ume@mahoroba.org>
+;;
+;; This patch supports IPv4/IPv6 dual stack and IPv4-mapped IPv6 address.
+;; You can replace stock tcpd or libwrap.a with this.
+;; IPv6 address pattern is as a `[net]/prefixlen' pair.
+;; This patch was tested on KAME/FreeBSD, KAME/FreeBSD3, KAME/NetBSD,
+;; RedHat 5.1 with kernel 2.1.126, and RedHat 6.0 with kernel 2.2.10.
+;; Solaris 8 is now supported. Thanks Alexander Gall <gall@switch.ch>
+;; and Shigechika AIKAWA <shige@cin.nihon-u.ac.jp>.
+;;
+;; This version is using getaddrinfo()/getnameinfo() instead of
+;; getipnode*() to support scoped address. Use of
+;; getaddrinfo()/getnameinfo() and scoped address support is only
+;; tested on KAME.
+;;
+;; CAUTION:
+;; Back out change for field separater. Now, field separater is `:'
+;; not `|'. To specify IPv6 address, enclose IPv6 address with `['
+;; and `]'.
+;;
+;; For Linux users:
+;; If your libc doesn't have sockaddr_storage, try target `linux-old'.
+diff -u src/tcp_wrappers/fix_options.c:1.1.1.1 src/tcp_wrappers/fix_options.c:1.4
+--- src/tcp_wrappers/fix_options.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/fix_options.c Tue Sep 28 04:13:19 1999
+@@ -11,6 +11,9 @@
+
+ #include <sys/types.h>
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <netinet/in_systm.h>
+ #include <netinet/ip.h>
+@@ -41,6 +44,22 @@
+ unsigned int opt;
+ int optlen;
+ struct in_addr dummy;
++#ifdef INET6
++ struct sockaddr_storage ss;
++ int sslen;
++
++ /*
++ * check if this is AF_INET socket
++ * XXX IPv6 support?
++ */
++ sslen = sizeof(ss);
++ if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) {
++ syslog(LOG_ERR, "getpeername: %m");
++ clean_exit(request);
++ }
++ if (ss.ss_family != AF_INET)
++ return;
++#endif
+
+ if ((ip = getprotobyname("ip")) != 0)
+ ipproto = ip->p_proto;
+Index: src/tcp_wrappers/inetcf.c
+diff -u src/tcp_wrappers/inetcf.c:1.1.1.1 src/tcp_wrappers/inetcf.c:1.2
+--- src/tcp_wrappers/inetcf.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/inetcf.c Tue May 4 21:58:36 1999
+@@ -26,6 +26,9 @@
+ * guesses. Shorter names follow longer ones.
+ */
+ char *inet_files[] = {
++#ifdef INET6
++ "/usr/local/v6/etc/inet6d.conf", /* KAME */
++#endif
+ "/private/etc/inetd.conf", /* NEXT */
+ "/etc/inet/inetd.conf", /* SYSV4 */
+ "/usr/etc/inetd.conf", /* IRIX?? */
+Index: src/tcp_wrappers/misc.c
+diff -u src/tcp_wrappers/misc.c:1.1.1.1 src/tcp_wrappers/misc.c:1.4
+--- src/tcp_wrappers/misc.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/misc.c Mon Aug 23 01:32:43 1999
+@@ -58,9 +58,31 @@
+ {
+ char *cp;
+
++#ifdef INET6
++ int bracket = 0;
++
++ for (cp = string; cp && *cp; cp++) {
++ switch (*cp) {
++ case '[':
++ bracket++;
++ break;
++ case ']':
++ bracket--;
++ break;
++ default:
++ if (bracket == 0 && *cp == delimiter) {
++ *cp++ = 0;
++ return cp;
++ }
++ break;
++ }
++ }
++ return (NULL);
++#else
+ if ((cp = strchr(string, delimiter)) != 0)
+ *cp++ = 0;
+ return (cp);
++#endif
+ }
+
+ /* dot_quad_addr - convert dotted quad to internal form */
+Index: src/tcp_wrappers/refuse.c
+diff -u src/tcp_wrappers/refuse.c:1.1.1.1 src/tcp_wrappers/refuse.c:1.2
+--- src/tcp_wrappers/refuse.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/refuse.c Tue May 4 21:58:36 1999
+@@ -25,7 +25,12 @@
+ void refuse(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ syslog(deny_severity, "refused connect from %s (%s)",
++ eval_client(request), eval_hostaddr(request->client));
++#else
+ syslog(deny_severity, "refused connect from %s", eval_client(request));
++#endif
+ clean_exit(request);
+ /* NOTREACHED */
+ }
+Index: src/tcp_wrappers/rfc931.c
+diff -u src/tcp_wrappers/rfc931.c:1.1.1.1 src/tcp_wrappers/rfc931.c:1.7
+--- src/tcp_wrappers/rfc931.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/rfc931.c Mon Aug 23 01:32:43 1999
+@@ -68,20 +68,50 @@
+ /* rfc931 - return remote user name, given socket structures */
+
+ void rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
+ struct sockaddr_in *rmt_sin;
+ struct sockaddr_in *our_sin;
++#endif
+ char *dest;
+ {
+ unsigned rmt_port;
+ unsigned our_port;
++#ifdef INET6
++ struct sockaddr_storage rmt_query_sin;
++ struct sockaddr_storage our_query_sin;
++ int alen;
++#else
+ struct sockaddr_in rmt_query_sin;
+ struct sockaddr_in our_query_sin;
++#endif
+ char user[256]; /* XXX */
+ char buffer[512]; /* XXX */
+ char *cp;
+ char *result = unknown;
+ FILE *fp;
+
++#ifdef INET6
++ /* address family must be the same */
++ if (rmt_sin->sa_family != our_sin->sa_family) {
++ STRN_CPY(dest, result, STRING_LENGTH);
++ return;
++ }
++ switch (our_sin->sa_family) {
++ case AF_INET:
++ alen = sizeof(struct sockaddr_in);
++ break;
++ case AF_INET6:
++ alen = sizeof(struct sockaddr_in6);
++ break;
++ default:
++ STRN_CPY(dest, result, STRING_LENGTH);
++ return;
++ }
++#endif
++
+ /*
+ * Use one unbuffered stdio stream for writing to and for reading from
+ * the RFC931 etc. server. This is done because of a bug in the SunOS
+@@ -92,7 +122,11 @@
+ * sockets.
+ */
+
++#ifdef INET6
++ if ((fp = fsocket(our_sin->sa_family, SOCK_STREAM, 0)) != 0) {
++#else
+ if ((fp = fsocket(AF_INET, SOCK_STREAM, 0)) != 0) {
++#endif
+ setbuf(fp, (char *) 0);
+
+ /*
+@@ -112,6 +146,25 @@
+ * addresses from the query socket.
+ */
+
++#ifdef INET6
++ memcpy(&our_query_sin, our_sin, alen);
++ memcpy(&rmt_query_sin, rmt_sin, alen);
++ switch (our_sin->sa_family) {
++ case AF_INET:
++ ((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT);
++ ((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC931_PORT);
++ break;
++ case AF_INET6:
++ ((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT);
++ ((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC931_PORT);
++ break;
++ }
++
++ if (bind(fileno(fp), (struct sockaddr *) & our_query_sin,
++ alen) >= 0 &&
++ connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
++ alen) >= 0) {
++#else
+ our_query_sin = *our_sin;
+ our_query_sin.sin_port = htons(ANY_PORT);
+ rmt_query_sin = *rmt_sin;
+@@ -121,6 +174,7 @@
+ sizeof(our_query_sin)) >= 0 &&
+ connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
+ sizeof(rmt_query_sin)) >= 0) {
++#endif
+
+ /*
+ * Send query to server. Neglect the risk that a 13-byte
+@@ -129,8 +183,13 @@
+ */
+
+ fprintf(fp, "%u,%u\r\n",
++#ifdef INET6
++ ntohs(((struct sockaddr_in *)rmt_sin)->sin_port),
++ ntohs(((struct sockaddr_in *)our_sin)->sin_port));
++#else
+ ntohs(rmt_sin->sin_port),
+ ntohs(our_sin->sin_port));
++#endif
+ fflush(fp);
+
+ /*
+@@ -144,8 +203,13 @@
+ && ferror(fp) == 0 && feof(fp) == 0
+ && sscanf(buffer, "%u , %u : USERID :%*[^:]:%255s",
+ &rmt_port, &our_port, user) == 3
++#ifdef INET6
++ && ntohs(((struct sockaddr_in *)rmt_sin)->sin_port) == rmt_port
++ && ntohs(((struct sockaddr_in *)our_sin)->sin_port) == our_port) {
++#else
+ && ntohs(rmt_sin->sin_port) == rmt_port
+ && ntohs(our_sin->sin_port) == our_port) {
++#endif
+
+ /*
+ * Strip trailing carriage return. It is part of the
+Index: src/tcp_wrappers/scaffold.c
+diff -u src/tcp_wrappers/scaffold.c:1.1.1.1 src/tcp_wrappers/scaffold.c:1.12
+--- src/tcp_wrappers/scaffold.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/scaffold.c Fri May 5 18:54:46 2000
+@@ -39,6 +41,7 @@
+ int deny_severity = LOG_WARNING;
+ int rfc931_timeout = RFC931_TIMEOUT;
+
++#ifndef INET6
+ /* dup_hostent - create hostent in one memory block */
+
+ static struct hostent *dup_hostent(hp)
+@@ -73,9 +76,46 @@
+ }
+ return (&hb->host);
+ }
++#endif
+
+ /* find_inet_addr - find all addresses for this host, result to free() */
+
++#ifdef INET6
++struct addrinfo *find_inet_addr(host)
++char *host;
++{
++ struct addrinfo hints, *res;
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(host, NULL, &hints, &res) == 0)
++ return (res);
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++ if (getaddrinfo(host, NULL, &hints, &res) != 0) {
++ tcpd_warn("%s: host not found", host);
++ return (0);
++ }
++ if (res->ai_family != AF_INET6 && res->ai_family != AF_INET) {
++ tcpd_warn("%d: not an internet host", res->ai_family);
++ freeaddrinfo(res);
++ return (0);
++ }
++ if (!res->ai_canonname) {
++ tcpd_warn("%s: hostname alias", host);
++ tcpd_warn("(cannot obtain official name)", res->ai_canonname);
++ } else if (STR_NE(host, res->ai_canonname)) {
++ tcpd_warn("%s: hostname alias", host);
++ tcpd_warn("(official name: %.*s)", STRING_LENGTH, res->ai_canonname);
++ }
++ return (res);
++}
++#else
+ struct hostent *find_inet_addr(host)
+ char *host;
+ {
+@@ -118,6 +158,7 @@
+ }
+ return (dup_hostent(hp));
+ }
++#endif
+
+ /* check_dns - give each address thorough workout, return address count */
+
+@@ -125,8 +166,13 @@
+ char *host;
+ {
+ struct request_info request;
++#ifdef INET6
++ struct sockaddr_storage sin;
++ struct addrinfo *hp, *res;
++#else
+ struct sockaddr_in sin;
+ struct hostent *hp;
++#endif
+ int count;
+ char *addr;
+
+@@ -134,11 +180,18 @@
+ return (0);
+ request_init(&request, RQ_CLIENT_SIN, &sin, 0);
+ sock_methods(&request);
++#ifndef INET6
+ memset((char *) &sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
++#endif
+
++#ifdef INET6
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&sin, res->ai_addr, res->ai_addrlen);
++#else
+ for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ memcpy((char *) &sin.sin_addr, addr, sizeof(sin.sin_addr));
++#endif
+
+ /*
+ * Force host name and address conversions. Use the request structure
+@@ -151,7 +204,11 @@
+ tcpd_warn("host address %s->name lookup failed",
+ eval_hostaddr(request.client));
+ }
++#ifdef INET6
++ freeaddrinfo(hp);
++#else
+ free((char *) hp);
++#endif
+ return (count);
+ }
+
+Index: src/tcp_wrappers/scaffold.h
+diff -u src/tcp_wrappers/scaffold.h:1.1.1.1 src/tcp_wrappers/scaffold.h:1.2
+--- src/tcp_wrappers/scaffold.h:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/scaffold.h Fri May 5 18:28:13 2000
+@@ -4,6 +4,10 @@
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
++#ifdef INET6
++extern struct addrinfo *find_inet_addr();
++#else
+ extern struct hostent *find_inet_addr();
++#endif
+ extern int check_dns();
+ extern int check_path();
+Index: src/tcp_wrappers/socket.c
+diff -u src/tcp_wrappers/socket.c:1.1.1.1 src/tcp_wrappers/socket.c:1.20
+--- src/tcp_wrappers/socket.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/socket.c Thu Jul 5 05:26:07 2001
+@@ -24,13 +24,22 @@
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
++#ifdef INT32_T
++typedef uint32_t u_int32_t;
++#endif
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+
++#ifdef INET6
++#ifndef NI_WITHSCOPEID
++#define NI_WITHSCOPEID 0
++#endif
++#else
+ extern char *inet_ntoa();
++#endif
+
+ /* Local stuff. */
+
+@@ -74,8 +83,13 @@
+ void sock_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ static struct sockaddr_storage client;
++ static struct sockaddr_storage server;
++#else
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
++#endif
+ int len;
+ char buf[BUFSIZ];
+ int fd = request->fd;
+@@ -104,7 +118,11 @@
+ memset(buf, 0 sizeof(buf));
+ #endif
+ }
++#ifdef INET6
++ request->client->sin = (struct sockaddr *)&client;
++#else
+ request->client->sin = &client;
++#endif
+
+ /*
+ * Determine the server binding. This is used for client username
+@@ -117,7 +135,11 @@
+ tcpd_warn("getsockname: %m");
+ return;
+ }
++#ifdef INET6
++ request->server->sin = (struct sockaddr *)&server;
++#else
+ request->server->sin = &server;
++#endif
+ }
+
+ /* sock_hostaddr - map endpoint address to printable form */
+@@ -125,10 +147,26 @@
+ void sock_hostaddr(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++ struct sockaddr *sin = host->sin;
++ int salen;
++
++ if (!sin)
++ return;
++#ifdef SIN6_LEN
++ salen = sin->sa_len;
++#else
++ salen = (sin->sa_family == AF_INET) ? sizeof(struct sockaddr_in)
++ : sizeof(struct sockaddr_in6);
++#endif
++ getnameinfo(sin, salen, host->addr, sizeof(host->addr),
++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++#else
+ struct sockaddr_in *sin = host->sin;
+
+ if (sin != 0)
+ STRN_CPY(host->addr, inet_ntoa(sin->sin_addr), sizeof(host->addr));
++#endif
+ }
+
+ /* sock_hostname - map endpoint address to host name */
+@@ -136,6 +174,160 @@
+ void sock_hostname(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++ struct sockaddr *sin = host->sin;
++ struct sockaddr_in sin4;
++ struct addrinfo hints, *res, *res0 = NULL;
++ int salen, alen, err = 1;
++ char *ap = NULL, *rap, hname[NI_MAXHOST];
++
++ if (sin != NULL) {
++ if (sin->sa_family == AF_INET6) {
++ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sin;
++
++ if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
++ memset(&sin4, 0, sizeof(sin4));
++#ifdef SIN6_LEN
++ sin4.sin_len = sizeof(sin4);
++#endif
++ sin4.sin_family = AF_INET;
++ sin4.sin_port = sin6->sin6_port;
++ sin4.sin_addr.s_addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12];
++ sin = (struct sockaddr *)&sin4;
++ }
++ }
++ switch (sin->sa_family) {
++ case AF_INET:
++ ap = (char *)&((struct sockaddr_in *)sin)->sin_addr;
++ alen = sizeof(struct in_addr);
++ salen = sizeof(struct sockaddr_in);
++ break;
++ case AF_INET6:
++ ap = (char *)&((struct sockaddr_in6 *)sin)->sin6_addr;
++ alen = sizeof(struct in6_addr);
++ salen = sizeof(struct sockaddr_in6);
++ break;
++ default:
++ break;
++ }
++ if (ap)
++ err = getnameinfo(sin, salen, hname, sizeof(hname),
++ NULL, 0, NI_WITHSCOPEID | NI_NAMEREQD);
++ }
++ if (!err) {
++
++ STRN_CPY(host->name, hname, sizeof(host->name));
++
++ /* reject numeric addresses */
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = sin->sa_family;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
++ if ((err = getaddrinfo(host->name, NULL, &hints, &res0)) == 0) {
++ freeaddrinfo(res0);
++ res0 = NULL;
++ tcpd_warn("host name/name mismatch: "
++ "reverse lookup results in non-FQDN %s",
++ host->name);
++ strcpy(host->name, paranoid); /* name is bad, clobber it */
++ }
++ err = !err;
++ }
++ if (!err) {
++ /* we are now sure that this is non-numeric */
++
++ /*
++ * Verify that the address is a member of the address list returned
++ * by gethostbyname(hostname).
++ *
++ * Verify also that gethostbyaddr() and gethostbyname() return the same
++ * hostname, or rshd and rlogind may still end up being spoofed.
++ *
++ * On some sites, gethostbyname("localhost") returns "localhost.domain".
++ * This is a DNS artefact. We treat it as a special case. When we
++ * can't believe the address list from gethostbyname("localhost")
++ * we're in big trouble anyway.
++ */
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = sin->sa_family;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++ if (getaddrinfo(host->name, NULL, &hints, &res0) != 0) {
++
++ /*
++ * Unable to verify that the host name matches the address. This
++ * may be a transient problem or a botched name server setup.
++ */
++
++ tcpd_warn("can't verify hostname: getaddrinfo(%s, %s) failed",
++ host->name,
++ (sin->sa_family == AF_INET) ? "AF_INET" : "AF_INET6");
++
++ } else if ((res0->ai_canonname == NULL
++ || STR_NE(host->name, res0->ai_canonname))
++ && STR_NE(host->name, "localhost")) {
++
++ /*
++ * The gethostbyaddr() and gethostbyname() calls did not return
++ * the same hostname. This could be a nameserver configuration
++ * problem. It could also be that someone is trying to spoof us.
++ */
++
++ tcpd_warn("host name/name mismatch: %s != %.*s",
++ host->name, STRING_LENGTH,
++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++
++ } else {
++
++ /*
++ * The address should be a member of the address list returned by
++ * gethostbyname(). We should first verify that the h_addrtype
++ * field is AF_INET, but this program has already caused too much
++ * grief on systems with broken library code.
++ */
++
++ for (res = res0; res; res = res->ai_next) {
++ if (res->ai_family != sin->sa_family)
++ continue;
++ switch (res->ai_family) {
++ case AF_INET:
++ rap = (char *)&((struct sockaddr_in *)res->ai_addr)->sin_addr;
++ break;
++ case AF_INET6:
++ /* need to check scope_id */
++ if (((struct sockaddr_in6 *)sin)->sin6_scope_id !=
++ ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id) {
++ continue;
++ }
++ rap = (char *)&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
++ break;
++ default:
++ continue;
++ }
++ if (memcmp(rap, ap, alen) == 0) {
++ freeaddrinfo(res0);
++ return; /* name is good, keep it */
++ }
++ }
++
++ /*
++ * The host name does not map to the initial address. Perhaps
++ * someone has messed up. Perhaps someone compromised a name
++ * server.
++ */
++
++ getnameinfo(sin, salen, hname, sizeof(hname),
++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++ tcpd_warn("host name/address mismatch: %s != %.*s",
++ hname, STRING_LENGTH,
++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++ }
++ strcpy(host->name, paranoid); /* name is bad, clobber it */
++ if (res0)
++ freeaddrinfo(res0);
++ }
++#else /* INET6 */
+ struct sockaddr_in *sin = host->sin;
+ struct hostent *hp;
+ int i;
+@@ -215,6 +407,7 @@
+ }
+ strcpy(host->name, paranoid); /* name is bad, clobber it */
+ }
++#endif /* INET6 */
+ }
+
+ /* sock_sink - absorb unreceived IP datagram */
+@@ -223,7 +416,11 @@
+ int fd;
+ {
+ char buf[BUFSIZ];
++#ifdef INET6
++ struct sockaddr_storage sin;
++#else
+ struct sockaddr_in sin;
++#endif
+ int size = sizeof(sin);
+
+ /*
+Index: src/tcp_wrappers/tcpd.c
+diff -u src/tcp_wrappers/tcpd.c:1.1.1.1 src/tcp_wrappers/tcpd.c:1.2
+--- src/tcp_wrappers/tcpd.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/tcpd.c Tue May 4 21:58:36 1999
+@@ -120,7 +120,12 @@
+
+ /* Report request and invoke the real daemon program. */
+
++#ifdef INET6
++ syslog(allow_severity, "connect from %s (%s)",
++ eval_client(&request), eval_hostaddr(request.client));
++#else
+ syslog(allow_severity, "connect from %s", eval_client(&request));
++#endif
+ closelog();
+ (void) execv(path, argv);
+ syslog(LOG_ERR, "error: cannot execute %s: %m", path);
+Index: src/tcp_wrappers/tcpd.h
+diff -u src/tcp_wrappers/tcpd.h:1.1.1.1 src/tcp_wrappers/tcpd.h:1.7
+--- src/tcp_wrappers/tcpd.h:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/tcpd.h Mon Aug 23 01:32:43 1999
+@@ -11,7 +11,11 @@
+ struct host_info {
+ char name[STRING_LENGTH]; /* access via eval_hostname(host) */
+ char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */
++#ifdef INET6
++ struct sockaddr *sin; /* socket address or 0 */
++#else
+ struct sockaddr_in *sin; /* socket address or 0 */
++#endif
+ struct t_unitdata *unit; /* TLI transport address or 0 */
+ struct request_info *request; /* for shared information */
+ };
+Index: src/tcp_wrappers/tcpdchk.c
+diff -u src/tcp_wrappers/tcpdchk.c:1.1.1.1 src/tcp_wrappers/tcpdchk.c:1.5
+--- src/tcp_wrappers/tcpdchk.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/tcpdchk.c Fri May 5 18:28:13 2000
+@@ -22,6 +22,9 @@
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -397,6 +400,31 @@
+ }
+ }
+
++#ifdef INET6
++static int is_inet6_addr(pat)
++ char *pat;
++{
++ struct addrinfo hints, *res;
++ int len, ret;
++ char ch;
++
++ if (*pat != '[')
++ return (0);
++ len = strlen(pat);
++ if ((ch = pat[len - 1]) != ']')
++ return (0);
++ pat[len - 1] = '\0';
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if ((ret = getaddrinfo(pat + 1, NULL, &hints, &res)) == 0)
++ freeaddrinfo(res);
++ pat[len - 1] = ch;
++ return (ret == 0);
++}
++#endif
++
+ /* check_host - criticize host pattern */
+
+ static int check_host(pat)
+@@ -423,14 +451,27 @@
+ #endif
+ #endif
+ } else if (mask = split_at(pat, '/')) { /* network/netmask */
++#ifdef INET6
++ int mask_len;
++
++ if ((dot_quad_addr(pat) == INADDR_NONE
++ || dot_quad_addr(mask) == INADDR_NONE)
++ && (!is_inet6_addr(pat)
++ || ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
++#else
+ if (dot_quad_addr(pat) == INADDR_NONE
+ || dot_quad_addr(mask) == INADDR_NONE)
++#endif
+ tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
+ } else if (STR_EQ(pat, "FAIL")) { /* obsolete */
+ tcpd_warn("FAIL is no longer recognized");
+ tcpd_warn("(use EXCEPT or DENY instead)");
+ } else if (reserved_name(pat)) { /* other reserved */
+ /* void */ ;
++#ifdef INET6
++ } else if (is_inet6_addr(pat)) { /* IPv6 address */
++ addr_count = 1;
++#endif
+ } else if (NOT_INADDR(pat)) { /* internet name */
+ if (pat[strlen(pat) - 1] == '.') {
+ tcpd_warn("%s: domain or host name ends in dot", pat);
+Index: src/tcp_wrappers/tcpdmatch.c
+diff -u src/tcp_wrappers/tcpdmatch.c:1.1.1.1 src/tcp_wrappers/tcpdmatch.c:1.7
+--- src/tcp_wrappers/tcpdmatch.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/tcpdmatch.c Fri May 5 19:06:40 2000
+@@ -57,7 +57,11 @@
+ int argc;
+ char **argv;
+ {
++#ifdef INET6
++ struct addrinfo hints, *hp, *res;
++#else
+ struct hostent *hp;
++#endif
+ char *myname = argv[0];
+ char *client;
+ char *server;
+@@ -68,8 +72,13 @@
+ int ch;
+ char *inetcf = 0;
+ int count;
++#ifdef INET6
++ struct sockaddr_storage server_sin;
++ struct sockaddr_storage client_sin;
++#else
+ struct sockaddr_in server_sin;
+ struct sockaddr_in client_sin;
++#endif
+ struct stat st;
+
+ /*
+@@ -172,13 +181,20 @@
+ if (NOT_INADDR(server) == 0 || HOSTNAME_KNOWN(server)) {
+ if ((hp = find_inet_addr(server)) == 0)
+ exit(1);
++#ifndef INET6
+ memset((char *) &server_sin, 0, sizeof(server_sin));
+ server_sin.sin_family = AF_INET;
++#endif
+ request_set(&request, RQ_SERVER_SIN, &server_sin, 0);
+
++#ifdef INET6
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&server_sin, res->ai_addr, res->ai_addrlen);
++#else
+ for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ memcpy((char *) &server_sin.sin_addr, addr,
+ sizeof(server_sin.sin_addr));
++#endif
+
+ /*
+ * Force evaluation of server host name and address. Host name
+@@ -194,7 +210,11 @@
+ fprintf(stderr, "Please specify an address instead\n");
+ exit(1);
+ }
++#ifdef INET6
++ freeaddrinfo(hp);
++#else
+ free((char *) hp);
++#endif
+ } else {
+ request_set(&request, RQ_SERVER_NAME, server, 0);
+ }
+@@ -208,6 +228,18 @@
+ tcpdmatch(&request);
+ exit(0);
+ }
++#ifdef INET6
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(client, NULL, &hints, &res) == 0) {
++ freeaddrinfo(res);
++ request_set(&request, RQ_CLIENT_ADDR, client, 0);
++ tcpdmatch(&request);
++ exit(0);
++ }
++#endif
+
+ /*
+ * Perhaps they are testing special client hostname patterns that aren't
+@@ -229,6 +261,34 @@
+ */
+ if ((hp = find_inet_addr(client)) == 0)
+ exit(1);
++#ifdef INET6
++ request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
++
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&client_sin, res->ai_addr, res->ai_addrlen);
++
++ /*
++ * getnameinfo() doesn't do reverse lookup against link-local
++ * address. So, we pass through host name evaluation against
++ * such addresses.
++ */
++ if (res->ai_family != AF_INET6 ||
++ !IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr)) {
++ /*
++ * Force evaluation of client host name and address. Host name
++ * conflicts will be reported while eval_hostname() does its job.
++ */
++ request_set(&request, RQ_CLIENT_NAME, "", RQ_CLIENT_ADDR, "", 0);
++ if (STR_EQ(eval_hostname(request.client), unknown))
++ tcpd_warn("host address %s->name lookup failed",
++ eval_hostaddr(request.client));
++ }
++ tcpdmatch(&request);
++ if (res->ai_next)
++ printf("\n");
++ }
++ freeaddrinfo(hp);
++#else
+ memset((char *) &client_sin, 0, sizeof(client_sin));
+ client_sin.sin_family = AF_INET;
+ request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
+@@ -250,6 +310,7 @@
+ printf("\n");
+ }
+ free((char *) hp);
++#endif
+ exit(0);
+ }
+
+Index: src/tcp_wrappers/tli.c
+diff -u src/tcp_wrappers/tli.c:1.1.1.1 src/tcp_wrappers/tli.c:1.4
+--- src/tcp_wrappers/tli.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/tli.c Fri May 5 19:15:09 2000
+@@ -65,8 +65,13 @@
+ void tli_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ static struct sockaddr_storage client;
++ static struct sockaddr_storage server;
++#else
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
++#endif
+
+ /*
+ * If we discover that we are using an IP transport, pretend we never
+@@ -76,14 +81,29 @@
+
+ tli_endpoints(request);
+ if ((request->config = tli_transport(request->fd)) != 0
++#ifdef INET6
++ && (STR_EQ(request->config->nc_protofmly, "inet") ||
++ STR_EQ(request->config->nc_protofmly, "inet6"))) {
++#else
+ && STR_EQ(request->config->nc_protofmly, "inet")) {
++#endif
+ if (request->client->unit != 0) {
++#ifdef INET6
++ client = *(struct sockaddr_storage *) request->client->unit->addr.buf;
++ request->client->sin = (struct sockaddr *) &client;
++#else
+ client = *(struct sockaddr_in *) request->client->unit->addr.buf;
+ request->client->sin = &client;
++#endif
+ }
+ if (request->server->unit != 0) {
++#ifdef INET6
++ server = *(struct sockaddr_storage *) request->server->unit->addr.buf;
++ request->server->sin = (struct sockaddr *) &server;
++#else
+ server = *(struct sockaddr_in *) request->server->unit->addr.buf;
+ request->server->sin = &server;
++#endif
+ }
+ tli_cleanup(request);
+ sock_methods(request);
+@@ -187,7 +207,15 @@
+ }
+ while (config = getnetconfig(handlep)) {
+ if (stat(config->nc_device, &from_config) == 0) {
++#ifdef NO_CLONE_DEVICE
++ /*
++ * If the network devices are not cloned (as is the case for
++ * Solaris 8 Beta), we must compare the major device numbers.
++ */
++ if (major(from_config.st_rdev) == major(from_client.st_rdev))
++#else
+ if (minor(from_config.st_rdev) == major(from_client.st_rdev))
++#endif
+ break;
+ }
+ }
+Index: src/tcp_wrappers/update.c
+diff -u src/tcp_wrappers/update.c:1.1.1.1 src/tcp_wrappers/update.c:1.3
+--- src/tcp_wrappers/update.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/update.c Mon Aug 23 01:32:43 1999
+@@ -46,10 +46,18 @@
+ request->fd = va_arg(ap, int);
+ continue;
+ case RQ_CLIENT_SIN:
++#ifdef INET6
++ request->client->sin = va_arg(ap, struct sockaddr *);
++#else
+ request->client->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ continue;
+ case RQ_SERVER_SIN:
++#ifdef INET6
++ request->server->sin = va_arg(ap, struct sockaddr *);
++#else
+ request->server->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ continue;
+
+ /*
+Index: src/tcp_wrappers/workarounds.c
+diff -u src/tcp_wrappers/workarounds.c:1.1.1.1 src/tcp_wrappers/workarounds.c:1.3
+--- src/tcp_wrappers/workarounds.c:1.1.1.1 Tue May 4 21:56:04 1999
++++ src/tcp_wrappers/workarounds.c Mon Aug 23 01:32:43 1999
+@@ -166,11 +166,22 @@
+ int *len;
+ {
+ int ret;
++#ifdef INET6
++ struct sockaddr *sin = sa;
++#else
+ struct sockaddr_in *sin = (struct sockaddr_in *) sa;
++#endif
+
+ if ((ret = getpeername(sock, sa, len)) >= 0
++#ifdef INET6
++ && ((sin->su_si.si_family == AF_INET6
++ && IN6_IS_ADDR_UNSPECIFIED(&sin->su_sin6.sin6_addr))
++ || (sin->su_si.si_family == AF_INET
++ && sin->su_sin.sin_addr.s_addr == 0))) {
++#else
+ && sa->sa_family == AF_INET
+ && sin->sin_addr.s_addr == 0) {
++#endif
+ errno = ENOTCONN;
+ return (-1);
+ } else {
+--- src/tcp_wrappers/hosts_access.c 2003-08-04 21:36:20.000000000 +0000
++++ src/tcp_wrappers/hosts_access.c 2003-08-04 21:45:59.000000000 +0000
+@@ -24,7 +24,13 @@
+ /* System libraries. */
+
+ #include <sys/types.h>
++#ifdef INT32_T
++ typedef uint32_t u_int32_t;
++#endif
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -33,6 +39,9 @@
+ #include <errno.h>
+ #include <setjmp.h>
+ #include <string.h>
++#ifdef INET6
++#include <netdb.h>
++#endif
+
+ extern char *fgets();
+ extern int errno;
+@@ -83,6 +92,10 @@
+ static int host_match();
+ static int string_match();
+ static int masked_match();
++#ifdef INET6
++static int masked_match4();
++static int masked_match6();
++#endif
+
+ /* Size of logical line buffer. */
+
+@@ -312,6 +325,13 @@
+ {
+ int n;
+
++#ifdef INET6
++ /* convert IPv4 mapped IPv6 address to IPv4 address */
++ if (STRN_EQ(string, "::ffff:", 7)
++ && dot_quad_addr(string + 7) != INADDR_NONE) {
++ string += 7;
++ }
++#endif
+ #ifndef DISABLE_WILDCARD_MATCHING
+ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */
+ /* we must convert the both to lowercase as match_pattern_ylo is case-sensitive */
+@@ -333,21 +353,72 @@
+ } else if (tok[(n = strlen(tok)) - 1] == '.') { /* prefix */
+ return (STRN_EQ(tok, string, n));
+ } else { /* exact match */
++#ifdef INET6
++ struct addrinfo hints, *res;
++ struct sockaddr_in6 pat, addr;
++ int len, ret;
++ char ch;
++
++ len = strlen(tok);
++ if (*tok == '[' && tok[len - 1] == ']') {
++ ch = tok[len - 1];
++ tok[len - 1] = '\0';
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if ((ret = getaddrinfo(tok + 1, NULL, &hints, &res)) == 0) {
++ memcpy(&pat, res->ai_addr, sizeof(pat));
++ freeaddrinfo(res);
++ }
++ tok[len - 1] = ch;
++ if (ret != 0 || getaddrinfo(string, NULL, &hints, &res) != 0)
++ return NO;
++ memcpy(&addr, res->ai_addr, sizeof(addr));
++ freeaddrinfo(res);
++#ifdef NI_WITHSCOPEID
++ if (pat.sin6_scope_id != 0 &&
++ addr.sin6_scope_id != pat.sin6_scope_id)
++ return NO;
++#endif
++ return (!memcmp(&pat.sin6_addr, &addr.sin6_addr,
++ sizeof(struct in6_addr)));
++ return (ret);
++ }
++#endif
+ return (STR_EQ(tok, string));
+ }
+ }
+
+ /* masked_match - match address against netnumber/netmask */
+
++#ifdef INET6
+ static int masked_match(net_tok, mask_tok, string)
+ char *net_tok;
+ char *mask_tok;
+ char *string;
+ {
++ return (masked_match4(net_tok, mask_tok, string) ||
++ masked_match6(net_tok, mask_tok, string));
++}
++
++static int masked_match4(net_tok, mask_tok, string)
++#else
++static int masked_match(net_tok, mask_tok, string)
++#endif
++char *net_tok;
++char *mask_tok;
++char *string;
++{
++#ifdef INET6
++ u_int32_t net;
++ u_int32_t mask;
++ u_int32_t addr;
++#else
+ unsigned long net;
+ unsigned long mask;
+ unsigned long addr;
+-
++#endif
+ /*
+ * Disallow forms other than dotted quad: the treatment that inet_addr()
+ * gives to forms with less than four components is inconsistent with the
+@@ -358,12 +429,81 @@
+ return (NO);
+ if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+ || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++#ifndef INET6
+ tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
++#endif
+ return (NO); /* not tcpd_jump() */
+ }
+ return ((addr & mask) == net);
+ }
+
++#ifdef INET6
++static int masked_match6(net_tok, mask_tok, string)
++char *net_tok;
++char *mask_tok;
++char *string;
++{
++ struct addrinfo hints, *res;
++ struct sockaddr_in6 net, addr;
++ u_int32_t mask;
++ int len, mask_len, i = 0;
++ char ch;
++
++ /*
++ * Behavior of getaddrinfo() against IPv4-mapped IPv6 address is
++ * different between KAME and Solaris8. While KAME returns
++ * AF_INET6, Solaris8 returns AF_INET. So, we avoid this here.
++ */
++ if (STRN_EQ(string, "::ffff:", 7)
++ && dot_quad_addr(string + 7) != INADDR_NONE)
++ return (masked_match4(net_tok, mask_tok, string + 7));
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(string, NULL, &hints, &res) != 0)
++ return NO;
++ memcpy(&addr, res->ai_addr, sizeof(addr));
++ freeaddrinfo(res);
++
++ /* match IPv6 address against netnumber/prefixlen */
++ len = strlen(net_tok);
++ if (*net_tok != '[' || net_tok[len - 1] != ']')
++ return NO;
++ ch = net_tok[len - 1];
++ net_tok[len - 1] = '\0';
++ if (getaddrinfo(net_tok + 1, NULL, &hints, &res) != 0) {
++ net_tok[len - 1] = ch;
++ return NO;
++ }
++ memcpy(&net, res->ai_addr, sizeof(net));
++ freeaddrinfo(res);
++ net_tok[len - 1] = ch;
++ if ((mask_len = atoi(mask_tok)) < 0 || mask_len > 128)
++ return NO;
++
++#ifdef NI_WITHSCOPEID
++ if (net.sin6_scope_id != 0 && addr.sin6_scope_id != net.sin6_scope_id)
++ return NO;
++#endif
++ while (mask_len > 0) {
++ if (mask_len < 32) {
++ mask = htonl(~(0xffffffff >> mask_len));
++ if ((*(u_int32_t *)&addr.sin6_addr.s6_addr[i] & mask) != (*(u_int32_t *)&net.sin6_addr.s6_addr[i] & mask))
++ return NO;
++ break;
++ }
++ if (*(u_int32_t *)&addr.sin6_addr.s6_addr[i] != *(u_int32_t *)&net.sin6_addr.s6_addr[i])
++ return NO;
++ i += 4;
++ mask_len -= 32;
++ }
++ return YES;
++}
++#endif /* INET6 */
++
++
+ #ifndef DISABLE_WILDCARD_MATCHING
+ /* Note: this feature has been adapted in a pretty straightforward way
+ from Tatu Ylonen's last SSH version under free license by
+--- src/tcp_wrappers/hosts_access.5 2003-08-04 21:52:29.000000000 +0000
++++ src/tcp_wrappers/hosts_access.5 2003-08-04 21:53:39.000000000 +0000
+@@ -85,7 +85,7 @@
+ for daemon process names or for client user names.
+ .IP \(bu
+ An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
+-`net/mask\' pair. A host address is matched if `net\' is equal to the
++`net/mask\' pair. A IPv4 host address is matched if `net\' is equal to the
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
+@@ -96,6 +96,13 @@
+ zero or more lines with zero or more host name or address patterns
+ separated by whitespace. A file name pattern can be used anywhere
+ a host name or address pattern can be used.
++.IP \(bu
++An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a
++`[net]/prefixlen\' pair. A IPv6 host address is matched if
++`prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the
++address. For example, the [net]/prefixlen pattern
++`[3ffe:505:2:1::]/64\' matches every address in the range
++`3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'.
+ .SH WILDCARDS
+ The access control language supports explicit wildcards:
+ .IP ALL
diff --git a/core/tcp_wrappers/try-from.8 b/core/tcp_wrappers/try-from.8
new file mode 100644
index 000000000..9c8f30543
--- /dev/null
+++ b/core/tcp_wrappers/try-from.8
@@ -0,0 +1,28 @@
+.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+try-from \- test program for the tcp_wrapper
+.SH SYNOPSIS
+.B try-from
+.SH DESCRIPTION
+The
+.B try-from
+command can be called via a remote shell command to find out
+if the hostname and address are properly recognized
+by the
+.B tcp_wrapper
+library, if username lookup works, and (SysV only) if the TLI
+on top of IP heuristics work. Diagnostics are reported through
+.BR syslog (3)
+and redirected to stderr.
+
+Example:
+
+rsh host /some/where/try-from
+
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/core/texinfo/PKGBUILD b/core/texinfo/PKGBUILD
new file mode 100644
index 000000000..c660deb2e
--- /dev/null
+++ b/core/texinfo/PKGBUILD
@@ -0,0 +1,30 @@
+# $Id: PKGBUILD 102128 2010-12-06 05:33:18Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
+
+pkgname=texinfo
+pkgver=4.13a
+pkgrel=5
+pkgdesc="Utilities to work with and produce manuals, ASCII text, and on-line documentation from a single source file"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/texinfo/"
+license=('GPL3')
+groups=('base')
+depends=('ncurses' 'findutils' 'gzip')
+install=texinfo.install
+source=(ftp://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz)
+md5sums=('71ba711519209b5fb583fed2b3d86fcb')
+
+build() {
+ cd ${srcdir}/${pkgname}-4.13
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-4.13
+ make DESTDIR=${pkgdir} install
+
+ # fix this here as it prevent make from trying to rebuild manual pages
+ sed -i 's#A-z#A-Za-z#' ${pkgdir}/usr/bin/texi2dvi
+}
diff --git a/core/texinfo/texinfo.install b/core/texinfo/texinfo.install
new file mode 100644
index 000000000..f1554e4f4
--- /dev/null
+++ b/core/texinfo/texinfo.install
@@ -0,0 +1,21 @@
+infodir=usr/share/info
+filelist=(info.info info-stnd.info texinfo texinfo-1 texinfo-2 texinfo-3)
+
+post_install() {
+ # Scan *all* info files on install
+ for file in $(find $infodir -type f ! -name dir); do
+ install-info $file $infodir/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+pre_remove() {
+ for file in ${filelist[@]}; do
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/tzdata/Makefile.patch b/core/tzdata/Makefile.patch
new file mode 100644
index 000000000..e88f9d907
--- /dev/null
+++ b/core/tzdata/Makefile.patch
@@ -0,0 +1,140 @@
+diff -Naur src/Makefile src-p/Makefile
+--- src/Makefile 2007-08-20 16:47:41.000000000 +0200
++++ src-p/Makefile 2007-10-02 04:07:44.000000000 +0200
+@@ -34,17 +34,17 @@
+
+ # Everything gets put in subdirectories of. . .
+
+-TOPDIR= /usr/local
++TOPDIR= $(DESTDIR)/usr
+
+ # "Compiled" time zone information is placed in the "TZDIR" directory
+ # (and subdirectories).
+ # Use an absolute path name for TZDIR unless you're just testing the software.
+
+-TZDIR= $(TOPDIR)/etc/zoneinfo
++TZDIR= $(TOPDIR)/share/zoneinfo
+
+ # The "tzselect", "zic", and "zdump" commands get installed in. . .
+
+-ETCDIR= $(TOPDIR)/etc
++SBINDIR= $(TOPDIR)/sbin
+
+ # If you "make INSTALL", the "date" command gets installed in. . .
+
+@@ -52,7 +52,7 @@
+
+ # Manual pages go in subdirectories of. . .
+
+-MANDIR= $(TOPDIR)/man
++MANDIR= $(TOPDIR)/share/man
+
+ # Library functions are put in an archive in LIBDIR.
+
+@@ -83,7 +83,7 @@
+
+ # Non-default libraries needed to link.
+ # Add -lintl if you want to use `gettext' on Solaris.
+-LDLIBS=
++LDLIBS=$(LDFLAGS)
+
+ # Add the following to the end of the "CFLAGS=" line as needed.
+ # -Dconst= if `const' does not work (SunOS 4.x cc, OSF1 V5.0 cc)
+@@ -211,7 +211,7 @@
+ # before the first Monday in January when a "%V" format is used and January 1
+ # falls on a Friday, Saturday, or Sunday.
+
+-CFLAGS=
++CFLAGS += -std=gnu99
+
+ # If you want zic's -s option used when installing, uncomment the next line
+ # ZFLAGS= -s
+@@ -220,7 +220,7 @@
+ ZIC= $(zic) $(ZFLAGS)
+
+ # The name of a Posix-compliant `awk' on your system.
+-AWK= nawk
++AWK= awk
+
+ # The path where SGML DTDs are kept.
+ SGML_SEARCH_PATH= $(TOPDIR)/share/doc/sgml-lib/REC-html401-19991224/
+@@ -241,8 +241,10 @@
+
+ ###############################################################################
+
+-cc= cc
+-CC= $(cc) -DTZDIR=\"$(TZDIR)\"
++CC+= -DTZDIR=\"$(TZDIR)\"
++ifeq ($(NLS),1)
++CC += -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\"
++endif
+
+ TZCSRCS= zic.c localtime.c asctime.c scheck.c ialloc.c
+ TZCOBJS= zic.o localtime.o asctime.o scheck.o ialloc.o
+@@ -282,14 +284,16 @@
+
+ ALL: all date
+
+-install: all $(DATA) $(REDO) $(TZLIB) $(MANS) $(TABDATA)
++install: all $(DATA) $(REDO) $(MANS) $(TABDATA)
+ $(ZIC) -y $(YEARISTYPE) \
+ -d $(TZDIR) -l $(LOCALTIME) -p $(POSIXRULES)
+ -rm -f $(TZDIR)/iso3166.tab $(TZDIR)/zone.tab
+ cp iso3166.tab zone.tab $(TZDIR)/.
+- -mkdir $(TOPDIR) $(ETCDIR)
+- cp tzselect zic zdump $(ETCDIR)/.
+- -mkdir $(TOPDIR) $(MANDIR) \
++ -mkdir -p $(TOPDIR) $(SBINDIR)
++ cp zic zdump $(SBINDIR)/.
++ -mkdir -p $(TOPDIR) $(BINDIR)
++ cp tzselect $(BINDIR)/.
++ -mkdir -p $(TOPDIR) $(MANDIR) \
+ $(MANDIR)/man3 $(MANDIR)/man5 $(MANDIR)/man8
+ -rm -f $(MANDIR)/man3/newctime.3 \
+ $(MANDIR)/man3/newtzset.3 \
+@@ -298,13 +302,11 @@
+ $(MANDIR)/man8/zdump.8 \
+ $(MANDIR)/man8/zic.8
+ cp newctime.3 newtzset.3 $(MANDIR)/man3/.
+- cp tzfile.5 $(MANDIR)/man5/.
+- cp tzselect.8 zdump.8 zic.8 $(MANDIR)/man8/.
+
+ INSTALL: ALL install date.1
+- -mkdir $(TOPDIR) $(BINDIR)
++ -mkdir -p $(TOPDIR) $(BINDIR)
+ cp date $(BINDIR)/.
+- -mkdir $(TOPDIR) $(MANDIR) $(MANDIR)/man1
++ -mkdir -p $(TOPDIR) $(MANDIR) $(MANDIR)/man1
+ -rm -f $(MANDIR)/man1/date.1
+ cp date.1 $(MANDIR)/man1/.
+
+@@ -334,9 +336,9 @@
+ # You must replace all of $(TZDIR) to switch from not using leap seconds
+ # to using them, or vice versa.
+ other_two: zic leapseconds $(TDATA)
+- $(ZIC) -y $(YEARISTYPE) -d $(TZDIR)-posix -L /dev/null $(TDATA)
++ $(ZIC) -y $(YEARISTYPE) -d $(TZDIR)/posix -L /dev/null $(TDATA)
+ $(ZIC) -y $(YEARISTYPE) \
+- -d $(TZDIR)-leaps -L leapseconds $(TDATA)
++ -d $(TZDIR)/right -L leapseconds $(TDATA)
+
+ posix_right: posix_only other_two
+
+@@ -367,7 +369,7 @@
+ <$? >$@
+ chmod +x $@
+
+-check: check_tables check_web
++check: check_tables
+
+ check_tables: checktab.awk $(PRIMARY_YDATA)
+ $(AWK) -f checktab.awk $(PRIMARY_YDATA)
+diff -Naur src/tzselect.ksh src-p/tzselect.ksh
+--- src/tzselect.ksh 2007-08-20 16:47:42.000000000 +0200
++++ src-p/tzselect.ksh 2007-10-02 04:07:44.000000000 +0200
+@@ -1,4 +1,4 @@
+-#! /bin/ksh
++#! /bin/bash
+
+ # '@(#)tzselect.ksh 8.1'
+
diff --git a/core/tzdata/PKGBUILD b/core/tzdata/PKGBUILD
new file mode 100644
index 000000000..2815732c9
--- /dev/null
+++ b/core/tzdata/PKGBUILD
@@ -0,0 +1,40 @@
+# $Id: PKGBUILD 114729 2011-03-15 19:46:03Z andyrtr $
+# Maintainer: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=tzdata
+pkgver=2011d
+pkgrel=1
+_tzcode=2011d
+_tzdata=2011d
+pkgdesc="Sources for time zone and daylight saving time data"
+arch=('i686' 'x86_64')
+url="http://www.twinsun.com/tz/tz-link.htm"
+license=('GPL')
+depends=()
+makedepends=()
+optdepends=('sh: required by tzselect')
+options=('!emptydirs')
+source=(ftp://elsie.nci.nih.gov/pub/tzcode${_tzcode}.tar.gz \
+ ftp://elsie.nci.nih.gov/pub/${pkgname}${_tzdata}.tar.gz \
+ Makefile.patch)
+md5sums=('95095242ee368e6a7e107f154590ac11'
+ '03c5793502b7c41985edd73146bf7e36'
+ 'a64ed97d1fc03c66ee8612c0d9f40507')
+
+build() {
+ cd ${srcdir}
+
+ tar -xf tzcode${_tzcode}.tar.gz
+ tar -xf ${pkgname}${_tzdata}.tar.gz
+
+ patch -Np1 -i "${srcdir}/Makefile.patch"
+
+ make
+}
+
+package() {
+ cd ${srcdir}
+ make DESTDIR="${pkgdir}" install
+
+ rm "${pkgdir}/usr/share/zoneinfo/localtime"
+}
diff --git a/core/udev/80-drivers.rules b/core/udev/80-drivers.rules
new file mode 100644
index 000000000..56ac06cb4
--- /dev/null
+++ b/core/udev/80-drivers.rules
@@ -0,0 +1,14 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="drivers_end"
+
+DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/lib/udev/load-modules.sh $env{MODALIAS}"
+SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/lib/udev/load-modules.sh tifm_sd"
+SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/lib/udev/load-modules.sh tifm_ms"
+SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh ms_block"
+SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh mspro_block"
+SUBSYSTEM=="i2o", RUN+="/lib/udev/load-modules.sh i2o_block"
+SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/lib/udev/load-modules.sh sg"
+SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/lib/udev/load-modules.sh ppdev"
+
+LABEL="drivers_end"
diff --git a/core/udev/81-arch.rules b/core/udev/81-arch.rules
new file mode 100644
index 000000000..21127a729
--- /dev/null
+++ b/core/udev/81-arch.rules
@@ -0,0 +1,138 @@
+# Udev rules for Archlinux by Tobias Powalowski <tpowa@archlinux.org>
+# do not edit this file, it will be overwritten on update
+#
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %k the kernel name for the device.
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute.
+# %% the '%' char itself.
+#
+# There are a number of modifiers that are allowed to be used in some of the
+# fields. See the udev man page for a full description of them.
+# global stuff
+#
+
+#####################################
+###### Hotplug rules - begin
+# Only additional modules,
+# which are not detectable,
+# are loaded here!
+#####################################
+# check if the device has already been claimed by a driver
+ACTION!="add", GOTO="drivers_end"
+
+# SOUND addon modules
+SUBSYSTEM=="sound", RUN+="/lib/udev/load-modules.sh snd-pcm-oss"
+SUBSYSTEM=="sound", RUN+="/lib/udev/load-modules.sh snd-seq-oss"
+
+#PNP addon modules
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP0800", RUN+="/lib/udev/load-modules.sh pcspkr"
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="*PNP051[01]*", RUN+="/lib/udev/load-modules.sh irtty-sir"
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNPb02f", RUN+="/lib/udev/load-modules.sh analog"
+
+# PARPORT addon modules
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP040*", RUN+="/lib/udev/load-modules.sh lp"
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP040*", RUN+="/lib/udev/load-modules.sh ppdev"
+
+# fix ide cdrom detection on old proliant servers
+SUBSYSTEM=="pci", ENV{MODALIAS}=="pci:v00000E11d00000001sv00000000sd00000000bc06sc02i00", RUN+="/lib/udev/load-modules.sh ide-generic"
+
+LABEL="drivers_end"
+#####################################
+##### Hotplug rules - end
+#####################################
+
+#####################################
+###### CD/DVD symlinks - begin
+#####################################
+ACTION=="add|change", SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", IMPORT="cdrom_id --export $tempnode"
+ACTION=="add|change", SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", IMPORT="cdrom_id --export $tempnode"
+ACTION=="add|change", SUBSYSTEMS=="scsi", KERNEL=="scd[a-z]", IMPORT="cdrom_id --export $tempnode"
+ENV{ID_CDROM}=="?*", SYMLINK+="cd/cdrom-%b"
+ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cd/cdrw-%b"
+ENV{ID_CDROM_DVD}=="?*", SYMLINK+="cd/dvd-%b"
+ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+="cd/dvdrw-%b"
+ACTION=="add|change", SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", ATTRS{media}=="cdrom*", RUN+="cdsymlinks.sh"
+ACTION=="add|change", SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", ATTRS{type}=="5", RUN+="cdsymlinks.sh"
+ACTION=="add|change", SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="5", RUN+="cdsymlinks.sh"
+ACTION=="remove", SUBSYSTEMS=="block", KERNEL=="hd[a-z]", RUN+="cdsymlinks.sh"
+ACTION=="remove", SUBSYSTEMS=="block", KERNEL=="sr[0-9]*", RUN+="cdsymlinks.sh"
+ACTION=="remove", SUBSYSTEMS=="block", KERNEL=="sg[0-9]*", RUN+="cdsymlinks.sh"
+#####################################
+###### CD/DVD symlinks - end
+#####################################
+
+#####################################
+# Additional Archlinux
+# Permissions and Symlinks - begin
+#####################################
+
+# permission for sg devices
+KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0660"
+
+# permissions for IDE CD devices
+SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", ATTRS{media}=="cdrom*", GROUP="optical"
+
+# permissions for SCSI CD devices
+SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", ATTRS{type}=="5", SYMLINK+="scd%n", GROUP="optical"
+SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="5", GROUP="optical"
+
+# permissions for removable devices like cardreaders or sticks
+KERNEL=="sd*", ATTRS{scsi_level}=="3", ATTRS{type}=="0", GROUP="storage"
+
+# permissions for firewire external drives
+KERNEL=="sd*", ATTRS{scsi_level}=="5", GROUP="storage"
+
+# permissions for usb to scsi external adapters
+KERNEL=="sd*", ATTRS{scsi_level}=="3", ATTRS{type}=="7", GROUP="storage"
+
+# permissions for ide storage like pcmcia card readers
+ACTION!="add", GOTO="pcmcia_end"
+SUBSYSTEM!="block", GOTO="pcmcia_end"
+KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
+KERNEL=="hd*", IMPORT{parent}=="ID_*"
+KERNEL=="hd*", ENV{ID_TYPE}=="generic", GROUP="storage"
+LABEL="pcmcia_end"
+
+# permissions for SCSI scanners
+SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="6", GROUP="scanner"
+
+# mem
+KERNEL=="ram0", SYMLINK+="ramdisk"
+KERNEL=="ram1", SYMLINK+="ram"
+
+# video4linux
+
+KERNEL=="vbi0", SYMLINK+="vbi"
+KERNEL=="radio0", SYMLINK+="radio"
+KERNEL=="radio[0-9]*", GROUP="video"
+KERNEL=="video0", SYMLINK+="video"
+KERNEL=="vtx0", SYMLINK+="vtx"
+
+# video devices
+### xorg resets those permissions, adjust your xorg.conf!
+KERNEL=="3dfx*", GROUP="video"
+KERNEL=="fb[0-9]*", GROUP="video"
+
+# misc
+KERNEL=="sgi_fetchop", MODE="0666"
+KERNEL=="sonypi", MODE="0666"
+
+# USB devices
+KERNEL=="legousbtower*", MODE="0666"
+
+# kbd devices
+KERNEL=="kbd", MODE="0664"
+
+# miscellaneous
+KERNEL=="rtc|rtc0", GROUP="audio", MODE="0664"
+#######################################
+# Permissions and Symlinks - end
+#######################################
diff --git a/core/udev/PKGBUILD b/core/udev/PKGBUILD
new file mode 100644
index 000000000..5f64aaaa7
--- /dev/null
+++ b/core/udev/PKGBUILD
@@ -0,0 +1,112 @@
+# $Id: PKGBUILD 109960 2011-02-14 14:00:15Z tpowa $
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgbase="udev"
+pkgname=('udev' 'udev-compat')
+pkgver=166
+pkgrel=2
+arch=(i686 x86_64)
+url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
+license=('GPL')
+groups=('base')
+# older initscripts versions required start_udev
+options=(!makeflags !libtool)
+makedepends=('glibc' 'coreutils' 'util-linux' 'pciutils' 'libusb-compat' 'glib2' 'kernel26' 'gperf' 'libxslt' 'gobject-introspection')
+source=(http://www.kernel.org/pub/linux/utils/kernel/hotplug/$pkgname-$pkgver.tar.bz2
+ 80-drivers.rules
+ 81-arch.rules
+ load-modules.sh
+ cdsymlinks.sh)
+md5sums=('4db27d73fdbe94f47fd89fdd105c2dfb'
+ '4427855146513a4703ab5c7eb8a0156e'
+ 'f17c99779173ddc79f866cf3a5de5e68'
+ 'f91fddc67609b45b244a624977c4247b'
+ '2e808ee78d237c478b57af2a68d43769')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ ./configure --sysconfdir=/etc --with-rootlibdir=/lib --libexecdir=/lib/udev\
+ --sbindir=/sbin --with-systemdsystemunitdir=/lib/systemd/system
+ make
+}
+
+package_udev() {
+ pkgdesc="The userspace dev tools (udev)"
+ depends=('glibc' 'coreutils' 'util-linux' 'libusb-compat' 'glib2'
+ 'module-init-tools>=3.11' 'pciutils')
+ install=udev.install
+ backup=(etc/udev/udev.conf
+ etc/modprobe.d/framebuffer_blacklist.conf)
+ conflicts=('pcmcia-cs' 'hotplug' 'initscripts<2009.07')
+ replaces=('devfsd')
+
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=${pkgdir} install
+ # Replace original 80-drivers.rules with custom one.
+ install -D -m644 $srcdir/80-drivers.rules $pkgdir/lib/udev/rules.d/80-drivers.rules
+ # Install our rule for permissions and symlinks
+ install -D -m644 $srcdir/81-arch.rules $pkgdir/lib/udev/rules.d/81-arch.rules
+ # install our module loading subsystem
+ install -D -m755 $srcdir/load-modules.sh $pkgdir/lib/udev/load-modules.sh
+ # install cdsymlinks.sh
+ install -D -m755 $srcdir/cdsymlinks.sh $pkgdir/lib/udev/cdsymlinks.sh
+ # disable error logging to prevent startup failures printed to vc on boot
+ sed -i -e 's|udev_log="err"|udev_log="0"|g' $pkgdir/etc/udev/udev.conf
+ # disable persistent cdromsymlinks and network by default
+ # and move it to /etc/udev/rules.d
+ mv $pkgdir/lib/udev/rules.d/75-persistent-net-generator.rules \
+ $pkgdir/etc/udev/rules.d/75-persistent-net-generator.rules.optional
+ mv $pkgdir/lib/udev/rules.d/75-cd-aliases-generator.rules \
+ $pkgdir/etc/udev/rules.d/75-cd-aliases-generator.rules.optional
+
+ # create framebuffer blacklist
+ mkdir -p $pkgdir/etc/modprobe.d/
+ for mod in $(find /lib/modules/*/kernel/drivers/video -name '*fb.ko.gz' -exec basename {} .ko.gz \;); do
+ echo "blacklist $mod"
+ done | sort -u > $pkgdir/etc/modprobe.d/framebuffer_blacklist.conf
+
+ # create static devices in /lib/udev/devices/
+ mkdir ${pkgdir}/lib/udev/devices/pts
+ mkdir ${pkgdir}/lib/udev/devices/shm
+
+ mknod -m 0600 ${pkgdir}/lib/udev/devices/console c 5 1
+ mknod -m 0666 ${pkgdir}/lib/udev/devices/null c 1 3
+ mknod -m 0660 ${pkgdir}/lib/udev/devices/zero c 1 5
+ mknod -m 0666 ${pkgdir}/lib/udev/devices/kmsg c 1 11
+
+ ln -snf /proc/self/fd ${pkgdir}/lib/udev/devices/fd
+ ln -snf /proc/self/fd/0 ${pkgdir}/lib/udev/devices/stdin
+ ln -snf /proc/self/fd/1 ${pkgdir}/lib/udev/devices/stdout
+ ln -snf /proc/self/fd/2 ${pkgdir}/lib/udev/devices/stderr
+ ln -snf /proc/kcore ${pkgdir}/lib/udev/devices/core
+
+ # these static devices are created for convenience, to autoload the modules if necessary
+ # /dev/loop0
+ mknod -m 0660 ${pkgdir}/lib/udev/devices/loop0 b 7 0
+ chgrp disk ${pkgdir}/lib/udev/devices/loop0
+ # /dev/net/tun
+ mkdir ${pkgdir}/lib/udev/devices/net
+ mknod -m 0666 ${pkgdir}/lib/udev/devices/net/tun c 10 200
+ # /dev/fuse
+ mknod -m 0666 ${pkgdir}/lib/udev/devices/fuse c 10 229
+ # /dev/ppp
+ mknod -m 0600 ${pkgdir}/lib/udev/devices/ppp c 108 0
+
+ # Replace dialout/tape/cdrom group in rules with uucp/storage/optical group
+ for i in $pkgdir/lib/udev/rules.d/*.rules; do
+ sed -i -e 's#GROUP="dialout"#GROUP="uucp"#g;
+ s#GROUP="tape"#GROUP="storage"#g;
+ s#GROUP="cdrom"#GROUP="optical"#g' $i
+ done
+}
+
+package_udev-compat() {
+ pkgdesc="The userspace dev tools (udev) - additional rules for older kernels"
+ depends=('udev')
+ groups=('')
+ cd $srcdir/$pkgname-$pkgver
+ install -d -m755 ${pkgdir}/lib/${pkgname}/rules.d
+ install -D -m644 ${srcdir}/${pkgname}-${pkgver}/rules/misc/30-kernel-compat.rules ${pkgdir}/lib/udev/rules.d/30-kernel-compat.rules
+}
diff --git a/core/udev/cdsymlinks.sh b/core/udev/cdsymlinks.sh
new file mode 100755
index 000000000..498abda4a
--- /dev/null
+++ b/core/udev/cdsymlinks.sh
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Creates cdsymlinks in /dev
+# for Archlinux by Tobias Powalowski <tpowa@archlinux.org>
+
+# check on cd/dvd drives and if persistant rules file is used
+if [ -d /dev/cd -a ! -e /etc/udev/rules.d/75-persistent-cd.rules ]; then
+ # remove existing device files
+ rm /dev/cdrom*
+ rm /dev/cdrw*
+ rm /dev/dvd*
+ rm /dev/dvdrw*
+ # start creating symlinks
+ for i in /dev/cd/cdrom-*; do
+ if [ -h $i ]; then
+ [ "$CD_NUMBER" = "" ] && ln -s $i /dev/cdrom
+ [ "$CD_NUMBER" = "" ] && CD_NUMBER="-1"
+ ! [ "$CD_NUMBER" = "" ] && CD_NUMBER="$((CD_NUMBER+1))" && ln -s $i /dev/cdrom$CD_NUMBER
+ fi
+ done
+
+ for i in /dev/cd/cdrw-*; do
+ if [ -h $i ]; then
+ [ "$CDRW_NUMBER" = "" ] && ln -s $i /dev/cdrw
+ [ "$CDRW_NUMBER" = "" ] && CDRW_NUMBER="-1"
+ ! [ "$CDRW_NUMBER" = "" ] && CDRW_NUMBER="$((CDRW_NUMBER+1))" && ln -s $i /dev/cdrw$CDRW_NUMBER
+ fi
+ done
+
+ for i in /dev/cd/dvd-*; do
+ if [ -h $i ]; then
+ [ "$DVD_NUMBER" = "" ] && ln -s $i /dev/dvd
+ [ "$DVD_NUMBER" = "" ] && DVD_NUMBER="-1"
+ ! [ "$DVD_NUMBER" = "" ] && DVD_NUMBER="$((DVD_NUMBER+1))" && ln -s $i /dev/dvd$DVD_NUMBER
+ fi
+ done
+
+ for i in /dev/cd/dvdrw-*; do
+ if [ -h $i ]; then
+ [ "$DVDRW_NUMBER" = "" ] && ln -s $i /dev/dvdrw
+ [ "$DVDRW_NUMBER" = "" ] && DVDRW_NUMBER="-1"
+ ! [ "$DVDRW_NUMBER" = "" ] && DVDRW_NUMBER="$((DVDRW_NUMBER+1))" && ln -s $i /dev/dvdrw$DVDRW_NUMBER
+ fi
+ done
+fi
diff --git a/core/udev/load-modules.sh b/core/udev/load-modules.sh
new file mode 100755
index 000000000..1e2af913e
--- /dev/null
+++ b/core/udev/load-modules.sh
@@ -0,0 +1,80 @@
+#!/bin/bash
+# Implement blacklisting for udev-loaded modules
+
+[ $# -ne 1 ] && exit 1
+
+. /etc/rc.conf
+
+# grab modules from rc.conf
+BLACKLIST="${MOD_BLACKLIST[@]}"
+MODPROBE="/sbin/modprobe"
+LOGGER="/usr/bin/logger"
+RESOLVEALIAS="${MODPROBE} --resolve-alias"
+USEBLACKLIST="--use-blacklist"
+
+if [ -f /proc/cmdline ]; then
+ for cmd in $(cat /proc/cmdline); do
+ case $cmd in
+ disablemodules=*) eval $cmd ;;
+ load_modules=off) exit ;;
+ esac
+ done
+ #parse cmdline entries of the form "disablemodules=x,y,z"
+ if [ -n "$disablemodules" ]; then
+ BLACKLIST="$BLACKLIST $(echo $disablemodules | sed 's|,| |g')"
+ fi
+fi
+
+#MODULES entries in rc.conf that begin with ! are blacklisted
+for mod in ${MODULES[@]}; do
+ if [ "${mod}" != "${mod#!}" ]; then
+ BLACKLIST="$BLACKLIST ${mod#!}"
+ fi
+done
+
+if [ "$MOD_AUTOLOAD" = "yes" -o "$MOD_AUTOLOAD" = "YES" ]; then
+ if [ -n "${BLACKLIST}" ]; then
+ # If an alias name is on the blacklist, load no modules for this device
+ if echo "${BLACKLIST}" | /bin/grep -q -e " $1 " -e "^$1 " -e " $1\$"; then
+ $LOGGER -p info -t "$(basename $0)" "Not loading module alias '$1' because it is blacklisted"
+ exit
+ fi
+ #sanitize the blacklist
+ BLACKLIST="$(echo "$BLACKLIST" | sed -e 's|-|_|g')"
+ # Try to find all modules for the alias
+ mods=$($RESOLVEALIAS $1)
+ # If no modules could be found, try if the alias name is a module name
+ # In that case, omit the --use-blacklist parameter to imitate normal modprobe behaviour
+ [ -z "${mods}" ] && $MODPROBE -qni $1 && mods="$1" && USEBLACKLIST=""
+ [ -z "${mods}" ] && $LOGGER -p local0.debug -t "$(basename $0)" "'$1' is not a valid module or alias name"
+ for mod in ${mods}; do
+ # Find the module and all its dependencies
+ deps="$($MODPROBE -i --show-depends ${mod})"
+ [ $? -ne 0 ] && continue
+
+ #sanitize the module names
+ deps="$(echo "$deps" | sed \
+ -e "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" \
+ -e 's|-|_|g')"
+
+ # If the module or any of its dependencies is blacklisted, don't load it
+ for dep in $deps; do
+ if echo "${BLACKLIST}" | /bin/grep -q -e " ${dep} " -e "^${dep} " -e " ${dep}\$"; then
+ if [ "${dep}" = "${mod}" ]; then
+ $LOGGER -p local0.info -t "$(basename $0)" "Not loading module '${mod}' for alias '$1' because it is blacklisted"
+ else
+ $LOGGER -p local0.info -t "$(basename $0)" "Not loading module '${mod}' for alias '$1' because its dependency '${dep}' is blacklisted"
+ fi
+ continue 2
+ fi
+ done
+ # modprobe usually uses the "blacklist" statements from modprobe.conf only to blacklist all aliases
+ # of a module, but not the module itself. We use --use-blacklist here so that modprobe also blacklists
+ # module names if we resolved alias names manually above
+ $MODPROBE $USEBLACKLIST ${mod}
+ done
+ else
+ $MODPROBE $USEBLACKLIST $1
+ fi
+fi
+# vim: set et ts=4:
diff --git a/core/udev/udev.install b/core/udev/udev.install
new file mode 100644
index 000000000..e953ec743
--- /dev/null
+++ b/core/udev/udev.install
@@ -0,0 +1,38 @@
+# arg 1: the new package version
+# arg 2: the old package version
+
+post_upgrade() {
+ if [ "$(vercmp $2 100)" -lt 0 ]; then
+ echo "ATTENTION UDEV:"
+ echo "----------"
+ echo "udev >=098 rules syntax has changed, please update your own rules."
+ echo "udev >=099 Added persistent network and CD/DVD Symlink generator rules."
+ echo "Please read the instructions carefully before reboot."
+ echo "They are located in /etc/udev/readme-udev-arch.txt"
+ echo "----------"
+ fi
+}
+
+post_install() {
+ # If a ramfs is mounted, we still need to make sure that /dev/{console,null,zero} exist
+ # The Archlinux installer bind-mounts /dev to /mnt/dev, thus making the real /dev invisible
+ ROOTDIR=""
+ [ "$(stat -c %D /)" != "$(stat -c %D /dev)" ] && ROOTDIR=$(mktemp -d /tmp/udevinstall.XXXXXX)
+ [ -n "${ROOTDIR}" ] && mount --bind / ${ROOTDIR}
+ if [ ! -c ${ROOTDIR}/dev/console ]; then
+ rm -f ${ROOTDIR}/dev/console
+ mknod -m600 ${ROOTDIR}/dev/console c 5 1
+ fi
+ if [ ! -c ${ROOTDIR}/dev/null ]; then
+ rm -f ${ROOTDIR}/dev/null
+ mknod -m644 ${ROOTDIR}/dev/null c 1 3
+ fi
+ if [ ! -c ${ROOTDIR}/dev/zero ]; then
+ rm -f ${ROOTDIR}/dev/zero
+ mknod -m644 ${ROOTDIR}/dev/zero c 1 5
+ fi
+ if [ -n "${ROOTDIR}" ]; then
+ umount ${ROOTDIR}
+ rmdir ${ROOTDIR}
+ fi
+}
diff --git a/core/usbutils/PKGBUILD b/core/usbutils/PKGBUILD
new file mode 100644
index 000000000..ef1a8c541
--- /dev/null
+++ b/core/usbutils/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 104566 2011-01-04 08:28:48Z tpowa $
+# Maintainer: Judd Vinet <jvinet@zeroflux.org>
+# Contributor: Curtis Campbell <curtisjamescampbell@hotmail.com>
+pkgname=usbutils
+pkgver=001
+pkgrel=2
+pkgdesc="USB Device Utilities"
+arch=(i686 x86_64)
+license=('GPL')
+groups=('base')
+makedepends=('wget')
+depends=('glibc' 'libusb')
+url="http://linux-usb.sourceforge.net/"
+source=(http://www.kernel.org/pub/linux/utils/usb/$pkgname/$pkgname-$pkgver.tar.gz)
+md5sums=('3ecdcb42f08ef0d63e2638feb06ececc')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ rm usb.ids
+ wget http://www.linux-usb.org/usb.ids
+ ./configure --prefix=/usr --datadir=/usr/share/hwdata --disable-zlib
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install
+ # fix pkgconfig file
+ mkdir -p $pkgdir/usr/lib
+ mv $pkgdir/usr/share/pkgconfig $pkgdir/usr/lib/
+}
diff --git a/core/util-linux/PKGBUILD b/core/util-linux/PKGBUILD
new file mode 100644
index 000000000..63866fdff
--- /dev/null
+++ b/core/util-linux/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 111132 2011-02-24 11:12:49Z ibiru $
+# Maintainer: judd <jvinet@zeroflux.org>
+pkgname=util-linux
+pkgver=2.19
+pkgrel=4
+pkgdesc="Miscellaneous system utilities for Linux"
+url="http://userweb.kernel.org/~kzak/util-linux-ng/"
+arch=('i686' 'x86_64')
+groups=('base')
+depends=('bash' 'ncurses>=5.7' 'zlib' 'filesystem')
+replaces=('linux32' 'util-linux-ng')
+conflicts=('linux32' 'util-linux-ng' 'e2fsprogs<1.41.8-2')
+provides=('linux32' "util-linux-ng=${pkgver}")
+license=('GPL2')
+options=('!libtool')
+source=(ftp://ftp.kernel.org/pub/linux/utils/${pkgname}/v2.19/${pkgname}-${pkgver}.tar.bz2)
+optdepends=('perl: for chkdupexe support')
+md5sums=('590ca71aad0b254e2631d84401f28255')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ # hardware clock
+ sed -e 's%etc/adjtime%var/lib/hwclock/adjtime%' -i hwclock/hwclock.c
+ ./configure --enable-arch --enable-write --enable-raw --disable-wall --enable-partx
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ mkdir -p "${pkgdir}/var/lib/hwclock"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/core/vi/PKGBUILD b/core/vi/PKGBUILD
new file mode 100644
index 000000000..379a2ca5a
--- /dev/null
+++ b/core/vi/PKGBUILD
@@ -0,0 +1,46 @@
+# $Id: PKGBUILD 109425 2011-02-09 15:16:39Z stephane $
+# Maintainer: tobias [ tobias at archlinux org ]
+
+pkgname=vi
+pkgver=050325
+pkgrel=4
+pkgdesc='The original ex/vi text editor.'
+arch=('i686' 'x86_64')
+url='http://ex-vi.sourceforge.net/'
+license=('custom:ex')
+depends=('ncurses')
+optdepends=('mailx: used by the preserve command for notification')
+groups=('base')
+options=(force strip !libtool emptydirs)
+source=(http://downloads.sourceforge.net/sourceforge/ex-vi/ex-${pkgver}.tar.bz2
+ exrc.sample
+ navkeys.patch
+ increase-tube.patch
+ preserve_dir.patch)
+md5sums=('e668595254233e4d96811083a3e4e2f3'
+ 'd3b483c994d859232ce369b82a4b5668'
+ 'aac133930047eafa4f28736cfaf976b3'
+ 'e596e05a00a24187b576e389fa1de45d'
+ '419a8755e0dd16e95542bc107e6d2b24')
+
+build() {
+ cd "${srcdir}/ex-${pkgver}"
+
+ # apply patches
+ patch -Np1 -i ../navkeys.patch
+ patch -Np0 -i ../increase-tube.patch
+ # FS#20653
+ patch -Np1 -i ../preserve_dir.patch
+
+ make PREFIX=/usr LIBEXECDIR=/usr/lib/ex PRESERVEDIR=/var/lib/ex \
+ 'FEATURES=-DCHDIR -DFASTTAG -DUCVISUAL -DMB -DBIT8' TERMLIB=ncurses
+}
+
+package() {
+ cd "${srcdir}/ex-${pkgver}"
+
+ make PREFIX=/usr LIBEXECDIR=/usr/lib/ex PRESERVEDIR=/var/lib/ex INSTALL=/bin/install \
+ DESTDIR="$pkgdir" install
+
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
diff --git a/core/vi/exrc.sample b/core/vi/exrc.sample
new file mode 100644
index 000000000..44b3045fd
--- /dev/null
+++ b/core/vi/exrc.sample
@@ -0,0 +1,5 @@
+" A sample .exrc file. Copy it to your home dir as ~/.exrc in order to work.
+set showmode
+set noflash
+set autoindent
+set shiftwidth=2
diff --git a/core/vi/increase-tube.patch b/core/vi/increase-tube.patch
new file mode 100644
index 000000000..5010798ce
--- /dev/null
+++ b/core/vi/increase-tube.patch
@@ -0,0 +1,13 @@
+--- config.h 2005-02-19 05:25:39.000000000 -0500
++++ config.h.fixed 2010-01-04 22:02:01.000000000 -0500
+@@ -95,8 +95,8 @@
+ #define TUBESIZE 6000 /* Maximum screen size for visual */
+ #else /* VMUNIX */
+ #define TUBELINES 100
+-#define TUBECOLS 160
+-#define TUBESIZE 16000
++#define TUBECOLS 320
++#define TUBESIZE 32000
+ #endif /* VMUNIX */
+
+ /*
diff --git a/core/vi/navkeys.patch b/core/vi/navkeys.patch
new file mode 100644
index 000000000..46924379c
--- /dev/null
+++ b/core/vi/navkeys.patch
@@ -0,0 +1,55 @@
+diff -ru ex-050325/ex_tty.c ex-050325-du/ex_tty.c
+--- ex-050325/ex_tty.c 2005-03-04 13:42:58.000000000 +0100
++++ ex-050325-du/ex_tty.c 2009-06-25 20:06:57.000000000 +0200
+@@ -132,7 +132,8 @@
+ &ED, &EI, &F0, &F1, &F2, &F3, &F4, &F5, &F6, &F7, &F8, &F9,
+ &HO, &IC, &IM, &IP, &KD, &KE, &KH, &KL, &KR, &KS, &KU, &LL, &ND, &xNL,
+ &xPC, &RC, &SC, &SE, &SF, &SO, &SR, &TA, &TE, &TI, &UP, &VB, &VS, &VE,
+- &AL_PARM, &DL_PARM, &UP_PARM, &DOWN_PARM, &LEFT_PARM, &RIGHT_PARM
++ &AL_PARM, &DL_PARM, &UP_PARM, &DOWN_PARM, &LEFT_PARM, &RIGHT_PARM,
++ &kI, &kD, &kh, &at7, &kP, &kN
+ };
+ bool *sflags[] = {
+ &AM, &BS, &DA, &DB, &EO, &HC,
+@@ -170,7 +171,12 @@
+ addmac1(KD, "j", "down", arrows, 1);
+ addmac1(KL, "h", "left", arrows, 1);
+ addmac1(KR, "l", "right", arrows, 1);
+- addmac1(KH, "H", "home", arrows, 1);
++ addmac1(kI, "i", "insert", arrows, 1);
++ addmac1(kD, "x", "delete", arrows, 1);
++ addmac1(kh, "^", "home", arrows, 1);
++ addmac1(at7, "$", "end", arrows, 1);
++ addmac1(kP, "", "pgup", arrows, 1);
++ addmac1(kN, "", "pgdn", arrows, 1);
+
+ /*
+ * Handle funny termcap capabilities
+@@ -341,7 +347,7 @@
+ *(*fp++) = flag;
+ namp += 2;
+ } while (*namp);
+- namp = "albcbtcdceclcmcrcsdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcrcscsesfsosrtatetiupvbvsveALDLUPDOLERI";
++ namp = "albcbtcdceclcmcrcsdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcrcscsesfsosrtatetiupvbvsveALDLUPDOLERIkIkDkh@7kPkN";
+ sp = sstrs;
+ do {
+ string = tgetstr(namp, &aoftspace);
+diff -ru ex-050325/ex_tty.h ex-050325-du/ex_tty.h
+--- ex-050325/ex_tty.h 2004-12-01 19:21:06.000000000 +0100
++++ ex-050325-du/ex_tty.h 2009-06-25 20:06:05.000000000 +0200
+@@ -183,6 +183,15 @@
+ var bool XX; /* Tektronix 4025 insert line */
+ /* X? is reserved for severely nauseous glitches */
+ /* If there are enough of these we may need bit masks! */
++/*
++ * Insert, Delete, Home, End, PgUp an PgDown keys
++ */
++var char *kI;
++var char *kD;
++var char *kh;
++var char *at7;
++var char *kP;
++var char *kN;
+
+ /*
+ * From the tty modes...
diff --git a/core/vi/preserve_dir.patch b/core/vi/preserve_dir.patch
new file mode 100644
index 000000000..5209f7b02
--- /dev/null
+++ b/core/vi/preserve_dir.patch
@@ -0,0 +1,81 @@
+diff -Naur ex-050325.ori/ex.1 ex-050325/ex.1
+--- ex-050325.ori/ex.1 2005-02-17 07:39:36.000000000 -0500
++++ ex-050325/ex.1 2011-02-01 16:21:51.496666674 -0500
+@@ -1950,7 +1950,7 @@
+ .B /var/tmp/Rx\fInnnnnnnnnn\fP
+ named buffer temporary
+ .TP
+-.B /var/preserve
++.B /var/lib/ex
+ preservation directory
+ .SH DOCUMENTATION
+ The document
+diff -Naur ex-050325.ori/expreserve.c ex-050325/expreserve.c
+--- ex-050325.ori/expreserve.c 2005-03-04 07:44:46.000000000 -0500
++++ ex-050325/expreserve.c 2011-02-01 16:22:06.583333342 -0500
+@@ -272,7 +272,7 @@
+ #ifdef notdef
+ char pattern[] = "/usr/preserve/Exaa`XXXXX";
+ #else
+-char pattern[] = "/var/preserve/Exa`XXXXXXXXXX";
++char pattern[] = "/var/lib/ex/Exa`XXXXXXXXXX";
+ #endif
+
+ /*
+@@ -296,7 +296,7 @@
+ timestamp = ctime(&time);
+ timestamp[16] = 0; /* blast from seconds on */
+ putenv("MAILRC=/dev/null");
+- sprintf(cmd, "/bin/mail %s", pp->pw_name);
++ sprintf(cmd, "/usr/bin/mail %s", pp->pw_name);
+ setuid(getuid());
+ mf = popen(cmd, "w");
+ if (mf == NULL)
+diff -Naur ex-050325.ori/exrecover.c ex-050325/exrecover.c
+--- ex-050325.ori/exrecover.c 2005-03-04 07:44:46.000000000 -0500
++++ ex-050325/exrecover.c 2011-02-01 16:21:51.496666674 -0500
+@@ -167,7 +167,7 @@
+ #ifdef notdef
+ char mydir[] = "/usr/preserve";
+ #else
+-char mydir[] = "/var/preserve";
++char mydir[] = "/var/lib/ex";
+ #endif
+
+ /*
+diff -Naur ex-050325.ori/ex.spec ex-050325/ex.spec
+--- ex-050325.ori/ex.spec 2005-03-24 18:50:09.000000000 -0500
++++ ex-050325/ex.spec 2011-02-01 16:21:51.496666674 -0500
+@@ -20,7 +20,7 @@
+ %define libexecdir %{prefix}/5lib
+ %define mandir %{prefix}/share/man/5man
+
+-%define preservedir /var/preserve
++%define preservedir /var/lib/ex
+
+ # install command
+ %define ucbinstall install
+diff -Naur ex-050325.ori/Makefile ex-050325/Makefile
+--- ex-050325.ori/Makefile 2005-03-24 18:50:09.000000000 -0500
++++ ex-050325/Makefile 2011-02-01 16:21:51.496666674 -0500
+@@ -83,7 +83,7 @@
+ BINDIR = $(PREFIX)/bin
+ LIBEXECDIR = $(PREFIX)/libexec
+ MANDIR = $(PREFIX)/share/man
+-PRESERVEDIR = /var/preserve
++PRESERVEDIR = /var/lib/ex
+
+ #
+ # DESTDIR is prepended to the installation paths. It is mostly useful
+diff -Naur ex-050325.ori/vi.1 ex-050325/vi.1
+--- ex-050325.ori/vi.1 2005-02-17 07:39:36.000000000 -0500
++++ ex-050325/vi.1 2011-02-01 16:21:51.496666674 -0500
+@@ -979,7 +979,7 @@
+ .B /var/tmp/Rx\fInnnnnnnnnn\fP
+ named buffer temporary
+ .TP
+-.B /var/preserve
++.B /var/lib/ex
+ preservation directory
+ .SH SEE ALSO
+ ex(1),
diff --git a/core/vpnc/PKGBUILD b/core/vpnc/PKGBUILD
new file mode 100644
index 000000000..d14842636
--- /dev/null
+++ b/core/vpnc/PKGBUILD
@@ -0,0 +1,35 @@
+# $Id: PKGBUILD 100076 2010-11-20 04:16:25Z pierre $
+# Maintainer: Thomas Baechler <thomas@archlinux.org>
+
+pkgname=vpnc
+pkgver=0.5.3
+pkgrel=3
+pkgdesc="VPN client for cisco3000 VPN Concentrators"
+url="http://www.unix-ag.uni-kl.de/~massar/vpnc/"
+license=('GPL')
+depends=('libgcrypt' 'openssl' 'iproute2')
+arch=('i686' 'x86_64')
+source=("http://www.unix-ag.uni-kl.de/~massar/vpnc/$pkgname-$pkgver.tar.gz"
+ 'vpnc.conf' 'vpnc.rc')
+backup=('etc/vpnc/default.conf')
+md5sums=('4378f9551d5b077e1770bbe09995afb3'
+ 'a3f4e0cc682f437e310a1c86ae198e45'
+ 'c5885162ac198eaa36da9a01e7c0c55b')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # Build hybrid support
+ sed -i 's|^#OPENSSL|OPENSSL|g' Makefile
+
+ make PREFIX=/usr
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir PREFIX=/usr install
+
+ install -D -m644 $srcdir/vpnc.conf $pkgdir/etc/vpnc/default.conf
+ install -D -m755 $srcdir/vpnc.rc $pkgdir/etc/rc.d/vpnc
+ rm -f $pkgdir/etc/vpnc/vpnc.conf
+}
diff --git a/core/vpnc/vpnc.conf b/core/vpnc/vpnc.conf
new file mode 100644
index 000000000..914f827fd
--- /dev/null
+++ b/core/vpnc/vpnc.conf
@@ -0,0 +1,17 @@
+# example vpnc configuration file
+# see vpnc --long-help for details
+
+#Interface name tun0
+#IKE DH Group dh2
+#Perfect Forward Secrecy nopfs
+
+# You may replace this script with something better
+#Script /etc/vpnc/vpnc-script
+# Enable this option for NAT traversal
+#UDP Encapsulate
+
+#IPSec gateway my.gateway.com
+#IPSec ID someid
+#IPSec secret somesecret
+#Xauth username myusername
+#Xauth password mypassword
diff --git a/core/vpnc/vpnc.rc b/core/vpnc/vpnc.rc
new file mode 100644
index 000000000..972ed3211
--- /dev/null
+++ b/core/vpnc/vpnc.rc
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Connecting to VPN"
+ /usr/sbin/vpnc
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon vpnc
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Disconnecting from VPN"
+ /usr/sbin/vpnc-disconnect
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon vpnc
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/wget/PKGBUILD b/core/wget/PKGBUILD
new file mode 100644
index 000000000..ca9407c22
--- /dev/null
+++ b/core/wget/PKGBUILD
@@ -0,0 +1,42 @@
+# $Id: PKGBUILD 110655 2011-02-21 09:03:23Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=wget
+pkgver=1.12
+pkgrel=5
+pkgdesc="A network utility to retrieve files from the Web"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/wget/wget.html"
+license=('GPL3')
+groups=('base')
+depends=('glibc' 'openssl')
+optdepends=('ca-certificates: HTTPS downloads')
+backup=('etc/wgetrc')
+install=wget.install
+source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz
+ wget-1.12-CVE-2010-2252.patch)
+md5sums=('141461b9c04e454dc8933c9d1f2abf83'
+ '2c8bc23eff98fd4efc3f96394fc8e61e')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # Fix arbitrary file overwrite via 3xx redirect (CVE-2010-2252)
+ patch -Np1 -i ../wget-1.12-CVE-2010-2252.patch
+
+ ./configure -with-ssl --prefix=/usr --sysconfdir=/etc
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ cat >> "$pkgdir/etc/wgetrc" <<EOF
+
+# default root certs location
+ca_certificate=/etc/ssl/certs/ca-certificates.crt
+EOF
+
+}
diff --git a/core/wget/wget-1.12-CVE-2010-2252.patch b/core/wget/wget-1.12-CVE-2010-2252.patch
new file mode 100644
index 000000000..d1d797a2c
--- /dev/null
+++ b/core/wget/wget-1.12-CVE-2010-2252.patch
@@ -0,0 +1,155 @@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' wget~/doc/wget.texi wget/doc/wget.texi
+--- wget~/doc/wget.texi 2010-09-05 15:32:44.000000000 +0200
++++ wget/doc/wget.texi 2010-09-05 15:32:44.000000000 +0200
+@@ -1487,6 +1487,13 @@
+ @code{Content-Disposition} headers to describe what the name of a
+ downloaded file should be.
+
++@cindex Trust server names
++@item --trust-server-names
++
++If this is set to on, on a redirect the last component of the
++redirection URL will be used as the local file name. By default it is
++used the last component in the original URL.
++
+ @cindex authentication
+ @item --auth-no-challenge
+
+@@ -2797,6 +2804,10 @@
+ Turn on recognition of the (non-standard) @samp{Content-Disposition}
+ HTTP header---if set to @samp{on}, the same as @samp{--content-disposition}.
+
++@item trust_server_names = on/off
++If set to on, use the last component of a redirection URL for the local
++file name.
++
+ @item continue = on/off
+ If set to on, force continuation of preexistent partially retrieved
+ files. See @samp{-c} before setting it.
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' wget~/src/http.c wget/src/http.c
+--- wget~/src/http.c 2010-09-05 15:30:22.000000000 +0200
++++ wget/src/http.c 2010-09-05 15:32:44.000000000 +0200
+@@ -2410,8 +2410,9 @@
+ /* The genuine HTTP loop! This is the part where the retrieval is
+ retried, and retried, and retried, and... */
+ uerr_t
+-http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
+- int *dt, struct url *proxy, struct iri *iri)
++http_loop (struct url *u, struct url *original_url, char **newloc,
++ char **local_file, const char *referer, int *dt, struct url *proxy,
++ struct iri *iri)
+ {
+ int count;
+ bool got_head = false; /* used for time-stamping and filename detection */
+@@ -2457,7 +2458,8 @@
+ }
+ else if (!opt.content_disposition)
+ {
+- hstat.local_file = url_file_name (u);
++ hstat.local_file =
++ url_file_name (opt.trustservernames ? u : original_url);
+ got_name = true;
+ }
+
+@@ -2497,7 +2499,7 @@
+
+ /* Send preliminary HEAD request if -N is given and we have an existing
+ * destination file. */
+- file_name = url_file_name (u);
++ file_name = url_file_name (opt.trustservernames ? u : original_url);
+ if (opt.timestamping
+ && !opt.content_disposition
+ && file_exists_p (file_name))
+@@ -2852,9 +2854,9 @@
+
+ /* Remember that we downloaded the file for later ".orig" code. */
+ if (*dt & ADDED_HTML_EXTENSION)
+- downloaded_file(FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
++ downloaded_file (FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
+ else
+- downloaded_file(FILE_DOWNLOADED_NORMALLY, hstat.local_file);
++ downloaded_file (FILE_DOWNLOADED_NORMALLY, hstat.local_file);
+
+ ret = RETROK;
+ goto exit;
+@@ -2885,9 +2887,9 @@
+
+ /* Remember that we downloaded the file for later ".orig" code. */
+ if (*dt & ADDED_HTML_EXTENSION)
+- downloaded_file(FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
++ downloaded_file (FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
+ else
+- downloaded_file(FILE_DOWNLOADED_NORMALLY, hstat.local_file);
++ downloaded_file (FILE_DOWNLOADED_NORMALLY, hstat.local_file);
+
+ ret = RETROK;
+ goto exit;
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' wget~/src/http.h wget/src/http.h
+--- wget~/src/http.h 2010-09-05 15:30:22.000000000 +0200
++++ wget/src/http.h 2010-09-05 15:32:44.000000000 +0200
+@@ -33,8 +33,8 @@
+
+ struct url;
+
+-uerr_t http_loop (struct url *, char **, char **, const char *, int *,
+- struct url *, struct iri *);
++uerr_t http_loop (struct url *, struct url *, char **, char **, const char *,
++ int *, struct url *, struct iri *);
+ void save_cookies (void);
+ void http_cleanup (void);
+ time_t http_atotm (const char *);
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' wget~/src/init.c wget/src/init.c
+--- wget~/src/init.c 2010-09-05 15:30:22.000000000 +0200
++++ wget/src/init.c 2010-09-05 15:32:44.000000000 +0200
+@@ -243,6 +243,7 @@
+ { "timeout", NULL, cmd_spec_timeout },
+ { "timestamping", &opt.timestamping, cmd_boolean },
+ { "tries", &opt.ntry, cmd_number_inf },
++ { "trustservernames", &opt.trustservernames, cmd_boolean },
+ { "useproxy", &opt.use_proxy, cmd_boolean },
+ { "user", &opt.user, cmd_string },
+ { "useragent", NULL, cmd_spec_useragent },
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' wget~/src/main.c wget/src/main.c
+--- wget~/src/main.c 2010-09-05 15:30:22.000000000 +0200
++++ wget/src/main.c 2010-09-05 15:32:44.000000000 +0200
+@@ -266,6 +266,7 @@
+ { "timeout", 'T', OPT_VALUE, "timeout", -1 },
+ { "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 },
+ { "tries", 't', OPT_VALUE, "tries", -1 },
++ { "trust-server-names", 0, OPT_BOOLEAN, "trustservernames", -1 },
+ { "user", 0, OPT_VALUE, "user", -1 },
+ { "user-agent", 'U', OPT_VALUE, "useragent", -1 },
+ { "verbose", 'v', OPT_BOOLEAN, "verbose", -1 },
+@@ -675,6 +676,8 @@
+ N_("\
+ -I, --include-directories=LIST list of allowed directories.\n"),
+ N_("\
++ --trust-server-names use the name specified by the redirection url last component.\n"),
++ N_("\
+ -X, --exclude-directories=LIST list of excluded directories.\n"),
+ N_("\
+ -np, --no-parent don't ascend to the parent directory.\n"),
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' wget~/src/options.h wget/src/options.h
+--- wget~/src/options.h 2010-09-05 15:30:22.000000000 +0200
++++ wget/src/options.h 2010-09-05 15:32:44.000000000 +0200
+@@ -242,6 +242,7 @@
+ char *encoding_remote;
+ char *locale;
+
++ bool trustservernames;
+ #ifdef __VMS
+ int ftp_stmlf; /* Force Stream_LF format for binary FTP. */
+ #endif /* def __VMS */
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' wget~/src/retr.c wget/src/retr.c
+--- wget~/src/retr.c 2010-09-05 15:30:22.000000000 +0200
++++ wget/src/retr.c 2010-09-05 15:32:44.000000000 +0200
+@@ -689,7 +689,8 @@
+ #endif
+ || (proxy_url && proxy_url->scheme == SCHEME_HTTP))
+ {
+- result = http_loop (u, &mynewloc, &local_file, refurl, dt, proxy_url, iri);
++ result = http_loop (u, orig_parsed, &mynewloc, &local_file, refurl, dt,
++ proxy_url, iri);
+ }
+ else if (u->scheme == SCHEME_FTP)
+ {
diff --git a/core/wget/wget.install b/core/wget/wget.install
new file mode 100644
index 000000000..171533352
--- /dev/null
+++ b/core/wget/wget.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(wget.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file $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
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/which/PKGBUILD b/core/which/PKGBUILD
new file mode 100644
index 000000000..c9a7b1abf
--- /dev/null
+++ b/core/which/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 100049 2010-11-20 03:27:58Z stephane $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Andreas Radke <andyrtr@archlinux.org>
+
+pkgname=which
+pkgver=2.20
+pkgrel=4
+pkgdesc="A utility to show the full path of commands"
+arch=('i686' 'x86_64')
+url="http://www.xs4all.nl/~carlo17/which"
+license=('GPL3')
+groups=('base')
+depends=('glibc' 'sh')
+install=which.install
+source=(http://www.xs4all.nl/~carlo17/$pkgname/$pkgname-$pkgver.tar.gz)
+md5sums=('95be0501a466e515422cde4af46b2744')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install
+}
diff --git a/core/which/which.install b/core/which/which.install
new file mode 100644
index 000000000..167e2506e
--- /dev/null
+++ b/core/which/which.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(which.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ 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
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
diff --git a/core/wireless_tools/PKGBUILD b/core/wireless_tools/PKGBUILD
new file mode 100644
index 000000000..a60b8b2a6
--- /dev/null
+++ b/core/wireless_tools/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 100106 2010-11-20 11:19:34Z pierre $
+# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
+# Contributer: Jason Chu <jchu@xentac.net>
+
+pkgname=wireless_tools
+pkgver=29
+pkgrel=4
+pkgdesc="Wireless Tools"
+arch=('i686' 'x86_64')
+url="http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html"
+license=('GPL')
+depends=('glibc')
+source=("http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools.${pkgver}.tar.gz")
+md5sums=('e06c222e186f7cc013fd272d023710cb')
+
+build() {
+ cd ${srcdir}/wireless_tools.${pkgver}
+ make
+}
+
+package() {
+ cd ${srcdir}/wireless_tools.${pkgver}
+ make INSTALL_DIR="${pkgdir}/usr/sbin" \
+ INSTALL_LIB="${pkgdir}/usr/lib" \
+ INSTALL_INC="${pkgdir}/usr/include" \
+ INSTALL_MAN="${pkgdir}/usr/share/man" install
+}
diff --git a/core/wpa_actiond/PKGBUILD b/core/wpa_actiond/PKGBUILD
new file mode 100644
index 000000000..7701e4c8f
--- /dev/null
+++ b/core/wpa_actiond/PKGBUILD
@@ -0,0 +1,25 @@
+# $Id: PKGBUILD 112297 2011-03-04 15:33:07Z stephane $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+pkgname=wpa_actiond
+pkgver=1.1
+pkgrel=2
+pkgdesc="Daemon that connects to wpa_supplicant and handles connect and disconnect events"
+arch=('i686' 'x86_64')
+url="http://projects.archlinux.org/wpa_actiond.git/"
+license=('GPL')
+depends=('glibc' 'wpa_supplicant')
+source=(ftp://ftp.archlinux.org/other/wpa_actiond/${pkgname}-${pkgver}.tar.xz)
+sha256sums=('d50a49cb5d56c31345d18e58f017b4ff923e8959a7e4e709abd156744f1668c3')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make CFLAGS="${CFLAGS}"
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ install -D -m755 wpa_actiond "${pkgdir}/usr/sbin/wpa_actiond"
+}
+# vim:set ts=2 sw=2 et:
diff --git a/core/wpa_supplicant/PKGBUILD b/core/wpa_supplicant/PKGBUILD
new file mode 100644
index 000000000..c2a1ac2d5
--- /dev/null
+++ b/core/wpa_supplicant/PKGBUILD
@@ -0,0 +1,45 @@
+# $Id: PKGBUILD 112948 2011-03-07 23:26:54Z heftig $
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgname=wpa_supplicant
+pkgver=0.7.3
+pkgrel=3
+pkgdesc="A utility providing key negotiation for WPA wireless networks"
+url="http://hostap.epitest.fi/wpa_supplicant"
+arch=('i686' 'x86_64')
+depends=('openssl' 'dbus-core>=1.2.4' 'readline>=6.0' 'libnl')
+optdepends=('wpa_supplicant_gui: wpa_gui program')
+license=('GPL')
+groups=('base')
+backup=('etc/wpa_supplicant.conf')
+source=(http://hostap.epitest.fi/releases/wpa_supplicant-$pkgver.tar.gz
+ config dbus.patch)
+sha256sums=('d0cd50caa85346ccc376dcda5ed3c258eef19a93b3cade39d25760118ad59443'
+ '6a0837f18e5ff179ccd6954f7952dfc2e6aa69f353194ee4cb29c1ed2ef68c5d'
+ '13effa9ed6a1bb940ffc056a3eabcf64c8cc057069eca5cc1822b98ed769812a')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}"
+ # Required by NetworkManager 0.8.995
+ patch -Np2 -i "$srcdir/dbus.patch"
+ cp "${srcdir}/config" ./.config
+ sed -i 's@/usr/local@$(PREFIX)@g' Makefile
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}"
+ make PREFIX=/usr DESTDIR="${pkgdir}" install
+ install -m755 -d "${pkgdir}/etc"
+ install -m644 wpa_supplicant.conf "${pkgdir}/etc/wpa_supplicant.conf"
+ install -d -m755 "${pkgdir}/usr/share/man/man"{5,8}
+ install -m644 doc/docbook/*.5 "${pkgdir}/usr/share/man/man5/"
+ install -m644 doc/docbook/*.8 "${pkgdir}/usr/share/man/man8/"
+ rm -f "${pkgdir}/usr/share/man/man8/wpa_"{priv,gui}.8
+
+ install -m755 -d "${pkgdir}/usr/share/dbus-1/system-services"
+ install -m644 dbus/{fi.epitest.hostap.WPASupplicant.service,fi.w1.wpa_supplicant1.service} "${pkgdir}/usr/share/dbus-1/system-services/"
+ sed -e 's/sbin/usr\/sbin/' -i "${pkgdir}/usr/share/dbus-1/system-services/"*.service
+ install -m755 -d "${pkgdir}/etc/dbus-1/system.d"
+ install -m644 dbus/dbus-wpa_supplicant.conf "${pkgdir}/etc/dbus-1/system.d/wpa_supplicant.conf"
+}
diff --git a/core/wpa_supplicant/config b/core/wpa_supplicant/config
new file mode 100644
index 000000000..192e338f2
--- /dev/null
+++ b/core/wpa_supplicant/config
@@ -0,0 +1,404 @@
+# Example wpa_supplicant build time configuration
+#
+# This file lists the configuration options that are used when building the
+# hostapd binary. All lines starting with # are ignored. Configuration option
+# lines must be commented out complete, if they are not to be included, i.e.,
+# just setting VARIABLE=n is not disabling that variable.
+#
+# This file is included in Makefile, so variables like CFLAGS and LIBS can also
+# be modified from here. In most cases, these lines should use += in order not
+# to override previous values of the variables.
+
+
+# Uncomment following two lines and fix the paths if you have installed OpenSSL
+# or GnuTLS in non-default location
+#CFLAGS += -I/usr/local/openssl/include
+#LIBS += -L/usr/local/openssl/lib
+
+# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
+# the kerberos files are not in the default include path. Following line can be
+# used to fix build issues on such systems (krb5.h not found).
+#CFLAGS += -I/usr/include/kerberos
+
+# Example configuration for various cross-compilation platforms
+
+#### sveasoft (e.g., for Linksys WRT54G) ######################################
+#CC=mipsel-uclibc-gcc
+#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
+#CFLAGS += -Os
+#CPPFLAGS += -I../src/include -I../../src/router/openssl/include
+#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl
+###############################################################################
+
+#### openwrt (e.g., for Linksys WRT54G) #######################################
+#CC=mipsel-uclibc-gcc
+#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
+#CFLAGS += -Os
+#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \
+# -I../WRT54GS/release/src/include
+#LIBS = -lssl
+###############################################################################
+
+
+# Driver interface for Host AP driver
+#CONFIG_DRIVER_HOSTAP=y
+
+# Driver interface for Agere driver
+#CONFIG_DRIVER_HERMES=y
+# Change include directories to match with the local setup
+#CFLAGS += -I../../hcf -I../../include -I../../include/hcf
+#CFLAGS += -I../../include/wireless
+
+# Driver interface for madwifi driver
+# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
+#CONFIG_DRIVER_MADWIFI=y
+# Set include directory to the madwifi source tree
+#CFLAGS += -I../../madwifi
+
+# Driver interface for ndiswrapper
+# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
+#CONFIG_DRIVER_NDISWRAPPER=y
+
+# Driver interface for Atmel driver
+#CONFIG_DRIVER_ATMEL=y
+
+# Driver interface for old Broadcom driver
+# Please note that the newer Broadcom driver ("hybrid Linux driver") supports
+# Linux wireless extensions and does not need (or even work) with the old
+# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver.
+#CONFIG_DRIVER_BROADCOM=y
+# Example path for wlioctl.h; change to match your configuration
+#CFLAGS += -I/opt/WRT54GS/release/src/include
+
+# Driver interface for Intel ipw2100/2200 driver
+# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
+#CONFIG_DRIVER_IPW=y
+
+# Driver interface for Ralink driver
+#CONFIG_DRIVER_RALINK=y
+
+# Driver interface for generic Linux wireless extensions
+CONFIG_DRIVER_WEXT=y
+
+# Driver interface for Linux drivers using the nl80211 kernel interface
+CONFIG_DRIVER_NL80211=y
+
+# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
+#CONFIG_DRIVER_BSD=y
+#CFLAGS += -I/usr/local/include
+#LIBS += -L/usr/local/lib
+#LIBS_p += -L/usr/local/lib
+#LIBS_c += -L/usr/local/lib
+
+# Driver interface for Windows NDIS
+#CONFIG_DRIVER_NDIS=y
+#CFLAGS += -I/usr/include/w32api/ddk
+#LIBS += -L/usr/local/lib
+# For native build using mingw
+#CONFIG_NATIVE_WINDOWS=y
+# Additional directories for cross-compilation on Linux host for mingw target
+#CFLAGS += -I/opt/mingw/mingw32/include/ddk
+#LIBS += -L/opt/mingw/mingw32/lib
+#CC=mingw32-gcc
+# By default, driver_ndis uses WinPcap for low-level operations. This can be
+# replaced with the following option which replaces WinPcap calls with NDISUIO.
+# However, this requires that WZC is disabled (net stop wzcsvc) before starting
+# wpa_supplicant.
+# CONFIG_USE_NDISUIO=y
+
+# Driver interface for development testing
+#CONFIG_DRIVER_TEST=y
+
+# Include client MLME (management frame processing) for test driver
+# This can be used to test MLME operations in hostapd with the test interface.
+# space.
+#CONFIG_CLIENT_MLME=y
+
+# Driver interface for wired Ethernet drivers
+CONFIG_DRIVER_WIRED=y
+
+# Driver interface for the Broadcom RoboSwitch family
+#CONFIG_DRIVER_ROBOSWITCH=y
+
+# Driver interface for no driver (e.g., WPS ER only)
+#CONFIG_DRIVER_NONE=y
+
+# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
+# included)
+CONFIG_IEEE8021X_EAPOL=y
+
+# EAP-MD5
+CONFIG_EAP_MD5=y
+
+# EAP-MSCHAPv2
+CONFIG_EAP_MSCHAPV2=y
+
+# EAP-TLS
+CONFIG_EAP_TLS=y
+
+# EAL-PEAP
+CONFIG_EAP_PEAP=y
+
+# EAP-TTLS
+CONFIG_EAP_TTLS=y
+
+# EAP-FAST
+# Note: Default OpenSSL package does not include support for all the
+# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL,
+# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch)
+# to add the needed functions.
+#CONFIG_EAP_FAST=y
+
+# EAP-GTC
+CONFIG_EAP_GTC=y
+
+# EAP-OTP
+CONFIG_EAP_OTP=y
+
+# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
+#CONFIG_EAP_SIM=y
+
+# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
+#CONFIG_EAP_PSK=y
+
+# EAP-PAX
+#CONFIG_EAP_PAX=y
+
+# LEAP
+CONFIG_EAP_LEAP=y
+
+# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
+#CONFIG_EAP_AKA=y
+
+# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
+# This requires CONFIG_EAP_AKA to be enabled, too.
+#CONFIG_EAP_AKA_PRIME=y
+
+# Enable USIM simulator (Milenage) for EAP-AKA
+#CONFIG_USIM_SIMULATOR=y
+
+# EAP-SAKE
+#CONFIG_EAP_SAKE=y
+
+# EAP-GPSK
+#CONFIG_EAP_GPSK=y
+# Include support for optional SHA256 cipher suite in EAP-GPSK
+#CONFIG_EAP_GPSK_SHA256=y
+
+# EAP-TNC and related Trusted Network Connect support (experimental)
+#CONFIG_EAP_TNC=y
+
+# Wi-Fi Protected Setup (WPS)
+CONFIG_WPS=y
+
+# EAP-IKEv2
+#CONFIG_EAP_IKEV2=y
+
+# PKCS#12 (PFX) support (used to read private key and certificate file from
+# a file that usually has extension .p12 or .pfx)
+CONFIG_PKCS12=y
+
+# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
+# engine.
+CONFIG_SMARTCARD=y
+
+# PC/SC interface for smartcards (USIM, GSM SIM)
+# Enable this if EAP-SIM or EAP-AKA is included
+#CONFIG_PCSC=y
+
+# Development testing
+#CONFIG_EAPOL_TEST=y
+
+# Select control interface backend for external programs, e.g, wpa_cli:
+# unix = UNIX domain sockets (default for Linux/*BSD)
+# udp = UDP sockets using localhost (127.0.0.1)
+# named_pipe = Windows Named Pipe (default for Windows)
+# y = use default (backwards compatibility)
+# If this option is commented out, control interface is not included in the
+# build.
+CONFIG_CTRL_IFACE=y
+
+# Include support for GNU Readline and History Libraries in wpa_cli.
+# When building a wpa_cli binary for distribution, please note that these
+# libraries are licensed under GPL and as such, BSD license may not apply for
+# the resulting binary.
+CONFIG_READLINE=y
+
+# Remove debugging code that is printing out debug message to stdout.
+# This can be used to reduce the size of the wpa_supplicant considerably
+# if debugging code is not needed. The size reduction can be around 35%
+# (e.g., 90 kB).
+#CONFIG_NO_STDOUT_DEBUG=y
+
+# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
+# 35-50 kB in code size.
+#CONFIG_NO_WPA=y
+
+# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to
+# save about 1 kB in code size when building only WPA-Personal (no EAP support)
+# or 6 kB if building for WPA-Enterprise.
+#CONFIG_NO_WPA2=y
+
+# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
+# This option can be used to reduce code size by removing support for
+# converting ASCII passphrases into PSK. If this functionality is removed, the
+# PSK can only be configured as the 64-octet hexstring (e.g., from
+# wpa_passphrase). This saves about 0.5 kB in code size.
+#CONFIG_NO_WPA_PASSPHRASE=y
+
+# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
+# This can be used if ap_scan=1 mode is never enabled.
+#CONFIG_NO_SCAN_PROCESSING=y
+
+# Select configuration backend:
+# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
+# path is given on command line, not here; this option is just used to
+# select the backend that allows configuration files to be used)
+# winreg = Windows registry (see win_example.reg for an example)
+CONFIG_BACKEND=file
+
+# Remove configuration write functionality (i.e., to allow the configuration
+# file to be updated based on runtime configuration changes). The runtime
+# configuration can still be changed, the changes are just not going to be
+# persistent over restarts. This option can be used to reduce code size by
+# about 3.5 kB.
+#CONFIG_NO_CONFIG_WRITE=y
+
+# Remove support for configuration blobs to reduce code size by about 1.5 kB.
+#CONFIG_NO_CONFIG_BLOBS=y
+
+# Select program entry point implementation:
+# main = UNIX/POSIX like main() function (default)
+# main_winsvc = Windows service (read parameters from registry)
+# main_none = Very basic example (development use only)
+#CONFIG_MAIN=main
+
+# Select wrapper for operatins system and C library specific functions
+# unix = UNIX/POSIX like systems (default)
+# win32 = Windows systems
+# none = Empty template
+#CONFIG_OS=unix
+
+# Select event loop implementation
+# eloop = select() loop (default)
+# eloop_win = Windows events and WaitForMultipleObject() loop
+# eloop_none = Empty template
+#CONFIG_ELOOP=eloop
+
+# Select layer 2 packet implementation
+# linux = Linux packet socket (default)
+# pcap = libpcap/libdnet/WinPcap
+# freebsd = FreeBSD libpcap
+# winpcap = WinPcap with receive thread
+# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
+# none = Empty template
+#CONFIG_L2_PACKET=linux
+
+# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS)
+CONFIG_PEERKEY=y
+
+# IEEE 802.11w (management frame protection)
+# This version is an experimental implementation based on IEEE 802.11w/D1.0
+# draft and is subject to change since the standard has not yet been finalized.
+# Driver support is also needed for IEEE 802.11w.
+#CONFIG_IEEE80211W=y
+
+# Select TLS implementation
+# openssl = OpenSSL (default)
+# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA)
+# internal = Internal TLSv1 implementation (experimental)
+# none = Empty template
+#CONFIG_TLS=openssl
+
+# Whether to enable TLS/IA support, which is required for EAP-TTLSv1.
+# You need CONFIG_TLS=gnutls for this to have any effect. Please note that
+# even though the core GnuTLS library is released under LGPL, this extra
+# library uses GPL and as such, the terms of GPL apply to the combination
+# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not
+# apply for distribution of the resulting binary.
+#CONFIG_GNUTLS_EXTRA=y
+
+# If CONFIG_TLS=internal is used, additional library and include paths are
+# needed for LibTomMath. Alternatively, an integrated, minimal version of
+# LibTomMath can be used. See beginning of libtommath.c for details on benefits
+# and drawbacks of this option.
+#CONFIG_INTERNAL_LIBTOMMATH=y
+#ifndef CONFIG_INTERNAL_LIBTOMMATH
+#LTM_PATH=/usr/src/libtommath-0.39
+#CFLAGS += -I$(LTM_PATH)
+#LIBS += -L$(LTM_PATH)
+#LIBS_p += -L$(LTM_PATH)
+#endif
+# At the cost of about 4 kB of additional binary size, the internal LibTomMath
+# can be configured to include faster routines for exptmod, sqr, and div to
+# speed up DH and RSA calculation considerably
+#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
+
+# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
+# This is only for Windows builds and requires WMI-related header files and
+# WbemUuid.Lib from Platform SDK even when building with MinGW.
+#CONFIG_NDIS_EVENTS_INTEGRATED=y
+#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
+
+# Add support for old DBus control interface
+# (fi.epitest.hostap.WPASupplicant)
+CONFIG_CTRL_IFACE_DBUS=y
+
+# Add support for new DBus control interface
+# (fi.w1.hostap.wpa_supplicant1)
+CONFIG_CTRL_IFACE_DBUS_NEW=y
+
+# Add introspection support for new DBus control interface
+CONFIG_CTRL_IFACE_DBUS_INTRO=y
+
+# Add support for loading EAP methods dynamically as shared libraries.
+# When this option is enabled, each EAP method can be either included
+# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
+# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
+# be loaded in the beginning of the wpa_supplicant configuration file
+# (see load_dynamic_eap parameter in the example file) before being used in
+# the network blocks.
+#
+# Note that some shared parts of EAP methods are included in the main program
+# and in order to be able to use dynamic EAP methods using these parts, the
+# main program must have been build with the EAP method enabled (=y or =dyn).
+# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
+# unless at least one of them was included in the main build to force inclusion
+# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
+# in the main build to be able to load these methods dynamically.
+#
+# Please also note that using dynamic libraries will increase the total binary
+# size. Thus, it may not be the best option for targets that have limited
+# amount of memory/flash.
+#CONFIG_DYNAMIC_EAP_METHODS=y
+
+# IEEE Std 802.11r-2008 (Fast BSS Transition)
+#CONFIG_IEEE80211R=y
+
+# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
+CONFIG_DEBUG_FILE=y
+
+# Enable privilege separation (see README 'Privilege separation' for details)
+#CONFIG_PRIVSEP=y
+
+# Enable mitigation against certain attacks against TKIP by delaying Michael
+# MIC error reports by a random amount of time between 0 and 60 seconds
+#CONFIG_DELAYED_MIC_ERROR_REPORT=y
+
+# Enable tracing code for developer debugging
+# This tracks use of memory allocations and other registrations and reports
+# incorrect use with a backtrace of call (or allocation) location.
+#CONFIG_WPA_TRACE=y
+# For BSD, comment out these.
+#LIBS += -lexecinfo
+#LIBS_p += -lexecinfo
+#LIBS_c += -lexecinfo
+
+# Use libbfd to get more details for developer debugging
+# This enables use of libbfd to get more detailed symbols for the backtraces
+# generated by CONFIG_WPA_TRACE=y.
+#CONFIG_WPA_TRACE_BFD=y
+# For BSD, comment out these.
+#LIBS += -lbfd -liberty -lz
+#LIBS_p += -lbfd -liberty -lz
+#LIBS_c += -lbfd -liberty -lz
diff --git a/core/wpa_supplicant/dbus.patch b/core/wpa_supplicant/dbus.patch
new file mode 100644
index 000000000..4c5002003
--- /dev/null
+++ b/core/wpa_supplicant/dbus.patch
@@ -0,0 +1,61 @@
+From b80b5639935d37b95d00f86b57f2844a9c775f57 Mon Sep 17 00:00:00 2001
+From: Dan Williams <dcbw@redhat.com>
+Date: Fri, 17 Dec 2010 15:56:01 +0200
+Subject: [PATCH] dbus: Emit property changed events when adding/removing BSSes
+
+The supplicant was not emitting property changed events when the BSSs
+property changed.
+
+Signed-off-by: Dan Williams <dcbw@redhat.com>
+(cherry picked from commit 1e6288df6b07a353a9246b77e0de2a840b5f2c72)
+---
+ wpa_supplicant/dbus/dbus_new.c | 6 ++++++
+ wpa_supplicant/dbus/dbus_new.h | 1 +
+ 2 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
+index bdfbbac..c66640a 100644
+--- a/wpa_supplicant/dbus/dbus_new.c
++++ b/wpa_supplicant/dbus/dbus_new.c
+@@ -691,6 +691,10 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
+ wpas_dbus_getter_current_network;
+ prop = "CurrentNetwork";
+ break;
++ case WPAS_DBUS_PROP_BSSS:
++ getter = (WPADBusPropertyAccessor) wpas_dbus_getter_bsss;
++ prop = "BSSs";
++ break;
+ default:
+ wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
+ __func__, property);
+@@ -1199,6 +1203,7 @@ int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
+ }
+
+ wpas_dbus_signal_bss_removed(wpa_s, bss_obj_path);
++ wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_BSSS);
+
+ return 0;
+ }
+@@ -1263,6 +1268,7 @@ int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
+ }
+
+ wpas_dbus_signal_bss_added(wpa_s, bss_obj_path);
++ wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_BSSS);
+
+ return 0;
+
+diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h
+index 80ea98c..9cdefcb 100644
+--- a/wpa_supplicant/dbus/dbus_new.h
++++ b/wpa_supplicant/dbus/dbus_new.h
+@@ -30,6 +30,7 @@ enum wpas_dbus_prop {
+ WPAS_DBUS_PROP_STATE,
+ WPAS_DBUS_PROP_CURRENT_BSS,
+ WPAS_DBUS_PROP_CURRENT_NETWORK,
++ WPAS_DBUS_PROP_BSSS,
+ };
+
+ enum wpas_dbus_bss_prop {
+--
+1.7.4-rc1
+
diff --git a/core/xfsprogs/PKGBUILD b/core/xfsprogs/PKGBUILD
new file mode 100644
index 000000000..6f6cf6e16
--- /dev/null
+++ b/core/xfsprogs/PKGBUILD
@@ -0,0 +1,29 @@
+# $Id: PKGBUILD 100477 2010-11-23 17:28:22Z tpowa $
+# Maintainer: Paul Mattal <paul@archlinux.org>
+pkgname=xfsprogs
+pkgver=3.1.4
+pkgrel=1
+pkgdesc="XFS filesystem utilities"
+arch=('i686' 'x86_64')
+license=('LGPL')
+url="http://oss.sgi.com/projects/xfs/"
+groups=('base')
+depends=('util-linux-ng>=2.16')
+options=('!makeflags' '!libtool')
+# We mirror the sources as upstream tends to move them once a new release is out
+source=("ftp://ftp.archlinux.org/other/xfsprogs/${pkgname}-${pkgver}.tar.gz")
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ export OPTIMIZER="-march=${CARCH/_/-} -O1"
+ export DEBUG=-DNDEBUG
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DIST_ROOT="${pkgdir}" install install-dev
+ chown -R root $pkgdir
+ chgrp -R root $pkgdir
+}
+md5sums=('74081975f148bcabcab26c4c3496ede9')
diff --git a/core/xinetd/PKGBUILD b/core/xinetd/PKGBUILD
new file mode 100644
index 000000000..395cad6f1
--- /dev/null
+++ b/core/xinetd/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id: PKGBUILD 99899 2010-11-19 13:00:23Z allan $
+# Maintainer:
+# Contributor: Judd <jvinet@zeroflux.org>
+
+pkgname=xinetd
+pkgver=2.3.14
+pkgrel=6
+pkgdesc="a secure replacement for inetd"
+arch=('i686' 'x86_64')
+url="http://www.xinetd.org/"
+license=('custom')
+depends=('tcp_wrappers')
+optdepends=('perl: for xconv.pl script')
+backup=('etc/xinetd.conf' 'etc/xinetd.d/servers' 'etc/xinetd.d/services')
+source=(http://www.xinetd.org/xinetd-$pkgver.tar.gz
+ xinetd.conf
+ xinetd
+ servers
+ services)
+md5sums=('567382d7972613090215c6c54f9b82d9'
+ 'f109f699a07bc8cfb5791060f5e87f9e'
+ 'ea37a2794f202e6b953d9b6956dad16a'
+ '21f47b4aa20921cfaddddd9f9a407f81'
+ '9fa2061dc7dd738c8424251deb86f81e')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ sed -i "s#${prefix}/man#${prefix}/share/man#" configure
+ ./configure --prefix=/usr --with-libwrap
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make prefix=$pkgdir/usr install
+
+ install -Dm755 $srcdir/xinetd $pkgdir/etc/rc.d/xinetd
+ install -Dm644 $srcdir/xinetd.conf $pkgdir/etc/xinetd.conf
+ install -Dm644 $srcdir/servers $pkgdir/etc/xinetd.d/servers
+ install -Dm644 $srcdir/services $pkgdir/etc/xinetd.d/services
+
+ # install license
+ install -Dm644 COPYRIGHT $pkgdir/usr/share/licenses/$pkgname/COPYRIGHT
+}
diff --git a/core/xinetd/servers b/core/xinetd/servers
new file mode 100644
index 000000000..f064c8d7a
--- /dev/null
+++ b/core/xinetd/servers
@@ -0,0 +1,10 @@
+service servers
+{
+ type = INTERNAL UNLISTED
+ port = 9099
+ socket_type = stream
+ protocol = tcp
+ wait = no
+ disable = yes
+ only_from = 127.0.0.1
+}
diff --git a/core/xinetd/services b/core/xinetd/services
new file mode 100644
index 000000000..4ea304c4f
--- /dev/null
+++ b/core/xinetd/services
@@ -0,0 +1,10 @@
+service services
+{
+ type = INTERNAL UNLISTED
+ port = 9098
+ socket_type = stream
+ protocol = tcp
+ wait = no
+ disable = yes
+ only_from = 127.0.0.1
+}
diff --git a/core/xinetd/xinetd b/core/xinetd/xinetd
new file mode 100755
index 000000000..4b8fa369a
--- /dev/null
+++ b/core/xinetd/xinetd
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/xinetd`
+case "$1" in
+ start)
+ stat_busy "Starting xinetd"
+ [ -z "$PID" ] && /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ echo $PID > /var/run/xinetd.pid
+ add_daemon xinetd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping xinetd"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm -f /var/run/xinetd.pid
+ rm_daemon xinetd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/core/xinetd/xinetd.conf b/core/xinetd/xinetd.conf
new file mode 100644
index 000000000..b15d9f649
--- /dev/null
+++ b/core/xinetd/xinetd.conf
@@ -0,0 +1,14 @@
+#
+# /etc/xinetd.conf
+#
+
+defaults
+{
+ instances = 60
+ log_type = SYSLOG authpriv
+ log_on_success = HOST PID
+ log_on_failure = HOST
+ cps = 25 30
+}
+
+includedir /etc/xinetd.d
diff --git a/core/xz/PKGBUILD b/core/xz/PKGBUILD
new file mode 100644
index 000000000..98dbf5c9c
--- /dev/null
+++ b/core/xz/PKGBUILD
@@ -0,0 +1,41 @@
+# $Id: PKGBUILD 117398 2011-04-01 14:53:42Z pierre $
+# Maintainer: Pierre Schmitz <pierre@archlinux.de>
+# Contributor: François Charette <firmicus@gmx.net>
+
+pkgname=xz
+pkgver=5.0.1
+pkgrel=1
+pkgdesc='Library and command line tools for XZ and LZMA compressed files'
+arch=('i686' 'x86_64')
+url='http://tukaani.org/xz/'
+license=('GPL' 'LGPL' 'custom')
+depends=('sh')
+provides=('lzma' 'lzma-utils' 'xz-utils')
+replaces=('lzma' 'lzma-utils' 'xz-utils')
+conflicts=('lzma' 'lzma-utils' 'xz-utils')
+options=('!libtool')
+source=("http://tukaani.org/${pkgname}/${pkgname}-${pkgver}.tar.xz")
+md5sums=('85d15b01a405616a888d09e19fb40f31')
+
+# keep an upgrade path for older installations
+PKGEXT='.pkg.tar.gz'
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ ./configure --prefix=/usr \
+ --disable-rpath \
+ --enable-werror
+ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+ make
+ make check
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+ install -d -m755 ${pkgdir}/usr/share/licenses/xz/
+ ln -sf /usr/share/doc/xz/COPYING ${pkgdir}/usr/share/licenses/xz/
+ ln -sf /usr/share/licenses/common/GPL2/license.txt ${pkgdir}/usr/share/doc/xz/COPYING.GPLv2
+}
diff --git a/core/zlib/PKGBUILD b/core/zlib/PKGBUILD
new file mode 100644
index 000000000..ee91eff75
--- /dev/null
+++ b/core/zlib/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 100000 2010-11-19 17:40:38Z pierre $
+# Maintainer: Pierre Schmitz <pierre@archlinux.de>
+
+pkgname=zlib
+pkgver=1.2.5
+pkgrel=3
+pkgdesc='Compression library implementing the deflate compression method found in gzip and PKZIP'
+arch=('i686' 'x86_64')
+license=('custom')
+url="http://www.zlib.net/"
+depends=('glibc')
+options=('!makeflags')
+source=("http://zlib.net/zlib-${pkgver}.tar.gz"
+ 'zlib-1.2.5-lfs-decls.patch')
+md5sums=('c735eab2d659a96e5a594c9e8541ad63'
+ '4cb279ea3beab621f3526bf7b7ab99e5')
+
+build() {
+ cd ${srcdir}/zlib-$pkgver
+ # see http://bugs.archlinux.org/task/19280
+ patch -p1 -i ${srcdir}/zlib-1.2.5-lfs-decls.patch || return 1
+ # work around gcc bug; see https://bugs.archlinux.org/task/20647
+ export CFLAGS="${CFLAGS/-O2/-O3} -fno-tree-vectorize -DUNALIGNED_OK"
+ ./configure --prefix=/usr
+ make
+
+ grep -A 24 '^ Copyright' zlib.h > LICENSE
+}
+
+package() {
+ cd ${srcdir}/zlib-$pkgver
+ make install DESTDIR=${pkgdir}
+ install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/zlib/LICENSE
+}
diff --git a/core/zlib/zlib-1.2.5-lfs-decls.patch b/core/zlib/zlib-1.2.5-lfs-decls.patch
new file mode 100644
index 000000000..36e26af03
--- /dev/null
+++ b/core/zlib/zlib-1.2.5-lfs-decls.patch
@@ -0,0 +1,13 @@
+Index: zlib-1.2.5/zlib.h
+===================================================================
+--- zlib-1.2.5.orig/zlib.h
++++ zlib-1.2.5/zlib.h
+@@ -1578,7 +1578,7 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF(
+ # define gzoffset gzoffset64
+ # define adler32_combine adler32_combine64
+ # define crc32_combine crc32_combine64
+-# ifdef _LARGEFILE64_SOURCE
++# ifndef _LARGEFILE64_SOURCE
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));