code:
# Cross-compiles utilities needed for git-annex on Android,
# and builds the Android app.

# Add Android cross-compiler to PATH (as installed by ghc-android)
ANDROID_CROSS_COMPILER?=$(HOME)/.ghc/$(shell cat abiversion)/bin
PATH:=$(ANDROID_CROSS_COMPILER):$(PATH)

# Paths to the Android SDK and NDK.
export ANDROID_SDK_ROOT?=$(HOME)/.android/adt-bundle-linux-x86/sdk
export ANDROID_NDK_ROOT?=$(HOME)/.android/android-ndk

# Where to store the source tree used to build utilities. This
# directory will be created by `make source`.
GIT_ANNEX_ANDROID_SOURCETREE?=$(HOME)/.android/git-annex-sourcetree

GITTREE=$(GIT_ANNEX_ANDROID_SOURCETREE)/git/installed-tree

VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<../../CHANGELOG)

build: start
	if [ ! -e "$(GIT_ANNEX_ANDROID_SOURCETREE)" ]; then $(MAKE) source; fi
	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp
	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/build-stamp
	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/build-stamp
	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/build-stamp
	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg/build-stamp
	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/git/build-stamp
	$(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/term/build-stamp

	perl -i -pe 's/(android:versionName=)"[^"]+"/$$1"'$(VER)'"/' $(GIT_ANNEX_ANDROID_SOURCETREE)/term/AndroidManifest.xml

	# Debug build because it does not need signing keys.
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && tools/build-debug

	# Install executables as pseudo-libraries so they will be
	# unpacked from the .apk.
	mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.busybox.so
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/ssh $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.ssh.so
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/ssh-keygen $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.ssh-keygen.so
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/rsync $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.rsync.so
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg/g10/gpg $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.gpg.so
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git.so
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git-shell $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-shell.so
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git-upload-pack $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-upload-pack.so
	arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/*
	cp runshell $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.runshell.so
	cp start $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.start.so

	# remove git stuff we don't need to save space
	rm -rf $(GITTREE)/bin/git-cvsserver \
		$(GITTREE)/libexec/git-core/git-daemon \
		$(GITTREE)/libexec/git-core/git-show-index \
		$(GITTREE)/libexec/git-core/mergetools \
		$(GITTREE)/libexec/git-core/git-credential-* \
		$(GITTREE)/libexec/git-core/git-cvsserver \
		$(GITTREE)/libexec/git-core/git-cvsimport \
		$(GITTREE)/libexec/git-core/git-fast-import \
		$(GITTREE)/libexec/git-core/git-http-backend \
		$(GITTREE)/libexec/git-core/git-imap-send \
		$(GITTREE)/libexec/git-core/git-instaweb \
		$(GITTREE)/libexec/git-core/git-p4 \
		$(GITTREE)/libexec/git-core/git-remote-test* \
		$(GITTREE)/libexec/git-core/git-submodule \
		$(GITTREE)/libexec/git-core/git-svn \
		$(GITTREE)/libexec/git-core/git-web--browse
	# Most of git is in one multicall binary, but a few important
	# commands are still shell scripts. Those are put into
	# a tarball, along with a list of all the links that should be
	# set up.
	cd $(GITTREE) && mkdir -p links
	cd $(GITTREE) && find -samefile bin/git -not -wholename ./bin/git > links/git
	cd $(GITTREE) && find -samefile bin/git-shell -not -wholename ./bin/git-shell > links/git-shell
	cd $(GITTREE) && find -samefile bin/git-upload-pack -not -wholename ./bin/git-upload-pack > links/git-upload-pack
	cd $(GITTREE) && find -type f -not -samefile bin/git -not -samefile bin/git-shell -not -samefile bin/git-upload-pack|tar czf ../git.tar.gz -T -
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git.tar.gz $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git.tar.gz.so

	git rev-parse HEAD > $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.version.so
	cp ../trustedkeys.gpg $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.trustedkeys.so

	mkdir -p ../../tmp/4.0 ../../tmp/4.3

	cp ../../tmp/androidtree/dist/build/git-annex/4.3/git-annex $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so
	arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && ant debug
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/term/bin/Term-debug.apk ../../tmp/4.3/git-annex.apk

	cp ../../tmp/androidtree/dist/build/git-annex/4.0/git-annex $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so
	arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && ant debug
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/term/bin/Term-debug.apk ../../tmp/4.0/git-annex.apk

$(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp:
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && CC=$$(which cc) ./Configure android
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && $(MAKE)
	touch $@

$(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/build-stamp: openssh.patch openssh.config.h
	# This is a known-good version that the patch works with.
	# TODO: Upgrade
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && git reset --hard 0a8617ed5af2f0248d0e9648e26b224e16ada742
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && ./configure --host=arm-linux-androideabi --with-ssl-dir=../openssl --without-openssl-header-check
	cat openssh.patch | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && patch -p1)
	cp openssh.config.h $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/config.h
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && sed -i -e 's/getrrsetbyname.o //' openbsd-compat/Makefile
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && sed -i -e 's/auth-passwd.o //' Makefile
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && $(MAKE) ssh ssh-keygen
	touch $@

$(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/build-stamp: busybox_config
	cp busybox_config $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/.config
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox && git reset --hard a758e3e1e04e7705f5d37b2f27be654cd0e7282c
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox && yes '' | $(MAKE) oldconfig
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox && $(MAKE)
	touch $@

$(GIT_ANNEX_ANDROID_SOURCETREE)/git/build-stamp: git.patch
	cat git.patch | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/git && git am)
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/git && $(MAKE) install NO_OPENSSL=1 NO_GETTEXT=1 NO_GECOS_IN_PWENT=1 NO_GETPASS=1 NO_NSEC=1 NO_MKDTEMP=1 NO_PTHREADS=1 NO_PERL=1 NO_CURL=1 NO_EXPAT=1 NO_TCLTK=1 NO_ICONV=1 prefix= DESTDIR=installed-tree
	touch $@

$(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/build-stamp: rsync.patch
	# This is a known-good version that the patch works with.
	cat rsync.patch | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync && git reset --hard eec26089b1c7bdbb260674480ffe6ece257bca63 && git am)
	cp $(GIT_ANNEX_ANDROID_SOURCETREE)/automake/lib/config.sub $(GIT_ANNEX_ANDROID_SOURCETREE)/automake/lib/config.guess $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync && ./configure --host=arm-linux-androideabi --disable-locale --disable-iconv-open --disable-iconv --disable-acl-support --disable-xattr-support
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync && $(MAKE)
	touch $@

$(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg/build-stamp:
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg && git checkout gnupg-1.4.15
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg && ./autogen.sh
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg && ./configure --host=arm-linux-androideabi --disable-gnupg-iconv --disable-card-support --disable-agent-support --disable-photo-viewers --disable-keyserver-helpers --disable-nls
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg; $(MAKE) || true # expected failure in doc build
	touch $@

$(GIT_ANNEX_ANDROID_SOURCETREE)/term/build-stamp: term.patch icons
	# This is a known-good version that the patch works with.
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && git reset --hard 3d34b3c42295c215b62e70f3ee696dd664ba08ce
	cat term.patch | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && patch -p1)
	(cd icons && tar c .) | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term/res && tar x)
	# This renaming has a purpose. It makes the path to the app's
	# /data directory shorter, which makes ssh connection caching
	# sockets placed there have more space for their filenames.
	# Also, it avoids overlap with the Android Terminal Emulator
	# app, if it's also installed.
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && find -name .git -prune -o -type f -print0 | xargs -0 perl -pi -e 's/jackpal/ga/g'
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && perl -pi -e 's/Terminal Emulator/Git Annex/g' res/*/strings.xml
	cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && echo y | tools/update.sh
	touch $@

source: $(GIT_ANNEX_ANDROID_SOURCETREE)

$(GIT_ANNEX_ANDROID_SOURCETREE):
	mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)
	git clone git://git.savannah.gnu.org/automake.git $(GIT_ANNEX_ANDROID_SOURCETREE)/automake
	git clone git://git.debian.org/git/d-i/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox
	git clone git://git.kernel.org/pub/scm/git/git.git $(GIT_ANNEX_ANDROID_SOURCETREE)/git
	git clone git://git.samba.org/rsync.git $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync
	git clone git://git.gnupg.org/gnupg.git $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg
	git clone git://git.openssl.org/openssl $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl
	git clone git://github.com/CyanogenMod/android_external_openssh.git $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh
	git clone git://github.com/jackpal/Android-Terminal-Emulator.git $(GIT_ANNEX_ANDROID_SOURCETREE)/term

clean:
	rm -rf $(GITTREE)
	rm -f start

reallyclean: clean
	rm -rf $(GIT_ANNEX_ANDROID_SOURCETREE)

path: standalone/android/Makefile


repo_name: kakafarm/git

path: standalone/android/abiversion

license: unknown


code:
#!/bin/sh
set -e
if [ "$(whoami)" != root ]; then
	echo "Must run this as root!" >&2
	exit 1
fi

debootstrap --arch=i386 stable debian-stable-android
cp $0-inchroot debian-stable-android/tmp
cp $0-inchroot-asuser debian-stable-android/tmp
cp $(dirname $0)/abiversion debian-stable-android/tmp

# Don't use these vars in the chroot.
unset TMP
unset TEMP
unset TMPDIR
unset TEMPDIR

chroot debian-stable-android "tmp/$(basename $0)-inchroot"

echo
echo
echo "debian-stable-android is set up, with a user builder"
echo "your next step is probably to check out git-annex in this chroot"
echo "and run standalone/android/install-haskell-packages"
echo
echo

path: standalone/android/buildchroot


code:
#!/bin/sh
# Runs inside the chroot set up by buildchroot
set -e
set -x
if [ "$(whoami)" != root ]; then
	echo "Must run this as root!" >&2
	exit 1
fi

# java needs this mounted to work
mount -t proc proc /proc || true

echo "deb-src http://ftp.us.debian.org/debian stable main" >> /etc/apt/sources.list
apt-get update
apt-get -y install build-essential ghc git libncurses5-dev cabal-install
apt-get -y install happy alex
apt-get -y install llvm-3.0 # not 3.1; buggy on arm. 3.2 is ok too
apt-get -y install ca-certificates curl file m4 autoconf zlib1g-dev
apt-get -y install libgnutls-dev libxml2-dev libgsasl7-dev pkg-config c2hs
apt-get -y install ant default-jdk rsync wget gnupg lsof
apt-get -y install gettext unzip python
apt-get -y install locales
# works around a dependncy issue with the current hjsmin
apt-get -y install libghc-hjsmin-dev
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
locale-gen
apt-get clean
wget http://snapshot.debian.org/archive/debian/20130903T155330Z/pool/main/a/automake-1.14/automake_1.14-1_all.deb
dpkg -i automake*.deb
rm *.deb
useradd builder --create-home || true
su builder -c $0-asuser

path: standalone/android/buildchroot-inchroot


code:
#!/bin/sh
# Runs inside the chroot set up by buildchroot, as the user it creates
set -e
set -x

# Put in /tmp by buildchroot, but when bootstrapping with propellor,
# this is run inside a checked out git-annex tree.
if [ -e /tmp/abiversion ]; then
	ABIVERSION=$(cat /tmp/abiversion)
else
	ABIVERSION=$(cat standalone/android/abiversion)
fi

cd
rm -rf .ghc .cabal .android
cabal update
cabal install happy alex --bindir=$HOME/bin
PATH=$HOME/bin:$PATH
export PATH
mkdir -p .android
cd .android
git clone https://github.com/joeyh/ghc-android
cd ghc-android
git checkout stable-ghc-snapshot
./build

# This saves 2 gb, and the same sources are in build-*/ghc
rm -rf stage0

# Set up android SDK where the git-annex android Makefile
# expects to find it.
cd ..
ln -s ghc-android/android-ndk-* android-ndk
wget http://dl.google.com/android/adt/adt-bundle-linux-x86-20130917.zip
unzip adt*.zip
rm adt*.zip
mv adt-bundle-linux-x86-* adt-bundle-linux-x86
rm -rf adt-bundle-linux-x86/eclipse

# The git-annex android Makefile needs this cc symlink.
ln -s arm-linux-androideabi-gcc $HOME/.ghc/$ABIVERSION/bin/cc

git config --global user.email androidbuilder@example.com
git config --global user.name androidbuilder


