OBS User unknown 2009-06-12 14:51:48 +00:00 committed by Git OBS Bridge
parent 5e51af484b
commit 3b36f99198
5 changed files with 266 additions and 16 deletions

75
bash-4.0-headers.dif Normal file
View File

@ -0,0 +1,75 @@
--- examples/loadables/Makefile.in
+++ examples/loadables/Makefile.in 2009-06-05 11:50:08.745961844 +0000
@@ -28,6 +28,9 @@ includedir = @includedir@
datarootdir = @datarootdir@
+# Support an alternate destination root directory for package building
+DESTDIR =
+
topdir = @top_srcdir@
BUILD_DIR = @BUILD_DIR@
srcdir = @srcdir@
@@ -61,6 +64,16 @@ LIBINTL_H = @LIBINTL_H@
CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CFLAGS)
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALLMODE= -m 0755
+INSTALLMODE2 = -m 0555
+
+Name = bash
+Version = @BASHVERS@
+
#
# These values are generated for configure by ${topdir}/support/shobj-conf.
# If your system is not supported by that script, but includes facilities for
@@ -79,20 +92,45 @@ INC = -I. -I.. -I$(topdir) -I$(topdir)/l
-I$(BASHINCDIR) -I$(BUILD_DIR) -I$(LIBBUILD) \
-I$(BUILD_DIR)/builtins $(INTL_INC)
+.SUFFIXES: .d
+.c.d:
+ $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -MM -MT install-headers -MF $@ $<
+
.c.o:
$(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $<
+SUPPORT_SRC = $(topdir)/support/
ALLPROG = print sleep finfo logname basename dirname \
tty pathchk tee head mkdir rmdir printenv id whoami \
uname sync push ln unlink cut realpath getconf strftime mypid
OTHERPROG = necho hello cat
+HEADERS =
all: $(SHOBJ_STATUS)
supported: $(ALLPROG)
others: $(OTHERPROG)
+dependlist: template.d
+-include template.d
+install-headers: HEADERS = $(sort $(filter %.h,$(realpath $^)))
+install-headers:
+ @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(includedir)/$(Name)/$(Version)/builtins
+ for head in $(subst $(realpath $(topdir))/,,$(HEADERS)) ; do \
+ case $$head in \
+ builtins/*) dest=$(DESTDIR)$(includedir)/$(Name)/$(Version)/builtins ;; \
+ *) dest=$(DESTDIR)$(includedir)/$(Name)/$(Version) ;; \
+ esac; \
+ $(INSTALL_DATA) -t $$dest $(topdir)/$$head; \
+ done
+
+install-plugins: $(ALLPROG)
+ @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(libdir)/$(Name)/$(Version)
+ for plugin in $(ALLPROG) ; do \
+ $(INSTALL) $$plugin $(DESTDIR)$(libdir)/$(Name)/$(Version)/$$plugin.so ; \
+ done
+
unsupported:
@echo "Your system (${host_os}) is not supported by the"
@echo "${topdir}/support/shobj-conf script."

57
bash-4.0.24-acl.dif Normal file
View File

@ -0,0 +1,57 @@
--- findcmd.c
+++ findcmd.c 2009-06-04 12:03:16.094615177 +0200
@@ -93,7 +93,22 @@ file_status (name)
r = FS_EXISTS;
-#if defined (AFS)
+#if defined (HAVE_EACCESS) /* FreeBSD, GLIBC_2.4+ */
+
+ /* For support of ACL's use eaccess(3) if found e.g. glibc 2.4 and up:
+ * Like access(2), euidaccess(3) checks permissions and existence of the
+ * file identified by its argument pathname. However, whereas access(2),
+ * performs checks using the real user and group identifiers of the pro-
+ * cess, euidaccess(3) uses the effective identifiers.
+ * eaccess(3) is a synonym for euidaccess(3), provided for compatibility
+ * with some other systems. */
+ if (eaccess (name, X_OK) == 0)
+ r |= FS_EXECABLE;
+ if (eaccess (name, R_OK) == 0)
+ r |= FS_READABLE;
+
+#elif defined (AFS)
+
/* We have to use access(2) to determine access because AFS does not
support Unix file system semantics. This may produce wrong
answers for non-AFS files when ruid != euid. I hate AFS. */
@@ -102,8 +117,7 @@ file_status (name)
if (access (name, R_OK) == 0)
r |= FS_READABLE;
- return r;
-#else /* !AFS */
+#else /* !AFS && !HAVE_EACCESS */
/* Find out if the file is actually executable. By definition, the
only other criteria is that the file has an execute bit set that
@@ -146,8 +160,8 @@ file_status (name)
r |= FS_READABLE;
}
+#endif /* !AFS && !HAVE_EACCESS */
return r;
-#endif /* !AFS */
}
/* Return non-zero if FILE exists and is executable.
--- lib/sh/eaccess.c
+++ lib/sh/eaccess.c 2009-06-04 11:59:33.165901707 +0200
@@ -201,7 +201,7 @@ sh_eaccess (path, mode)
if (path_is_devfd (path))
return (sh_stataccess (path, mode));
-#if defined (HAVE_EACCESS) /* FreeBSD */
+#if defined (HAVE_EACCESS) /* FreeBSD, GLIBC_2.4+ */
return (eaccess (path, mode));
#elif defined (EFF_ONLY_OK) /* SVR4(?), SVR4.2 */
return access (path, mode|EFF_ONLY_OK);

