###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that 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, see . #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
PKG_NAME = bash
VER = 3.2
PKG_VER = 0
THISAPP = $(PKG_NAME)-$(VER)
DL_FILE = $(THISAPP).tar.gz
DIR_APP = $(DIR_SRC)/$(THISAPP)
OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
MAINTAINER =
GROUP = System/Tools
EXTRA = no
DEBUG = no
DEPS =
URL = http://www.gnu.org/software/bash/
LICENSE = GPLv2+
SHORT_DESC = Bash is short for born again shell.
define LONG_DESC
Bash is the shell, or command language interpreter, that will appear in \
the GNU operating system. Bash is an sh-compatible shell that incorporates \
useful features from the Korn shell (ksh) and C shell (csh). It is intended \
to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard.
endef
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE) \
$(THISAPP)-fixes-9.patch \
$(PKG_NAME)-doc-$(VER).tar.gz \
$(THISAPP)-arc4random-1.patch \
$(THISAPP)-rng.patch
download: $(objects)
info:
$(DO_PKG_INFO)
install: $(OBJECT)
package:
@$(DO_PACKAGE)
$(objects):
@$(LOAD)
###############################################################################
# Installation Details
###############################################################################
$(OBJECT): $(objects)
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 < $(DIR_PATCHES)/$(THISAPP)-fixes-9.patch
ifeq "$(STAGE)" "toolchain"
# This patch modifies Bash to use /dev/urandom (settable with
# --with-randomdev=) for $RANDOM, instead of getpid() and gettimeofday().
# The test is "( echo $RANDOM; ( echo $RANDOM ); ( echo $RANDOM ) )":
cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-rng.patch
# Bash uses the RTLD_LAZY option when loading libraries. We want to use
# RTLD_NOW (it is defined from :
cd $(DIR_APP) && sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
-i builtins/enable.def
cd $(DIR_APP) && \
ac_cv_func_working_mktime=yes \
./configure \
$(CONFIGURE_ARCH) \
--prefix=$(TOOLS_DIR) \
--without-bash-malloc
cd $(DIR_APP) && make #$(PARALLELISMFLAGS)
cd $(DIR_APP) && make install
ln -sf bash $(TOOLS_DIR)/bin/sh
# Without the following lines, stage2 will not work
if [ ! -e $(LFS)/bin/bash ]; then \
install -d $(LFS)/bin && \
ln -sf $(TOOLS_DIR)/bin/bash $(LFS)/bin && \
ln -sf bash $(LFS)/bin/sh; \
fi
endif
ifeq "$(STAGE)" "base"
cd $(DIR_APP) && tar -xvf $(DIR_DL)/$(PKG_NAME)-doc-$(VER).tar.gz
cd $(DIR_APP) && sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/$(THISAPP)|" \
Makefile.in
cd $(DIR_APP) && patch -Np1 < $(DIR_PATCHES)/$(THISAPP)-arc4random-1.patch
cd $(DIR_APP) && \
ac_cv_func_working_mktime=yes \
./configure \
$(CONFIGURE_ARCH) \
--prefix=/usr \
--bindir=/bin \
--without-bash-malloc \
--with-installed-readline
cd $(DIR_APP) && make #$(PARALLELISMFLAGS)
cd $(DIR_APP) && make install
endif
@rm -rf $(DIR_APP)
@$(POSTBUILD)