]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - bash/bash.nm
d9d33b34cf015b14b8ddba78138d50600049f5ec
[people/stevee/ipfire-3.x.git] / bash / bash.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = bash
7 version = 4.2
8 release = 4
9
10 groups = Base Build System/Tools
11 url = http://www.gnu.org/software/bash/
12 license = GPLv2+
13 summary = Bash is short for born again shell.
14
15 description
16 Bash is the shell, or command language interpreter, that will appear in \
17 the GNU operating system. Bash is an sh-compatible shell that incorporates \
18 useful features from the Korn shell (ksh) and C shell (csh). It is intended \
19 to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard.
20 end
21
22 source_dl = http://ftp.gnu.org/gnu/bash/
23
24 build
25 requires
26 autoconf
27 automake
28 bison
29 ncurses-devel
30 readline-devel
31 end
32
33 prepare_cmds
34 # Bash uses the RTLD_LAZY option when loading libraries. We want to use
35 # RTLD_NOW (it is defined from <dlfcn.h>:
36 sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
37 -i builtins/enable.def
38
39 sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/%{thisapp}|" \
40 Makefile.in
41 end
42
43 configure_options += \
44 --bindir=/bin \
45 --without-bash-malloc \
46 --with-installed-readline
47
48 # Test hangs forever
49 #def test
50 # make tests
51 #end
52
53 install_cmds
54 mkdir -pv %{BUILDROOT}/{bin,etc/profile.d,root}
55
56 # Bash startup files
57 cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}/root/.bash_logout
58 cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}/root/.bash_profile
59 cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}/root/.bashrc
60
61 # /etc/profile.d
62 cp -vf %{DIR_SOURCE}/profile.d/* %{BUILDROOT}/etc/profile.d
63
64 ln -svf bash %{BUILDROOT}/bin/sh
65 end
66 end
67
68 packages
69 package %{name}
70 prerequires = coreutils
71 requires = /etc/bashrc /etc/profile
72
73 script postin
74 # Create /etc/shells, if it does not exist.
75 [ -f "/etc/shells" ] || touch /etc/shells
76
77 found_sh=0
78 found_bash=0
79 while read line; do
80 if [ "/bin/bash" = "${line}" ]; then
81 found_bash=1
82 elif [ "/bin/sh" = "${line}" ]; then
83 found_sh=1
84 fi
85 done < /etc/shells
86
87 if [ "${found_bash}" = "0" ]; then
88 echo "/bin/bash" >> /etc/shells
89 fi
90
91 if [ "${found_sh}" = "0" ]; then
92 echo "/bin/sh" >> /etc/shells
93 fi
94 end
95
96 script postun
97 [ -e "/etc/shells" ] || exit 0
98
99 # Remove /bin/bash and /bin/sh from /etc/shells.
100 while read line; do
101 if [ "/bin/bash" = "${line}" ]; then
102 continue
103 elif [ "/bin/sh" = "${line}" ]; then
104 continue
105 fi
106
107 echo "${line}"
108 done < /etc/shells > /etc/shells.$$
109
110 mv -f /etc/shells{.$$,}
111 end
112 end
113 end