code:
# Run "make android2_defconfig", then "make".
#
# Tested with the standalone toolchain from ndk r6:
# android-ndk-r6/build/tools/make-standalone-toolchain.sh --platform=android-8
#
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 is not set
# 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 is not set
# CONFIG_UNICODE_USING_LOCALE is not set
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
CONFIG_SUBST_WCHAR=0
CONFIG_LAST_SUPPORTED_WCHAR=0
# 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 is not set
# CONFIG_FEATURE_DEVPTS is not set
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_UTMP is not set
# CONFIG_FEATURE_WTMP is not set
# CONFIG_FEATURE_PIDFILE is not set
# CONFIG_FEATURE_SUID is not set
# 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="/proc/self/exe"
CONFIG_FEATURE_SYSLOG=y
# CONFIG_FEATURE_HAVE_RPC is not set

#
# 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 is not set
CONFIG_CROSS_COMPILER_PREFIX="arm-linux-androideabi-"
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_FEATURE_SYSTEMD is not set
# CONFIG_FEATURE_RTMINMAX is not set
CONFIG_PASSWORD_MINLEN=6
CONFIG_MD5_SMALL=1
# CONFIG_FEATURE_FAST_TOP is not set
# CONFIG_FEATURE_ETC_NETWORKS is not set
CONFIG_FEATURE_USE_TERMIOS=y
# CONFIG_FEATURE_EDITING is not set
CONFIG_FEATURE_EDITING_MAX_LEN=0
# CONFIG_FEATURE_EDITING_VI is not set
CONFIG_FEATURE_EDITING_HISTORY=0
# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set
# CONFIG_FEATURE_TAB_COMPLETION is not set
# CONFIG_FEATURE_USERNAME_COMPLETION is not set
# CONFIG_FEATURE_EDITING_FANCY_PROMPT is not set
# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
# CONFIG_FEATURE_NON_POSIX_CP is not set
# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
CONFIG_FEATURE_COPYBUF_KB=4
# CONFIG_FEATURE_SKIP_ROOTFS is not set
# CONFIG_MONOTONIC_SYSCALL is not set
# CONFIG_IOCTL_HEX2STR_ERROR is not set
# CONFIG_FEATURE_HWIB is not set

#
# Applets
#

#
# Archival Utilities
#
CONFIG_FEATURE_SEAMLESS_XZ=y
CONFIG_FEATURE_SEAMLESS_LZMA=y
CONFIG_FEATURE_SEAMLESS_BZ2=y
CONFIG_FEATURE_SEAMLESS_GZ=y
CONFIG_FEATURE_SEAMLESS_Z=y
CONFIG_AR=y
CONFIG_FEATURE_AR_LONG_FILENAMES=y
CONFIG_FEATURE_AR_CREATE=y
CONFIG_BUNZIP2=y
CONFIG_BZIP2=y
CONFIG_CPIO=y
CONFIG_FEATURE_CPIO_O=y
CONFIG_FEATURE_CPIO_P=y
CONFIG_DPKG=y
CONFIG_DPKG_DEB=y
# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
CONFIG_GUNZIP=y
CONFIG_GZIP=y
# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
CONFIG_LZOP=y
CONFIG_LZOP_COMPR_HIGH=y
CONFIG_RPM2CPIO=y
CONFIG_RPM=y
CONFIG_TAR=y
CONFIG_FEATURE_TAR_CREATE=y
CONFIG_FEATURE_TAR_AUTODETECT=y
CONFIG_FEATURE_TAR_FROM=y
CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
# CONFIG_FEATURE_TAR_TO_COMMAND is not set
CONFIG_FEATURE_TAR_UNAME_GNAME=y
CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
# CONFIG_FEATURE_TAR_SELINUX is not set
CONFIG_UNCOMPRESS=y
CONFIG_UNLZMA=y
CONFIG_FEATURE_LZMA_FAST=y
CONFIG_LZMA=y
CONFIG_UNXZ=y
CONFIG_XZ=y
CONFIG_UNZIP=y

#
# 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_ID is not set
# CONFIG_GROUPS is not set
CONFIG_TEST=y
CONFIG_FEATURE_TEST_64=y
CONFIG_TOUCH=y
CONFIG_TR=y
CONFIG_FEATURE_TR_CLASSES=y
CONFIG_FEATURE_TR_EQUIV=y
CONFIG_BASE64=y
CONFIG_CAL=y
CONFIG_CATV=y
CONFIG_CHGRP=y
CONFIG_CHMOD=y
CONFIG_CHOWN=y
# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
CONFIG_CHROOT=y
CONFIG_CKSUM=y
CONFIG_COMM=y
CONFIG_CP=y
# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
CONFIG_CUT=y
CONFIG_DD=y
CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y
CONFIG_FEATURE_DD_IBS_OBS=y
# CONFIG_DF is not set
# CONFIG_FEATURE_DF_FANCY is not set
CONFIG_DIRNAME=y
CONFIG_DOS2UNIX=y
CONFIG_UNIX2DOS=y
CONFIG_DU=y
CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
CONFIG_ECHO=y
CONFIG_FEATURE_FANCY_ECHO=y
# CONFIG_ENV is not set
# CONFIG_FEATURE_ENV_LONG_OPTIONS is not set
CONFIG_EXPAND=y
# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
# CONFIG_EXPR is not set
# CONFIG_EXPR_MATH_SUPPORT_64 is not set
CONFIG_FALSE=y
CONFIG_FOLD=y
# CONFIG_FSYNC is not set
CONFIG_HEAD=y
CONFIG_FEATURE_FANCY_HEAD=y
# CONFIG_HOSTID is not set
CONFIG_INSTALL=y
# CONFIG_FEATURE_INSTALL_LONG_OPTIONS 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=y
CONFIG_MKDIR=y
# CONFIG_FEATURE_MKDIR_LONG_OPTIONS is not set
CONFIG_MKFIFO=y
CONFIG_MKNOD=y
CONFIG_MV=y
# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
CONFIG_NICE=y
CONFIG_NOHUP=y
CONFIG_OD=y
CONFIG_PRINTENV=y
CONFIG_PRINTF=y
CONFIG_PWD=y
CONFIG_READLINK=y
CONFIG_FEATURE_READLINK_FOLLOW=y
CONFIG_REALPATH=y
CONFIG_RM=y
CONFIG_RMDIR=y
# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
CONFIG_SEQ=y
CONFIG_SHA1SUM=y
CONFIG_SHA256SUM=y
CONFIG_SHA512SUM=y
CONFIG_SLEEP=y
CONFIG_FEATURE_FANCY_SLEEP=y
CONFIG_FEATURE_FLOAT_SLEEP=y
CONFIG_SORT=y
CONFIG_FEATURE_SORT_BIG=y
CONFIG_SPLIT=y
CONFIG_FEATURE_SPLIT_FANCY=y
# CONFIG_STAT is not set
# CONFIG_FEATURE_STAT_FORMAT is not set
CONFIG_STTY=y
CONFIG_SUM=y
CONFIG_SYNC=y
CONFIG_TAC=y
CONFIG_TAIL=y
CONFIG_FEATURE_FANCY_TAIL=y
CONFIG_TEE=y
CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
CONFIG_TRUE=y
# CONFIG_TTY is not set
CONFIG_UNAME=y
CONFIG_UNEXPAND=y
# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
CONFIG_UNIQ=y
# CONFIG_USLEEP is not set
CONFIG_UUDECODE=y
CONFIG_UUENCODE=y
CONFIG_WC=y
CONFIG_FEATURE_WC_LARGE=y
# CONFIG_WHO is not set
CONFIG_WHOAMI=y
CONFIG_YES=y

#
# Common options for cp and mv
#
CONFIG_FEATURE_PRESERVE_HARDLINKS=y

#
# Common options for ls, more and telnet
#
CONFIG_FEATURE_AUTOWIDTH=y

#
# Common options for df, du, ls
#
CONFIG_FEATURE_HUMAN_READABLE=y

#
# Common options for md5sum, sha1sum, sha256sum, sha512sum
#
CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y

#
# Console Utilities
#
CONFIG_CHVT=y
CONFIG_FGCONSOLE=y
CONFIG_CLEAR=y
CONFIG_DEALLOCVT=y
CONFIG_DUMPKMAP=y
# CONFIG_KBD_MODE is not set
# CONFIG_LOADFONT is not set
CONFIG_LOADKMAP=y
CONFIG_OPENVT=y
CONFIG_RESET=y
CONFIG_RESIZE=y
CONFIG_FEATURE_RESIZE_PRINT=y
CONFIG_SETCONSOLE=y
# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
# CONFIG_SETFONT is not set
# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
CONFIG_DEFAULT_SETFONT_DIR=""
CONFIG_SETKEYCODES=y
CONFIG_SETLOGCONS=y
CONFIG_SHOWKEY=y
# CONFIG_FEATURE_LOADFONT_PSF2 is not set
# CONFIG_FEATURE_LOADFONT_RAW is not set

#
# Debian Utilities
#
CONFIG_MKTEMP=y
CONFIG_PIPE_PROGRESS=y
CONFIG_RUN_PARTS=y
# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
CONFIG_FEATURE_RUN_PARTS_FANCY=y
CONFIG_START_STOP_DAEMON=y
CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
CONFIG_WHICH=y

#
# Editors
#
CONFIG_PATCH=y
CONFIG_VI=y
CONFIG_FEATURE_VI_MAX_LEN=0
# CONFIG_FEATURE_VI_8BIT is not set
# CONFIG_FEATURE_VI_COLON is not set
# CONFIG_FEATURE_VI_YANKMARK is not set
CONFIG_FEATURE_VI_SEARCH=y
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
CONFIG_FEATURE_VI_USE_SIGNALS=y
# CONFIG_FEATURE_VI_DOT_CMD is not set
# CONFIG_FEATURE_VI_READONLY is not set
# CONFIG_FEATURE_VI_SETOPTS is not set
# CONFIG_FEATURE_VI_SET is not set
CONFIG_FEATURE_VI_WIN_RESIZE=y
# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
# CONFIG_FEATURE_VI_OPTIMIZE_CURSOR is not set
# CONFIG_AWK is not set
# CONFIG_FEATURE_AWK_LIBM is not set
CONFIG_CMP=y
CONFIG_DIFF=y
# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
CONFIG_FEATURE_DIFF_DIR=y
# CONFIG_ED is not set
CONFIG_SED=y
# CONFIG_FEATURE_ALLOW_EXEC is not set

#
# Finding Utilities
#
CONFIG_FIND=y
CONFIG_FEATURE_FIND_PRINT0=y
CONFIG_FEATURE_FIND_MTIME=y
# CONFIG_FEATURE_FIND_MMIN is not set
CONFIG_FEATURE_FIND_PERM=y
CONFIG_FEATURE_FIND_TYPE=y
# 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 is not set
# CONFIG_FEATURE_GREP_FGREP_ALIAS is not set
# CONFIG_FEATURE_GREP_CONTEXT is not set
CONFIG_XARGS=y
CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y

#
# 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 is not set
# 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="linux"
# CONFIG_MESG is not set
# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y

#
# 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=y
# CONFIG_FSCK is not set
CONFIG_LSATTR=y
CONFIG_TUNE2FS=y

#
# Linux Module Utilities
#
# CONFIG_MODINFO is not set
# CONFIG_MODPROBE_SMALL is not set
# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y
# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y
# CONFIG_INSMOD is not set
# CONFIG_RMMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
# 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 is not set
# CONFIG_FEATURE_MODUTILS_ALIAS is not set
# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
# CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
# CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"

