wok view bash/receipt @ rev 17185

Add phpfm (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Oct 02 12:48:18 2014 +0200 (2014-10-02)
parents b5a7e88f4bf6
children 40e999c964ea
line source
1 # SliTaz package receipt.
3 PACKAGE="bash"
4 VERSION="4.2"
5 CATEGORY="system-tools"
6 SHORT_DESC="The GNU bourne SHell."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="GPL3"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.gnu.org/software/bash/"
11 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
13 DEPENDS="readline"
14 BUILD_DEPENDS="readline bison"
16 # Rules to compile & install the temporary toolchain.
17 cook_tmp_toolchain()
18 {
19 cd $src
20 # CVE-2014-6271
21 patch -p0 < $stuff/funcdef-import-4.2.patch
22 ./configure --without-bash-malloc &&
23 make && make install
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 # Patch and then build.
30 cd $src
31 # CVE-2014-6271
32 patch -p0 < $stuff/funcdef-import-4.2.patch
33 # Skip tests that can not run while cross-compiling.
34 cat > config.cache << "EOF"
35 ac_cv_func_mmap_fixed_mapped=yes
36 ac_cv_func_strcoll_works=yes
37 ac_cv_func_working_mktime=yes
38 bash_cv_func_sigsetjmp=present
39 bash_cv_getcwd_malloc=yes
40 bash_cv_job_control_missing=present
41 bash_cv_printf_a_format=yes
42 bash_cv_sys_named_pipes=present
43 bash_cv_ulimit_maxfds=yes
44 bash_cv_under_sys_siglist=yes
45 bash_cv_unusable_rtsigs=no
46 gt_cv_int_divbyzero_sigfpe=yes
47 EOF
48 ./configure \
49 $CONFIGURE_ARGS \
50 --cache-file=config.cache \
51 --bindir=/bin \
52 --enable-history --enable-alias \
53 --disable-nls --without-bash-malloc \
54 --disable-help-builtin \
55 --with-installed-readline &&
56 make &&
57 # Bash doesn't care about DESTDIR in environnment variable.
58 make DESTDIR=$DESTDIR install
59 }
61 # Rules to gen a SliTaz package suitable for Tazpkg.
62 genpkg_rules()
63 {
64 cp -a $install/bin $fs
65 # Config files.
66 #
67 mkdir $fs/etc
68 cp $stuff/example.bashrc $fs/etc/bashrc
69 }
72 post_install()
73 {
74 local root
75 root=$1
76 echo "Processing post-install commands..."
77 echo -n "Do you want to set Bash to default (y/N) ? : "
78 read -t 30 anser
79 if [ "$anser" == "y" ]; then
80 echo ""
81 echo "Setting bash as default for all users"
82 sed -i "s/:\/bin\/sh$/:\/bin\/bash/g" /etc/passwd
83 sed -i "s/:\/bin\/ksh$/:\/bin\/bash/g" /etc/passwd
84 sed -i "s/:\/bin\/zsh$/:\/bin\/bash/g" /etc/passwd
85 sed -i "s/:\/bin\/csh$/:\/bin\/bash/g" /etc/passwd
86 echo "Creating .bashrc file for all users"
87 for i in `ls -d /home/*`
88 do
89 cp /etc/bashrc $i/.bashrc
90 done
91 cp /etc/bashrc /root/.bashrc
92 cp /etc/bashrc /etc/skel/.bashrc
93 fi
94 }
97 pre_remove()
98 {
99 local root
100 root=$1
101 echo "Setting back sh as default for all users"
102 sed -i "s/:\/bin\/bash$/:\/bin\/sh/g" /etc/passwd
103 if [ -f /etc/skel/.bashrc ]; then
104 rm /etc/skel/.bashrc
105 fi
106 }