# # spec file for package btrfsprogs # # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: btrfsprogs Url: http://btrfs.wiki.kernel.org/index.php/Main_Page Version: 0.19 Release: 0 %define tar_version v0.19-118-gfdb6c04 Summary: Utilities for the Btrfs filesystem License: GPL-2.0 Group: System/Filesystems #Git-Web: http://git.kernel.org/cgit/linux/kernel/git/mason/btrfs-progs.git #Git-Clone: git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs # git archive --format=tar --prefix=btrfs-progs-`git describe`/ HEAD > %D/btrfs-progs-`git describe`.tar Source: btrfs-progs-%{tar_version}.tar.bz2 Source1: boot-btrfs.sh Source2: btrfs-dev-clear-sb Patch0: memleak-fix.diff Patch1: Plug-Memory-leak-in-find_and_setup_log_root.patch Patch1000: local-version-override.patch # patches above upstream master: # + hugo's integration Patch100: 0100-btrfs-progs-ignore-a-option-in-mkfs.patch Patch102: 0102-Add-the-force-option.patch Patch103: 0103-mkfs.btrfs-man-page-document-the-force-option.patch Patch104: 0104-Ignore-the-error-ENXIO-and-ENOMEDIUM-during-a-devs-s.patch Patch105: 0105-Regression-tests.patch Patch106: 0106-Fix-sub-snap-parameter-handling.patch Patch107: 0107-Add-info-for-the-commands.patch Patch108: 0108-Add-the-header-footer-introduction-of-the-man-page.patch Patch109: 0109-helpextract-tool-to-extract-the-info-for-the-help-fr.patch Patch110: 0110-Update-the-makefile-for-generating-the-man-page.patch Patch111: 0111-Show-the-help-messages-from-the-info-in-the-comment.patch Patch112: 0112-Update-the-makefile-for-generating-the-help-messages.patch Patch115: 0115-btrfs-progs-fixup-is_mounted-checks.patch Patch113: 0113-Btrfs-progs-add-restriper-commands.patch Patch114: 0114-btrfs-progs-Add-ioctl-to-read-compressed-size-of-a-f.patch # + josef's restore utility fixes Patch116: 0116-Btrfs-progs-add-an-option-for-specifying-the-root-to.patch Patch117: 0117-Btrfs-progs-try-other-mirrors-if-decomression-fails.patch Patch118: 0118-Btrfs-progs-try-other-mirrors-on-read-failure.patch Patch119: 0119-btrfs-progs-Fix-error-handling-for-failed-reads-in-r.patch Patch120: 0120-btrfs-progs-Check-metadata-mirrors-in-find-root.patch Patch121: 0121-restore-Split-output-directory-and-btrfs-local-path-.patch Patch122: 0122-restore-Add-regex-matching-of-paths-and-files-to-be-.patch Patch123: 0123-btrfs-progs-In-find-root-dump-bytenr-for-every-slot.patch Patch124: 0124-btrfs-progs-Add-utility-to-dump-all-superblocks-foun.patch Patch125: 0125-btrfs-progs-Add-the-ability-to-use-the-earliest-supe.patch Patch126: 0126-btrfs-progs-Use-oldest-super-for-btrfs-select-super..patch Patch127: 0127-btrfs-progs-add-lzo-compression-support-to-restore.patch Patch128: 0128-btrfs-progs-fix-regexec-to-only-work-if-we-actually-.patch Patch129: 0129-btrfs-progs-Fix-compilation-errors-with-btrfs-select.patch Patch130: 0130-Btrfs-progs-fix-restore-to-fall-back-to-the-broken-o.patch Patch131: 0131-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch Patch132: 0132-Btrfs-progs-make-find_and_setup_root-return-an-error.patch Patch133: 0133-Btrfs-progs-check-return-value-properly.patch Patch134: 0134-Btrfs-progs-give-restore-a-list-roots-option.patch Patch139: 0139-Btrfs-progs-make-find-root-spit-out-the-size-of-the-.patch Patch140: 0140-Btrfs-progs-add-some-verbose-output-to-find-root.patch Patch141: 0141-Btrfs-progs-fix-restore-to-actually-use-the-root-loc.patch Patch142: 0142-Btrfs-progs-remove-the-physical-disk-size-check-from.patch Patch143: 0143-Btrfs-progs-fix-error-output-and-dont-read-from-cach.patch Patch144: 0144-Btrfs-progs-print-the-objectid-of-the-root-we-find-w.patch Patch145: 0145-Btrfs-progs-make-specifying-root-objectid-work-if-th.patch Patch146: 0146-Btrfs-progs-don-t-free-the-existing-node.patch Patch147: 0147-mkfs-Handle-creation-of-filesystem-larger-than-the-f.patch Patch181: 0181-btrfs-progs-mkfs-allow-not-to-trim-a-device.patch Patch182: 0182-btrfs-progs-convert-set-label-or-copy-from-origin.patch Patch150: 0150-btrfs-progs-removed-extraneous-whitespace-from-mkfs-.patch Patch151: 0151-btrfs-progs-document-rootdir-mkfs-switch.patch Patch152: 0152-Add-open_ctree_fs_info-for-partial-FS-opens.patch Patch153: 0153-btrfsck-print-some-progress-Signed-off-by-Chris-Maso.patch Patch154: 0154-Allow-extent_buffers-to-use-more-ram.patch Patch155: 0155-btrfsck-don-t-BUG-on-corrupted-extent-records.patch Patch156: 0156-btrfs-corrupt-block-add-e-option-to-corrupt-the-exte.patch Patch157: 0157-btrfsck-add-code-to-rebuild-extent-records.patch Patch158: 0158-btrfs-corrupt-block-add-E-option-to-randomly-corrupt.patch Patch159: 0159-btrfsck-fix-block-group-accounting-during-repair.patch Patch160: 0160-Turn-off-some-commands-in-Makefile.patch Patch161: 0161-Fix-btrfs-convert-btrfs-restore-and-btrfs-find-root-.patch Patch162: 0162-btrfsck-make-sure-to-dirty-all-block-groups-as-we-fi.patch Patch163: 0163-btrfsck-add-init-csum-tree-to-replace-the-csum-root-.patch Patch164: 0164-btrfsck-make-sure-we-fix-the-block-group-accounting-.patch Patch165: 0165-btrfsck-remove-extents-from-the-fsck-reference-track.patch Patch166: 0166-Btrfsck-add-the-ability-to-prune-corrupt-extent-allo.patch Patch167: 0167-Btrfs-use-proc-partitions-scanning-for-btrfs_scan_fo.patch Patch168: 0168-Scan-dev-md-and-device-mapper-devices-last.patch Patch169: 0169-btrfsck-add-early-code-to-handle-corrupted-block-gro.patch Patch170: 0170-Btrfs-progs-btrfs-map-logical-Fix-typo-in-usage.patch Patch171: 0171-Btrfs-progs-btrfs-corrupt-block-fix-the-wrong-usage.patch Patch172: 0172-Btrfs-progs-fix-btrfsck-s-snapshot-wrong-unresolved-.patch Patch173: 0173-btrfs-progs-adjust-size-of-filesystem-if-blockdevice.patch Patch174: 0174-Btrfs-progs-nuke-redundant-zeroing-in-__list_subvol_.patch Patch175: 0175-Btrfs-progs-refactor-resolve_root-function-a-bit.patch Patch176: 0176-Btrfs-progs-bring-subvol-get-default-back-in.patch Patch177: 0177-Btrfs-progs-make-print-tree.c-aware-of-free-space-ca.patch Patch178: 0178-Btrfs-progs-allow-dup-for-data-chunks-in-mixed-mode.patch Patch179: 0179-btrfs-progs-mkfs-rename-T-to-K.patch Patch180: 0180-btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch Patch183: 0183-btrfs-progs-mkfs-disallow-uneven-data-metadata-block.patch Patch184: 0184-btrfs-progs-get-default-man-page.patch Patch185: 0185-btrfs-progs-Correct-xstrip-function.patch Patch186: 0186-btrfs-progs-document-devid-parameter-for-resize.patch Patch187: 0187-btrfs-progs-document-csize-in-manpage.patch Patch188: 0188-btrfs-progs-document-balance-in-manpage.patch Patch189: 0189-btrfs-progs-manpage-fix-markup-in-device-scan.patch Patch190: 0190-btrfs-progs-document-fi-df.patch Patch191: 0191-btrfs-progs-document-inspect-internal-commands.patch Patch192: 0192-btrfs-progs-add-man-page-for-btrfs-convert.patch Patch193: 0193-btrfs-progs-tweak-order-of-devices-in-fi-show.patch # other fixes Patch135: 0135-Btrfs-progs-fix-compiler-warning-of-extent-tree.c.patch Patch136: 0136-Btrfs-progs-change-the-way-mkfs-picks-raid-profiles.patch Patch137: 0137-Btrfs-progs-fail-gracefully-on-error-from-open_ctree.patch Patch138: 0138-Btrfs-progs-bugfix-for-scrubbing-single-devices.patch # Patch250: btrfs-progs-fix-open_ctree_usage_segfaults.patch Patch253: btrfs-reorder-commands-help BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libacl-devel BuildRequires: libattr-devel BuildRequires: libext2fs-devel BuildRequires: libuuid-devel BuildRequires: lzo-devel BuildRequires: zlib-devel # for /bin/true Requires: coreutils Supplements: filesystem(btrfs) %description Utilities needed to create and maintain btrfs file systems under Linux. %prep %setup -q -n btrfs-progs-%{tar_version} %patch0 %patch1 -p1 %patch1000 -p1 %patch100 -p1 %patch102 -p1 %patch103 -p1 %patch104 -p1 %patch105 -p1 %patch106 -p1 %patch107 -p1 %patch108 -p1 %patch109 -p1 %patch110 -p1 %patch111 -p1 %patch112 -p1 %patch115 -p1 %patch114 -p1 %patch113 -p1 # josef's tree %patch116 -p1 %patch117 -p1 %patch118 -p1 %patch119 -p1 %patch120 -p1 %patch121 -p1 %patch122 -p1 %patch123 -p1 %patch124 -p1 %patch125 -p1 %patch126 -p1 %patch127 -p1 %patch128 -p1 %patch129 -p1 %patch130 -p1 %patch131 -p1 %patch132 -p1 %patch133 -p1 %patch134 -p1 %patch139 -p1 %patch140 -p1 %patch141 -p1 %patch142 -p1 %patch143 -p1 %patch144 -p1 %patch145 -p1 %patch146 -p1 %patch147 -p1 %patch181 -p1 %patch182 -p1 %patch150 -p1 %patch151 -p1 # other fixes %patch135 -p1 %patch136 -p1 %patch137 -p1 %patch138 -p1 %patch152 -p1 %patch153 -p1 %patch154 -p1 %patch155 -p1 %patch156 -p1 %patch157 -p1 %patch158 -p1 %patch159 -p1 %patch160 -p1 %patch161 -p1 %patch162 -p1 %patch163 -p1 %patch164 -p1 %patch165 -p1 %patch166 -p1 %patch167 -p1 %patch168 -p1 %patch169 -p1 %patch170 -p1 %patch171 -p1 %patch172 -p1 %patch173 -p1 %patch174 -p1 %patch175 -p1 %patch176 -p1 %patch177 -p1 %patch178 -p1 %patch179 -p1 %patch180 -p1 %patch183 -p1 %patch184 -p1 %patch185 -p1 %patch186 -p1 %patch187 -p1 %patch188 -p1 %patch189 -p1 %patch190 -p1 %patch191 -p1 %patch192 -p1 %patch193 -p1 %patch250 -p1 #%patch252 -p1 %patch253 -p1 %build make %{?_smp_mflags} CFLAGS="%{optflags}" all btrfs-convert \ btrfs-zero-log btrfs-select-super btrfs-image btrfstune \ btrfs-find-root btrfs-restore btrfs-dump-super %install make install DESTDIR=${RPM_BUILD_ROOT} prefix=%{_prefix} bindir=%{_sbindir} mandir=%{_mandir} install -m 0755 -d ${RPM_BUILD_ROOT}/%{_sbindir} install -m 0755 -d ${RPM_BUILD_ROOT}/%{_bindir} # add btrfs- prefix to generic names # move some utilities out of /usr/sbin mv ${RPM_BUILD_ROOT}/%{_sbindir}/btrfs-map-logical ${RPM_BUILD_ROOT}/%{_bindir} # remove obsolete utilites rm ${RPM_BUILD_ROOT}/%{_sbindir}/{btrfs-show,btrfs-vol,btrfsctl} rm ${RPM_BUILD_ROOT}/%{_mandir}/man8/btrfs-show.* rm ${RPM_BUILD_ROOT}/%{_mandir}/man8/btrfsctl.* # mkinitrd rescue utilities install -m 0755 btrfs-zero-log ${RPM_BUILD_ROOT}/%{_sbindir} install -m 0755 btrfs-select-super ${RPM_BUILD_ROOT}/%{_sbindir} install -m 0755 btrfs-image ${RPM_BUILD_ROOT}/%{_sbindir} install -m 0755 btrfstune ${RPM_BUILD_ROOT}/%{_sbindir} install -m 0755 btrfs-dump-super ${RPM_BUILD_ROOT}/%{_sbindir} install -m 0755 btrfs-restore ${RPM_BUILD_ROOT}/%{_sbindir} install -m 0755 btrfs-find-root ${RPM_BUILD_ROOT}/%{_sbindir} #UsrMerge install -m 0755 -d ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfs ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfs-zero-log ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfs-convert ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfs-select-super ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfs-image ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfstune ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfsck ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfs-restore ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfs-find-root ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfs-dump-super ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/btrfs-debug-tree ${RPM_BUILD_ROOT}/sbin ln -s %{_sbindir}/mkfs.btrfs ${RPM_BUILD_ROOT}/sbin #EndUsrMerge # command line options are not compatible (bnc#599224) # copy needed if /bin is different fs from /sbin if [ -x "%{_bindir}/true" ]; then cp %{_bindir}/true ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs else echo -e '#!/bin/sh\nexit 0' > ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs chmod +x ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs fi #UsrMerge ln -s %{_sbindir}/fsck.btrfs ${RPM_BUILD_ROOT}/sbin #EndUsrMerge install -d -m0755 ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/ install -m 0755 %{S:1} ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/ install -m 0755 %{S:2} ${RPM_BUILD_ROOT}/usr/sbin/ %files %defattr(-, root, root) /sbin/fsck.btrfs # mkinitrd utils #UsrMerge /sbin/btrfs /sbin/btrfs-zero-log /sbin/btrfs-convert /sbin/btrfs-select-super /sbin/btrfs-image /sbin/btrfstune /sbin/btrfsck /sbin/btrfs-restore /sbin/btrfs-find-root /sbin/btrfs-dump-super /sbin/mkfs.btrfs /sbin/btrfs-debug-tree #EndUsrMerge %{_sbindir}/btrfs %{_sbindir}/btrfs-zero-log %{_sbindir}/btrfs-convert %{_sbindir}/btrfs-select-super %{_sbindir}/btrfs-image %{_sbindir}/btrfstune %{_sbindir}/btrfsck %{_sbindir}/btrfs-restore %{_sbindir}/btrfs-find-root %{_sbindir}/btrfs-dump-super %{_sbindir}/fsck.btrfs %{_sbindir}/mkfs.btrfs %{_sbindir}/btrfs-debug-tree /usr/sbin/btrfs-dev-clear-sb /lib/mkinitrd/scripts/boot-btrfs.sh # other /usr/bin/btrfs-map-logical %_mandir/man8/btrfs-image.8.gz %_mandir/man8/btrfsck.8.gz %_mandir/man8/mkfs.btrfs.8.gz %_mandir/man8/btrfs.8.gz %_mandir/man8/btrfs-convert.8.gz %changelog