]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - lfs/coreutils
Fix toolchain build
[people/ms/ipfire-3.x.git] / lfs / coreutils
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 PKG_NAME = coreutils
28 PKG_VER = 7.4
29 PKG_REL = 0
30
31 THISAPP = $(PKG_NAME)-$(PKG_VER)
32 DL_FILE = $(THISAPP).tar.gz
33 DIR_APP = $(DIR_SRC)/$(THISAPP)
34
35 OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
36
37 MAINTAINER =
38 GROUP = System/Base
39 CORE = yes
40 EXTRA = no
41 DEBUG = no
42 BUILD_DEPS =
43
44 # Don't check deps at toolchain build
45 ifneq "$(STAGE)" "toolchain"
46 DEPS = attr libcap2 ncurses pam shadow util-linux-ng
47 endif
48
49 URL = http://www.gnu.org/software/coreutils/
50 LICENSE = GPLv3+
51 SHORT_DESC = A set of basic GNU tools commonly used in shell scripts.
52
53 define LONG_DESC
54 These are the GNU core utilities. This package is the combination of \
55 the old GNU fileutils, sh-utils, and textutils packages.
56 endef
57
58 CFLAGS += -D_GNU_SOURCE=1 -fno-strict-aliasing
59
60 ###############################################################################
61 # Top-level Rules
62 ###############################################################################
63
64 objects = $(DL_FILE) \
65 $(THISAPP)-uname_PIC-1.patch \
66 $(THISAPP)-i18n-1.patch
67
68 download: $(objects)
69
70 info:
71 $(DO_PKG_INFO)
72
73 install: $(OBJECT)
74
75 package:
76 @$(DO_PACKAGE)
77
78 $(objects):
79 @$(LOAD)
80
81 ###############################################################################
82 # Installation Details
83 ###############################################################################
84
85 $(OBJECT): $(objects)
86 @$(PREBUILD)
87 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE)
88
89 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-i18n-1.patch
90 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-uname_PIC-1.patch
91
92 ifeq "$(STAGE)" "toolchain"
93 cd $(DIR_APP) && \
94 gl_cv_func_printf_directive_n=no \
95 ./configure \
96 $(CONFIGURE_ARCH) \
97 --prefix=$(TOOLS_DIR) \
98 --enable-install-program=hostname
99 cd $(DIR_APP) && make $(PARALLELISMFLAGS)
100 cd $(DIR_APP) && make install
101
102 cd $(DIR_APP) && cp -v src/su $(TOOLS_DIR)/bin/su-tools
103 endif
104
105 ifeq "$(STAGE)" "base"
106 cd $(DIR_APP) && \
107 gl_cv_func_printf_directive_n=no \
108 ./configure \
109 $(CONFIGURE_ARCH) \
110 --prefix=/usr \
111 --enable-largefile \
112 --enable-install-program=arch,hostname,su \
113 --enable-no-install-program=kill,uptime
114
115 cd $(DIR_APP) && make $(PARALLELISMFLAGS) \
116 CPPFLAGS="-DUSE_PAM" su_LDFLAGS="-pie -lpam -lpam_misc"
117 cd $(DIR_APP) && make install
118
119 mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
120 mv -v /usr/bin/{false,hostname,ln,ls,mkdir,mknod,mv,pwd,readlink,rm} /bin
121 mv -v /usr/bin/{rmdir,stty,sync,touch,true,uname} /bin
122 mv -v /usr/bin/chroot /usr/sbin
123 mv -v /usr/bin/{head,sleep,nice} /bin
124
125 cd $(DIR_APP) && install -m 4755 src/su /bin
126
127 # Dump /etc/dircolors.
128 dircolors -p > /etc/dircolors
129
130 # PAM
131 cp -vf $(DIR_CONFIG)/pam.d/su{,-l} /etc/pam.d
132 endif
133
134 @rm -rf $(DIR_APP)
135 @$(POSTBUILD)