#
# Linux System Utilities
#
CONFIG_BLOCKDEV=y
CONFIG_REV=y
# CONFIG_ACPID is not set
# CONFIG_FEATURE_ACPID_COMPAT is not set
CONFIG_BLKID=y
# CONFIG_FEATURE_BLKID_TYPE is not set
CONFIG_DMESG=y
CONFIG_FEATURE_DMESG_PRETTY=y
CONFIG_FBSET=y
CONFIG_FEATURE_FBSET_FANCY=y
CONFIG_FEATURE_FBSET_READMODE=y
CONFIG_FDFLUSH=y
CONFIG_FDFORMAT=y
CONFIG_FDISK=y
CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
CONFIG_FEATURE_FDISK_WRITABLE=y
# 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=y
CONFIG_FINDFS=y
CONFIG_FLOCK=y
CONFIG_FREERAMDISK=y
# 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=y
CONFIG_HD=y
# 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=y
CONFIG_LSUSB=y
# 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=y
CONFIG_FEATURE_MKSWAP_UUID=y
CONFIG_MORE=y
# CONFIG_MOUNT is not set
# CONFIG_FEATURE_MOUNT_FAKE is not set
# CONFIG_FEATURE_MOUNT_VERBOSE is not set
# CONFIG_FEATURE_MOUNT_HELPERS is not set
# CONFIG_FEATURE_MOUNT_LABEL is not set
# CONFIG_FEATURE_MOUNT_NFS is not set
# CONFIG_FEATURE_MOUNT_CIFS is not set
# CONFIG_FEATURE_MOUNT_FLAGS is not set
# CONFIG_FEATURE_MOUNT_FSTAB is not set
# CONFIG_PIVOT_ROOT is not set
# CONFIG_RDATE is not set
CONFIG_RDEV=y
CONFIG_READPROFILE=y
CONFIG_RTCWAKE=y
CONFIG_SCRIPT=y
CONFIG_SCRIPTREPLAY=y
# CONFIG_SETARCH is not set
# CONFIG_SWAPONOFF is not set
# CONFIG_FEATURE_SWAPON_PRI is not set
# CONFIG_SWITCH_ROOT is not set
# CONFIG_UMOUNT is not set
# CONFIG_FEATURE_UMOUNT_ALL is not set
# CONFIG_FEATURE_MOUNT_LOOP is not set
# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set
# CONFIG_FEATURE_MTAB_SUPPORT is not set
CONFIG_VOLUMEID=y

#
# Filesystem/Volume identification
#
CONFIG_FEATURE_VOLUMEID_EXT=y
CONFIG_FEATURE_VOLUMEID_BTRFS=y
CONFIG_FEATURE_VOLUMEID_REISERFS=y
CONFIG_FEATURE_VOLUMEID_FAT=y
CONFIG_FEATURE_VOLUMEID_HFS=y
CONFIG_FEATURE_VOLUMEID_JFS=y
CONFIG_FEATURE_VOLUMEID_XFS=y
CONFIG_FEATURE_VOLUMEID_NTFS=y
CONFIG_FEATURE_VOLUMEID_ISO9660=y
CONFIG_FEATURE_VOLUMEID_UDF=y
CONFIG_FEATURE_VOLUMEID_LUKS=y
CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
CONFIG_FEATURE_VOLUMEID_CRAMFS=y
CONFIG_FEATURE_VOLUMEID_ROMFS=y
CONFIG_FEATURE_VOLUMEID_SYSV=y
CONFIG_FEATURE_VOLUMEID_OCFS2=y
CONFIG_FEATURE_VOLUMEID_LINUXRAID=y

#
# Miscellaneous Utilities
#
# CONFIG_CONSPY is not set
# CONFIG_NANDWRITE is not set
CONFIG_NANDDUMP=y
CONFIG_SETSERIAL=y
# CONFIG_UBIATTACH is not set
# CONFIG_UBIDETACH is not set
# CONFIG_UBIMKVOL is not set
# CONFIG_UBIRMVOL is not set
# CONFIG_UBIRSVOL is not set
# CONFIG_UBIUPDATEVOL is not set
# CONFIG_ADJTIMEX is not set
# CONFIG_BBCONFIG is not set
# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
CONFIG_BEEP=y
CONFIG_FEATURE_BEEP_FREQ=4000
CONFIG_FEATURE_BEEP_LENGTH_MS=30
CONFIG_CHAT=y
CONFIG_FEATURE_CHAT_NOFAIL=y
# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
CONFIG_FEATURE_CHAT_IMPLICIT_CR=y
CONFIG_FEATURE_CHAT_SWALLOW_OPTS=y
CONFIG_FEATURE_CHAT_SEND_ESCAPES=y
CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y
CONFIG_FEATURE_CHAT_CLR_ABORT=y
CONFIG_CHRT=y
# 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=y
CONFIG_FEATURE_DC_LIBM=y
# 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=y
# CONFIG_EJECT is not set
# CONFIG_FEATURE_EJECT_SCSI is not set
CONFIG_FBSPLASH=y
CONFIG_FLASHCP=y
CONFIG_FLASH_LOCK=y
CONFIG_FLASH_UNLOCK=y
# CONFIG_FLASH_ERASEALL is not set
# CONFIG_IONICE is not set
CONFIG_INOTIFYD=y
# CONFIG_LAST is not set
# CONFIG_FEATURE_LAST_SMALL is not set
# CONFIG_FEATURE_LAST_FANCY is not set
# CONFIG_LESS is not set
CONFIG_FEATURE_LESS_MAXLINES=0
# CONFIG_FEATURE_LESS_BRACKETS is not set
# CONFIG_FEATURE_LESS_FLAGS is not set
# 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=y
CONFIG_FEATURE_HDPARM_GET_IDENTITY=y
CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y
CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF=y
CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET=y
CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF=y
CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA=y
CONFIG_MAKEDEVS=y
# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
CONFIG_FEATURE_MAKEDEVS_TABLE=y
CONFIG_MAN=y
# CONFIG_MICROCOM is not set
# CONFIG_MOUNTPOINT is not set
# CONFIG_MT is not set
CONFIG_RAIDAUTORUN=y
# CONFIG_READAHEAD is not set
# CONFIG_RFKILL is not set
# CONFIG_RUNLEVEL is not set
CONFIG_RX=y
CONFIG_SETSID=y
CONFIG_STRINGS=y
# CONFIG_TASKSET is not set
# CONFIG_FEATURE_TASKSET_FANCY is not set
CONFIG_TIME=y
CONFIG_TIMEOUT=y
CONFIG_TTYSIZE=y
CONFIG_VOLNAME=y
# CONFIG_WALL is not set
# CONFIG_WATCHDOG is not set

#
# Networking Utilities
#
# CONFIG_NAMEIF is not set
# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
CONFIG_NBDCLIENT=y
CONFIG_NC=y
CONFIG_NC_SERVER=y
CONFIG_NC_EXTRA=y
# CONFIG_NC_110_COMPAT is not set
# CONFIG_PING is not set
# CONFIG_PING6 is not set
# CONFIG_FEATURE_FANCY_PING is not set
CONFIG_WHOIS=y
# CONFIG_FEATURE_IPV6 is not set
# CONFIG_FEATURE_UNIX_LOCAL is not set
# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
CONFIG_ARP=y
# 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=y
# CONFIG_ETHER_WAKE is not set
CONFIG_FAKEIDENTD=y
CONFIG_FTPD=y
CONFIG_FEATURE_FTP_WRITE=y
CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST=y
CONFIG_FTPGET=y
CONFIG_FTPPUT=y
# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
# CONFIG_HOSTNAME is not set
CONFIG_HTTPD=y
CONFIG_FEATURE_HTTPD_RANGES=y
CONFIG_FEATURE_HTTPD_USE_SENDFILE=y
CONFIG_FEATURE_HTTPD_SETUID=y
CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
CONFIG_FEATURE_HTTPD_CGI=y
CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y
CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
CONFIG_FEATURE_HTTPD_PROXY=y
CONFIG_FEATURE_HTTPD_GZIP=y
CONFIG_IFCONFIG=y
CONFIG_FEATURE_IFCONFIG_STATUS=y
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
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=y
CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
CONFIG_FEATURE_IFUPDOWN_IP=y
CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y
# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set
CONFIG_FEATURE_IFUPDOWN_IPV4=y
# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
CONFIG_FEATURE_IFUPDOWN_MAPPING=y
# 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=y
CONFIG_FEATURE_IPCALC_FANCY=y
# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
CONFIG_NETSTAT=y
CONFIG_FEATURE_NETSTAT_WIDE=y
CONFIG_FEATURE_NETSTAT_PRG=y
# CONFIG_NSLOOKUP is not set
# CONFIG_NTPD is not set
# CONFIG_FEATURE_NTPD_SERVER is not set
CONFIG_PSCAN=y
CONFIG_ROUTE=y
# CONFIG_SLATTACH is not set
CONFIG_TCPSVD=y
# CONFIG_TELNET is not set
# 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 is not set
# CONFIG_TFTPD is not set
# CONFIG_FEATURE_TFTP_GET is not set
# 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=y
CONFIG_FEATURE_TUNCTL_UG=y
# 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_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
CONFIG_DHCPD_LEASES_FILE=""
CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
# CONFIG_FEATURE_UDHCP_PORT is not set
CONFIG_UDHCP_DEBUG=9
CONFIG_FEATURE_UDHCP_RFC3397=y
CONFIG_FEATURE_UDHCP_8021Q=y
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"
# 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 is not set
CONFIG_FEATURE_WGET_TIMEOUT=y
# CONFIG_ZCIP is not set

#
# Print Utilities
#
CONFIG_LPD=y
CONFIG_LPR=y
CONFIG_LPQ=y

#
# Mail Utilities
#
CONFIG_MAKEMIME=y
CONFIG_FEATURE_MIME_CHARSET="us-ascii"
CONFIG_POPMAILDIR=y
CONFIG_FEATURE_POPMAILDIR_DELIVERY=y
CONFIG_REFORMIME=y
CONFIG_FEATURE_REFORMIME_COMPAT=y
CONFIG_SENDMAIL=y

#
# Process Utilities
#
CONFIG_IOSTAT=y
CONFIG_MPSTAT=y
CONFIG_NMETER=y
CONFIG_PMAP=y
# CONFIG_POWERTOP is not set
CONFIG_PSTREE=y
CONFIG_PWDX=y
CONFIG_SMEMCAP=y
# CONFIG_FREE is not set
CONFIG_FUSER=y
# CONFIG_KILL is not set
# CONFIG_KILLALL is not set
# CONFIG_KILLALL5 is not set
# CONFIG_PGREP is not set
CONFIG_PIDOF=y
CONFIG_FEATURE_PIDOF_SINGLE=y
CONFIG_FEATURE_PIDOF_OMIT=y
# CONFIG_PKILL is not set
# CONFIG_PS is not set
# CONFIG_FEATURE_PS_WIDE is not set
# 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=y
CONFIG_BB_SYSCTL=y
CONFIG_TOP=y
CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
CONFIG_FEATURE_TOP_SMP_CPU=y
CONFIG_FEATURE_TOP_DECIMALS=y
CONFIG_FEATURE_TOP_SMP_PROCESS=y
CONFIG_FEATURE_TOPMEM=y
CONFIG_FEATURE_SHOW_THREADS=y
# CONFIG_UPTIME is not set
CONFIG_WATCH=y

#
# Runit Utilities
#
CONFIG_RUNSV=y
CONFIG_RUNSVDIR=y
# CONFIG_FEATURE_RUNSVDIR_LOG is not set
CONFIG_SV=y
CONFIG_SV_DEFAULT_SERVICE_DIR="/var/service"
CONFIG_SVLOGD=y
CONFIG_CHPST=y
CONFIG_SETUIDGID=y
CONFIG_ENVUIDGID=y
CONFIG_ENVDIR=y
CONFIG_SOFTLIMIT=y
# 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 is not set
# CONFIG_ASH_IDLE_TIMEOUT is not set
CONFIG_ASH_JOB_CONTROL=y
# CONFIG_ASH_ALIAS is not set
CONFIG_ASH_GETOPTS=y
# CONFIG_ASH_BUILTIN_ECHO is not set
# CONFIG_ASH_BUILTIN_PRINTF is not set
# CONFIG_ASH_BUILTIN_TEST is not set
# CONFIG_ASH_CMDCMD is not set
# CONFIG_ASH_MAIL is not set
# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set
# CONFIG_ASH_RANDOM_SUPPORT is not set
# CONFIG_ASH_EXPAND_PRMT is not set
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 is not set
# CONFIG_SH_MATH_SUPPORT_64 is not set
# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
CONFIG_FEATURE_SH_STANDALONE=y
# CONFIG_FEATURE_SH_NOFORK is not set
# CONFIG_FEATURE_SH_HISTFILESIZE 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_CFG 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=y
CONFIG_FEATURE_KLOGD_KLOGCTL=y
# CONFIG_LOGGER is not set


