partclone/partclone.spec

145 lines
4.2 KiB
RPMSpec
Raw Permalink Normal View History

2020-08-13 11:18:00 +08:00
# Testsuite is CPU and disk space intensive, partially also just broken
%{!?testsuite: %global testsuite 1}
Summary: Utility to clone and restore a partition
Name: partclone
2023-10-09 15:09:57 +08:00
Version: 0.3.27
Release: 1
2020-08-13 11:18:00 +08:00
# Partclone itself is GPLv2+ but uses other source codes, breakdown:
# GPLv3+: fail-mbr/fail-mbr.S
# GPLv2 and GPLv2+: src/btrfs*
# GPL+ and GPLv2 and GPLv2+ and LGPLv2 and LGPLv2+: src/xfs*
# GPLv2 and GPLv2+: src/f2fs*
# GPLv2+: src/{dd,extfs,fat,hfsplus,minix,nilfs,ntfsclone-ng,part}clone*
# GPLv2+: src/{{fuseimg,info,main,ntfsfixboot,readblock}.c,progress*}
# LGPLv2+: src/gettext.h
# Unused source code (= not built): src/{exfat,jfs,reiser,ufs,vmfs}*
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2 and LGPLv2+
URL: http://partclone.org/
Source0: https://github.com/Thomas-Tsai/partclone/archive/%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc
BuildRequires: libuuid-devel
BuildRequires: fuse-devel
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: e2fsprogs-devel
BuildRequires: ntfs-3g-devel
BuildRequires: libblkid-devel
%if 0%{?testsuite}
BuildRequires: e2fsprogs
BuildRequires: ntfsprogs
BuildRequires: dosfstools
2020-11-06 15:18:03 +08:00
BuildRequires: hfsplus-tools
2023-10-09 15:09:57 +08:00
BuildRequires: xfsprogs
BuildRequires: btrfs-progs
BuildRequires: f2fs-tools
2020-08-13 11:18:00 +08:00
%endif
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
2023-10-09 15:09:57 +08:00
Provides: bundled(libbtrfs)
Provides: bundled(libbtrfsutil)
Provides: bundled(xfsprogs-libs)
2020-08-13 11:18:00 +08:00
%description
Partclone provides utilities to clone and restore used blocks on a partition
and is designed for higher compatibility of the file system by using existing
libraries, e.g. e2fslibs is used to read and write the ext2 partition.
%prep
2021-08-03 15:59:34 +08:00
%autosetup -p1
2020-08-13 11:18:00 +08:00
autoreconf -i -f
%build
# /usr/include/asm/types.h:31 and xfs/platform_defs.h:50 try both to define
# umode_t, reported: https://github.com/Thomas-Tsai/partclone/issues/96
%configure \
--enable-extfs \
--enable-xfs \
--disable-reiserfs \
--disable-reiser4 \
--enable-hfsp \
--enable-fat \
--disable-exfat \
--enable-f2fs \
--disable-nilfs2 \
--enable-ntfs \
--disable-ufs \
--disable-vmfs \
--disable-jfs \
--enable-btrfs \
--enable-minix \
--enable-ncursesw \
--enable-fs-test
2021-08-03 15:59:34 +08:00
# https://forum.slitaz.org/topic/parclone-needs-to-be-rebuilded
sed -i 's|exit 1|exit 0|' fail-mbr/compile-mbr.sh
2020-08-13 11:18:00 +08:00
%make_build
%install
%make_install
# Building fail-mbr.bin requires a compiler that can build x86 binaries
%ifnarch %{ix86} x86_64
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/
%endif
%find_lang %{name}
%if 0%{?testsuite}
%check
# Patch proposal submitted: https://github.com/Thomas-Tsai/partclone/issues/103
sed -e 's/256/1440/' -i tests/_common
# Tests for Btrfs, XFS and F2FS filesystems are broken on all architectures
2023-10-09 15:09:57 +08:00
sed -e 's/^\(am__append_[[:digit:]]* = btrfs.test\)/#\1/' \
-e 's/^\(am__append_[[:digit:]]* = xfs.test\)/#\1/' \
-e 's/^\(am__append_[[:digit:]]* = f2fs.test\)/#\1/' \
-e 's/^\(am__append_[[:digit:]]* = btrfs.test\)/#\1/' \
2020-08-13 11:18:00 +08:00
-i tests/Makefile
# NILFS2 tests must be run as root (mockbuild is unprivileged)
2023-10-09 15:09:57 +08:00
sed -e 's/^\(am__append_[[:digit:]]* = nilfs2.test\)/#\1/' \
-i tests/Makefile
# Reiser4 tests require reiser4progs (which are not packaged)
sed -e 's/^\(am__append_[[:digit:]]* = reiser4.test\)/#\1/' \
2020-08-13 11:18:00 +08:00
-i tests/Makefile
# Tests for FAT and HFS+ filesystems are broken on ppc64 and s390x
%ifarch ppc64 s390x
2023-10-09 15:09:57 +08:00
sed -e 's/^\(am__append_[[:digit:]]* = fat.test\)/#\1/' \
-e 's/^\(am__append_[[:digit:]]* = hfsplus.test\)/#\1/' \
2020-08-13 11:18:00 +08:00
-i tests/Makefile
%endif
make check || (cat tests/test-suite.log; exit 1)
%endif
%files -f %{name}.lang
%license COPYING
%doc AUTHORS ChangeLog
%{_sbindir}/%{name}.*
%ifarch %{ix86} x86_64
%{_datadir}/%{name}/
%endif
%{_mandir}/man8/%{name}*.8*
%changelog
2023-10-09 15:09:57 +08:00
* Mon Oct 09 2023 yaoxin <yao_xin001@hoperun.com> - 0.3.27-1
- Upgrade to 0.3.27
* Thu Mar 10 2022 liyanan <liyanan32@huawei.com> - 0.3.12-4
- Fix build error
2021-08-03 15:59:34 +08:00
* Tue Aug 3 2021 weidong <weidong@uniontech.com> - 0.3.12-3
- Fix link failuer with gcc-10
2020-11-06 15:18:03 +08:00
* Fri Nov 6 2020 weidong <weidong@uniontech.com> - 0.3.12-2
2020-11-09 13:11:28 +08:00
- Modify buildrequires
2020-11-06 15:18:03 +08:00
2020-08-14 11:10:45 +08:00
* Fri Aug 7 2020 weidong <weidong@uniontech.com> - 0.3.12-1
2020-08-13 11:18:00 +08:00
- Initial release for OpenEuler