Accepting request 611921 from home:scarabeus_iv:branches:filesystems

- Fix build for SLE11 again

- Do not probe for lto on older GCCs as it exposes errors that
  might cause random runtime issues

- Do not distribute static libraries they are not needed
- Remove the crazy part about avoiding shared library policies
  it does work on SLE11 even if it is not mandated
- Make sure to run only proper parts of services on reloads for
  xfs unitfiles

OBS-URL: https://build.opensuse.org/request/show/611921
OBS-URL: https://build.opensuse.org/package/show/filesystems/xfsprogs?expand=0&rev=71
This commit is contained in:
Luis Chamberlain 2018-05-25 03:50:13 +00:00 committed by Git OBS Bridge
parent 1db781a2b5
commit 6aa56c47a7
2 changed files with 67 additions and 131 deletions

View File

@ -1,8 +1,28 @@
-------------------------------------------------------------------
Thu May 24 19:38:41 UTC 2018 - tchvatal@suse.com
- Fix build for SLE11 again
------------------------------------------------------------------- -------------------------------------------------------------------
Thu May 24 14:29:20 CEST 2018 - kukuk@suse.de Thu May 24 14:29:20 CEST 2018 - kukuk@suse.de
- Use %license instead of %doc [bsc#1082318] - Use %license instead of %doc [bsc#1082318]
-------------------------------------------------------------------
Tue May 22 13:49:03 UTC 2018 - tchvatal@suse.com
- Do not probe for lto on older GCCs as it exposes errors that
might cause random runtime issues
-------------------------------------------------------------------
Wed May 16 12:31:58 UTC 2018 - tchvatal@suse.com
- Do not distribute static libraries they are not needed
- Remove the crazy part about avoiding shared library policies
it does work on SLE11 even if it is not mandated
- Make sure to run only proper parts of services on reloads for
xfs unitfiles
------------------------------------------------------------------- -------------------------------------------------------------------
Thu May 10 23:48:29 UTC 2018 - lurodriguez@suse.com Thu May 10 23:48:29 UTC 2018 - lurodriguez@suse.com

View File

@ -17,36 +17,20 @@
%define _dracutmodulesdir %{_libexecdir}/dracut/modules.d %define _dracutmodulesdir %{_libexecdir}/dracut/modules.d
# make sure we use systemd services on products where it is available
# Note: requiring split_so_package does imply xfs_use_systemd, however, %if 0%{?suse_version} >= 1210
# needing xfs_use_systemd does not imply requiring split_so_package. These %bcond_without systemd
# need to be kept split for now.
# We're strict now about packages with shared objects, they must be in their
# own package. This is not a requirement for older releases so do not do the
# split there. For details see:
# https://en.opensuse.org/openSUSE:Shared_library_packaging_policy
%if 0%{?suse_version} >= 1315
%define split_so_package 1
%else %else
%define split_so_package 0 %bcond_with systemd
%endif %endif
%define libname libhandle1
# Starting with OpenSUSE Leap 42.1 and SLE12-SP1 we get systemd
%if 0%{?sle_version} >= 120100
%define xfs_use_systemd 1
%else
%define xfs_use_systemd 0
%endif
Name: xfsprogs Name: xfsprogs
Version: 4.16.1 Version: 4.16.1
Release: 0 Release: 0
Summary: Utilities for managing the XFS file system Summary: Utilities for managing the XFS file system
License: GPL-2.0-or-later License: GPL-2.0-or-later
Group: System/Filesystems Group: System/Filesystems
Url: http://xfs.org URL: http://xfs.org
Source0: https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-%{version}.tar.xz Source0: https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-%{version}.tar.xz
Source1: https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-%{version}.tar.sign Source1: https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-%{version}.tar.sign
Source2: %{name}.keyring Source2: %{name}.keyring
@ -56,23 +40,21 @@ Patch0: xfsprogs-docdir.diff
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: libblkid-devel BuildRequires: libblkid-devel
BuildRequires: pkg-config
BuildRequires: readline-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libuuid-devel BuildRequires: libuuid-devel
%if 0%{?suse_version} >= 1010 BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: xz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(post): coreutils
# hint for ZYPP # hint for ZYPP
Supplements: filesystem(xfs) Supplements: filesystem(xfs)
%endif
%if 0%{?suse_version} >= 1310 %if 0%{?suse_version} >= 1310
BuildRequires: suse-module-tools BuildRequires: suse-module-tools
%endif %endif
BuildRequires: xz %if %{with systemd}
Requires(post): coreutils
%if 0%{?xfs_use_systemd} == 1
BuildRequires: pkgconfig
BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(systemd)
%endif %endif
%description %description
A set of commands to use the XFS file system, including mkfs.xfs. A set of commands to use the XFS file system, including mkfs.xfs.
@ -87,19 +69,16 @@ Refer to the documentation at http://oss.sgi.com/projects/xfs/ for
complete details. This implementation is on-disk compatible with the complete details. This implementation is on-disk compatible with the
IRIX version of XFS. IRIX version of XFS.
%if 0%{?split_so_package} == 1 %package -n %{libname}
%package -n libhandle1
Summary: XFS Filesystem-specific Shared library Summary: XFS Filesystem-specific Shared library
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
%description -n libhandle1 %description -n %{libname}
libhandle1 contains the shared libraries needed by xfsprogs %{libname} contains the shared libraries needed by xfsprogs
to run xfsprogs programs. to run xfsprogs programs.
libhandle1 is always needed by xfsprogs. If you want to use this %{libname} is always needed by xfsprogs. If you want to use this
library for your own new xfs tools install xfsprogs-devel. library for your own new xfs tools install xfsprogs-devel.
%endif
%package devel %package devel
Summary: XFS Filesystem-specific Static Libraries and Headers Summary: XFS Filesystem-specific Static Libraries and Headers
@ -117,9 +96,7 @@ want to install xfsprogs.
%prep %prep
%setup -q %setup -q
%if 0%{?suse_version}
%patch0 -p1 %patch0 -p1
%endif
%build %build
aclocal -I m4 aclocal -I m4
@ -128,21 +105,16 @@ autoconf
export OPTIMIZER="-fPIC" export OPTIMIZER="-fPIC"
export DEBUG=-DNDEBUG export DEBUG=-DNDEBUG
export LIBUUID=%{_libdir}/libuuid.a export LIBUUID=%{_libdir}/libuuid.a
%if 0%{?xfs_use_systemd} == 1
export USE_SYSTEMD="--with-systemd-unit-dir=%{_unitdir}"
%endif
# Some paranoid compiler errors appear with read() which *do not* appear %configure \
# on newer compilers. With -Werror we'd fail building the packages so --enable-readline=yes \
# we need to work around these compilers for now. I tried fixing %if %{with systemd}
# these concerns but in no way saw any issues with the warning issued, --with-systemd-unit-dir=%{_unitdir} \
# as such I don't think this is a real code issue, but more a compiler
# issue.
%if 0%{?sle_version} < 150000
export CFLAGS="$CFLAGS -Wno-error"
%endif %endif
%if 0%{?suse_version} < 1500
%configure --enable-readline=yes $USE_SYSTEMD --disable-lto \
%endif
%{nil}
make %{?_smp_mflags} V=1 make %{?_smp_mflags} V=1
PATH_TO_HELP="%{_dracutmodulesdir}/95suse-xfs/dracut-fsck-help.txt" PATH_TO_HELP="%{_dracutmodulesdir}/95suse-xfs/dracut-fsck-help.txt"
@ -150,136 +122,80 @@ sed -e "s|@@PATH_TO_HELP@@|$PATH_TO_HELP|" %{SOURCE3} > module-setup.sh
%install %install
export DIST_ROOT=%{buildroot} export DIST_ROOT=%{buildroot}
make install %make_install
make install-dev make install-dev
# installed by %license macro
%if 0%{?suse_version} < 1315
rm %{buildroot}%{_defaultdocdir}/%{name}/COPYING rm %{buildroot}%{_defaultdocdir}/%{name}/COPYING
# Move libhandle to usr, libhandle.{a,la} are symlinks to usr/lib* already so %endif
# remove them first. # remove the static libs and libtool archive
rm %{buildroot}/%{_lib}/libhandle.a rm -rf %{buildroot}/%{_lib}/*.{la,a}
rm %{buildroot}/%{_lib}/libhandle.la rm -rf %{buildroot}/%{_libdir}/*.{la,a}
mv %{buildroot}/%{_lib}/* %{buildroot}%{_libdir} mv %{buildroot}/%{_lib}/* %{buildroot}%{_libdir}
%find_lang %{name} %find_lang %{name}
install -m 0755 -d %{buildroot}/%{_dracutmodulesdir}/95suse-xfs/ install -m 0755 -d %{buildroot}/%{_dracutmodulesdir}/95suse-xfs/
install -m 0755 module-setup.sh %{buildroot}/%{_dracutmodulesdir}/95suse-xfs/ install -m 0755 module-setup.sh %{buildroot}/%{_dracutmodulesdir}/95suse-xfs/
install -m 0644 %{SOURCE4} %{buildroot}/%{_dracutmodulesdir}/95suse-xfs/ install -m 0644 %{SOURCE4} %{buildroot}/%{_dracutmodulesdir}/95suse-xfs/
# This seems more complex than it looks but deserves some notes otherwise %if %{with systemd}
# anyone trying to undertand this will really scratch their heads. First the
# split_so_package implies that instead of doing the ldconfig's for the main
# xfsprogs package we'd be doing it now for the libhandle1 package. But if a
# system has systemd, the main xfsprogs package requires its own set of
# pre/post/prerun/postrun hooks for the main xfsprogs for the service files.
# For the systems that lack the requirement for libhandle1, we can expect them
# to also not require systemd, and as such the only package in those system
# requiring hooks is the main xfsprogs package which provides the libhandle so
# file.
%if 0%{?split_so_package} == 1
%if 0%{?suse_version} >= 1310
%if 0%{?xfs_use_systemd} == 1
%pre %pre
%service_add_pre xfs_scrub@.service xfs_scrub_all.service xfs_scrub_all.timer xfs_scrub_fail@.service %service_add_pre xfs_scrub_all.service xfs_scrub_all.timer
%post %post
%service_add_post xfs_scrub@.service xfs_scrub_all.service xfs_scrub_all.timer xfs_scrub_fail@.service %service_add_post xfs_scrub_all.service xfs_scrub_all.timer
%preun %preun
%service_del_preun xfs_scrub@.service xfs_scrub_all.service xfs_scrub_all.timer xfs_scrub_fail@.service %service_del_preun xfs_scrub_all.service xfs_scrub_all.timer
%postun %postun
%service_del_postun xfs_scrub@.service xfs_scrub_all.service xfs_scrub_all.timer xfs_scrub_fail@.service %service_del_postun xfs_scrub_all.service xfs_scrub_all.timer
%endif %endif
%post -n libhandle1 %post -n %{libname}
%{?regenerate_initrd_post} %{?regenerate_initrd_post}
/sbin/ldconfig /sbin/ldconfig
%postun -n libhandle1 %postun -n %{libname}
%{?regenerate_initrd_post} %{?regenerate_initrd_post}
/sbin/ldconfig /sbin/ldconfig
%posttrans -n libhandle1 %posttrans -n %{libname}
%{?regenerate_initrd_posttrans} %{?regenerate_initrd_posttrans}
%else
%postun -n libhandle1
%post -p /sbin/ldconfig
%endif
%else
# Below are systems that do not require the libhandle1 package. For these,
# its as we had things before, and xfsprogs provides the so library.
%if 0%{?suse_version} >= 1310
%post
%{?regenerate_initrd_post}
/sbin/ldconfig
%postun
%{?regenerate_initrd_post}
/sbin/ldconfig
%posttrans
%{?regenerate_initrd_posttrans}
%else
%postun
%post -p /sbin/ldconfig
%endif
%endif
%files -f %{name}.lang %files -f %{name}.lang
%defattr(-,root,root,755) %defattr(-,root,root,755)
#UsrMerge #UsrMerge
/sbin/* /sbin/*
#EndUsrMerge #EndUsrMerge
%{_sbindir}/* %{_sbindir}/*
%if 0%{?split_so_package} != 1
%{_libdir}/libhandle.so.*
%endif
%dir %{_libdir}/xfsprogs/ %dir %{_libdir}/xfsprogs/
%{_libdir}/xfsprogs/xfs_scrub_all.cron %{_libdir}/xfsprogs/xfs_scrub_all.cron
%if 0%{?xfs_use_systemd} == 1 %if %{with systemd}
%{_libdir}/xfsprogs/xfs_scrub_fail %{_libdir}/xfsprogs/xfs_scrub_fail
%{_unitdir}/xfs_scrub@.service %{_unitdir}/xfs_scrub@.service
%{_unitdir}/xfs_scrub_all.service %{_unitdir}/xfs_scrub_all.service
%{_unitdir}/xfs_scrub_all.timer %{_unitdir}/xfs_scrub_all.timer
%{_unitdir}/xfs_scrub_fail@.service %{_unitdir}/xfs_scrub_fail@.service
%endif %endif
%doc %{_mandir}/man[258]/* %{_mandir}/man[258]/*
%doc %{_defaultdocdir}/%{name} %doc %{_defaultdocdir}/%{name}
%if 0%{?suse_version} >= 1315
%license doc/COPYING %license doc/COPYING
%endif
%dir %{_libexecdir}/dracut %dir %{_libexecdir}/dracut
%dir %{_libexecdir}/dracut/modules.d %dir %{_libexecdir}/dracut/modules.d
%dir %{_dracutmodulesdir}/95suse-xfs/ %dir %{_dracutmodulesdir}/95suse-xfs/
%{_dracutmodulesdir}/95suse-xfs/dracut-fsck-help.txt %{_dracutmodulesdir}/95suse-xfs/dracut-fsck-help.txt
%{_dracutmodulesdir}/95suse-xfs/module-setup.sh %{_dracutmodulesdir}/95suse-xfs/module-setup.sh
%if 0%{?split_so_package} == 1 %files -n %{libname}
%files -n libhandle1 %defattr(-,root,root,755)
%{_libdir}/libhandle.so.1.0.3 %{_libdir}/libhandle.so.*
# The .1 symlink belongs to the main library package as per the
# documentation here:
# https://en.opensuse.org/openSUSE:Shared_library_packaging_policy
%{_libdir}/libhandle.so.1
%endif
%files -n xfsprogs-devel %files -n xfsprogs-devel
%defattr(-,root,root,755) %defattr(-,root,root,755)
%{_includedir}/xfs %{_includedir}/xfs
# The symlink single so file belongs in devel packages as per rpm lint
# and documentation here:
# https://en.opensuse.org/openSUSE:Shared_library_packaging_policy
%{_libdir}/libhandle.so %{_libdir}/libhandle.so
# Archives for static builds
%{_libdir}/*.a
# Description of the libraries for libtool
%{_libdir}/*.la
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %changelog