From 994db06da7d5f1f5e8b0187139931d3e0d870d64a1431b4fb22ade7a99cc5234 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 5 Nov 2015 10:26:47 +0000 Subject: [PATCH] Accepting request 342136 from home:dsterba:branches:filesystems - build btrfsprogs-static package for 13.2 and Factory, package with static versions of the utilities, aimed for rescue environments OBS-URL: https://build.opensuse.org/request/show/342136 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=218 --- btrfsprogs.changes | 6 ++++ btrfsprogs.spec | 62 ++++++++++++++++++++++++++++++++++-- local-version-override.patch | 2 +- 3 files changed, 67 insertions(+), 3 deletions(-) diff --git a/btrfsprogs.changes b/btrfsprogs.changes index d42b2ce..4530081 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 2 00:00:00 CET 2015 - dsterba@suse.cz + +- build btrfsprogs-static package for 13.2 and Factory, package + with static versions of the utilities, aimed for rescue environments + ------------------------------------------------------------------- Mon Oct 19 00:00:00 CEST 2015 - dsterba@suse.cz diff --git a/btrfsprogs.spec b/btrfsprogs.spec index 85e7f1c..3dbd3c6 100644 --- a/btrfsprogs.spec +++ b/btrfsprogs.spec @@ -16,6 +16,13 @@ # +# enable building of btrfsprogs-static +%if 0%{?suse_version} <= 1310 || 0%{?suse_version} == 1315 +%define build_static 0 +%else +%define build_static 1 +%endif + Name: btrfsprogs Version: 4.2.3 Release: 0 @@ -59,6 +66,26 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Utilities needed to create and maintain btrfs file systems under Linux. +%if %build_static +%package -n btrfsprogs-static +Summary: Static build of utilities for the Btrfs filesystem +Group: System/Filesystems +BuildRequires: glibc-devel-static +BuildRequires: libblkid-devel-static +BuildRequires: libcom_err-devel-static +BuildRequires: libext2fs-devel-static +BuildRequires: libuuid-devel-static +BuildRequires: lzo-devel-static +BuildRequires: zlib-devel-static + +%description -n btrfsprogs-static +Static build of utilities needed to create and maintain btrfs file systems +under Linux. Suitable for limited or rescue environments. + +Warning: the zlib and lzo libraries are statically linked in and may lack +important updates +%endif + %package -n libbtrfs0 Summary: Library for interacting with Btrfs Group: System/Libraries @@ -89,10 +116,22 @@ build applications to interface with btrfs. %build ./autogen.sh %configure -make V=1 %{?_smp_mflags} all +make V=1 %{?_smp_mflags} all \ +%if %build_static + static +%endif %install -make install DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_sbindir} mandir=%{_mandir} libdir=%{_libdir} +make install \ +%if %build_static + install-static \ +%endif + DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_sbindir} mandir=%{_mandir} libdir=%{_libdir} + +%if %build_static +make install-static DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_sbindir} mandir=%{_mandir} libdir=%{_libdir} +%endif + install -m 0755 -d %{buildroot}/%{_sbindir} install -m 0755 -d %{buildroot}/%{_bindir} # move some utilities out of /usr/sbin @@ -219,6 +258,25 @@ done %{_sbindir}/btrfs-select-super %endif +%if %build_static +%files -n btrfsprogs-static +%defattr(-, root, root) +%{_sbindir}/btrfs.static +%{_sbindir}/btrfs-zero-log.static +%{_sbindir}/btrfs-convert.static +%{_sbindir}/btrfs-image.static +%{_sbindir}/btrfstune.static +%{_sbindir}/btrfsck.static +%{_sbindir}/mkfs.btrfs.static +%{_sbindir}/btrfs-debug-tree.static +%{_sbindir}/btrfs-show-super.static +%{_sbindir}/btrfs-calc-size.static +%{_sbindir}/btrfs-corrupt-block.static +%{_sbindir}/btrfs-find-root.static +%{_sbindir}/btrfs-map-logical.static +%{_sbindir}/btrfs-select-super.static +%endif + %files -n libbtrfs0 %defattr(-, root, root) %{_libdir}/libbtrfs.so.* diff --git a/local-version-override.patch b/local-version-override.patch index 4185cda..001dc74 100644 --- a/local-version-override.patch +++ b/local-version-override.patch @@ -7,7 +7,7 @@ Index: btrfs-progs-v4.1/version.sh # Released under the GNU GPLv2 -v="v4.2.3" -+v="v4.2.3+20151019" ++v="v4.2.3+20151102" opt=$1