View File

@ -59,12 +59,6 @@
/* Define if you want the case-capitalizing operators (~[~]) and the
`capcase' variable attribute (declare -c). */
@@ -98,3 +98,5 @@
name is not found. If you want to name it something other than the
default ("command_not_found_handle"), change it here. */
/* #define NOTFOUND_HOOK "command_not_found_handle" */
+
+#define eaccess(path,mode) access(path,mode)
--- general.h
+++ general.h 2006-03-27 14:15:25.000000000 +0200
@@ -21,10 +21,13 @@

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jun 9 18:16:25 CEST 2009 - werner@suse.de
- Branch off some sub packages:
* bash-lang to include localization
* bash-loadables for installing the loadable runtime builtins
* bash-devel to install headers for developing loadable builtins
-------------------------------------------------------------------
Wed Jun 3 12:16:43 CEST 2009 - werner@suse.de

136
bash.spec
View File

@ -24,10 +24,11 @@ Group: System/Shells
%define bash_vers 4.0
%define rl_vers 6.0
Recommends: bash-doc = %bash_vers
Recommends: bash-lang = %bash_vers
Suggests: command-not-found
AutoReqProv: on
Version: 4.0
Release: 11
Release: 12
Summary: The GNU Bourne-Again Shell
Url: http://www.gnu.org/software/bash/bash.html
Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{bash_vers}.tar.bz2
@ -52,6 +53,7 @@ Patch11: bash-4.0-loadables.dif
Patch14: bash-3.2-sigrestart.patch
Patch15: bash-3.2-longjmp.dif
Patch16: bash-4.0-setlocale.dif
Patch17: bash-4.0-headers.dif
Patch20: readline-%{rl_vers}.dif
Patch21: readline-4.3-input.dif
Patch22: readline-6.0-wrap.patch
@ -59,9 +61,11 @@ Patch23: readline-5.2-conf.patch
Patch30: readline-6.0-destdir.patch
Patch40: bash-4.0.10-typo.patch
Patch41: bash-4.0.24-globstar-nulldir.patch
Patch42: bash-4.0.24-acl.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global _sysconfdir /etc
%global _incdir %{_includedir}
%global _ldldir /%{_lib}/bash
%global _minsh 0
%{expand: %%global rl_major %(echo %{rl_vers} | sed -r 's/.[0-9]+//g')}
@ -86,7 +90,7 @@ Group: Documentation/Man
Provides: bash:%{_infodir}/bash.info.gz
PreReq: %install_info_prereq
Version: 4.0
Release: 11
Release: 12
AutoReqProv: on
%description -n bash-doc
@ -95,6 +99,95 @@ interpreter Bash.
Authors:
--------
Brian Fox <bfox@gnu.org>
Chet Ramey <chet@ins.cwru.edu>
%lang_package(bash)
%package -n bash-devel
License: GPL v2 or later
Summary: Include Files mandatory for Development of bash loadable builtins
Group: Development/Languages/C and C++
Version: 4.0
Release: 1
AutoReqProv: on
%description -n bash-devel
This package contains the C header files for writing loadable new
builtins for the interpreter Bash. Use -I /usr/include/bash/<version>
on the compilers command line.
Authors:
--------
Brian Fox <bfox@gnu.org>
Chet Ramey <chet@ins.cwru.edu>
%package -n bash-loadables
License: GPL v2 or later
Summary: Loadable bash builtins
Group: System/Shells
Version: 4.0
Release: 1
AutoReqProv: on
%description -n bash-loadables
This package contains the examples for the ready-to-dynamic-load
builtins found in the source tar ball of the bash:
basename Return non-directory portion of pathname.
cut cut(1) replacement.
dirname Return directory portion of pathname.
finfo Print file info.
getconf POSIX.2 getconf utility.
head Copy first part of files.
id POSIX.2 user identity.
ln Make links.
logname Print login name of current user.
mkdir Make directories.
pathchk Check pathnames for validity and portability.
print Loadable ksh-93 style print builtin.
printenv Minimal builtin clone of BSD printenv(1).
push Anyone remember TOPS-20?
realpath Canonicalize pathnames, resolving symlinks.
rmdir Remove directory.
sleep sleep for fractions of a second.
strftime Loadable builtin interface to strftime(3).
sync Sync the disks by forcing pending filesystem writes to
complete.
tee Duplicate standard input.
tty Return terminal name.
uname Print system information.
unlink Remove a directory entry.
whoami Print out username of current user.
Authors:
--------
Brian Fox <bfox@gnu.org>
@ -106,7 +199,7 @@ Summary: The Readline Library
Group: System/Libraries
Provides: bash:/%{_lib}/libreadline.so.%{rl_major}
Version: 6.0
Release: 11
Release: 12
Recommends: readline-doc = %{version}
# bug437293
%ifarch ppc64
@ -135,7 +228,7 @@ Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Provides: bash:%{_libdir}/libreadline.a
Version: 6.0
Release: 11
Release: 12
Requires: libreadline6 = %{version}
Requires: ncurses-devel
Recommends: readline-doc = %{version}
@ -164,7 +257,7 @@ Group: System/Libraries
Provides: readline:%{_infodir}/readline.info.gz
PreReq: %install_info_prereq
Version: 6.0
Release: 11
Release: 12
AutoReqProv: on
%description -n readline-doc
@ -202,11 +295,13 @@ unset p
%patch14 -p0 -b .sigrestart
%patch15 -p0 -b .longjmp
%patch16 -p0 -b .setlocale
%patch17 -p0 -b .headers
%patch21 -p0 -b .zerotty
%patch22 -p0 -b .wrap
%patch23 -p0 -b .conf
%patch40 -p0 -b .typo
%patch41 -p0 -b .globstar
%patch42 -p0 -b .acl
%patch0 -p0
cd ../readline-%{rl_vers}
for p in ../readline-%{rl_vers}-patches/*; do
@ -263,6 +358,7 @@ cd ../readline-%{rl_vers}
cflags -Wl,--as-needed LDFLAGS
cflags -Wl,-O2 LDFLAGS
cflags -Wl,--hash-size=16699 LDFLAGS
cflags -Wl,-rpath,%{_ldldir}/%{bash_vers} LDFLAGS
CC=gcc
CC_FOR_BUILD="$CC"
CFLAGS_FOR_BUILD="$CFLAGS"
@ -396,6 +492,8 @@ cd ../readline-%{rl_vers}
ln -sf /%{_lib}/libreadline.so.%{rl_vers} %{buildroot}/%{_libdir}/libreadline.so
cd ../bash-%{bash_vers}
make install DESTDIR=%{buildroot}
make -C examples/loadables/ install-plugins DESTDIR=%{buildroot} libdir=/%{_lib}
make -C examples/loadables/ install-headers DESTDIR=%{buildroot}
mkdir -p %{buildroot}/bin
mv %{buildroot}%{_bindir}/bash %{buildroot}/bin/
%if %_minsh
@ -469,7 +567,7 @@ ldd -u -r %{buildroot}/bin/bash || true
ldd -u -r %{buildroot}%{_libdir}/libreadline.so || true
%{?buildroot: %{__rm} -rf %{buildroot}}
%files -f bash.lang
%files
%defattr(-,root,root)
%config %attr(600,root,root) %{_sysconfdir}/skel/.bash_history
%config %attr(644,root,root) %{_sysconfdir}/skel/.bashrc
@ -484,6 +582,9 @@ ldd -u -r %{buildroot}%{_libdir}/libreadline.so || true
%dir %{_datadir}/bash/helpfiles
%{_datadir}/bash/helpfiles/*
%files -n bash-lang -f bash.lang
%defattr(-,root,root)
%files -n bash-doc
%defattr(-,root,root)
%doc %{_infodir}/bash.info.gz
@ -492,10 +593,20 @@ ldd -u -r %{buildroot}%{_libdir}/libreadline.so || true
%doc %{_mandir}/man1/bashbug.1.gz
%doc %{_mandir}/man1/rbash.1.gz
%doc %{_defaultdocdir}/bash/
#%files -n bash-plugins
#%defattr(-,root,root)
#%dir /%{_lib}/bash/%{version}/
#/%{_lib}/bash/%{version}/*.so
%files -n bash-devel
%defattr(-,root,root)
%dir /%{_includedir}/bash/
%dir /%{_includedir}/bash/%{bash_vers}/
%dir /%{_includedir}/bash/%{bash_vers}/builtins/
/%{_incdir}/bash/%{bash_vers}/*.h
/%{_incdir}/bash/%{bash_vers}/builtins/*.h
%files -n bash-loadables
%defattr(-,root,root)
%dir %{_ldldir}/
%dir %{_ldldir}/%{bash_vers}/
%{_ldldir}/%{bash_vers}/*
%files -n libreadline6
%defattr(-,root,root)
@ -520,6 +631,11 @@ ldd -u -r %{buildroot}%{_libdir}/libreadline.so || true
%doc %{_defaultdocdir}/readline/
%changelog
* Tue Jun 09 2009 werner@suse.de
- Branch off some sub packages:
* bash-lang to include localization
* bash-loadables for installing the loadable runtime builtins
* bash-devel to install headers for developing loadable builtins
* Wed Jun 03 2009 werner@suse.de
- Enforce the usage of euidaccess(3) instead of stat(2) for testing
permissions for a file (bnc#509105)