Compare commits

...

4 Commits
rawhide ... f21

Author SHA1 Message Date
Jaromir Capik 8308737c49 Adding --without-tinfo to STAGE1 recipe
When the configure script finds no tinfo headers in the buildroot,
it searches for them on the host's rootfs and when found there,
it marks tinfo as present even when there's no compatible library
installed for the target architecture. That causes the build to fail
during cross-compiling.
The above switch explicitly says we don't want tinfo.
2015-06-30 15:07:37 +02:00
Jaromir Capik a19165d872 Adding STAGE1 bootstrap recipe 2015-06-15 17:12:12 +02:00
Karel Zak b76b33d646 2.25.2-3: add BuildRequires 2015-05-22 13:55:31 +02:00
Karel Zak 6c2ea52b6f 2.25.2-3: #1223894 2015-05-22 13:47:32 +02:00
3 changed files with 142 additions and 2 deletions

117
2.27-buildsys-without.patch Normal file
View File

@ -0,0 +1,117 @@
diff -up util-linux-2.25.2/configure.ac.kzak util-linux-2.25.2/configure.ac
--- util-linux-2.25.2/configure.ac.kzak 2014-10-24 12:24:02.952545559 +0200
+++ util-linux-2.25.2/configure.ac 2015-05-22 13:08:25.120672632 +0200
@@ -501,8 +501,28 @@ AS_CASE([$scanf_cv_alloc_modifier],
have_scanf_alloc_modifier=no]
)
-UL_CHECK_LIB([util], [openpty])
-UL_CHECK_LIB([termcap], [tgetnum])
+
+AC_ARG_WITH([util], AS_HELP_STRING([--without-util], [compile without libutil]),
+ [], [with_util=auto]
+)
+AS_IF([test "x$with_util" = xno], [
+ AM_CONDITIONAL([HAVE_UTIL], [false])
+ have_util=no
+], [
+ UL_CHECK_LIB([util], [openpty])
+])
+
+
+AC_ARG_WITH([termcap], AS_HELP_STRING([--without-termcap], [compile without libtermcap]),
+ [], [with_termcap=auto]
+)
+AS_IF([test "x$with_termcap" = xno], [
+ AM_CONDITIONAL([HAVE_TERMCAP], [false])
+ have_termcap=no
+], [
+ UL_CHECK_LIB([termcap], [tgetnum])
+])
+
AC_CHECK_TYPES([union semun], [], [], [[
#include <sys/sem.h>
@@ -725,17 +745,24 @@ AS_IF([test "x$have_slang" = xyes -o "x$
])
-dnl Try pkg-config for libtinfo
-PKG_CHECK_MODULES(TINFO, [tinfo], [have_tinfo=yes], [
- dnl If that failed, fall back to classic searching.
- AC_CHECK_LIB([tinfo], [tgetent], [
- have_tinfo=yes
- TINFO_LIBS="-ltinfo"
- TINFO_CFLAGS=""])
+AC_ARG_WITH([tinfo], AS_HELP_STRING([--without-tinfo], [compile without libtinfo]),
+ [], [with_tinfo=auto]
+)
+have_tinfo=no
+AS_IF([test "x$with_tinfo" != xno], [
+ dnl Try pkg-config for libtinfo
+ PKG_CHECK_MODULES(TINFO, [tinfo], [have_tinfo=yes], [
+ dnl If that failed, fall back to classic searching.
+ AC_CHECK_LIB([tinfo], [tgetent], [
+ have_tinfo=yes
+ TINFO_LIBS="-ltinfo"
+ TINFO_CFLAGS=""])
+ ])
])
AC_SUBST([TINFO_LIBS])
AC_SUBST([TINFO_CFLAGS])
AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes])
+AS_IF([test "x$have_tinfo" = xyes], [AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo available.])])
AC_ARG_WITH([utempter],
@@ -753,7 +780,6 @@ AS_IF([test "x$with_utempter" = xyes], [
])
-
dnl
dnl libuuid
dnl
@@ -994,10 +1020,16 @@ UL_REQUIRES_SYSCALL_CHECK([nsenter], [UL
AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes])
AC_CHECK_FUNCS([setns])
-dnl setpriv depends on libcap-ng. It would be possible to build
-dnl a version of setpriv with limited functionality without libcap-ng,
-dnl but this isn't currently supported.
-UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
+
+AC_ARG_WITH([cap_ng],
+ AS_HELP_STRING([--without-capng], [compile without libcap-ng]),
+ [], [with_cap_ng=auto]
+)
+AS_IF([test "x$with_cap_ng" = xno], [have_cap_ng=no],[
+ UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
+])
+
+
AC_ARG_ENABLE([setpriv],
AS_HELP_STRING([--disable-setpriv], [do not build setpriv]),
[], [UL_DEFAULT_ENABLE([setpriv], [check])]
@@ -1027,12 +1059,20 @@ UL_BUILD_INIT([agetty])
AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes])
+AC_ARG_WITH([libz],
+ AS_HELP_STRING([--without-libz], [compile without libz]),
+ [], [with_libz=auto]
+)
+AS_IF([test "x$with_libz" = xno], [have_z=no], [
+ AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
+])
+
+
AC_ARG_ENABLE([cramfs],
AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
[], [UL_DEFAULT_ENABLE([cramfs], [check])]
)
UL_BUILD_INIT([cramfs])
-AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
UL_REQUIRES_HAVE([cramfs], [z], [z library])
AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes])

