]>
Commit | Line | Data |
---|---|---|
166a6c21 | 1 | ############################################################################### |
802ea3af MT |
2 | # IPFire.org - An Open Source Firewall Solution # |
3 | # Copyright (C) - IPFire Development Team <info@ipfire.org> # | |
166a6c21 MT |
4 | ############################################################################### |
5 | ||
802ea3af | 6 | name = bash |
5f2d5505 | 7 | version = 5.2.15 |
7766db7e | 8 | release = 2 |
166a6c21 | 9 | |
cd711c7b | 10 | groups = System/Tools |
e14a82a1 | 11 | url = https://www.gnu.org/software/bash/ |
802ea3af MT |
12 | license = GPLv2+ |
13 | summary = Bash is short for born again shell. | |
166a6c21 | 14 | |
802ea3af | 15 | description |
7a5553dc SS |
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 | |
166a6c21 | 19 | to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. |
802ea3af MT |
20 | end |
21 | ||
1f700a53 | 22 | source_dl = https://ftp.gnu.org/gnu/bash/ |
802ea3af MT |
23 | |
24 | build | |
25 | requires | |
26 | autoconf | |
27 | automake | |
28 | bison | |
9118c7ca | 29 | filesystem >= 002 |
802ea3af | 30 | ncurses-devel |
1f700a53 | 31 | readline-devel >= 8.0 |
daf84637 | 32 | texinfo |
802ea3af MT |
33 | end |
34 | ||
35 | prepare_cmds | |
36 | # Bash uses the RTLD_LAZY option when loading libraries. We want to use | |
37 | # RTLD_NOW (it is defined from <dlfcn.h>: | |
38 | sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \ | |
39 | -i builtins/enable.def | |
802ea3af MT |
40 | end |
41 | ||
f4587ad0 MT |
42 | CPPFLAGS += -D_GNU_SOURCE %(getconf LFS_CFLAGS) |
43 | ||
44 | CPPFLAGS += -DNON_INTERACTIVE_LOGIN_SHELLS | |
45 | CPPFLAGS += -DSSH_SOURCE_BASHRC | |
56ba7d19 MT |
46 | |
47 | # Recycles pids is neccessary. When bash's last fork's pid was X | |
48 | # and new fork's pid is also X, bash has to wait for this same pid. | |
49 | # Without Recycles pids bash will not wait. | |
f4587ad0 MT |
50 | CPPFLAGS += -DRECYCLES_PIDS |
51 | ||
52 | CPPFLAGS += \ | |
53 | -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"' \ | |
54 | -DSTANDARD_UTILS_PATH='\"/bin:/usr/bin:/sbin:/usr/sbin\"' \ | |
55 | -DSYS_BASH_LOGOUT='\"/etc/bash.bash_logout\"' | |
56 | ||
57 | configure_options += \ | |
58 | --with-installed-readline \ | |
59 | --with-afs \ | |
60 | --with-bash-malloc=no | |
61 | ||
62 | make_build_targets += CPPFLAGS="%{CPPFLAGS}" | |
802ea3af | 63 | |
56ba7d19 MT |
64 | test |
65 | make tests | |
66 | end | |
802ea3af MT |
67 | |
68 | install_cmds | |
7a5553dc | 69 | mkdir -pv %{BUILDROOT}%{sysconfdir}/{profile.d,skel} |
6de61f74 | 70 | install -v -m 700 -d %{BUILDROOT}/root |
802ea3af MT |
71 | |
72 | # Bash startup files | |
7a5553dc SS |
73 | cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}%{sysconfdir}/skel/.bash_logout |
74 | cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}%{sysconfdir}/skel/.bash_profile | |
75 | cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}%{sysconfdir}/skel/.bashrc | |
76 | ||
802ea3af MT |
77 | cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}/root/.bash_logout |
78 | cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}/root/.bash_profile | |
79 | cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}/root/.bashrc | |
80 | ||
81 | # /etc/profile.d | |
82 | cp -vf %{DIR_SOURCE}/profile.d/* %{BUILDROOT}/etc/profile.d | |
83 | ||
9118c7ca | 84 | ln -svf bash %{BUILDROOT}%{bindir}/sh |
56ba7d19 MT |
85 | |
86 | # https://bugzilla.redhat.com/show_bug.cgi?id=820192 | |
87 | # bug #820192, need to add execable alternatives for regular built-ins | |
88 | for f in alias bg cd command fc fg getopts jobs read umask unalias wait; do | |
89 | ( | |
90 | echo "#!/bin/sh" | |
91 | echo "builtin \"${f}\" \"\$@\"" | |
92 | ) > "%{BUILDROOT}/%{bindir}/${f}" | |
93 | chmod +x "%{BUILDROOT}%{bindir}/${f}" | |
94 | done | |
6de61f74 SS |
95 | |
96 | # Set correct permissions for binaries. | |
97 | find %{BUILDROOT}%{bindir} -type f -executable -exec chmod 755 {} \; | |
802ea3af MT |
98 | end |
99 | end | |
100 | ||
101 | packages | |
102 | package %{name} | |
cd711c7b MT |
103 | groups += Base Build |
104 | ||
774bad77 | 105 | requires |
57b0ba3a | 106 | coreutils |
774bad77 MT |
107 | /etc/bashrc |
108 | /etc/profile | |
109 | end | |
84292e3e | 110 | |
9118c7ca MT |
111 | provides |
112 | /bin/bash | |
113 | /bin/sh | |
114 | end | |
115 | ||
7766db7e MT |
116 | recommends |
117 | bash-completion | |
118 | end | |
119 | ||
9118c7ca MT |
120 | conflicts |
121 | filesystem < 002 | |
122 | end | |
123 | ||
0e13ce8c | 124 | script posttransin |
84292e3e MT |
125 | # Create /etc/shells, if it does not exist. |
126 | [ -f "/etc/shells" ] || touch /etc/shells | |
127 | ||
c84c1f1a MT |
128 | found_sh=0 |
129 | found_bash=0 | |
130 | while read line; do | |
131 | if [ "/bin/bash" = "${line}" ]; then | |
132 | found_bash=1 | |
133 | elif [ "/bin/sh" = "${line}" ]; then | |
134 | found_sh=1 | |
135 | fi | |
136 | done < /etc/shells | |
137 | ||
138 | if [ "${found_bash}" = "0" ]; then | |
84292e3e MT |
139 | echo "/bin/bash" >> /etc/shells |
140 | fi | |
141 | ||
c84c1f1a | 142 | if [ "${found_sh}" = "0" ]; then |
84292e3e MT |
143 | echo "/bin/sh" >> /etc/shells |
144 | fi | |
145 | end | |
146 | ||
147 | script postun | |
148 | [ -e "/etc/shells" ] || exit 0 | |
149 | ||
150 | # Remove /bin/bash and /bin/sh from /etc/shells. | |
151 | while read line; do | |
c84c1f1a | 152 | if [ "/bin/bash" = "${line}" ]; then |
84292e3e | 153 | continue |
c84c1f1a | 154 | elif [ "/bin/sh" = "${line}" ]; then |
84292e3e MT |
155 | continue |
156 | fi | |
157 | ||
158 | echo "${line}" | |
159 | done < /etc/shells > /etc/shells.$$ | |
160 | ||
161 | mv -f /etc/shells{.$$,} | |
162 | end | |
802ea3af | 163 | end |
1f9bc2f0 MT |
164 | |
165 | package %{name}-debuginfo | |
166 | template DEBUGINFO | |
167 | end | |
802ea3af | 168 | end |