- Use macro for configure and make install

- Use update-alternatives according to current documentation
- Enable testsuite

OBS-URL: https://build.opensuse.org/package/show/Archiving/cpio?expand=0&rev=67
This commit is contained in:
Martin Pluskal 2017-03-27 11:14:11 +00:00 committed by Git OBS Bridge
parent e97844868d
commit 6c51e5aa2f
2 changed files with 23 additions and 18 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Mar 27 11:13:08 UTC 2017 - mpluskal@suse.com
- Use macro for configure and make install
- Use update-alternatives according to current documentation
- Enable testsuite
-------------------------------------------------------------------
Fri Mar 24 13:28:00 UTC 2017 - svalx@svalx.net

View File

@ -63,10 +63,10 @@ the disk, a magnetic tape, or a pipe.
%package mt
Summary: Tape drive control utility
Group: Productivity/Archiving/Backup
Provides: mt
Requires: %{name} = %{version}
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides: mt
%description mt
This package includes the 'mt', a local tape drive control program.
@ -91,24 +91,19 @@ This package includes the 'mt', a local tape drive control program.
%build
gettextize -f
autoreconf --force --install
CFLAGS="%{optflags} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIE" \
LDFLAGS="-pie" \
./configure \
--with-rmt="%{_bindir}/rmt" \
--enable-mt \
--prefix=%{_prefix} \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
--libdir=%{_libdir} \
--disable-silent-rules \
--program-transform-name='s/^mt$/gnumt/'
autoreconf -fiv
export CFLAGS="%{optflags} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIE"
export LDFLAGS="-pie"
%configure \
--with-rmt="%{_bindir}/rmt" \
--enable-mt \
--disable-silent-rules \
--program-transform-name='s/^mt$/gnumt/'
make %{?_smp_mflags}
%install
mkdir -p %{buildroot}/{usr/bin,bin}
make prefix=%{buildroot}%{_prefix} infodir=%{buildroot}%{_infodir} mandir=%{buildroot}%{_mandir} \
DEFAULT_RMT_DIR=%{buildroot}%{_sbindir} install
%make_install
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -sf %{_sysconfdir}/alternatives/mt %{buildroot}%{_bindir}/mt
ln -sf %{_sysconfdir}/alternatives/mt.1%{ext_man} %{buildroot}%{_mandir}/man1/mt.1%{ext_man}
@ -118,19 +113,22 @@ ln -sf %{_bindir}/cpio %{buildroot}/bin
%find_lang %{name}
%check
make %{?_smp_mflags} check
%post mt
%{_sbindir}/update-alternatives --force \
--install %{_bindir}/mt mt %{_bindir}/gnumt 10 \
--slave %{_mandir}/man1/mt.1%{ext_man} mt.1%{ext_man} %{_mandir}/man1/gnumt.1%{ext_man}
%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info}
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info%{ext_info}
%postun mt
if [ "$1" = 0 ] ; then
if [ ! -f %{_bindir}/gnumt ] ; then
"%{_sbindir}/update-alternatives" --remove mt %{_bindir}/gnumt
fi