summaryrefslogtreecommitdiff
path: root/mk/fakeroot.mk
blob: ac59d43d1ebd8ec5ba023c0fe0997f187b0e0102 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#########################################################################################
# GAYE Abdoulaye Walsimou, <walsimou@walsimou.com>
# Copyright(C) 2009 GAYE Abdoulaye Walsimou. All rights reserved.
#
# This program is free software; you can distribute it and/or modify it
# under the terms of the GNU General Public License
# (Version 2 or later) published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
#########################################################################################
#
# \file         fakeroot.mk
# \brief	fakeroot.mk of Embtoolkit. fakeroot helps building root filesystem,
# \brief	without the need to be root.
# \author       GAYE Abdoulaye Walsimou, <walsimou@walsimou.com>
# \date         June 2009
#########################################################################################

FAKEROOT_VERSION := 1.11
FAKEROOT_SITE := http://snapshot.debian.net/archive/2008/12/31/debian/pool/main/f/fakeroot
FAKEROOT_PACKAGE := fakeroot_$(FAKEROOT_VERSION).tar.gz
FAKEROOT_BUILD_DIR := $(TOOLS_BUILD)/fakeroot-build
FAKEROOT_DIR := $(EMBTK_ROOT)/fakeroot
FAKEROOT_BIN := $(FAKEROOT_DIR)/bin/fakeroot

fakeroot_install: $(FAKEROOT_BUILD_DIR)/.installed

$(FAKEROOT_BUILD_DIR)/.installed: download_fakeroot $(FAKEROOT_BUILD_DIR)/.decompressed \
	$(FAKEROOT_BUILD_DIR)/.configured
	@$(MAKE) -C $(FAKEROOT_BUILD_DIR) && $(MAKE) -C $(FAKEROOT_BUILD_DIR) install
	@touch $@

download_fakeroot:
	@test -e $(DOWNLOAD_DIR)/$(FAKEROOT_PACKAGE) || \
	wget -O $(DOWNLOAD_DIR)/$(FAKEROOT_PACKAGE) $(FAKEROOT_SITE)/$(FAKEROOT_PACKAGE)

$(FAKEROOT_BUILD_DIR)/.decompressed:
	@tar -C $(TOOLS_BUILD) -xzf $(DOWNLOAD_DIR)/$(FAKEROOT_PACKAGE)
	@mkdir -p $(FAKEROOT_BUILD_DIR)
	@mkdir -p $(FAKEROOT_DIR)
	@touch $@

$(FAKEROOT_BUILD_DIR)/.configured:
	@cd $(FAKEROOT_BUILD_DIR); \
	$(TOOLS_BUILD)/fakeroot-$(FAKEROOT_VERSION)/configure \
	--prefix=$(FAKEROOT_DIR) --build=$(HOST_BUILD) --host=$(HOST_ARCH)
	@touch $@