code:
#!/bin/sh
# Removes all currently installed cross-compiled haskell packages
# except those part of ghc.
# Useful if the build failed.
rm -f $(grep -l $HOME/.ghc/$(cat abiversion)/.cabal/lib/ $HOME/.ghc/android-14/arm-linux-androideabi-4.8/lib/*-ghc-*/package.conf.d/*.conf)
$HOME/.ghc/$(cat abiversion)/arm-linux-androideabi/bin/ghc-pkg recache


code:
From 014dadb02fd984828a6232534c47dba8e2f7818a Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Wed, 13 Feb 2013 15:29:52 -0400
Subject: [PATCH] android patch for dropbear

* Disable HOME override
* Use urandom to avoid blocking on every ssh connection.
* Enable use of netbsd_getpass.c
---
 cli-auth.c |    1 +
 cli-main.c |    2 --
 options.h  |    2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/cli-auth.c b/cli-auth.c
index 4c17a21..91dfdf8 100644
--- a/cli-auth.c
+++ b/cli-auth.c
@@ -31,6 +31,7 @@
 #include "ssh.h"
 #include "packet.h"
 #include "runopts.h"
+#include "netbsd_getpass.c"

 void cli_authinitialise() {

diff --git a/cli-main.c b/cli-main.c
index 106006b..68cf023 100644
--- a/cli-main.c
+++ b/cli-main.c
@@ -47,8 +47,6 @@ int main(int argc, char ** argv) {
 	_dropbear_exit = cli_dropbear_exit;
 	_dropbear_log = cli_dropbear_log;

-	putenv("HOME=/data/local");
-
 	disallow_core();

 	cli_getopts(argc, argv);
diff --git a/options.h b/options.h
index 7625151..48e404d 100644
--- a/options.h
+++ b/options.h
@@ -159,7 +159,7 @@ etc) slower (perhaps by 50%). Recommended for most small systems. */
  * however significantly reduce the security of your ssh connections
  * if the PRNG state becomes guessable - make sure you know what you are
  * doing if you change this. */
-#define DROPBEAR_RANDOM_DEV "/dev/random"
+#define DROPBEAR_RANDOM_DEV "/dev/urandom"

 /* prngd must be manually set up to produce output */
 /*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/
--
1.7.10.4


code:
From ec690f617cab405ec2c6420bde53e9d9ed984e5c Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 3 Jul 2014 15:55:17 -0400
Subject: [PATCH] Revert "config: preserve config file permissions on edits"

This reverts commit daa22c6f8da466bd7a438f1bc27375fd737ffcf3.

This breaks on Android's /sdcard, which has a variety of FUSE
implentations, all total shite.

diff --git a/config.c b/config.c
index a1aef1c..7f3303d 100644
--- a/config.c
+++ b/config.c
@@ -1637,13 +1637,6 @@ int git_config_set_multivar_in_file(const char *config_filename,
 			MAP_PRIVATE, in_fd, 0);
 		close(in_fd);

-		if (fchmod(fd, st.st_mode & 07777) < 0) {
-			error("fchmod on %s failed: %s",
-				lock->filename, strerror(errno));
-			ret = CONFIG_NO_WRITE;
-			goto out_free;
-		}
-
 		if (store.seen == 0)
 			store.seen = 1;

@@ -1792,7 +1785,6 @@ int git_config_rename_section_in_file(const char *config_filename,
 	int out_fd;
 	char buf[1024];
 	FILE *config_file;
-	struct stat st;

 	if (new_name && !section_name_is_ok(new_name)) {
 		ret = error("invalid section name: %s", new_name);
@@ -1814,14 +1806,6 @@ int git_config_rename_section_in_file(const char *config_filename,
 		goto unlock_and_out;
 	}

-	fstat(fileno(config_file), &st);
-
-	if (fchmod(out_fd, st.st_mode & 07777) < 0) {
-		ret = error("fchmod on %s failed: %s",
-				lock->filename, strerror(errno));
-		goto out;
-	}
-
 	while (fgets(buf, sizeof(buf), config_file)) {
 		int i;
 		int length;
--
2.0.1


code:
From 3779c75175e895f94b21341ebd6361e9d6af54fd Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 9 May 2013 12:36:23 -0400
Subject: [PATCH] support Android cert store

Android puts it in a different place and has only hashed files.
See https://github.com/vincenthz/hs-certificate/issues/19
---
 System/Certificate/X509/Unix.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/System/Certificate/X509/Unix.hs b/System/Certificate/X509/Unix.hs
index 8463465..74e9503 100644
--- a/System/Certificate/X509/Unix.hs
+++ b/System/Certificate/X509/Unix.hs
@@ -35,7 +35,8 @@ import qualified Control.Exception as E
 import Data.Char

 defaultSystemPath :: FilePath
-defaultSystemPath = "/etc/ssl/certs/"
+defaultSystemPath = "/system/etc/security/cacerts/"
+--defaultSystemPath = "/etc/ssl/certs/"

 envPathOverride :: String
 envPathOverride = "SYSTEM_CERTIFICATE_PATH"
@@ -47,7 +48,7 @@ listDirectoryCerts path = (map (path </>) . filter isCert <$> getDirectoryConten
                         && isDigit (s !! 9)
                         && (s !! 8) == '.'
                         && all isHexDigit (take 8 s)
-          isCert x = (not $ isPrefixOf "." x) && (not $ isHashedFile x)
+          isCert x = (not $ isPrefixOf "." x)

 getSystemCertificateStore :: IO CertificateStore
 getSystemCertificateStore = makeCertificateStore . concat <$> (getSystemPath >>= listDirectoryCerts >>= mapM readCertificates)
--
1.8.2.rc3


code:
From 589c6a87ec62e35942c9a86ea8d91b443c80da99 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Fri, 18 Oct 2013 23:07:02 +0000
Subject: [PATCH] cross build

---
 comonad.cabal |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/comonad.cabal b/comonad.cabal
index 5d34b13..756ed92 100644
--- a/comonad.cabal
+++ b/comonad.cabal
@@ -13,7 +13,7 @@ copyright:     Copyright (C) 2008-2013 Edward A. Kmett,
                Copyright (C) 2004-2008 Dave Menendez
 synopsis:      Comonads
 description:   Comonads
-build-type:    Custom
+build-type:    Simple
 extra-source-files:
   .ghci
   .gitignore
--
1.7.10.4


code:
From 0cfdb30120976290068f4bcbebbf236b960afbb6 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Thu, 26 Dec 2013 20:01:30 -0400
Subject: [PATCH] hack to build

---
 Crypto/Number/Basic.hs         |   14 --------------
 Crypto/Number/ModArithmetic.hs |   29 -----------------------------
 Crypto/Number/Prime.hs         |   18 ------------------
 crypto-numbers.cabal           |    2 +-
 4 files changed, 1 insertion(+), 62 deletions(-)

diff --git a/Crypto/Number/Basic.hs b/Crypto/Number/Basic.hs
index 65c14b3..eaee853 100644
--- a/Crypto/Number/Basic.hs
+++ b/Crypto/Number/Basic.hs
@@ -20,11 +20,7 @@ module Crypto.Number.Basic
     , areEven
     ) where

-#if MIN_VERSION_integer_gmp(0,5,1)
-import GHC.Integer.GMP.Internals
-#else
 import Data.Bits
-#endif

 -- | sqrti returns two integer (l,b) so that l <= sqrt i <= b
 -- the implementation is quite naive, use an approximation for the first number
@@ -63,25 +59,16 @@ sqrti i
 -- gcde 'a' 'b' find (x,y,gcd(a,b)) where ax + by = d
 --
 gcde :: Integer -> Integer -> (Integer, Integer, Integer)
-#if MIN_VERSION_integer_gmp(0,5,1)
-gcde a b = (s, t, g)
-  where (# g, s #) = gcdExtInteger a b
-        t = (g - s * a) `div` b
-#else
 gcde a b = if d < 0 then (-x,-y,-d) else (x,y,d) where
     (d, x, y)                     = f (a,1,0) (b,0,1)
     f t              (0, _, _)    = t
     f (a', sa, ta) t@(b', sb, tb) =
         let (q, r) = a' `divMod` b' in
         f t (r, sa - (q * sb), ta - (q * tb))
-#endif

 -- | get the extended GCD of two integer using the extended binary algorithm (HAC 14.61)
 -- get (x,y,d) where d = gcd(a,b) and x,y satisfying ax + by = d
 gcde_binary :: Integer -> Integer -> (Integer, Integer, Integer)
-#if MIN_VERSION_integer_gmp(0,5,1)
-gcde_binary = gcde
-#else
 gcde_binary a' b'
     | b' == 0   = (1,0,a')
     | a' >= b'  = compute a' b'
@@ -105,7 +92,6 @@ gcde_binary a' b'
              in if u2 >= v2
                 then loop g x y (u2 - v2) v2 (a2 - c2) (b2 - d2) c2 d2
                 else loop g x y u2 (v2 - u2) a2 b2 (c2 - a2) (d2 - b2)
-#endif

 -- | check if a list of integer are all even
 areEven :: [Integer] -> Bool
diff --git a/Crypto/Number/ModArithmetic.hs b/Crypto/Number/ModArithmetic.hs
index 942c12f..f8cfc32 100644
--- a/Crypto/Number/ModArithmetic.hs
+++ b/Crypto/Number/ModArithmetic.hs
@@ -29,12 +29,8 @@ module Crypto.Number.ModArithmetic
 import Control.Exception (throw, Exception)
 import Data.Typeable

-#if MIN_VERSION_integer_gmp(0,5,1)
-import GHC.Integer.GMP.Internals
-#else
 import Crypto.Number.Basic (gcde_binary)
 import Data.Bits
-#endif

 -- | Raised when two numbers are supposed to be coprimes but are not.
 data CoprimesAssertionError = CoprimesAssertionError
@@ -55,13 +51,7 @@ expSafe :: Integer -- ^ base
         -> Integer -- ^ exponant
         -> Integer -- ^ modulo
         -> Integer -- ^ result
-#if MIN_VERSION_integer_gmp(0,5,1)
-expSafe b e m
-    | odd m     = powModSecInteger b e m
-    | otherwise = powModInteger b e m
-#else
 expSafe = exponentiation
-#endif

 -- | Compute the modular exponentiation of base^exponant using
 -- the fastest algorithm without any consideration for
@@ -74,11 +64,7 @@ expFast :: Integer -- ^ base
         -> Integer -- ^ modulo
         -> Integer -- ^ result
 expFast =
-#if MIN_VERSION_integer_gmp(0,5,1)
-    powModInteger
-#else
     exponentiation
-#endif

 -- note on exponentiation: 0^0 is treated as 1 for mimicking the standard library;
 -- the mathematic debate is still open on whether or not this is true, but pratically
@@ -87,22 +73,15 @@ expFast =
 -- | exponentiation_rtl_binary computes modular exponentiation as b^e mod m
 -- using the right-to-left binary exponentiation algorithm (HAC 14.79)
 exponentiation_rtl_binary :: Integer -> Integer -> Integer -> Integer
-#if MIN_VERSION_integer_gmp(0,5,1)
-exponentiation_rtl_binary = expSafe
-#else
 exponentiation_rtl_binary 0 0 m = 1 `mod` m
 exponentiation_rtl_binary b e m = loop e b 1
     where sq x          = (x * x) `mod` m
           loop !0 _  !a = a `mod` m
           loop !i !s !a = loop (i `shiftR` 1) (sq s) (if odd i then a * s else a)
-#endif

 -- | exponentiation computes modular exponentiation as b^e mod m
 -- using repetitive squaring.
 exponentiation :: Integer -> Integer -> Integer -> Integer
-#if MIN_VERSION_integer_gmp(0,5,1)
-exponentiation = expSafe
-#else
 exponentiation b e m
     | b == 1    = b
     | e == 0    = 1
@@ -110,7 +89,6 @@ exponentiation b e m
     | even e    = let p = (exponentiation b (e `div` 2) m) `mod` m
                    in (p^(2::Integer)) `mod` m
     | otherwise = (b * exponentiation b (e-1) m) `mod` m
-#endif

 --{-# DEPRECATED exponantiation_rtl_binary "typo in API name it's called exponentiation_rtl_binary #-}
 exponantiation_rtl_binary :: Integer -> Integer -> Integer -> Integer
@@ -122,17 +100,10 @@ exponantiation = exponentiation

 -- | inverse computes the modular inverse as in g^(-1) mod m
 inverse :: Integer -> Integer -> Maybe Integer
-#if MIN_VERSION_integer_gmp(0,5,1)
-inverse g m
-    | r == 0    = Nothing
-    | otherwise = Just r
-  where r = recipModInteger g m
-#else
 inverse g m
     | d > 1     = Nothing
     | otherwise = Just (x `mod` m)
   where (x,_,d) = gcde_binary g m
-#endif

 -- | Compute the modular inverse of 2 coprime numbers.
 -- This is equivalent to inverse except that the result
diff --git a/Crypto/Number/Prime.hs b/Crypto/Number/Prime.hs
index 0cea9da..458c94d 100644
--- a/Crypto/Number/Prime.hs
+++ b/Crypto/Number/Prime.hs
@@ -3,9 +3,7 @@
 #ifndef MIN_VERSION_integer_gmp
 #define MIN_VERSION_integer_gmp(a,b,c) 0
 #endif
-#if MIN_VERSION_integer_gmp(0,5,1)
 {-# LANGUAGE MagicHash #-}
-#endif
 -- |
 -- Module      : Crypto.Number.Prime
 -- License     : BSD-style
@@ -30,12 +28,7 @@ import Crypto.Number.Generate
 import Crypto.Number.Basic (sqrti, gcde_binary)
 import Crypto.Number.ModArithmetic (exponantiation)

-#if MIN_VERSION_integer_gmp(0,5,1)
-import GHC.Integer.GMP.Internals
-import GHC.Base
-#else
 import Data.Bits
-#endif

 -- | returns if the number is probably prime.
 -- first a list of small primes are implicitely tested for divisibility,
@@ -78,21 +71,11 @@ findPrimeFromWith rng prop !n
 -- | find a prime from a starting point with no specific property.
 findPrimeFrom :: CPRG g => g -> Integer -> (Integer, g)
 findPrimeFrom rng n =
-#if MIN_VERSION_integer_gmp(0,5,1)
-    (nextPrimeInteger n, rng)
-#else
     findPrimeFromWith rng (\g _ -> (True, g)) n
-#endif

 -- | Miller Rabin algorithm return if the number is probably prime or composite.
 -- the tries parameter is the number of recursion, that determines the accuracy of the test.
 primalityTestMillerRabin :: CPRG g => g -> Int -> Integer -> (Bool, g)
-#if MIN_VERSION_integer_gmp(0,5,1)
-primalityTestMillerRabin rng (I# tries) !n =
-    case testPrimeInteger n tries of
-        0# -> (False, rng)
-        _  -> (True, rng)
-#else
 primalityTestMillerRabin rng tries !n
     | n <= 3     = error "Miller-Rabin requires tested value to be > 3"
     | even n     = (False, rng)
@@ -129,7 +112,6 @@ primalityTestMillerRabin rng tries !n
                   | x2 == 1   = False
                   | x2 /= nm1 = loop' ws ((x2*x2) `mod` n) (r+1)
                   | otherwise = loop ws
-#endif

 {-
     n < z -> witness to test
diff --git a/crypto-numbers.cabal b/crypto-numbers.cabal
index 9610e34..6669d78 100644
--- a/crypto-numbers.cabal
+++ b/crypto-numbers.cabal
@@ -15,7 +15,7 @@ Extra-Source-Files:  Tests/*.hs

 Flag integer-gmp
   Description: Are we using integer-gmp?
-  Default: True
+  Default: False

 Library
   Build-Depends:     base >= 4 && < 5
--
1.7.10.4


code:
From 86eca0993e1716b4db14570836efbe838626892f Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Sun, 25 May 2014 09:11:15 +0200
Subject: [PATCH] cross build

---
 distributive.cabal | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/distributive.cabal b/distributive.cabal
index 9be5133..3e72c65 100644
--- a/distributive.cabal
+++ b/distributive.cabal
@@ -12,7 +12,7 @@ bug-reports:   http://github.com/ekmett/distributive/issues
 copyright:     Copyright (C) 2011-2014 Edward A. Kmett
 synopsis:      Distributive functors -- Dual to Traversable
 description:   Distributive functors -- Dual to Traversable
-build-type:    Custom
+build-type:    Simple
 extra-source-files:
   .ghci
   .travis.yml
--
2.0.0.rc2


code:
From aaef1aadb21a198475a656132ef4488b85b8fd1b Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Thu, 3 Jul 2014 23:22:47 +0000
Subject: [PATCH] use android net.dns1 command instead of resolv.conf file

Android has no /etc/resolv.conf. Some might have /system/etc/resolv.conf,
but even that does not seem likely.

This is likely a little slow, but is at least fine for git-annex's uses,
since it only uses this library for occasional SRV lookups.
---
 Network/DNS/Resolver.hs |   11 +++++++++--
 dns.cabal               |    1 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Network/DNS/Resolver.hs b/Network/DNS/Resolver.hs
index e4124b8..7aca431 100644
--- a/Network/DNS/Resolver.hs
+++ b/Network/DNS/Resolver.hs
@@ -19,7 +19,7 @@ module Network.DNS.Resolver (
   ) where

 import Control.Applicative ((<$>), (<*>), pure)
-import Control.Exception (bracket)
+import Control.Exception (bracket, catch, IOException)
 import qualified Data.ByteString.Char8 as BS
 import Data.Char (isSpace)
 import Data.List (isPrefixOf)
@@ -32,6 +32,7 @@ import Network.Socket (AddrInfoFlag(..), AddrInfo(..), SockAddr(..), PortNumber(
 import Prelude hiding (lookup)
 import System.Random (getStdRandom, randomR)
 import System.Timeout (timeout)
+import System.Process

 #if mingw32_HOST_OS == 1
 import Network.Socket (send)
@@ -132,7 +133,13 @@ makeResolvSeed conf = ResolvSeed <$> addr
     addr = case resolvInfo conf of
         RCHostName numhost -> makeAddrInfo numhost Nothing
         RCHostPort numhost mport -> makeAddrInfo numhost $ Just mport
-        RCFilePath file -> toAddr <$> readFile file >>= \i -> makeAddrInfo i Nothing
+        RCFilePath file -> do
+		-- Android has no /etc/resolv.conf; use getprop command.
+		ls <- catch (lines <$> readProcess "getprop" ["net.dns1"] []) (const (return []) :: IOException -> IO [String])
+		let addr = case ls of
+			[] -> "8.8.8.8" -- google public dns as a fallback only
+			(l:_) -> l
+		makeAddrInfo addr Nothing
     toAddr cs = let l:_ = filter ("nameserver" `isPrefixOf`) $ lines cs
                 in extract l
     extract = reverse . dropWhile isSpace . reverse . dropWhile isSpace . drop 11
diff --git a/dns.cabal b/dns.cabal
index 0a08a9e..724a3e0 100644
--- a/dns.cabal
+++ b/dns.cabal
@@ -38,6 +38,7 @@ Library
                       , network >= 2.3
                       , random
                       , resourcet
+                      , process
   else
     Build-Depends:      base >= 4 && < 5
                       , attoparsec
--
1.7.10.4


code:
From a3cc880bd06a8d7efda79339afa81e02decbd04b Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Mon, 14 Jul 2014 21:01:25 +0000
Subject: [PATCH] fix cross build

---
 entropy.cabal |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/entropy.cabal b/entropy.cabal
index 914d33a..9ab80f7 100644
--- a/entropy.cabal
+++ b/entropy.cabal
@@ -16,7 +16,7 @@ bug-reports:    https://github.com/TomMD/entropy/issues
 stability:      stable
 -- build-type:  Simple
 -- ^^ Used for HaLVM
-build-type:        Custom
+build-type:        Simple
 -- ^^ Test for RDRAND support using 'ghc'
 cabal-version:  >=1.10
 tested-with:    GHC == 7.8.2
--
1.7.10.4


code:
From 311aab1ae9d7a653edfbec1351f548b98de85c4b Mon Sep 17 00:00:00 2001
From: androidbuilder <androidbuilder@example.com>
Date: Mon, 26 May 2014 21:54:18 +0000
Subject: [PATCH] hack gnutls to link on android

This uses a hardcoded path to the library, which includes the
arm-linux-androideabi-4.8 part. Will need to be changed when that changes..

Have to list all the libraries that gnutls depends on, pkgconfig depends
seems not to be working.
---
 gnutls.cabal |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnutls.cabal b/gnutls.cabal
index 5bfe687..61db23f 100644
--- a/gnutls.cabal
+++ b/gnutls.cabal
@@ -31,16 +31,17 @@ source-repository this
 library
   hs-source-dirs: lib
   ghc-options: -Wall -O2
+  LD-Options: -L /home/builder/.ghc/android-14/arm-linux-androideabi-4.8/sysroot/usr/lib/
+
+  extra-libraries: gnutls nettle hogweed gmp z
+  pkgconfig-depends: gnutls

   build-depends:
       base >= 4.0 && < 5.0
-    , bytestring >= 0.9
+    , bytestring >= 0.10.3.0
     , transformers >= 0.2
     , monads-tf >= 0.1 && < 0.2

-  extra-libraries: gnutls
-  pkgconfig-depends: gnutls
-
   exposed-modules:
     Network.Protocol.TLS.GNU

--
1.7.10.4


code:
From df0f41f92d003f7d59ef927737ffec3a9bd61827 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Tue, 7 May 2013 18:41:01 -0400
Subject: [PATCH] avoid cabal hell

---
 gsasl.cabal |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gsasl.cabal b/gsasl.cabal
index d991873..c5c2b19 100644
--- a/gsasl.cabal
+++ b/gsasl.cabal
@@ -31,7 +31,7 @@ library
   build-depends:
       base >= 4.0 && < 5.0
     , transformers >= 0.2
-    , bytestring >= 0.9
+    , bytestring >= 0.10.3.0

   pkgconfig-depends: libgsasl >= 1.1

--
1.7.10.4


code:
From 7beec2e707d59f9573aa2dc7c57bd2a62f16b480 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Wed, 15 May 2013 19:06:03 -0400
Subject: [PATCH] build without IPv6 stuff

---
 Data/IP.hs      |    2 +-
 Data/IP/Addr.hs |    3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Data/IP.hs b/Data/IP.hs
index cffef93..ea486c9 100644
--- a/Data/IP.hs
+++ b/Data/IP.hs
@@ -6,7 +6,7 @@ module Data.IP (
   -- ** IP data
     IP (..)
   , IPv4, toIPv4, fromIPv4, fromHostAddress, toHostAddress
-  , IPv6, toIPv6, fromIPv6, fromHostAddress6, toHostAddress6
+  , IPv6, toIPv6, fromIPv6 -- , fromHostAddress6, toHostAddress6
   -- ** IP range data
   , IPRange (..)
   , AddrRange (addr, mask, mlen)
diff --git a/Data/IP/Addr.hs b/Data/IP/Addr.hs
index faaf0c7..5b556fb 100644
--- a/Data/IP/Addr.hs
+++ b/Data/IP/Addr.hs
@@ -312,6 +312,7 @@ toHostAddress (IP4 addr4)
   | byteOrder == LittleEndian = fixByteOrder addr4
   | otherwise                 = addr4

+{-
 -- | The 'fromHostAddress6' function converts 'HostAddress6' to 'IPv6'.
 fromHostAddress6 :: HostAddress6 -> IPv6
 fromHostAddress6 = IP6
@@ -320,6 +321,8 @@ fromHostAddress6 = IP6
 toHostAddress6 :: IPv6 -> HostAddress6
 toHostAddress6 (IP6 addr6) = addr6

+-}
+
 fixByteOrder :: Word32 -> Word32
 fixByteOrder s = d1 .|. d2 .|. d3 .|. d4
   where
--
1.7.10.4


code:
From cb5252db1a0d515da69d9167a8b2facd839940b2 Mon Sep 17 00:00:00 2001
From: androidbuilder <androidbuilder@example.com>
Date: Mon, 11 Nov 2013 02:29:06 +0000
Subject: [PATCH] fix build with new ghc

---
 src/Language/JavaScript/Parser/Lexer.hs |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Language/JavaScript/Parser/Lexer.hs b/src/Language/JavaScript/Parser/Lexer.hs
index 79fa9c5..fa96e29 100644
--- a/src/Language/JavaScript/Parser/Lexer.hs
+++ b/src/Language/JavaScript/Parser/Lexer.hs
@@ -712,7 +712,7 @@ alex_scan_tkn user orig_input len input s last_acc =
 		(offset) = (base +# ord_c)
 		(check)  = alexIndexInt16OffAddr alex_check offset

-		(new_s) = if (offset >=# 0#) && (check ==# ord_c)
+		(new_s) = if (tagToEnum# (offset >=# 0#)) && (tagToEnum# (check ==# ord_c))
 			  then alexIndexInt16OffAddr alex_table offset
 			  else alexIndexInt16OffAddr alex_deflt s
 	in
--
1.7.10.4


code:
From 7861b133bb269b50fcf709291449cb0473818902 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Sun, 29 Dec 2013 21:29:23 +0000
Subject: [PATCH] remove Network.BSD symbols not available in bionic

---
 Network/BSD.hsc |   98 -------------------------------------------------------
 1 file changed, 98 deletions(-)

diff --git a/Network/BSD.hsc b/Network/BSD.hsc
index d6dae85..27910f4 100644
--- a/Network/BSD.hsc
+++ b/Network/BSD.hsc
@@ -30,15 +30,6 @@ module Network.BSD
     , getHostByAddr
     , hostAddress

-#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
-    , getHostEntries
-
-    -- ** Low level functionality
-    , setHostEntry
-    , getHostEntry
-    , endHostEntry
-#endif
-
     -- * Service names
     , ServiceEntry(..)
     , ServiceName
@@ -64,14 +55,6 @@ module Network.BSD
     , getProtocolNumber
     , defaultProtocol

-#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
-    , getProtocolEntries
-    -- ** Low level functionality
-    , setProtocolEntry
-    , getProtocolEntry
-    , endProtocolEntry
-#endif
-
     -- * Port numbers
     , PortNumber

@@ -83,11 +66,7 @@ module Network.BSD
 #if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
     , getNetworkByName
     , getNetworkByAddr
-    , getNetworkEntries
     -- ** Low level functionality
-    , setNetworkEntry
-    , getNetworkEntry
-    , endNetworkEntry
 #endif
     ) where

@@ -303,31 +282,6 @@ getProtocolNumber proto = do
  (ProtocolEntry _ _ num) <- getProtocolByName proto
  return num

-#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
-getProtocolEntry :: IO ProtocolEntry    -- Next Protocol Entry from DB
-getProtocolEntry = withLock $ do
- ent <- throwNoSuchThingIfNull "getProtocolEntry" "no such protocol entry"
-                $ trySysCall c_getprotoent
- peek ent
-
-foreign import ccall unsafe  "getprotoent" c_getprotoent :: IO (Ptr ProtocolEntry)
-
-setProtocolEntry :: Bool -> IO ()       -- Keep DB Open ?
-setProtocolEntry flg = withLock $ trySysCall $ c_setprotoent (fromBool flg)
-
-foreign import ccall unsafe "setprotoent" c_setprotoent :: CInt -> IO ()
-
-endProtocolEntry :: IO ()
-endProtocolEntry = withLock $ trySysCall $ c_endprotoent
-
-foreign import ccall unsafe "endprotoent" c_endprotoent :: IO ()
-
-getProtocolEntries :: Bool -> IO [ProtocolEntry]
-getProtocolEntries stayOpen = withLock $ do
-  setProtocolEntry stayOpen
-  getEntries (getProtocolEntry) (endProtocolEntry)
-#endif
-
 -- ---------------------------------------------------------------------------
 -- Host lookups

@@ -402,31 +356,6 @@ getHostByAddr family addr = do
 foreign import CALLCONV safe "gethostbyaddr"
    c_gethostbyaddr :: Ptr HostAddress -> CInt -> CInt -> IO (Ptr HostEntry)

-#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
-getHostEntry :: IO HostEntry
-getHostEntry = withLock $ do
- throwNoSuchThingIfNull         "getHostEntry" "unable to retrieve host entry"
-   $ trySysCall $ c_gethostent
- >>= peek
-
-foreign import ccall unsafe "gethostent" c_gethostent :: IO (Ptr HostEntry)
-
-setHostEntry :: Bool -> IO ()
-setHostEntry flg = withLock $ trySysCall $ c_sethostent (fromBool flg)
-
-foreign import ccall unsafe "sethostent" c_sethostent :: CInt -> IO ()
-
-endHostEntry :: IO ()
-endHostEntry = withLock $ c_endhostent
-
-foreign import ccall unsafe "endhostent" c_endhostent :: IO ()
-
-getHostEntries :: Bool -> IO [HostEntry]
-getHostEntries stayOpen = do
-  setHostEntry stayOpen
-  getEntries (getHostEntry) (endHostEntry)
-#endif
-
 -- ---------------------------------------------------------------------------
 -- Accessing network information

@@ -488,33 +417,6 @@ getNetworkByAddr addr family = withLock $ do
 foreign import ccall unsafe "getnetbyaddr"
    c_getnetbyaddr  :: NetworkAddr -> CInt -> IO (Ptr NetworkEntry)

-getNetworkEntry :: IO NetworkEntry
-getNetworkEntry = withLock $ do
- throwNoSuchThingIfNull "getNetworkEntry" "no more network entries"
-          $ trySysCall $ c_getnetent
- >>= peek
-
-foreign import ccall unsafe "getnetent" c_getnetent :: IO (Ptr NetworkEntry)
-
--- | Open the network name database. The parameter specifies
--- whether a connection is maintained open between various
--- networkEntry calls
-setNetworkEntry :: Bool -> IO ()
-setNetworkEntry flg = withLock $ trySysCall $ c_setnetent (fromBool flg)
-
-foreign import ccall unsafe "setnetent" c_setnetent :: CInt -> IO ()
-
--- | Close the connection to the network name database.
-endNetworkEntry :: IO ()
-endNetworkEntry = withLock $ trySysCall $ c_endnetent
-
-foreign import ccall unsafe "endnetent" c_endnetent :: IO ()
-
--- | Get the list of network entries.
-getNetworkEntries :: Bool -> IO [NetworkEntry]
-getNetworkEntries stayOpen = do
-  setNetworkEntry stayOpen
-  getEntries (getNetworkEntry) (endNetworkEntry)
 #endif

 -- Mutex for name service lockdown
--
1.7.10.4


code:
From 63a7a97511266c1a9d2414d3314ee17fc88bb8f2 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Fri, 18 Oct 2013 15:58:35 +0000
Subject: [PATCH] configure misdetects accept4

---
 Network/Socket.hsc |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Network/Socket.hsc b/Network/Socket.hsc
index 9af31f8..6c21209 100644
--- a/Network/Socket.hsc
+++ b/Network/Socket.hsc
@@ -503,7 +503,7 @@ accept sock@(MkSocket s family stype protocol status) = do
                 return new_sock
 #else
      with (fromIntegral sz) $ \ ptr_len -> do
-# ifdef HAVE_ACCEPT4
+#if 0
      new_sock <- throwSocketErrorIfMinus1RetryMayBlock "accept"
                         (threadWaitRead (fromIntegral s))
                         (c_accept4 s sockaddr ptr_len (#const SOCK_NONBLOCK))
@@ -1615,7 +1615,7 @@ foreign import CALLCONV SAFE_ON_WIN "connect"
   c_connect :: CInt -> Ptr SockAddr -> CInt{-CSockLen???-} -> IO CInt
 foreign import CALLCONV unsafe "accept"
   c_accept :: CInt -> Ptr SockAddr -> Ptr CInt{-CSockLen???-} -> IO CInt
-#ifdef HAVE_ACCEPT4
+#if 0
 foreign import CALLCONV unsafe "accept4"
   c_accept4 :: CInt -> Ptr SockAddr -> Ptr CInt{-CSockLen???-} -> CInt -> IO CInt
 #endif
--
1.7.10.4


code:
From b1a581007759e2d9e53ef776e4f10d1de87b8377 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Tue, 7 May 2013 14:51:09 -0400
Subject: [PATCH] getprotobyname hack for tcp and udp

Otherwise, core network stuff fails to get the numbers for these protocols.
---
 Network/BSD.hsc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Network/BSD.hsc b/Network/BSD.hsc
index f0c9f5b..a289143 100644
--- a/Network/BSD.hsc
+++ b/Network/BSD.hsc
@@ -259,6 +259,10 @@ instance Storable ProtocolEntry where
    poke _p = error "Storable.poke(BSD.ProtocolEntry) not implemented"

 getProtocolByName :: ProtocolName -> IO ProtocolEntry
+getProtocolByName "tcp" = return $
+	ProtocolEntry {protoName = "tcp", protoAliases = ["TCP"], protoNumber = 6}
+getProtocolByName "udp" = return $
+	ProtocolEntry {protoName = "udp", protoAliases = ["UDP"], protoNumber = 17}
 getProtocolByName name = withLock $ do
  withCString name $ \ name_cstr -> do
  throwNoSuchThingIfNull "getProtocolByName" ("no such protocol name: " ++ name)
--
1.8.2.rc3


code:
From bfecbc7bd09cbbebdef12aa525dc17109326db3f Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Sun, 29 Dec 2013 21:31:07 +0000
Subject: [PATCH] no NODELAY on android

---
 Network/Socket.hsc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Network/Socket.hsc b/Network/Socket.hsc
index 6c21209..c360889 100644
--- a/Network/Socket.hsc
+++ b/Network/Socket.hsc
@@ -923,7 +923,7 @@ packSocketOption so =
     Just MaxSegment    -> Just ((#const IPPROTO_TCP), (#const TCP_MAXSEG))
 #endif
 #ifdef TCP_NODELAY
-    Just NoDelay       -> Just ((#const IPPROTO_TCP), (#const TCP_NODELAY))
+    Just NoDelay       -> Nothing -- Just ((#const IPPROTO_TCP), (#const TCP_NODELAY))
 #endif
 #ifdef TCP_CORK
     Just Cork          -> Just ((#const IPPROTO_TCP), (#const TCP_CORK))
--
1.7.10.4


code:
From b3cb294077b627892721a2ebf9e0ce81f35f8c4c Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Sun, 25 May 2014 09:28:45 +0200
Subject: [PATCH] android port fixes

Build note: Ensure a hsc2hs in PATH is modified to pass -x to the real
one, to enable cross-compiling.
---
 Network/Socket.hsc            | 22 ++++++----------------
 Network/Socket/ByteString.hsc |  2 +-
 Network/Socket/Internal.hsc   |  2 +-
 Network/Socket/Types.hsc      |  4 ++--
 cbits/HsNet.c                 | 14 ++++++++++++++
 configure                     |  1 +
 6 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/Network/Socket.hsc b/Network/Socket.hsc
index 607b270..04a83e8 100644
--- a/Network/Socket.hsc
+++ b/Network/Socket.hsc
@@ -35,7 +35,7 @@ module Network.Socket
     , SockAddr(..)
     , SocketStatus(..)
     , HostAddress
-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORTNO)
     , HostAddress6
     , FlowInfo
     , ScopeID
@@ -52,7 +52,7 @@ module Network.Socket
     , HostName
     , ServiceName

-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORT) || 1
     , AddrInfo(..)

     , AddrInfoFlag(..)
@@ -134,7 +134,7 @@ module Network.Socket
     -- * Special constants
     , aNY_PORT
     , iNADDR_ANY
-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORTNO)
     , iN6ADDR_ANY
 #endif
     , sOMAXCONN
@@ -326,16 +326,6 @@ socket family stype protocol = do
     setNonBlockIfNeeded fd
     socket_status <- newMVar NotConnected
     let sock = MkSocket fd family stype protocol socket_status
-#if HAVE_DECL_IPV6_V6ONLY
-# if defined(mingw32_HOST_OS)
-    -- the IPv6Only option is only supported on Windows Vista and later,
-    -- so trying to change it might throw an error
-    when (family == AF_INET6) $
-            E.catch (setSocketOption sock IPv6Only 0) $ (\(_ :: E.IOException) -> return ())
-# else
-    when (family == AF_INET6) $ setSocketOption sock IPv6Only 0
-# endif
-#endif
     return sock

 -- | Build a pair of connected socket objects using the given address
@@ -1061,9 +1051,9 @@ aNY_PORT = 0
 iNADDR_ANY :: HostAddress
 iNADDR_ANY = htonl (#const INADDR_ANY)

-foreign import CALLCONV unsafe "htonl" htonl :: Word32 -> Word32
+foreign import CALLCONV unsafe "my_htonl" htonl :: Word32 -> Word32

-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORTNO)
 -- | The IPv6 wild card address.

 iN6ADDR_ANY :: HostAddress6
@@ -1241,7 +1231,7 @@ unpackBits ((k,v):xs) r
 -----------------------------------------------------------------------------
 -- Address and service lookups

-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORT) || 1

 -- | Flags that control the querying behaviour of 'getAddrInfo'.
 data AddrInfoFlag
diff --git a/Network/Socket/ByteString.hsc b/Network/Socket/ByteString.hsc
index e21ad1b..c2dd70a 100644
--- a/Network/Socket/ByteString.hsc
+++ b/Network/Socket/ByteString.hsc
@@ -197,7 +197,7 @@ sendMany sock@(MkSocket fd _ _ _ _) cs = do
       liftM fromIntegral . withIOVec cs $ \(iovsPtr, iovsLen) ->
           throwSocketErrorWaitWrite sock "writev" $
               c_writev (fromIntegral fd) iovsPtr
-              (fromIntegral (min iovsLen (#const IOV_MAX)))
+              (fromIntegral (min iovsLen (0x0026)))
 #else
 sendMany sock = sendAll sock . B.concat
 #endif
diff --git a/Network/Socket/Internal.hsc b/Network/Socket/Internal.hsc
index 83333f7..0dd6a7d 100644
--- a/Network/Socket/Internal.hsc
+++ b/Network/Socket/Internal.hsc
@@ -24,7 +24,7 @@ module Network.Socket.Internal
     (
     -- * Socket addresses
       HostAddress
-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORTNO)
     , HostAddress6
     , FlowInfo
     , ScopeID
diff --git a/Network/Socket/Types.hsc b/Network/Socket/Types.hsc
index 48a43bb..1c5994f 100644
--- a/Network/Socket/Types.hsc
+++ b/Network/Socket/Types.hsc
@@ -711,8 +711,8 @@ intToPortNumber v = PortNum (htons (fromIntegral v))
 portNumberToInt :: PortNumber -> Int
 portNumberToInt (PortNum po) = fromIntegral (ntohs po)

-foreign import CALLCONV unsafe "ntohs" ntohs :: Word16 -> Word16
-foreign import CALLCONV unsafe "htons" htons :: Word16 -> Word16
+foreign import CALLCONV unsafe "my_ntohs" ntohs :: Word16 -> Word16
+foreign import CALLCONV unsafe "my_htons" htons :: Word16 -> Word16
 --foreign import CALLCONV unsafe "ntohl" ntohl :: Word32 -> Word32

 instance Enum PortNumber where
diff --git a/cbits/HsNet.c b/cbits/HsNet.c
index 86b55dc..5ea1199 100644
--- a/cbits/HsNet.c
+++ b/cbits/HsNet.c
@@ -6,3 +6,17 @@

 #define INLINE
 #include "HsNet.h"
+
+#include <sys/endian.h>
+uint16_t my_htons(uint16_t v)
+{
+	htons(v);
+}
+uint32_t my_htonl(uint32_t v)
+{
+	htonl(v);
+}
+uint16_t my_ntohs(uint16_t v)
+{
+	ntohs(v);
+}
diff --git a/configure b/configure
index db8240d..41674d9 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,5 @@
 #! /bin/sh
+set -- --host=arm-linux-androideabi
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for Haskell network package 2.3.0.14.
 #
--
2.0.0.rc2


code:
From ff2d1519fb294a123636ac6bd80e50741922c856 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Sun, 25 May 2014 09:41:13 +0200
Subject: [PATCH] disable i386 opt stuff to allow cross-compilation

---
 primitive.cabal | 2 --
 1 file changed, 2 deletions(-)

diff --git a/primitive.cabal b/primitive.cabal
index 9651dfd..b655e8d 100644
--- a/primitive.cabal
+++ b/primitive.cabal
@@ -47,8 +47,6 @@ Library
   cc-options: -O3 -fomit-frame-pointer -Wall
   if !os(solaris)
       cc-options: -ftree-vectorize
-  if arch(i386) || arch(x86_64)
-      cc-options: -msse2

 source-repository head
   type:     git
--
2.0.0.rc2


code:
From e1a2f80f6bec25921ab645a0aaf1c6422a8917ab Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Mon, 11 Nov 2013 01:06:58 +0000
Subject: [PATCH] fix

---
 Network/Socks5/Command.hs  |    8 +-------
 Network/Socks5/Conf.hs     |    1 -
 Network/Socks5/Lowlevel.hs |    1 -
 Network/Socks5/Types.hs    |   18 +-----------------
 Network/Socks5/Wire.hs     |    2 --
 5 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/Network/Socks5/Command.hs b/Network/Socks5/Command.hs
index db95fbd..fdba5ec 100644
--- a/Network/Socks5/Command.hs
+++ b/Network/Socks5/Command.hs
@@ -13,7 +13,6 @@ module Network.Socks5.Command
     , Connect(..)
     , Command(..)
     , connectIPV4
-    , connectIPV6
     , connectDomainName
     -- * lowlevel interface
     , rpc
@@ -29,7 +28,7 @@ import qualified Data.ByteString as B
 import qualified Data.ByteString.Char8 as BC
 import Data.Serialize

-import Network.Socket (Socket, PortNumber, HostAddress, HostAddress6)
+import Network.Socket (Socket, PortNumber, HostAddress)
 import Network.Socket.ByteString

 import Network.Socks5.Types
@@ -65,11 +64,6 @@ connectIPV4 socket hostaddr port = onReply <$> rpc_ socket (Connect $ SocksAddre
     where onReply (SocksAddrIPV4 h, p) = (h, p)
           onReply _                    = error "ipv4 requested, got something different"

-connectIPV6 :: Socket -> HostAddress6 -> PortNumber -> IO (HostAddress6, PortNumber)
-connectIPV6 socket hostaddr6 port = onReply <$> rpc_ socket (Connect $ SocksAddress (SocksAddrIPV6 hostaddr6) port)
-    where onReply (SocksAddrIPV6 h, p) = (h, p)
-          onReply _                    = error "ipv6 requested, got something different"
-
 -- TODO: FQDN should only be ascii, maybe putting a "fqdn" data type
 -- in front to make sure and make the BC.pack safe.
 connectDomainName :: Socket -> String -> PortNumber -> IO (SocksHostAddress, PortNumber)
diff --git a/Network/Socks5/Conf.hs b/Network/Socks5/Conf.hs
index c29ff7b..007d382 100644
--- a/Network/Socks5/Conf.hs
+++ b/Network/Socks5/Conf.hs
@@ -47,5 +47,4 @@ defaultSocksConfFromSockAddr sockaddr = SocksConf server SocksVer5
     where server       = SocksAddress haddr port
           (haddr,port) = case sockaddr of
                              SockAddrInet p h      -> (SocksAddrIPV4 h, p)
-                             SockAddrInet6 p _ h _ -> (SocksAddrIPV6 h, p)
                              _                     -> error "unsupported unix sockaddr type"
diff --git a/Network/Socks5/Lowlevel.hs b/Network/Socks5/Lowlevel.hs
index c10d9b9..2c3d59c 100644
--- a/Network/Socks5/Lowlevel.hs
+++ b/Network/Socks5/Lowlevel.hs
@@ -17,7 +17,6 @@ resolveToSockAddr :: SocksAddress -> IO SockAddr
 resolveToSockAddr (SocksAddress sockHostAddr port) =
     case sockHostAddr of
         SocksAddrIPV4 ha       -> return $ SockAddrInet port ha
-        SocksAddrIPV6 ha6      -> return $ SockAddrInet6 port 0 ha6 0
         SocksAddrDomainName bs -> do he <- getHostByName (BC.unpack bs)
                                      return $ SockAddrInet port (hostAddress he)

diff --git a/Network/Socks5/Types.hs b/Network/Socks5/Types.hs
index 7fbec25..17c7c83 100644
--- a/Network/Socks5/Types.hs
+++ b/Network/Socks5/Types.hs
@@ -19,7 +19,7 @@ module Network.Socks5.Types
 import Data.ByteString (ByteString)
 import Data.Word
 import Data.Data
-import Network.Socket (HostAddress, HostAddress6, PortNumber)
+import Network.Socket (HostAddress, PortNumber)
 import Control.Exception
 import qualified Data.ByteString.Char8 as BC
 import Numeric (showHex)
@@ -53,12 +53,10 @@ data SocksMethod =
 data SocksHostAddress =
       SocksAddrIPV4 !HostAddress
     | SocksAddrDomainName !ByteString
-    | SocksAddrIPV6 !HostAddress6
     deriving (Eq,Ord)

 instance Show SocksHostAddress where
     show (SocksAddrIPV4 ha)       = "SocksAddrIPV4(" ++ showHostAddress ha ++ ")"
-    show (SocksAddrIPV6 ha6)      = "SocksAddrIPV6(" ++ showHostAddress6 ha6 ++ ")"
     show (SocksAddrDomainName dn) = "SocksAddrDomainName(" ++ BC.unpack dn ++ ")"

 -- | Converts a HostAddress to a String in dot-decimal notation
@@ -69,20 +67,6 @@ showHostAddress num = concat [show q1, ".", show q2, ".", show q3, ".", show q4]
         (num''',q3) = num'' `quotRem` 256
         (_,q4)      = num''' `quotRem` 256

--- | Converts a IPv6 HostAddress6 to standard hex notation
-showHostAddress6 :: HostAddress6 -> String
-showHostAddress6 (a,b,c,d) =
-    (concat . intersperse ":" . map (flip showHex ""))
-        [p1,p2,p3,p4,p5,p6,p7,p8]
-    where (a',p2) = a `quotRem` 65536
-          (_,p1)  = a' `quotRem` 65536
-          (b',p4) = b `quotRem` 65536
-          (_,p3)  = b' `quotRem` 65536
-          (c',p6) = c `quotRem` 65536
-          (_,p5)  = c' `quotRem` 65536
-          (d',p8) = d `quotRem` 65536
-          (_,p7)  = d' `quotRem` 65536
-
 -- | Describe a Socket address on the SOCKS protocol
 data SocksAddress = SocksAddress !SocksHostAddress !PortNumber
     deriving (Show,Eq,Ord)
diff --git a/Network/Socks5/Wire.hs b/Network/Socks5/Wire.hs
index 10bd262..a30f32e 100644
--- a/Network/Socks5/Wire.hs
+++ b/Network/Socks5/Wire.hs
@@ -46,12 +46,10 @@ data SocksResponse = SocksResponse

 getAddr 1 = SocksAddrIPV4 <$> getWord32host
 getAddr 3 = SocksAddrDomainName <$> (getWord8 >>= getByteString . fromIntegral)
-getAddr 4 = SocksAddrIPV6 <$> (liftM4 (,,,) getWord32host getWord32host getWord32host getWord32host)
 getAddr n = error ("cannot get unknown socket address type: " ++ show n)

 putAddr (SocksAddrIPV4 h)         = putWord8 1 >> putWord32host h
 putAddr (SocksAddrDomainName b)   = putWord8 3 >> putWord8 (fromIntegral $ B.length b) >> putByteString b
-putAddr (SocksAddrIPV6 (a,b,c,d)) = putWord8 4 >> mapM_ putWord32host [a,b,c,d]

 getSocksRequest 5 = do
     cmd <- toEnum . fromIntegral <$> getWord8
--
1.7.10.4


code:
From c1b166ad1dbed80f7eed7b9c1b2dc5c668eeb8fc Mon Sep 17 00:00:00 2001
From: androidbuilder <androidbuilder@example.com>
Date: Fri, 18 Oct 2013 23:28:56 +0000
Subject: [PATCH] cross build

---
 stm-chans.cabal |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stm-chans.cabal b/stm-chans.cabal
index 89d4780..2119a74 100644
--- a/stm-chans.cabal
+++ b/stm-chans.cabal
@@ -6,7 +6,7 @@
 -- and source-repository:.
 Cabal-Version:  >= 1.6
 -- We need a custom build in order to define __HADDOCK__
-Build-Type:     Custom
+Build-Type:     Simple

 Name:           stm-chans
 Version:        3.0.0
--
1.7.10.4


code:
From 0e728d5b049224394908d793c73902a8c981e636 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Mon, 26 May 2014 01:04:40 +0000
Subject: [PATCH] fix cross build

---
 system-filepath.cabal |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system-filepath.cabal b/system-filepath.cabal
index d6aa726..f4e5e0f 100644
--- a/system-filepath.cabal
+++ b/system-filepath.cabal
@@ -6,7 +6,7 @@ license-file: license.txt
 author: John Millikin <jmillikin@gmail.com>
 maintainer: John Millikin <jmillikin@gmail.com>
 copyright: John Millikin 2010-2012
-build-type: Custom
+build-type: Simple
 cabal-version: >= 1.8
 category: System
 stability: experimental
--
1.7.10.4


code:
From 0ad071f80ee72e7b8ca5b0b70dfae5bbf8677969 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Wed, 12 Mar 2014 12:18:17 -0400
Subject: [PATCH] cross build

---
 unbounded-delays.cabal |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unbounded-delays.cabal b/unbounded-delays.cabal
index 76d0a50..0f27569 100644
--- a/unbounded-delays.cabal
+++ b/unbounded-delays.cabal
@@ -1,7 +1,7 @@
 name:          unbounded-delays
 version:       0.1.0.6
 cabal-version: >= 1.6
-build-type:    Custom
+build-type:    Simple
 author:        Bas van Dijk <v.dijk.bas@gmail.com>
                Roel van Dijk <vandijk.roel@gmail.com>
 maintainer:    Bas van Dijk <v.dijk.bas@gmail.com>
--
1.7.10.4


code:
From add5feeb9ee9b4ffa1b43e4ba04b63e5ac2bfaf7 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Mon, 14 Jul 2014 20:45:24 +0000
Subject: [PATCH] hack for bionic

---
 Data/UnixTime/Types.hsc |   12 ------------
 cbits/conv.c            |    2 +-
 unix-time.cabal         |    1 -
 3 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/Data/UnixTime/Types.hsc b/Data/UnixTime/Types.hsc
index 2ad0623..04fd766 100644
--- a/Data/UnixTime/Types.hsc
+++ b/Data/UnixTime/Types.hsc
@@ -12,8 +12,6 @@ import Data.Binary

 #include <sys/time.h>

-#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__)
-
 -- |
 -- Data structure for Unix time.
 data UnixTime = UnixTime {
@@ -23,16 +21,6 @@ data UnixTime = UnixTime {
   , utMicroSeconds :: {-# UNPACK #-} !Int32
   } deriving (Eq,Ord,Show)

-instance Storable UnixTime where
-    sizeOf _    = (#size struct timeval)
-    alignment _ = (#alignment struct timeval)
-    peek ptr    = UnixTime
-            <$> (#peek struct timeval, tv_sec)  ptr
-            <*> (#peek struct timeval, tv_usec) ptr
-    poke ptr ut = do
-            (#poke struct timeval, tv_sec)  ptr (utSeconds ut)
-            (#poke struct timeval, tv_usec) ptr (utMicroSeconds ut)
-
 #if __GLASGOW_HASKELL__ >= 704
 instance Binary UnixTime where
         put (UnixTime (CTime sec) msec) = do
diff --git a/cbits/conv.c b/cbits/conv.c
index ec31fef..b7bc0f9 100644
--- a/cbits/conv.c
+++ b/cbits/conv.c
@@ -96,7 +96,7 @@ time_t c_parse_unix_time_gmt(char *fmt, char *src) {
 #else
     strptime(src, fmt, &dst);
 #endif
-    return timegm(&dst);
+    return NULL; /* timegm(&dst); (not in Bionic) */
 }

 size_t c_format_unix_time(char *fmt, time_t src, char* dst, int siz) {
diff --git a/unix-time.cabal b/unix-time.cabal
index 5de3f7c..7a0c244 100644
--- a/unix-time.cabal
+++ b/unix-time.cabal
@@ -15,7 +15,6 @@ Extra-Tmp-Files:        config.log config.status autom4te.cache cbits/config.h
 Library
   Default-Language:     Haskell2010
   GHC-Options:          -Wall
-  CC-Options:           -fPIC
   Exposed-Modules:      Data.UnixTime
   Other-Modules:        Data.UnixTime.Conv
                         Data.UnixTime.Diff
--
1.7.10.4


code:
From 87283f9b6f992a7f0e36c7b1bafc288bf2bf106a Mon Sep 17 00:00:00 2001
From: androidbuilder <androidbuilder@example.com>
Date: Mon, 11 Nov 2013 02:46:27 +0000
Subject: [PATCH] build without v1 uuid which needs network-ino

---
 Data/UUID/Util.hs |   11 -----------
 Data/UUID/V1.hs   |    2 --
 uuid.cabal        |    2 --
 3 files changed, 15 deletions(-)

diff --git a/Data/UUID/Util.hs b/Data/UUID/Util.hs
index 581391a..399e508 100644
--- a/Data/UUID/Util.hs
+++ b/Data/UUID/Util.hs
@@ -3,7 +3,6 @@ module Data.UUID.Util (
     UnpackedUUID(..)
   , unpack, pack
   , version
-  , extractMac
   , extractTime
   , setTime
   ) where
@@ -13,7 +12,6 @@ import Data.Word
 import Data.Word.Util
 import Data.Bits
 import Data.UUID.Internal
-import Network.Info
 import Data.Int (Int64)

 version :: UUID -> Int
@@ -43,12 +41,3 @@ extractTime uuid =
 timeAndVersionToTime :: Word16 -> Word16
 timeAndVersionToTime tv = tv .&. 0x0FFF

-extractMac :: UUID -> Maybe MAC
-extractMac uuid =
-  if version uuid == 1
-  then Just $
-       MAC (node_0 unpacked) (node_1 unpacked) (node_2 unpacked) (node_3 unpacked) (node_4 unpacked) (node_5 unpacked)
-  else Nothing
-  where
-    unpacked = unpack uuid
-
diff --git a/Data/UUID/V1.hs b/Data/UUID/V1.hs
index 067e729..ca4c235 100644
--- a/Data/UUID/V1.hs
+++ b/Data/UUID/V1.hs
@@ -37,8 +37,6 @@ import System.IO.Unsafe

 import qualified System.Random as R

-import Network.Info
-
 import Data.UUID.Builder
 import Data.UUID.Internal

diff --git a/uuid.cabal b/uuid.cabal
index 0a53059..57b1b86 100644
--- a/uuid.cabal
+++ b/uuid.cabal
@@ -32,14 +32,12 @@ Library
                 cryptohash >= 0.7 && < 0.12,
                 deepseq == 1.3.*,
                 hashable (>= 1.1.1.0 && < 1.2.0) || (>= 1.2.1 && < 1.3),
-                network-info == 0.2.*,
                 random >= 1.0.1 && < 1.1,
                 time >= 1.1 && < 1.5

  Exposed-Modules:
    Data.UUID
    Data.UUID.Util
-   Data.UUID.V1
    Data.UUID.V3
    Data.UUID.V4
    Data.UUID.V5
--
1.7.10.4


code:
From 2c736615e38ee4f582af9d98d7169cf07b84d875 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Mon, 10 Feb 2014 23:27:32 +0000
Subject: [PATCH] support Android cert store

Android puts it in a different place and has only hashed files.
See https://github.com/vincenthz/hs-certificate/issues/19
---
 System/X509/Unix.hs |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/System/X509/Unix.hs b/System/X509/Unix.hs
index cbf9bbe..cab4f4a 100644
--- a/System/X509/Unix.hs
+++ b/System/X509/Unix.hs
@@ -34,7 +34,7 @@ import qualified Control.Exception as E
 import Data.Char

 defaultSystemPath :: FilePath
-defaultSystemPath = "/etc/ssl/certs/"
+defaultSystemPath = "/system/etc/security/cacerts/"

 envPathOverride :: String
 envPathOverride = "SYSTEM_CERTIFICATE_PATH"
@@ -46,7 +46,7 @@ listDirectoryCerts path = (map (path </>) . filter isCert <$> getDirectoryConten
                         && isDigit (s !! 9)
                         && (s !! 8) == '.'
                         && all isHexDigit (take 8 s)
-          isCert x = (not $ isPrefixOf "." x) && (not $ isHashedFile x)
+          isCert x = (not $ isPrefixOf "." x)

 getSystemCertificateStore :: IO CertificateStore
 getSystemCertificateStore = makeCertificateStore . concat <$> (getSystemPath >>= listDirectoryCerts >>= mapM readCertificates)
--
1.7.10.4


code:
From 63d07ae4a1e3b77cbe023364599f7c2c3e853d5f Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 28 Feb 2013 23:40:57 -0400
Subject: [PATCH] hack to build on Android

---
 Codec/Compression/Zlib/Stream.hsc |    4 ++--
 zlib.cabal                        |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Codec/Compression/Zlib/Stream.hsc b/Codec/Compression/Zlib/Stream.hsc
index fe851e6..c6168f4 100644
--- a/Codec/Compression/Zlib/Stream.hsc
+++ b/Codec/Compression/Zlib/Stream.hsc
@@ -921,7 +921,7 @@ foreign import ccall unsafe "zlib.h inflateInit2_"

 c_inflateInit2 :: StreamState -> CInt -> IO CInt
 c_inflateInit2 z n =
-  withCAString #{const_str ZLIB_VERSION} $ \versionStr ->
+  withCAString "1.2.5" $ \versionStr ->
     c_inflateInit2_ z n versionStr (#{const sizeof(z_stream)} :: CInt)

 foreign import ccall unsafe "zlib.h inflate"
@@ -940,7 +940,7 @@ foreign import ccall unsafe "zlib.h deflateInit2_"
 c_deflateInit2 :: StreamState
                -> CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt
 c_deflateInit2 z a b c d e =
-  withCAString #{const_str ZLIB_VERSION} $ \versionStr ->
+  withCAString "1.2.5" $ \versionStr ->
     c_deflateInit2_ z a b c d e versionStr (#{const sizeof(z_stream)} :: CInt)

 foreign import ccall unsafe "zlib.h deflateSetDictionary"
--
1.7.10.4


code:
#!/bin/bash
# Bootstraps from an empty cabal to all the necessary haskell packages
# being installed, with the necessary patches to work on Android.
#
# You should install ghc-android first.
#
# Note that the newest version of packages is installed.
# It attempts to reuse patches for older versions, but
# new versions of packages often break cross-compilation by adding TH,
# etc
#
# Future work: Convert to using the method used here:
# https://github.com/kaoskorobase/ghc-ios-cabal-scripts/

set -e

if [ ! -d haskell-patches ]; then
	cd standalone/android
fi

cabalopts="$@"

setupcabal () {
	cabal update

	# Workaround for http://www.reddit.com/r/haskell/comments/26045a/if_youre_finding_cabal_cant_build_your_project/
	# should be able to remove this eventually.
	cabal install transformers-compat -fthree
	cabal install mtl-2.1.3.1

	# Some packages fail to install in a non unicode locale.
	LANG=en_US.UTF-8
	export LANG

	# The android build chroot has recent versions of alex and happy
	# installed here.
	PATH=$HOME/bin:$PATH
	export PATH
}

cabalinstall () {
	echo cabal install "$@" "$cabalopts"
	eval cabal install "$@" "$cabalopts"
}

patched () {
	pkg=$1
	ver=$2
	if [ -z "$ver" ]; then
		cabal unpack $pkg
	else
		cabal unpack $pkg-$ver
	fi
	cd $pkg*
	git init
	git config user.name dummy
	git config user.email dummy@example.com
	git add .
	git commit -m "pre-patched state of $pkg"
	for patch in ../../haskell-patches/${pkg}_* ../../../no-th/haskell-patches/${pkg}_*; do
		if [ -e "$patch" ]; then
			echo trying $patch
			if ! patch -p1 < $patch; then
				echo "failed to apply $patch"
				echo "please resolve this, replace the patch with a new version, and exit the subshell to continue"
				$SHELL
			fi
		fi
	done
	cabalinstall
	rm -rf $pkg*
	cd ..
}

installgitannexdeps () {
	pushd ../..
	echo cabal install --only-dependencies "$@"
	cabal install --only-dependencies "$@"
	popd
}

install_pkgs () {
	rm -rf tmp
	mkdir tmp
	cd tmp

	patched network
	patched unix-time
	patched lifted-base
	patched zlib
	patched MissingH
	patched distributive
	patched comonad
	patched iproute
	patched primitive
	patched socks
	patched entropy
	patched vector
	patched stm-chans
	patched persistent
	patched profunctors
	patched skein
	patched lens
	patched certificate
	patched x509-system
	patched persistent-template
	patched system-filepath
	patched wai-app-static
	patched shakespeare
	patched shakespeare-css
	patched shakespeare-js
	patched yesod-routes
	patched yesod-core
	patched yesod-persistent
	patched yesod-form
	patched crypto-numbers
	patched yesod-auth
	patched yesod
	patched shakespeare-text
	patched process-conduit
	patched DAV
	patched yesod-static
	patched uuid
	patched dns
	patched gnutls
	patched unbounded-delays

	cd ..

	installgitannexdeps -fAndroid -f-Pairing
}

echo
echo
echo native build
echo
setupcabal
installgitannexdeps

echo
echo
echo cross build
echo
PATH=$HOME/.ghc/$(cat abiversion)/bin:$HOME/.ghc/$(cat abiversion)/arm-linux-androideabi/bin:$PATH
setupcabal
install_pkgs