From 6c51e5aa2fffe785e219b72ab6435f180c0c269db58d13e7451a8426cfdd5e70 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Mon, 27 Mar 2017 11:14:11 +0000 Subject: [PATCH] - 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 --- cpio.changes | 7 +++++++ cpio.spec | 34 ++++++++++++++++------------------ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/cpio.changes b/cpio.changes index bc7efb7..5c1c18c 100644 --- a/cpio.changes +++ b/cpio.changes @@ -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 diff --git a/cpio.spec b/cpio.spec index 40c8f5c..aae948a 100644 --- a/cpio.spec +++ b/cpio.spec @@ -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