12
STAGE1-util-linux Normal file
View File

@ -0,0 +1,12 @@
srpm util-linux
mcd $BUILDDIR/$1
cat <<EOF > config.cache
ax_cv_have_tls=yes
scanf_cv_alloc_modifier=ms
EOF
$SRC/${1}-*/configure $TCONFIGARGS --without-ncurses --without-tinfo \
--prefix=/usr --libexecdir=/usr/lib${SUFFIX} --libdir=/usr/lib${SUFFIX} \
--disable-wall --cache-file=config.cache --without-python --without-systemd
notparallel
make $J V=1
make $J install DESTDIR=${ROOTFS}

View File

@ -2,7 +2,7 @@
Summary: A collection of basic system utilities
Name: util-linux
Version: 2.25.2
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
Group: System Environment/Base
URL: http://en.wikipedia.org/wiki/Util-linux
@ -26,6 +26,12 @@ Buildrequires: libuser-devel
BuildRequires: libcap-ng-devel
BuildRequires: python3-devel
# due to patch to build-sys
BuildRequires: gettext-devel
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
### Sources
Source0: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.25/util-linux-%{upstream_version}.tar.xz
Source1: util-linux-login.pamd
@ -79,6 +85,8 @@ Patch0: 2.23-login-lastlog-create.patch
# 1168490 - CVE-2014-9114 util-linux: command injection flaw in blkid
Patch1: 2.26-libblkid-escape.patch
# 1223894 - util-linux FTBFS during stage1 bootstrap
Patch2: 2.27-buildsys-without.patch
%description
The util-linux package contains a large variety of low-level system
@ -226,10 +234,10 @@ mountinfo, etc) and mount filesystems.
%prep
%autosetup -p1 -n %{name}-%{upstream_version}
./autogen.sh
%build
unset LINGUAS || :
export CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $RPM_OPT_FLAGS"
export SUID_CFLAGS="-fpie"
export SUID_LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now"
@ -838,6 +846,9 @@ exit 0
%{_libdir}/python*/site-packages/libmount/*
%changelog
* Fri May 22 2015 Karel Zak <kzak@redhat.com> 2.25.2-3
- fix #1223894 - util-linux FTBFS during stage1 bootstrap
* Thu Nov 27 2014 Karel Zak <kzak@redhat.com> 2.25.2-2
- fix #1168490 - CVE-2014-9114 util-linux: command injection flaw in blkid