fix prerequisites due to libc changes
[buildroot.git] / package / portage / portage.mk
blob65ae4db87859dfa097f0fca183c95b19aeb3f94d
1 #############################################################
3 # portage
5 #############################################################
6 PORTAGE_DOWNLOAD_VERSION:=2.1.2
7 PORTAGE_PATCH_VERSION:=.9
8 PORTAGE_VERSION:=$(PORTAGE_DOWNLOAD_VERSION)$(PORTAGE_PATCH_VERSION)
9 PORTAGE_PATCH:=portage-$(PORTAGE_VERSION).patch.bz2
11 PORTAGE_SOURCE:=portage-$(PORTAGE_DOWNLOAD_VERSION).tar.bz2
12 PORTAGE_SITE:=http://gentoo.osuosl.org/distfiles
13 PORTAGE_CAT:=$(BZCAT)
14 PORTAGE_DIR:=$(BUILD_DIR)/portage-$(PORTAGE_VERSION)
15 PORTAGE_TARGET_DIR:=$(TARGET_DIR)/usr/lib/portage
16 PORTAGE_TARGET_BINARY:=usr/bin/emerge
18 SANDBOX_VERSION:=1.2.18.1
19 SANDBOX_SOURCE:=sandbox-$(SANDBOX_VERSION).tar.bz2
20 SANDBOX_SITE:=http://dev.gentoo.org/~azarah/sandbox/
21 #SANDBOX_SITE:=$(PORTAGE_SITE)
22 SANDBOX_CAT:=$(PORTAGE_CAT)
23 SANDBOX_DIR:=$(BUILD_DIR)/sandbox-$(SANDBOX_VERSION)
24 SANDBOX_TARGET_BINARY:=usr/bin/sandbox
26 ifeq ($(BR2_cris),y)
27 PORTAGE_ARCH:=x86
28 endif
29 ifeq ($(BR2_mipsel),y)
30 PORTAGE_ARCH:=mips
31 endif
32 ifeq ($(BR2_powerpc),y)
33 PORTAGE_ARCH:=ppc
34 endif
35 ifeq ($(BR2_sh4),y)
36 PORTAGE_ARCH:=sh
37 endif
38 ifeq ($(BR2_sh64),y)
39 PORTAGE_ARCH:=sh
40 endif
41 ifeq ($(BR2_i386),y)
42 PORTAGE_ARCH:=x86
43 endif
44 ifeq ($(PORTAGE_ARCH),)
45 PORTAGE_ARCH:=$(ARCH)
46 endif
48 $(DL_DIR)/$(PORTAGE_SOURCE):
49 $(WGET) -P $(DL_DIR) $(PORTAGE_SITE)/$(PORTAGE_SOURCE)
50 $(DL_DIR)/$(PORTAGE_PATCH):
51 $(WGET) -P $(DL_DIR) $(PORTAGE_SITE)/$(PORTAGE_PATCH)
52 $(DL_DIR)/$(SANDBOX_SOURCE):
53 $(WGET) -P $(DL_DIR) $(SANDBOX_SITE)/$(SANDBOX_SOURCE)
55 portage-source: $(DL_DIR)/$(PORTAGE_SOURCE)
56 sandbox-source: $(DL_DIR)/$(SANDBOX_SOURCE)
58 $(PORTAGE_DIR)/.unpacked: $(DL_DIR)/$(PORTAGE_SOURCE)
59 $(PORTAGE_CAT) $(DL_DIR)/$(PORTAGE_SOURCE) | tar -C $(BUILD_DIR) -xf -
60 mv -f $(BUILD_DIR)/portage-$(PORTAGE_DOWNLOAD_VERSION) $(PORTAGE_DIR)
61 rm -f $(PORTAGE_DIR)/bin/tbz2tool
62 touch $@
64 $(PORTAGE_DIR)/.patched: $(PORTAGE_DIR)/.unpacked $(DL_DIR)/$(PORTAGE_PATCH)
65 (cd $(PORTAGE_DIR); $(PORTAGE_CAT) $(DL_DIR)/$(PORTAGE_PATCH) | patch -p0)
66 touch $@
68 $(SANDBOX_DIR)/.unpacked: $(DL_DIR)/$(SANDBOX_SOURCE)
69 $(SANDBOX_CAT) $(DL_DIR)/$(SANDBOX_SOURCE) | tar -C $(BUILD_DIR) -xf -
70 touch $@
72 $(PORTAGE_DIR)/.compiled: $(PORTAGE_DIR)/.patched
73 $(TARGET_CC) $(TARGET_CFLAGS) $(PORTAGE_DIR)/src/tbz2tool.c -o $(PORTAGE_DIR)/src/tbz2tool
74 touch $@
76 $(SANDBOX_DIR)/.compiled: $(SANDBOX_DIR)/.unpacked
77 touch $@
79 $(TARGET_DIR)/$(PORTAGE_TARGET_BINARY): $(PORTAGE_DIR)/.compiled
80 (cd $(PORTAGE_DIR)/cnf; \
81 $(INSTALL) -D make.globals $(TARGET_DIR)/etc/make.globals; \
82 $(INSTALL) -D make.conf $(TARGET_DIR)/etc/make.conf; \
83 cp $(TARGET_DIR)/etc/make.conf $(TARGET_DIR)/etc/make.conf.$(PORTAGE_ARCH); \
84 patch $(TARGET_DIR)/etc/make.conf.$(PORTAGE_ARCH) $(PORTAGE_DIR)/cnf/make.conf.$(PORTAGE_ARCH).diff; \
85 $(INSTALL) etc-update.conf dispatch-conf.conf $(TARGET_DIR)/etc; \
87 # $(INSTALL) -D make.globals.$(PORTAGE_ARCH) $(TARGET_DIR)/etc/make.globals; \
88 # $(INSTALL) -D make.conf.$(PORTAGE_ARCH) $(TARGET_DIR)/etc/make.conf; \
90 $(INSTALL) -d $(PORTAGE_TARGET_DIR)/pym
91 $(INSTALL) $(PORTAGE_DIR)/pym/*.py $(PORTAGE_TARGET_DIR)/pym/
92 mkdir -p $(PORTAGE_TARGET_DIR)/pym/cache
93 $(INSTALL) $(PORTAGE_DIR)/pym/cache/*.py $(PORTAGE_TARGET_DIR)/pym
94 mkdir -p $(PORTAGE_TARGET_DIR)/pym/elog_modules
95 $(INSTALL) $(PORTAGE_DIR)/pym/elog_modules/*.py $(PORTAGE_TARGET_DIR)/pym/elog_modules
97 $(INSTALL) -d $(PORTAGE_TARGET_DIR)/bin
98 $(INSTALL) -D -m 0755 $(PORTAGE_DIR)/bin/* $(PORTAGE_DIR)/src/tbz2tool $(PORTAGE_TARGET_DIR)/bin/
100 mkdir -p $(TARGET_DIR)/usr/portage/distfiles
101 mkdir -p $(TARGET_DIR)/var/lib/portage
103 $(INSTALL) -d $(PORTAGE_TARGET_DIR)/usr/bin
104 $(INSTALL) -d $(PORTAGE_TARGET_DIR)/usr/sbin
105 ln -sf newins $(PORTAGE_TARGET_DIR)/bin/donewins
106 for sbin in pkgmerge ebuild ebuild.sh etc-update dispatch-conf \
107 archive-conf fixpackages env-update regenworld emerge-webrsync; do \
108 ln -sf ../lib/portage/bin/$${sbin} $(TARGET_DIR)/usr/sbin/$${sbin}; \
109 done
110 for bin in xpak repoman tbz2tool portageq g-cpan.pl quickpkg emerge; do \
111 ln -sf ../lib/portage/bin/$${bin} $(TARGET_DIR)/usr/bin/$${bin}; \
112 done
113 $(TARGET_DIR)/$(SANDBOX_TARGET_BINARY): $(SANDBOX_DIR)/.compiled
114 touch $(TARGET_DIR)/$(SANDBOX_TARGET_BINARY)
116 sandbox: $(TARGET_DIR)/$(SANDBOX_TARGET_BINARY)
117 portage: sandbox python $(TARGET_DIR)/$(PORTAGE_TARGET_BINARY)
119 portage-clean:
120 (cd $(TARGET_DIR)/etc; \
121 rm -f make.globals make.conf etc-update.conf dispatch-conf.conf)
122 rm -rf $(PORTAGE_TARGET_DIR)
124 for sbin in pkgmerge ebuild ebuild.sh etc-update dispatch-conf \
125 archive-conf fixpackages env-update regenworld emerge-webrsync; do \
126 rm -f $(TARGET_DIR)/usr/sbin/$${sbin}; \
127 done
128 for bin in xpak repoman tbz2tool portageq g-cpan.pl quickpkg emerge; do \
129 rm -f $(TARGET_DIR)/usr/bin/$${bin}; \
130 done
131 sandbox-clean:
134 portage-dirclean:
135 rm -rf $(PORTAGE_DIR)
136 sandbox-dirclean:
137 rm -rf $(SANDBOX_DIR)
138 #############################################################
140 # Toplevel Makefile options
142 #############################################################
143 ifeq ($(BR2_PACKAGE_PORTAGE),y)
144 TARGETS+=portage sandbox
145 endif