File parted.spec of Package parted
%define realname parted
%define realver 3.3
%define srcext tar.xz
%define resize_so_ver 0
%define parted_so_ver 2
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}
Version: %{realver}
Release: wiz%{?extraver:0.}1%{?dist}
License: GPL-3.0+
Group: System/Filesystems
URL: https://www.gnu.org/software/parted/
Summary: GNU Parted is a program for creating and manipulating partition tables
# Install-time parameters
%if 0%{?suse_version}
Recommends: %{name}-lang
Recommends: libreiserfs
# Unclean deps - libparted0 contains libparted.so.2
Obsoletes: libparted0 < %{version}-%{release}
%endif
# Build-time parameters
BuildRequires: xz
BuildRequires: pkg-config
BuildRequires: gettext%{?suse_version:-runtime}
BuildRequires: libuuid-devel
BuildRequires: device-mapper-devel
BuildRequires: libselinux-devel
BuildRequires: readline-devel >= 5.2
BuildRequires: libblkid-devel
%if 0%{?suse_version}
BuildRequires: libreiserfs-devel
%endif
BuildRoot: %{_tmppath}/%{name}-root
Source: https://ftp.gnu.org/gnu/parted/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
GNU Parted manipulates partition tables. This is useful for creating space for
new operating systems, reorganizing disk usage, copying data on hard disks and
disk imaging. The package contains a command-line frontend, parted, which can
also be used in scripts.
GNU Parted was designed to minimize the chance of data loss. For example, it was
designed to avoid data loss during interruptions (like power failure) and
performs many safety checks. However, there could be bugs in GNU Parted, so you
should back up your important files before running Parted.
WARNING: USING PARTED TO PERFORM FILE SYSTEM OPERATIONS IS NO LONGER SUPPORTED
------------------------------------------------------------------------------
Parted (post-2.4) no longer has the ability to create and modify file systems.
%package -n libparted-fs-resize%{resize_so_ver}
Group: System/Filesystems
Summary: Parted filesystem resizing library
%description -n libparted-fs-resize%{resize_so_ver}
This package contains shared library for resizing some filesystems.
%package -n libparted%{parted_so_ver}
Group: System/Filesystems
Summary: Parted shared library
%description -n libparted%{parted_so_ver}
The package contains Parted shared library - libparted.
%package devel
Group: Development/Languages/C and C++
Summary: Developent stuff to build software using parted library
Requires: libparted-fs-resize%{resize_so_ver} = %{version}-%{release}
Requires: libparted%{parted_so_ver} = %{version}-%{release}
Provides: libparted-devel
Provides: libparted%{parted_so_ver}-devel
%description devel
This package contains development stuff for building software using
parted library.
%package lang
Group: System/Localization
Summary: Localization for %{name}
BuildArch: noarch
%description lang
Provides localization for %{name}.
# Preparation step (unpacking and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}
# Build step (compile/build binaries, documentation, etc)
%build
%configure \
--disable-static \
--disable-debug \
CFLAGS="%{optflags} %{?gcc_lto}" \
CXXFLAGS="%{optflags} %{?gcc_lto}" \
LDFLAGS="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}"
%{__make} %{?_smp_mflags}
# Install built stuff
%install
%{__make} install DESTDIR=%{buildroot}
%{find_lang} %{realname}
# Cleanup
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
# Files list
%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README THANKS
%{_sbindir}/*
%doc %{_infodir}/parted.info*
%doc %{_mandir}/man8/*
%exclude %{_infodir}/dir
%files -n libparted-fs-resize%{resize_so_ver}
%defattr(-,root,root)
%{_libdir}/libparted-fs-resize.so.%{resize_so_ver}*
%files -n libparted%{parted_so_ver}
%defattr(-,root,root)
%{_libdir}/libparted.so.%{parted_so_ver}*
%files devel
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README THANKS doc/API doc/FAT
%dir %{_includedir}/%{realname}
%{_includedir}/%{realname}/*.h
%{_libdir}/pkgconfig/libparted.pc
%{_libdir}/pkgconfig/libparted-fs-resize.pc
%{_libdir}/*.so
%exclude %{_libdir}/*.la
%files lang -f %{realname}.lang
%defattr(-,root,root)
%post
/sbin/install-info %{_infodir}/parted.info* %{_infodir}/dir || :
%preun
if [ $1 -eq 0 ] ; then
/sbin/install-info --delete %{_infodir}/parted.info* %{_infodir}/dir || :
fi
%post -n libparted-fs-resize%{resize_so_ver} -p /sbin/ldconfig
%postun -n libparted-fs-resize%{resize_so_ver} -p /sbin/ldconfig
%post -n libparted%{parted_so_ver} -p /sbin/ldconfig
%postun -n libparted%{parted_so_ver} -p /sbin/ldconfig
%changelog