]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - bash/bash.nm
c71e528774d7daf325c3fe1b2e990266d50a4b6f
[people/amarx/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 = 9
9
10 groups = 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 filesystem >= 002
30 ncurses-devel
31 readline-devel
32 end
33
34 prepare_cmds
35 # Bash uses the RTLD_LAZY option when loading libraries. We want to use
36 # RTLD_NOW (it is defined from <dlfcn.h>:
37 sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
38 -i builtins/enable.def
39
40 sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/%{thisapp}|" \
41 Makefile.in
42 end
43
44 configure_options += \
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}/{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}%{bindir}/sh
65 end
66 end
67
68 packages
69 package %{name}
70 groups += Base Build
71
72 requires
73 coreutils
74 /etc/bashrc
75 /etc/profile
76 end
77
78 provides
79 /bin/bash
80 /bin/sh
81 end
82
83 conflicts
84 filesystem < 002
85 end
86
87 script posttransin
88 # Create /etc/shells, if it does not exist.
89 [ -f "/etc/shells" ] || touch /etc/shells
90
91 found_sh=0
92 found_bash=0
93 while read line; do
94 if [ "/bin/bash" = "${line}" ]; then
95 found_bash=1
96 elif [ "/bin/sh" = "${line}" ]; then
97 found_sh=1
98 fi
99 done < /etc/shells
100
101 if [ "${found_bash}" = "0" ]; then
102 echo "/bin/bash" >> /etc/shells
103 fi
104
105 if [ "${found_sh}" = "0" ]; then
106 echo "/bin/sh" >> /etc/shells
107 fi
108 end
109
110 script postun
111 [ -e "/etc/shells" ] || exit 0
112
113 # Remove /bin/bash and /bin/sh from /etc/shells.
114 while read line; do
115 if [ "/bin/bash" = "${line}" ]; then
116 continue
117 elif [ "/bin/sh" = "${line}" ]; then
118 continue
119 fi
120
121 echo "${line}"
122 done < /etc/shells > /etc/shells.$$
123
124 mv -f /etc/shells{.$$,}
125 end
126 end
127
128 package %{name}-debuginfo
129 template DEBUGINFO
130 end
131 end