summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-07 17:26:05 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-07 17:26:05 -0400
commit2da860256a11db54cad7ff981fc4e9e000572564 (patch)
treeb7d3f4c43e3888ce79f3b41c3668cb665ebc8348
parent6d9eb8da566c410c7780e15625dfed3f76a3e8f8 (diff)
parent5cb4e8b3705db23d652e0a5f12ab2de88fe721e7 (diff)
Merge branch 'master' of ssh://git-annex.branchable.com into relativepaths
-rw-r--r--doc/backends.mdwn4
-rw-r--r--doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn2
-rw-r--r--doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows/comment_5_a1c8ac1d7884d676f05db588b2894603._comment11
-rw-r--r--doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_10_2e434e142a0d8b7ad27c00836043e261._comment9
-rw-r--r--doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_11_d8d5a0c61320b583dc1c42e875173bc3._comment7
-rw-r--r--doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_12_feeb65a0cb3273b605061ae3d3b8ff92._comment7
-rw-r--r--doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_9_0c8b65e117ffb3f00c57c4a420313c05._comment7
-rw-r--r--doc/forum/How_To_Permanently_Delete_a_File__63__/comment_7_1a6fab467a1c4db2dee39ef464f6cc7b._comment10
-rw-r--r--doc/internals/lockdown/comment_2_7bf74adb5556b7fc74a94e751c5fd3d6._comment13
-rw-r--r--doc/tips/using_Amazon_S3/comment_8_4f9c2f6627f8ed3423bcc8b7bf2f76cb._comment10
-rw-r--r--doc/tips/using_Amazon_S3/comment_9_47e4ea77d0262d332d86a06d7aaeddd8._comment11
-rw-r--r--standalone/android/Makefile119
-rwxr-xr-xstandalone/android/buildapk145
-rw-r--r--standalone/android/wrapper.pl10
14 files changed, 254 insertions, 111 deletions
diff --git a/doc/backends.mdwn b/doc/backends.mdwn
index 06475adfb..bf6471fa7 100644
--- a/doc/backends.mdwn
+++ b/doc/backends.mdwn
@@ -25,6 +25,10 @@ can use different ones for different files.
-- [Skein hash](http://en.wikipedia.org/wiki/Skein_hash),
a well-regarded SHA3 hash competition finalist.
+Note that the SHA512, SKEIN512 and SHA384 generate long paths,
+which are known to not work on Windows. If interoperability on Windows is a
+concern, avoid those backends.
+
The `annex.backends` git-config setting can be used to list the backends
git-annex should use. The first one listed will be used by default when
new files are added.
diff --git a/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn b/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn
index f8c84b440..d127934fa 100644
--- a/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn
+++ b/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows.mdwn
@@ -105,3 +105,5 @@ c:\temp\sbv>
# End of transcript or log.
"""]]
+
+[[!meta title="window's tiny mind is confused by some long paths used by git-annex"]]
diff --git a/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows/comment_5_a1c8ac1d7884d676f05db588b2894603._comment b/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows/comment_5_a1c8ac1d7884d676f05db588b2894603._comment
new file mode 100644
index 000000000..54c29af3b
--- /dev/null
+++ b/doc/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows/comment_5_a1c8ac1d7884d676f05db588b2894603._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="http://joeyh.name/"
+ subject="comment 5"
+ date="2015-01-07T02:35:46Z"
+ content="""
+I've beat on the relativepaths branch some more and am probably as confident about it as I'm going to get. Will have to merge it and see what else it breaks.
+
+Also, I've documented that SHA512 and other large hashes are not recommended if one wants to interop with Windows.
+
+None of which completely fixes this bug, but short of teaching git about the magic filename prefix to make windows not be so broken, I don't see anything more I can do.
+"""]]
diff --git a/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_10_2e434e142a0d8b7ad27c00836043e261._comment b/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_10_2e434e142a0d8b7ad27c00836043e261._comment
new file mode 100644
index 000000000..01fdc9b4a
--- /dev/null
+++ b/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_10_2e434e142a0d8b7ad27c00836043e261._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="http://joeyh.name/"
+ subject="comment 10"
+ date="2015-01-07T02:41:21Z"
+ content="""
+I really want to know if I managed to get git-annex linked PIE before proceeding with furher yak shaving on getting busybox, etc built PIE.
+
+If you can use adb or another terminal, see if you can run /data/data/ga.androidterm/lib/lib.git-annex.so and if it prints git-annex's usage message.
+"""]]
diff --git a/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_11_d8d5a0c61320b583dc1c42e875173bc3._comment b/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_11_d8d5a0c61320b583dc1c42e875173bc3._comment
new file mode 100644
index 000000000..a76fd7869
--- /dev/null
+++ b/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_11_d8d5a0c61320b583dc1c42e875173bc3._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="etset"
+ subject="git-annex is correctly linked"
+ date="2015-01-07T14:30:38Z"
+ content="""
+I tested the executable you mention, and indeed, the git-annex help/list of commands appears. I also tested every other executable in the folder, and most of them display the PIE error message.
+"""]]
diff --git a/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_12_feeb65a0cb3273b605061ae3d3b8ff92._comment b/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_12_feeb65a0cb3273b605061ae3d3b8ff92._comment
new file mode 100644
index 000000000..6bf56ddea
--- /dev/null
+++ b/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_12_feeb65a0cb3273b605061ae3d3b8ff92._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="http://joeyh.name/"
+ subject="comment 12"
+ date="2015-01-07T20:39:27Z"
+ content="""
+After some work, all binaries are now built PIE. Further testing appreciated.
+"""]]
diff --git a/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_9_0c8b65e117ffb3f00c57c4a420313c05._comment b/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_9_0c8b65e117ffb3f00c57c4a420313c05._comment
new file mode 100644
index 000000000..7b14e7328
--- /dev/null
+++ b/doc/bugs/__91__Android__93___5.0_needs_PIE_executables___40__git_annex_does_not_work_on_android_5.0__41__/comment_9_0c8b65e117ffb3f00c57c4a420313c05._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="http://joeyh.name/"
+ subject="comment 9"
+ date="2015-01-07T02:37:25Z"
+ content="""
+Then it's busybox (and git, and...) that's the problem.
+"""]]
diff --git a/doc/forum/How_To_Permanently_Delete_a_File__63__/comment_7_1a6fab467a1c4db2dee39ef464f6cc7b._comment b/doc/forum/How_To_Permanently_Delete_a_File__63__/comment_7_1a6fab467a1c4db2dee39ef464f6cc7b._comment
deleted file mode 100644
index 0b1f6812b..000000000
--- a/doc/forum/How_To_Permanently_Delete_a_File__63__/comment_7_1a6fab467a1c4db2dee39ef464f6cc7b._comment
+++ /dev/null
@@ -1,10 +0,0 @@
-[[!comment format=mdwn
- username="https://www.google.com/accounts/o8/id?id=AItOawmwjQzWgiD7_I3zw-_91rMRf_6qoThupis"
- nickname="Mike"
- subject="comment 7"
- date="2015-01-06T18:01:40Z"
- content="""
-Unfortunately, that is not useful for this at all. We are talking about millions of files here, and the issue is leaving behind old hard links, so that program just won't work at all.
-
-Furthermore, this questions has all ready been answered in previous comments.
-"""]]
diff --git a/doc/internals/lockdown/comment_2_7bf74adb5556b7fc74a94e751c5fd3d6._comment b/doc/internals/lockdown/comment_2_7bf74adb5556b7fc74a94e751c5fd3d6._comment
new file mode 100644
index 000000000..72d24a283
--- /dev/null
+++ b/doc/internals/lockdown/comment_2_7bf74adb5556b7fc74a94e751c5fd3d6._comment
@@ -0,0 +1,13 @@
+[[!comment format=mdwn
+ username="https://www.google.com/accounts/o8/id?id=AItOawm_YXzEdPHzbSGVwtmTR7g1BqDtTnIBB5s"
+ nickname="Matthias"
+ subject="File immutability"
+ date="2015-01-07T12:06:15Z"
+ content="""
+# setcap cap_linux_immutable+ep /usr/bin/git-annex
+
+After doing that, git-annex is able to make files immutable, so the additional directory is not needed any more.
+Even on file systems / in environments where that is not possible, in some situations file lookup speed is way more important than not being able to delete the target of a symlink.
+
+I have no idea how to code in Haskell, so if somebody else could add an appropriate always/never/only-when-necessary config option I'd be very happy, and my media server would not have any more hiccups when switching songs …
+"""]]
diff --git a/doc/tips/using_Amazon_S3/comment_8_4f9c2f6627f8ed3423bcc8b7bf2f76cb._comment b/doc/tips/using_Amazon_S3/comment_8_4f9c2f6627f8ed3423bcc8b7bf2f76cb._comment
new file mode 100644
index 000000000..0616e0c87
--- /dev/null
+++ b/doc/tips/using_Amazon_S3/comment_8_4f9c2f6627f8ed3423bcc8b7bf2f76cb._comment
@@ -0,0 +1,10 @@
+[[!comment format=mdwn
+ username="https://www.google.com/accounts/o8/id?id=AItOawkPIqJZ88VZEVqLhLOd1LMdYXcy6bAW9qE"
+ nickname="Lemao"
+ subject="comment 8"
+ date="2015-01-07T13:54:23Z"
+ content="""
+I use github as my central git repository and I would like to use S3 to store large files with annex. Since the s3 remote in .git/config is not stored in github, how do I make sure I reconnect to the same s3 bucket in case I delete my local clone? Reinitializing the remote will create a completely new bucket.
+
+I would also be a good idea to centralize git-annex folders inside a single bucket so I keep the global namespace under control and can narrow down the permissioning.
+"""]]
diff --git a/doc/tips/using_Amazon_S3/comment_9_47e4ea77d0262d332d86a06d7aaeddd8._comment b/doc/tips/using_Amazon_S3/comment_9_47e4ea77d0262d332d86a06d7aaeddd8._comment
new file mode 100644
index 000000000..277e1c02b
--- /dev/null
+++ b/doc/tips/using_Amazon_S3/comment_9_47e4ea77d0262d332d86a06d7aaeddd8._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="http://joeyh.name/"
+ subject="comment 9"
+ date="2015-01-07T17:25:43Z"
+ content="""
+Lemao, make sure you have pushed your git-annex branch to your central git repository.
+
+When you clone that repo elsewhere, you can add the S3 remote by running `git annex enableremote cloud` (replace \"cloud\" with whatever name you originally picked when you used `git annex initremote` to set up the S3 remote in the first place.
+
+git-annex stores the necessary configuration of the S3 remote on the git-annex branch.
+"""]]
diff --git a/standalone/android/Makefile b/standalone/android/Makefile
index 020303374..261259bf4 100644
--- a/standalone/android/Makefile
+++ b/standalone/android/Makefile
@@ -1,93 +1,29 @@
# 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)
+build:
+ ./buildapk 4
+ ./buildapk 5
-# 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
+# Targets below are used by buildapk, which sets
+# GIT_ANNEX_ANDROID_SOURCETREE
-# 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
+source: $(GIT_ANNEX_ANDROID_SOURCETREE)
- set -e; \
- for v in 4.0 4.3 5.0; do \
- mkdir -p ../../tmp/$$v; \
- cp ../../tmp/androidtree/dist/build/git-annex/$$v/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/$$v/git-annex.apk; \
- done
+$(GIT_ANNEX_ANDROID_SOURCETREE):
+ mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)
+ 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
$(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp:
+ # This is a version which the openssh below can build with.
+ # Newer versions changed something to do with BIGNUM.
+ cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && git reset --hard 616f71e486d693991b594439c884ec624b32c2d4
cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && CC=$$(which cc) ./Configure android
cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && $(MAKE)
touch $@
@@ -146,22 +82,3 @@ $(GIT_ANNEX_ANDROID_SOURCETREE)/term/build-stamp: term.patch icons
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 || true
touch $@
-
-source: $(GIT_ANNEX_ANDROID_SOURCETREE)
-
-$(GIT_ANNEX_ANDROID_SOURCETREE):
- mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)
- 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)
diff --git a/standalone/android/buildapk b/standalone/android/buildapk
new file mode 100755
index 000000000..063fe6c83
--- /dev/null
+++ b/standalone/android/buildapk
@@ -0,0 +1,145 @@
+#!/bin/sh
+#
+# Cross-compiles utilities needed for git-annex on Android,
+# and builds the Android app.
+
+set -e
+
+androidversion=$1
+if [ -z "$androidversion" ]; then
+ echo "need android version (4 or 5) as parameter" >&2
+ exit 1
+fi
+
+VER="$(perl -e '$_=<>;print m/\((.*?)\)/'<../../CHANGELOG)"
+
+wrap () {
+ sed -e "s!PROG!$1!" -e "s!OPTS!$3!" < wrapper.pl > "$2"
+ chmod +x "$2"
+}
+
+# Add Android cross-compiler to PATH (as installed by ghc-android)
+androidtoolchain="$HOME/.ghc/$(cat abiversion)/bin"
+# For Android 5, use a wrapped version of the C compiler,
+# which sets PIE build flags.
+if [ "$androidversion" = 5 ]; then
+ rm -rf "$androidtoolchain/5"
+ mkdir -p "$androidtoolchain/5"
+ for f in $(find "$androidtoolchain" -maxdepth 1 -not -type d -printf '%f\n'); do
+ src="$androidtoolchain/$f"
+ dest="$androidtoolchain/5/$f"
+ case "$f" in
+ *-ld*)
+ wrap "$src" "$dest" "-pie"
+ ;;
+ *-gcc)
+ wrap "$src" "$dest" "-pie -fPIE"
+ ;;
+ *'-g++')
+ wrap "$src" "$dest" "-pie -fPIE"
+ ;;
+ *)
+ cp -a "$src" "$dest"
+ ;;
+ esac
+ done
+ PATH="$androidtoolchain/5:$PATH"
+else
+ PATH="$androidtoolchain:$PATH"
+fi
+export 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"
+
+GIT_ANNEX_ANDROID_SOURCETREE="$HOME/.android/git-annex-sourcetree"
+export GIT_ANNEX_ANDROID_SOURCETREE
+if [ ! -e "$GIT_ANNEX_ANDROID_SOURCETREE" ]; then
+ make source
+fi
+src="$GIT_ANNEX_ANDROID_SOURCETREE-$androidversion"
+if [ ! -e "$src" ] ; then
+ cp -a "$GIT_ANNEX_ANDROID_SOURCETREE" "$src"
+fi
+GIT_ANNEX_ANDROID_SOURCETREE="$src"
+export GIT_ANNEX_ANDROID_SOURCETREE
+
+gittree="$GIT_ANNEX_ANDROID_SOURCETREE/git/installed-tree"
+
+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"
+cc start.c -o "$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"
+
+genapk () {
+ mkdir -p ../../tmp/$1; \
+ cp ../../tmp/androidtree/dist/build/git-annex/$1/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/$1/git-annex.apk
+}
+
+if [ "$androidversion" = 4 ]; then
+ for v in 4.0 4.3; do
+ genapk $v
+ done
+else
+ genapk 5.0
+fi
diff --git a/standalone/android/wrapper.pl b/standalone/android/wrapper.pl
new file mode 100644
index 000000000..a7136a950
--- /dev/null
+++ b/standalone/android/wrapper.pl
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+my $prog=q{PROG}; # replaced
+my @opts=qw{OPTS}; # replaced
+
+if (grep { $_ eq "-r" || $_ eq "--relocatable" } @ARGV) {
+ exec($prog,@ARGV) || die "failed to run $prog";
+}
+else {
+ exec($prog,@opts,@ARGV) || die "failed to run $prog";
+}