]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blobdiff - bash/bash.nm
elfutils: Correctly configure debuginfod
[people/pmueller/ipfire-3.x.git] / bash / bash.nm
index 0c57eab1615720183c7c66a69bcbba9f0a257761..79712e9341d0a59a86efe91b0e8340ae2cf3c0ea 100644 (file)
@@ -4,30 +4,32 @@
 ###############################################################################
 
 name       = bash
-version    = 4.2
-release    = 3
+version    = 5.2.15
+release    = 2
 
-groups     = Base Build System/Tools
-url        = http://www.gnu.org/software/bash/
+groups     = System/Tools
+url        = https://www.gnu.org/software/bash/
 license    = GPLv2+
 summary    = Bash is short for born again shell.
 
 description
-       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 \
+       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.
 end
 
-source_dl  = http://ftp.gnu.org/gnu/bash/
+source_dl  = https://ftp.gnu.org/gnu/bash/
 
 build
        requires
                autoconf
                automake
                bison
+               filesystem >= 002
                ncurses-devel
-               readline-devel
+               readline-devel >= 8.0
+               texinfo
        end
 
        prepare_cmds
@@ -35,25 +37,43 @@ build
                # RTLD_NOW (it is defined from <dlfcn.h>:
                sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
                        -i builtins/enable.def
-
-               sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/%{thisapp}|" \
-                       Makefile.in
        end
 
+       CPPFLAGS += -D_GNU_SOURCE %(getconf LFS_CFLAGS)
+
+       CPPFLAGS += -DNON_INTERACTIVE_LOGIN_SHELLS
+       CPPFLAGS += -DSSH_SOURCE_BASHRC
+
+       # Recycles pids is neccessary. When bash's last fork's pid was X
+       # and new fork's pid is also X, bash has to wait for this same pid.
+       # Without Recycles pids bash will not wait.
+       CPPFLAGS += -DRECYCLES_PIDS
+
+       CPPFLAGS += \
+               -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"' \
+               -DSTANDARD_UTILS_PATH='\"/bin:/usr/bin:/sbin:/usr/sbin\"' \
+               -DSYS_BASH_LOGOUT='\"/etc/bash.bash_logout\"'
+
        configure_options += \
-               --bindir=/bin \
-               --without-bash-malloc \
-               --with-installed-readline
+               --with-installed-readline \
+               --with-afs \
+               --with-bash-malloc=no
+
+       make_build_targets += CPPFLAGS="%{CPPFLAGS}"
 
-       # Test hangs forever
-       #def test
-       #       make tests
-       #end
+       test
+               make tests
+       end
 
        install_cmds
-               mkdir -pv %{BUILDROOT}/{bin,etc/profile.d,root}
+               mkdir -pv %{BUILDROOT}%{sysconfdir}/{profile.d,skel}
+               install -v -m 700 -d %{BUILDROOT}/root
 
                # Bash startup files
+               cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}%{sysconfdir}/skel/.bash_logout
+               cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}%{sysconfdir}/skel/.bash_profile
+               cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}%{sysconfdir}/skel/.bashrc
+
                cp -vf %{DIR_SOURCE}/dot_bash_logout %{BUILDROOT}/root/.bash_logout
                cp -vf %{DIR_SOURCE}/dot_bash_profile %{BUILDROOT}/root/.bash_profile
                cp -vf %{DIR_SOURCE}/dot_bashrc %{BUILDROOT}/root/.bashrc
@@ -61,23 +81,65 @@ build
                # /etc/profile.d
                cp -vf %{DIR_SOURCE}/profile.d/* %{BUILDROOT}/etc/profile.d
 
-               ln -svf bash %{BUILDROOT}/bin/sh
+               ln -svf bash %{BUILDROOT}%{bindir}/sh
+
+               # https://bugzilla.redhat.com/show_bug.cgi?id=820192
+               # bug #820192, need to add execable alternatives for regular built-ins
+               for f in alias bg cd command fc fg getopts jobs read umask unalias wait; do
+                       (
+                               echo "#!/bin/sh"
+                               echo "builtin \"${f}\" \"\$@\""
+                       ) > "%{BUILDROOT}/%{bindir}/${f}"
+                       chmod +x "%{BUILDROOT}%{bindir}/${f}"
+               done
+
+               # Set correct permissions for binaries.
+               find %{BUILDROOT}%{bindir} -type f -executable -exec chmod 755 {} \;
        end
 end
 
 packages
        package %{name}
-               requires = /etc/bashrc /etc/profile
+               groups += Base Build
+
+               requires
+                       coreutils
+                       /etc/bashrc
+                       /etc/profile
+               end
 
-               script postin
+               provides
+                       /bin/bash
+                       /bin/sh
+               end
+
+               recommends
+                       bash-completion
+               end
+
+               conflicts
+                       filesystem < 002
+               end
+
+               script posttransin
                        # Create /etc/shells, if it does not exist.
                        [ -f "/etc/shells" ] || touch /etc/shells
 
-                       if ! grep -q "/bin/bash" /etc/shells; then
+                       found_sh=0
+                       found_bash=0
+                       while read line; do
+                               if [ "/bin/bash" = "${line}" ]; then
+                                       found_bash=1
+                               elif [ "/bin/sh" = "${line}" ]; then
+                                       found_sh=1
+                               fi
+                       done < /etc/shells
+
+                       if [ "${found_bash}" = "0" ]; then
                                echo "/bin/bash" >> /etc/shells
                        fi
 
-                       if ! grep -q "/bin/sh" /etc/shells; then
+                       if [ "${found_sh}" = "0" ]; then
                                echo "/bin/sh" >> /etc/shells
                        fi
                end
@@ -87,9 +149,9 @@ packages
 
                        # Remove /bin/bash and /bin/sh from /etc/shells.
                        while read line; do
-                               if [[ $line =~ ^/bin/sh ]]; then
+                               if [ "/bin/bash" = "${line}" ]; then
                                        continue
-                               elif [[ $line =~ ^/bin/bash ]]; then
+                               elif [ "/bin/sh" = "${line}" ]; then
                                        continue
                                fi
 
@@ -99,4 +161,8 @@ packages
                        mv -f /etc/shells{.$$,}
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end