source: projects/specs/branches/6/b/bash/bash-vl.spec @ 6828

Revision 6828, 15.2 KB checked in by iwamoto, 12 years ago (diff)

bash: add security patch

Line 
1%define bashversion 4.2
2%define patchlevel 8
3
4Summary:      The GNU Bourne Again shell (bash).
5Summary(ja):  GNU Bourne Again シェル (bash).
6
7Name:         bash
8Version:      %{bashversion}.%{patchlevel}
9Release:      2%{?_dist_release}
10
11Group:        System Environment/Shells
12License:      GPLv2+
13
14Vendor:       Project Vine
15Distribution: Vine Linux
16
17Source0:      ftp://ftp.gnu.org/pub/gnu/bash/bash-%{bashversion}.tar.gz
18Source10:     bashrc-vine
19
20# Official upstream patches
21Patch1: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-001
22Patch2: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-002
23Patch3: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-003
24Patch4: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-004
25Patch5: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-005
26Patch6: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-006
27Patch7: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-007
28Patch8: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-008
29
30# Other patches
31Patch101: bash-2.02-security.patch
32Patch102: bash-2.03-paths.patch
33Patch103: bash-2.03-profile.patch
34Patch104: bash-2.05a-interpreter.patch
35Patch105: bash-2.05b-debuginfo.patch
36Patch106: bash-2.05b-manso.patch
37Patch107: bash-2.05b-pgrp_sync.patch
38Patch108: bash-2.05b-readline-oom.patch
39Patch109: bash-2.05b-xcc.patch
40Patch110: bash-3.2-audit.patch
41Patch111: bash-3.2-ssh_source_bash.patch
42Patch112: bash-bashbug.patch
43Patch113: bash-infotags.patch
44Patch114: bash-requires.patch
45Patch115: bash-setlocale.patch
46Patch116: bash-tty-tests.patch
47
48# 484809, check if interp section is NOBITS
49Patch117: bash-4.0-nobits.patch
50
51# Do the same CFLAGS in generated Makefile in examples
52Patch118: bash-4.1-examples.patch
53
54# Builtins like echo and printf won't report errors
55# when output does not succeed due to EPIPE
56Patch119: bash-4.1-broken_pipe.patch
57
58# Enable system-wide .bash_logout for login shells
59Patch120: bash-4.2-rc2-logout.patch
60
61# Static analyzis shows some issues in bash-2.05a-interpreter.patch
62Patch121: bash-4.2-coverity.patch
63
64# security
65Patch1000: bash-4.2_CVE-2012-3410.patch
66
67Buildroot:    %{_tmppath}/%{name}-%{version}-root
68BuildRequires: texinfo, bison, ncurses-devel, autoconf, gettext
69Obsoletes:    bash <= 1.14.7
70Obsoletes:    bash2
71
72
73%description
74Bash is a GNU project sh-compatible shell or command language
75interpreter. Bash (Bourne Again shell) incorporates useful features
76from the Korn shell (ksh) and the C shell (csh). Most sh scripts
77can be run by bash without modification.
78
79Bash offers several improvements over sh, including command line
80editing, unlimited size command history, job control, shell
81functions and aliases, indexed arrays of unlimited size and
82integer arithmetic in any base from two to 64. Bash is ultimately
83intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and
84Tools standard.
85
86
87%package doc
88Summary:  Documentation for the GNU Bourne Again shell (bash).
89Summary:  GNU Bourne Again シェル向けドキュメント
90Group:    Applications/Documentation
91Requires: %{name} = %{version}-%{release}
92
93Obsoletes: bash2-doc
94
95%description doc
96This is a separate documentation package for the GNU Bourne
97Again shell.
98
99
100%prep
101%setup -q -n %{name}-%{bashversion}
102
103# Official upstream patches
104%patch1 -p0 -b .001
105%patch2 -p0 -b .002
106%patch3 -p0 -b .003
107%patch4 -p0 -b .004
108%patch5 -p0 -b .005
109%patch6 -p0 -b .006
110%patch7 -p0 -b .007
111%patch8 -p0 -b .008
112
113# Other patches
114%patch101 -p1 -b .security
115%patch102 -p1 -b .paths
116%patch103 -p1 -b .profile
117%patch104 -p1 -b .interpreter
118%patch105 -p1 -b .debuginfo
119%patch106 -p1 -b .manso
120%patch107 -p1 -b .pgrp_sync
121%patch108 -p1 -b .readline_oom
122%patch109 -p1 -b .xcc
123%patch110 -p1 -b .audit
124%patch111 -p1 -b .ssh_source_bash
125%patch112 -p1 -b .bashbug
126%patch113 -p1 -b .infotags
127%patch114 -p1 -b .requires
128%patch115 -p1 -b .setlocale
129%patch116 -p1 -b .tty_tests
130%patch117 -p1 -b .nobits
131%patch118 -p1 -b .examples
132%patch119 -p1 -b .broken_pipe
133%patch120 -p1 -b .logout
134%patch121 -p1 -b .coverity
135
136%patch1000 -p1 -b .CVE-2012-3410
137
138echo %{version} > _distribution
139echo %{release} |sed 's/vl.*//' > _patchlevel
140
141
142%build
143%configure --with-bash-malloc=no
144make CPPFLAGS="-D_GNU_SOURCE -DRECYCLES_PIDS `getconf LFS_CFLAGS`"
145
146%install
147rm -rf %{buildroot}
148
149# Fix bug #83776
150perl -pi -e 's,bashref\.info,bash.info,' doc/bashref.info
151
152make DESTDIR=$RPM_BUILD_ROOT install
153
154pushd $RPM_BUILD_ROOT
155 mkdir ./bin
156 mv ./usr/bin/bash ./bin/bash
157 ln -s bash ./bin/sh
158 rm -f .%{_infodir}/dir
159popd
160
161ln -s bash.1 %{buildroot}%{_mandir}/man1/sh.1
162
163# make manpages for bash builtins as per suggestion in DOC/README
164pushd doc
165sed -e '
166/^\.SH NAME/, /\\- bash built-in commands, see \\fBbash\\fR(1)$/{
167/^\.SH NAME/d
168s/^bash, //
169s/\\- bash built-in commands, see \\fBbash\\fR(1)$//
170s/,//g
171b
172}
173d
174' builtins.1 > man.pages
175for i in echo pwd test kill; do
176  perl -pi -e "s,$i,,g" man.pages
177  perl -pi -e "s,  , ,g" man.pages
178done
179
180install -c -m 644 builtins.1 %{buildroot}%{_mandir}/man1/builtins.1
181
182for i in `cat man.pages` ; do
183  echo .so man1/builtins.1 > %{buildroot}%{_mandir}/man1/$i.1
184  chmod 0644 ${RPM_BUILD_ROOT}%{_mandir}/man1/$i.1
185done
186
187mkdir -p $RPM_BUILD_ROOT/etc/profile.d/
188install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/etc/bashrc
189
190# Not for printf, false and true (conflict with coreutils)
191rm -f $RPM_BUILD_ROOT%{_mandir}/man1/printf.1
192rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/true.1
193rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/false.1
194
195popd
196
197%find_lang %{name}
198
199
200%clean
201rm -rf %{buildroot}
202
203# ***** bash doesn't use install-info. It's always listed in %{_infodir}/dir
204# to prevent prereq loops
205
206# post is in lua so that we can run it without any external deps.  Helps
207# for bootstrapping a new install.
208# Jesse Keating 2009-01-29 (code from Ignacio Vazquez-Abrams)
209%post -p <lua>
210bashfound = false;
211shfound = false;
212 
213f = io.open("/etc/shells", "r");
214if f == nil
215then
216  f = io.open("/etc/shells", "w");
217else
218  repeat
219    t = f:read();
220    if t == "/bin/bash"
221    then
222      bashfound = true;
223    end
224    if t == "/bin/sh"
225    then
226      shfound = true;
227    end
228  until t == nil;
229end
230f:close()
231 
232f = io.open("/etc/shells", "a");
233if not bashfound
234then
235  f:write("/bin/bash\n")
236end
237if not shfound
238then
239  f:write("/bin/sh\n")
240end
241f:close()
242
243%postun -p <lua>
244t={}
245for line in io.lines("/etc/shells")
246do
247  if line ~= "/bin/bash" and line ~= "/bin/sh"
248  then
249    table.insert(t,line)
250  end
251end
252
253f = io.open("/etc/shells", "w+")
254for n,line in pairs(t)
255do
256  f:write(line.."\n")
257end
258
259
260%files -f %{name}.lang
261%defattr(-,root,root)
262%doc CHANGES COPYING
263%doc examples
264%config(noreplace) /etc/bashrc
265/bin/bash
266/bin/sh
267%{_infodir}/bash.info*
268%{_mandir}/*/*
269%{_mandir}/*/..1*
270%{_bindir}/bashbug
271
272
273%files doc
274%defattr(-,root,root)
275%doc COMPAT NEWS NOTES POSIX RBASH
276%doc examples/bashdb/ examples/functions/ examples/misc/
277%doc examples/scripts.noah/ examples/scripts.v2/ examples/scripts/
278%doc examples/startup-files/ examples/complete/ examples/loadables/
279%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
280%doc doc/FAQ doc/INTRO doc/article.ms doc/README
281
282
283%changelog
284* Mon Sep 17 2012 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.2.8-1
285- add patch1000 for fix CVE-2012-3410 (/dev/fd)
286
287* Tue Apr 12 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 4.2.8-1
288- update to 4.2 patch level 8
289- use lua script in post/postun
290- update patches from fedora
291
292* Fri Sep 03 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 4.1-1
293- update to 4.1 patch level 7
294
295* Fri Mar  5 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-9
296- check if /bin/grep exists on %%post script
297
298* Fri Feb 12 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-8
299- rebuilt with gcc-4.4.3-3 on ppc
300
301* Tue Feb  2 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-7
302- rebuilt with new toolchain
303
304* Fri Dec  4 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-6
305- revert changes on 3.2-5 (avoid a nasty dependency loop on bootstrapping)
306
307* Fri Dec  4 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-5
308- add Requires(post): grep
309
310* Sat Oct 24 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-4
311- remove obsolete /bin/bash2 entry from /etc/shells
312
313* Mon Apr 27 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 3.2-3
314- add Requires(post): ncurses (should be added by find-requires..)
315
316* Mon Mar 29 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 3.2-2
317- add upstream patch (from 040 to 048)
318- build against ncurses-devel (libtinfo)
319- spec in utf-8
320
321* Mon May 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.2-1vl5
322- added upstream patch (from 026 to 039)
323- added Japanese summary
324- applied new versioning policy
325
326* Fri Jan 18 2008 Shu KONNO <owa@bg.wakwak.com> 3.2-0vl2
327- rebuilt with libtermcap-devel
328
329* Fri Oct 26 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 3.2-0vl1
330- new upstream release
331- add upstream patch (from 001 to 025)
332- remove Provides: bash2
333
334* Wed May 09 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.05b-0vl4
335- rebuilt with new toolchain
336
337* Mon Sep 11 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 2.05b-0vl3
338- change doc Group to Applications/Documentation. <BTS:VineLinux:163>
339- quote CPPFLAGS to avoid configure error. <BTS:VineLinux:173>
340
341* Mon Jun 28 2004 NISHIMURA Daisuke <nishi@graco.c.u-tokyo.ac.jp> 2.05b-0vl2
342- Don't read /etc/profile.d/*.sh in /etc/bashrc; done in /etc/profile
343
344* Wed Mar 10 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.05b-0vl1
345- update to 2.05b
346- rebuild with new toolchains
347- add make check
348- add %postun script based on Fedora development
349- README file moved doc package
350- update Patch5 and Patch8 from Fedora development
351- change Patch6
352- remove Patch2 and Patch100 (bash-2.05b supports multibyte string)
353- add Patch11--39 from Fedora development 2.05b-36
354  * Tim Waugh <twaugh@redhat.com>
355  - Fix parameter expansion in multibyte locales (bug #112657).
356  - Speed up UTF-8 command-line redrawing in the common case (bug #102353,
357    bug #110777).
358  - Apply upstream patches (bug #109269 among others).
359  - Fix bash.info (bug #83776).
360  - Add bash205b-007 patch to fix bug #106876.
361  - Avoid crashing on multibyte input when locale is set incorrectly
362    (bug #74266).
363  - LFS support (bug #103627).
364  - Fix completion display when multibyte or control characters are to be
365    shown (bug #90201).
366  - Fix a warning message (bug #79629).
367  - Don't build with AFS support (bug #86514).
368  - Don't explicitly strip binaries (bug #85995).
369  - Really fix bug #83331 for good.
370  - Fix builtins.1.
371  - Actually apply the patch (bug #83331).
372  - Fix history/UTF-8 bug (bug #83331).
373  - More tab-completion fixing (bug #72512).
374  - Force pgrp synchronization (bug #81653).
375  - Prevent prompt overwriting output (bug #74383).
376  - Fix '-rbash' (bug #78455).
377  - Add readline-init patch (bug #74925).
378  - Add the (4) patches from ftp.gnu.org (bug #75888, bug #72512).
379  - Ship '.' man page, which doesn't get picked up by glob.
380  - Locale shell variables fix (bug #74701).
381  * Elliot Lee <sopwith@redhat.com>
382  - (patch26) Don't call 'size' in makefile. Pointless, and interferes with
383    cross compiles.
384
385* Wed Oct  9 2002 NISHIMURA Daisuke <nishi@graco.c.u-tokyo.ac.jp> 2.05-0vl1
386- update to 2.05
387- add README.jpatch to %doc
388- remove patch4 (bash2): revert command name in man pages to "bash"
389  - fix perl command to remove man pages conflict with sh-utils
390- remove section of config.h.in from patch0 to prevent remake of configure
391- change patch9: define in config-top.h to avoid conflict with patch100
392- remove patches 7, 10 & 101
393
394* Mon Apr  8 2002 NISHIMURA Daisuke <nishi@graco.c.u-tokyo.ac.jp> 2.04-1vl14
395- made a link for man sh
396
397* Thu Nov 15 2001 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.04-1vl13
398- added missing %%post and %%triggerpostun section
399
400* Sun Jul 15 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
401- 2.04-1vl12
402- now bash2 is finally bash
403
404* Sun Jul 15 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 2.04-1vl11
405- build for Playstation2
406
407* Mon Jun 11 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
408- 2.04-1vl10
409- Provides: bash = %%{version}
410
411* Thu Jun 07 2001 Satoshi MACHINO  <machino@vinelinux.org> 2.04-1vl9
412- added Provides: bash
413
414* Thu Jun 07 2001 Satoshi MACHINO  <machino@vinelinux.org> 2.04-1vl8
415- Obsoletes: bash
416- changed Copyright to License
417
418* Fri Dec 29 2000 Lisa Sagami <czs14350@mb.infoweb.ne.jp>
419- 2.04-1vl7
420- deleted: /etc/profile.d/alias.sh (which we have in /etc/skel/.bashrc)
421- corrected: bashrc-vine -> bashrc
422
423* Sat Dec 16 2000 Satoshi MACHINO  <machino@vinelinux.org> 2.04-1vl6
424- combined bash-1.x and bash-2.x packages
425- added some patches from bash-2.04-13mdk
426
427* Sun Dec 10 2000 Jun Nishii <jun@vinelinux.org> 2.04-1vl5
428- fix spec macros
429- added tests
430
431* Sun Nov 19 2000 Satoshi MACHINO <machino@vinelinux.org> 2.04-1vl5
432- build with gcc-2.95.3
433- partially used rpmmacros
434
435* Fri Sep  8 2000 Jun Nishii <jun@vinelinux.org>
436- minor bug fix in spec file
437
438* Sun Aug 27 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
439- 2.04-1vl3
440- modified %install and %files section to handle compressed man page(s)
441
442* Thu Mar 23 2000 Yasuyuki Furukawa <furukawa@vinelinux.org>
443- added pcomplete patch to fix complete if the candidate list is NULL.
444
445* Wed Mar 22 2000 Yasuyuki Furukawa <furukawa@vinelinux.org>
446- updated to 2.04
447
448* Fri Sep 14 1999 Dale Lovelace <dale@redhat.com>
449- Remove annoying ^H's from documentation
450
451* Fri Jul 16 1999 Ken Estes <kestes@staff.mail.com>
452- patch to detect what executables are required by a script.
453
454* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
455- auto rebuild in the new build environment (release 4)
456
457* Fri Mar 19 1999 Jeff Johnson <jbj@redhat.com>
458- strip binaries.
459- include bash-doc correctly.
460
461* Thu Mar 18 1999 Preston Brown <pbrown@redhat.com>
462- fixed post/postun /etc/shells work.
463
464* Thu Mar 18 1999 Cristian Gafton <gafton@redhat.com>
465- updated again text in the spec file
466
467* Mon Feb 22 1999 Jeff Johnson <jbj@redhat.com>
468- updated text in spec file.
469- update to 2.03.
470
471* Fri Feb 12 1999 Cristian Gafton <gafton@redhat.com>
472- build it as bash2 instead of bash
473
474* Tue Feb  9 1999 Bill Nottingham <notting@redhat.com>
475- set 'NON_INTERACTIVE_LOGIN_SHELLS' so profile gets read
476
477* Thu Jan 14 1999 Jeff Johnson <jbj@redhat.com>
478- rename man pages in bash-doc to avoid packaging conflicts (#606).
479
480* Wed Dec 02 1998 Cristian Gafton <gafton@redhat.com>
481- patch for the arm
482- use $RPM_ARCH-redhat-linux as the build target
483
484* Tue Oct  6 1998 Bill Nottingham <notting@redhat.com>
485- rewrite %pre, axe %postun (to avoid prereq loops)
486
487* Wed Aug 19 1998 Jeff Johnson <jbj@redhat.com>
488- resurrect for RH 6.0.
489
490* Sun Jul 26 1998 Jeff Johnson <jbj@redhat.com>
491- update to 2.02.1
492
493* Thu Jun 11 1998 Jeff Johnson <jbj@redhat.com>
494- Package for 5.2.
495
496* Mon Apr 20 1998 Ian Macdonald <ianmacd@xs4all.nl>
497- added POSIX.NOTES doc file
498- some extraneous doc files removed
499- minor .spec file changes
500
501* Sun Apr 19 1998 Ian Macdonald <ianmacd@xs4all.nl>
502- upgraded to version 2.02
503- Alpha, MIPS & Sparc patches removed due to lack of test platforms
504- glibc & signal patches no longer required
505- added documentation subpackage (doc)
506
507* Fri Nov 07 1997 Donnie Barnes <djb@redhat.com>
508- added signal handling patch from Dean Gaudet <dgaudet@arctic.org> that
509  is based on a change made in bash 2.0.  Should fix some early exit
510  problems with suspends and fg.
511
512* Mon Oct 20 1997 Donnie Barnes <djb@redhat.com>
513- added %clean
514
515* Mon Oct 20 1997 Erik Troan <ewt@redhat.com>
516- added comment explaining why install-info isn't used
517- added mips patch
518
519* Fri Oct 17 1997 Donnie Barnes <djb@redhat.com>
520- added BuildRoot
521
522* Tue Jun 03 1997 Erik Troan <ewt@redhat.com>
523- built against glibc
Note: See TracBrowser for help on using the repository browser.