sed/sed.spec

115 lines
3.8 KiB
RPMSpec

#
# spec file for package sed
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: sed
Version: 4.2.2
Release: 0
Summary: A Stream-Oriented Non-Interactive Text Editor
License: GPL-3.0+
Group: System/Base
Url: http://www.gnu.org/software/sed/
Source: ftp://ftp.gnu.org/gnu/sed/%{name}-%{version}.tar.bz2
Source1: %{name}-%{version}.tar.bz2.sig
Source2: %{name}.keyring
# PATCH-FIX-SLE sed-dont_close_twice.patch bnc@880817 tcech@suse.cz -- Fix double close.
Patch: sed-dont_close_twice.patch
# PATCH-FIX-UPSTREAM sed-follow-symlinks-hyphen.patch bnc933029 gnu20796 sbrabec@suse.com -- Make behavior of "sed --follow-symlinks -" consistent again.
Patch1: sed-follow-symlinks-hyphen.patch
# PATCH-FIX-UPSTREAM sed-follow-symlinks-stdin.patch bnc933029 gnu20795 sbrabec@suse.com -- Fix --follow-symlinks on stdin.
Patch2: sed-follow-symlinks-stdin.patch
# PATCH-FIX-UPSTREAM sed-y-NUL-RHS.patch sbrabec@suse.com -- Fix y command in the RHS of a y/LHS/RHS/ transliteration.
Patch3: sed-y-NUL-RHS.patch
# PATCH-FIX-UPSTREAM sed-fix-overlapping-address-ranges.patch sbrabec@suse.com -- Fix mishandling of overlapping address ranges.
Patch4: sed-fix-overlapping-address-ranges.patch
# PATCH-FIX-UPSTREAM sed-temp-delete.patch sbrabec@suse.com -- Fix fail to remove a temporary file.
Patch5: sed-temp-delete.patch
# Use rpmbuild -D 'VERIFY_SIG 1' to verify signature during build or run one-shot check by "gpg-offline --verify --package=sed sed-*.sig".
%if 0%{?VERIFY_SIG}
BuildRequires: gpg-offline
%endif
BuildRequires: libacl-devel
BuildRequires: libselinux-devel
PreReq: %install_info_prereq
Provides: base:/bin/sed
Recommends: %{name}-lang
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Sed takes text input, performs one or more operations on it, and
outputs the modified text. Sed is typically used for extracting parts
of a file using pattern matching or for substituting multiple
occurrences of a string within a file.
%lang_package
%prep
%if 0%{?VERIFY_SIG}
%gpg_verify %{S:1}
%endif
%setup -q
%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
%define warn_flags -Wall -Wstrict-prototypes -Wpointer-arith -Wformat-security
export CFLAGS="%{optflags} %warn_flags -fPIE"
export LDFLAGS="-pie"
./configure --prefix=/usr \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
--without-included-regex \
%{_target_cpu}-suse-linux
%if %do_profiling
make %{?_smp_mflags} CFLAGS="$CFLAGS "%cflags_profile_generate
make %{?_smp_mflags} check
make clean
make %{?_smp_mflags} CFLAGS="$CFLAGS "%cflags_profile_feedback
%else
make %{?_smp_mflags}
%endif
make %{?_smp_mflags} check
%install
%makeinstall
#UsrMerge
mkdir -p %{buildroot}/bin
ln -s %{_bindir}/sed %{buildroot}/bin/sed
#EndUserMerge
%find_lang %{name}
%files
%defattr(-, root, root)
/bin/sed
%{_bindir}/sed
%doc AUTHORS BUGS COPYING* NEWS README* THANKS
%doc %{_infodir}/sed.info*.gz
%doc %{_mandir}/man*/*.gz
%files lang -f %{name}.lang
%post
%install_info --info-dir=%{_infodir} %{_infodir}/%name.info.gz
%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%name.info.gz
%changelog