glibc: close privil. escalation hole ($origin libpath) with S/GUID.
[ipfire-2.x.git] / lfs / glibc
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302
MT
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
5# #
6# This program is free software: you can redistribute it and/or modify #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
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 #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
dd714b8a 27VER = 2.3.6
cd1a2927 28
dd714b8a 29THISAPP = glibc-$(VER)
cd1a2927 30DL_FILE = $(THISAPP).tar.bz2
7a98bae5 31DL_FROM = $(URL_IPFIRE)
cd1a2927
MT
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33CFLAGS =
34CXXFLAGS =
35
36# Normal build or /tools build.
37#
38ifeq "$(ROOT)" ""
39 TARGET = $(DIR_INFO)/$(THISAPP)
40 EXTRA_CONFIG = --prefix=/usr \
dd714b8a
MT
41 --disable-profile --enable-add-ons \
42 --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc
cd1a2927
MT
43 EXTRA_MAKE =
44 EXTRA_INSTALL =
45else
46 TARGET = $(DIR_INFO)/$(THISAPP)-tools
47 EXTRA_CONFIG = --prefix=/tools \
dd714b8a
MT
48 --disable-profile --enable-add-ons \
49 --enable-kernel=2.6.0 --with-binutils=/tools/bin \
50 --without-gd --with-headers=/tools/include \
51 --without-selinux
e22c7973
MT
52 EXTRA_MAKE =
53 EXTRA_INSTALL =
cd1a2927
MT
54endif
55
56###############################################################################
57# Top-level Rules
58###############################################################################
59
dd714b8a
MT
60objects = $(DL_FILE) \
61 glibc-libidn-$(VER).tar.bz2
cd1a2927
MT
62
63$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
dd714b8a 64glibc-libidn-$(VER).tar.bz2 = $(DL_FROM)/glibc-libidn-$(VER).tar.bz2
cd1a2927 65
dd714b8a
MT
66$(DL_FILE)_MD5 = bfdce99f82d6dbcb64b7f11c05d6bc96
67glibc-libidn-$(VER).tar.bz2_MD5 = 49dbe06ce830fc73874d6b38bdc5b4db
cd1a2927
MT
68
69install : $(TARGET)
70
71check : $(patsubst %,$(DIR_CHK)/%,$(objects))
72
73download :$(patsubst %,$(DIR_DL)/%,$(objects))
74
75md5 : $(subst %,%_MD5,$(objects))
76
77###############################################################################
78# Downloading, checking, md5sum
79###############################################################################
80
81$(patsubst %,$(DIR_CHK)/%,$(objects)) :
82 @$(CHECK)
83
84$(patsubst %,$(DIR_DL)/%,$(objects)) :
85 @$(LOAD)
86
87$(subst %,%_MD5,$(objects)) :
88 @$(MD5)
89
90###############################################################################
91# Installation Details
92###############################################################################
93
94$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
95 @$(PREBUILD)
96 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
cd1a2927 97 @mkdir $(DIR_SRC)/glibc-build
82a8499a
AF
98 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-dont_use_origin_on_privil_exec.patch
99
9b0ff0a0
MT
100ifeq "$(ROOT)" ""
101 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-linux_types-1.patch
102 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-inotify-1.patch
dd714b8a
MT
103 # This locale causes a loop on bash login - exclude it
104 cd $(DIR_APP) && sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
105 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
106 scripts/test-installation.pl
9b0ff0a0 107endif
cd1a2927 108 cd $(DIR_SRC)/glibc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
9b0ff0a0 109
cd1a2927
MT
110ifeq "$(ROOT)" ""
111 touch /etc/ld.so.conf
dd714b8a 112 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
cd1a2927 113 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
dd714b8a 114 cp -v $(DIR_APP)/sysdeps/unix/sysv/linux/inotify.h /usr/include/sys
cd1a2927
MT
115else
116 -mkdir /tools/etc
117 touch /tools/etc/ld.so.conf
dd714b8a
MT
118 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
119 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
cd1a2927
MT
120endif
121
122 # Creating the locales
123ifeq "$(ROOT)" ""
124 mkdir -p /usr/lib/locale
cd1a2927
MT
125 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f ISO-8859-1 en_US
126 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f UTF-8 en_US.utf8
9b0ff0a0 127 cp -f /usr/share/zoneinfo/GMT /etc/localtime
cd1a2927 128endif
cd1a2927
MT
129 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
130 @$(POSTBUILD)