Skip to content

Commit 4c2fd21

Browse files
committed
first commit
0 parents  commit 4c2fd21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+128768
-0
lines changed

Makefile

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
RECIPE_FILENAME := recipe.mk
2+
3+
TOP := $(shell pwd)
4+
TOP_INSTALL := ${TOP}/rootfs
5+
DIR_REPO := repo
6+
DIR_COOKBOOK := cookbook
7+
8+
export OPKG_MAINTAINER := Jiang Yio <[email protected]>
9+
#export AGCC_ECHO := yes
10+
11+
CROSS := arm-linux-androideabi
12+
NDKPATH := ${HOME}/android-ndk-r6
13+
NDKAPI := 8
14+
NDKGCC := 4.4.3
15+
16+
-include config.mk
17+
18+
NDKPLATFORM := ${NDKPATH}/platforms/android-${NDKAPI}/arch-arm
19+
NDKTOOLCHAIN := ${NDKPATH}/toolchains/${CROSS}-${NDKGCC}
20+
NDKPREBUILT := ${NDKTOOLCHAIN}/prebuilt/linux-x86
21+
NDKLDSCRIPTS := ${NDKPREBUILT}/${CROSS}/lib/ldscripts
22+
CC := ${CROSS}-gcc
23+
CXX := ${CROSS}-g++
24+
LD := ${CROSS}-ld
25+
AR := ${CROSS}-ar
26+
NM := ${CROSS}-nm
27+
RANLIB := ${CROSS}-ranlib
28+
STRIP := ${CROSS}-strip
29+
OBJCOPY := ${CROSS}-objcopy
30+
OBJDUMP := ${CROSS}-objdump
31+
32+
CFLAGS := -I${TOP_INSTALL}/system/include -mandroid -fomit-frame-pointer -DNO_MALLINFO=1
33+
LDFLAGS := -Wl,-rpath=/system/lib -L${TOP_INSTALL}/system/lib
34+
export PATH := ${TOP}/bin:${TOP}/bin/opkg-utils:${NDKPREBUILT}/bin:${NDKPATH}:${PATH}
35+
36+
export AGCC_NDK := ${NDKPATH}
37+
export AGCC_CXC := ${CROSS}
38+
export OPKG_MAINTAINER
39+
40+
RECIPE_LIST = $(shell find . -name ${RECIPE_FILENAME} | sed 's/\/${RECIPE_FILENAME}//')
41+
42+
define process_recipe
43+
~ := $1
44+
~F := ${TOP}/$1
45+
EXPORT_MAKE :=
46+
EXPORT_INSTALL :=
47+
EXPORT_PACKAGE :=
48+
EXPORT_CLEAN :=
49+
EXPORT_CLOBBER :=
50+
include $1/${RECIPE_FILENAME}
51+
ALL_MAKE += $${EXPORT_MAKE}
52+
ALL_INSTALL += $${EXPORT_INSTALL}
53+
ALL_PACKAGE += $${EXPORT_PACKAGE}
54+
ALL_CLEAN += $${EXPORT_CLEAN}
55+
ALL_CLOBBER += $${EXPORT_CLOBBER}
56+
57+
# The last line of the function must be left blank
58+
# in order to avoid some quirky, broken gmake
59+
# behavior when expanding macros within foreach
60+
# loops.
61+
62+
endef
63+
64+
define process_recipes
65+
$(foreach DIR,$(RECIPE_LIST),$(call process_recipe,$(DIR)))
66+
endef
67+
68+
CWD :=
69+
ALL_MAKE :=
70+
ALL_INSTALL :=
71+
ALL_PACKAGE :=
72+
ALL_CLEAN :=
73+
ALL_CLOBBER :=
74+
75+
$(eval $(process_recipes))
76+
77+
~ := tilde is broken in commands
78+
79+
.PHONY: all package clean clobber
80+
all: $(ALL_MAKE)
81+
install: $(ALL_INSTALL)
82+
package: $(ALL_PACKAGE)
83+
opkg-make-index ${DIR_REPO} > ${DIR_REPO}/Packages
84+
mv Packages.* ${DIR_REPO}/
85+
gzip -c9 ${DIR_REPO}/Packages > ${DIR_REPO}/Packages.gz
86+
clean: $(ALL_CLEAN)
87+
clobber: $(ALL_CLOBBER)
88+
89+
opkg: opkg.tgz
90+
opkg.tgz: cookbook/opkg/package/opkg.yml
91+
rm -rf opkg_tgz
92+
mkdir -p opkg_tgz/CONTROL
93+
cd opkg_tgz; \
94+
for opk in ../repo/opkg_*.opk; do :; done; \
95+
ar x ../repo/$$opk; \
96+
tar zxvf data.tar.gz; \
97+
tar zxvf control.tar.gz -C CONTROL; \
98+
rm debian-binary control.tar.gz data.tar.gz
99+
cat opkg_tgz/CONTROL/postinst > temp
100+
echo "echo 'You have installed Opkg. For best results, please run:'" >> temp
101+
echo "echo ' opkg update'" >> temp
102+
echo "echo ' opkg install opkg'" >> temp
103+
echo "rm -f /system/bin/opkg-install" >> temp
104+
mv temp opkg_tgz/system/bin/opkg-install
105+
chmod +x opkg_tgz/system/bin/opkg-install
106+
rm -rf opkg_tgz/CONTROL
107+
for file in opkg_tgz/system/etc/opkg/*.opkg-new; do mv "$$file" "$${file%.opkg-new}"; done
108+
cd opkg_tgz; fakeroot tar --owner=root --group=root -zcvf ../opkg.tgz *
109+
rm -rf opkg_tgz

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# BotBrew - *nix tools and package management for Android
2+
3+
This project compiles various *nix tools and makes Opkg packages suitable for installation on ARM devices running Android.
4+
5+
## Prebuilt
6+
7+
If you just want to use prebuilt binaries, get a shell on your rooted Android device and run:
8+
9+
wget http://botbrew.inportb.com/opkg/install.sh -O- | su
10+
11+
Otherwise, keep reading to roll your own.
12+
13+
## Prerequisites
14+
15+
The following Debian packages are required for using BotBrew.
16+
17+
- git-core
18+
- mercurial
19+
- subversion
20+
- build-essential
21+
- autoconf
22+
- libtool
23+
- libglib2.0-dev
24+
- python
25+
- python-yaml
26+
- ruby1.9.1
27+
28+
In addition, the Android NDK (r6 recommended) is required.
29+
30+
## Cookbook
31+
32+
BotBrew knows how to make
33+
34+
- bzip2
35+
- curl
36+
- ncurses
37+
- openssl
38+
- opkg
39+
- python
40+
- readline
41+
- ruby
42+
- vim
43+
44+
## Configuration
45+
46+
Create a new file `config.mk` to define a couple of Make variables
47+
48+
- OPKG_MAINTAINER := your name and <email address> in RFC822 format
49+
- NDKPATH := absolute path to the NDK
50+
51+
## Usage
52+
53+
`make all`
54+
55+
- builds and packages all projects
56+
57+
`make install`
58+
59+
- builds all projects
60+
61+
`make package`
62+
63+
- packages all projects
64+
65+
`make clean`
66+
67+
- cleans all projects
68+
69+
`make clobber`
70+
71+
- cleans and removes source code from all projects
72+
73+
`make opkg.tgz`
74+
75+
- makes a package for opkg distributable without opkg
76+
77+
`make cookbook/<project>/install`
78+
79+
- builds `<project>`
80+
81+
`make cookbook/<project>/package/*`
82+
83+
- packages `<project>`
84+
85+
`make cookbook/<project>/clean`
86+
87+
- cleans `<project>`
88+
89+
`make cookbook/<project>/clobber`
90+
91+
- cleans and removes source code from `<project>`

0 commit comments

Comments
 (0)