SHA256
1
0
forked from pool/cpio

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