dos2unix/dos2unix.spec

91 lines
2.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package dos2unix (Version 3.1)
#
# Copyright (c) 2009 SUSE LINUX Products 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: dos2unix
Summary: A DOS to UNIX Text Converter
Version: 3.1
Release: 439
Group: Productivity/Text/Convertors
License: BSD 3-Clause
Source: %{name}-%{version}.tar.bz2
Patch0: %{name}-%{version}.patch
Patch1: dos2unix-3.1-segfault.patch
Patch2: dos2unix-3.1-preserve-file-modes.patch
Patch3: dos2unix-bnc#488261-dont_destroy_original.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
dos2unix is used to convert plain text from DOS (CR/LF) format to UNIX
format (LF).
Authors:
--------
Benjamin Lin blin @ socs.uts.edu.au
%prep
%setup -q
%patch0 -p1 -b .orig
%patch1 -p1 -b .segf
%patch2 -b .fmode
%patch3
perl -pi -e 's,(#endif|#else)[^ ]*(.*),$1 /* $2 */,g' *.[ch]
%build
make clean
make CFLAGS="$RPM_OPT_FLAGS"
make link
%install
mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
install -m755 dos2unix $RPM_BUILD_ROOT%{_bindir}
ln -s dos2unix $RPM_BUILD_ROOT%{_bindir}/mac2unix
install -m444 dos2unix.1 $RPM_BUILD_ROOT%{_mandir}/man1
ln -s dos2unix.1 $RPM_BUILD_ROOT%{_mandir}/man1/mac2unix.1
%files
%defattr(-,root,root,0755)
%doc COPYRIGHT
%{_bindir}/dos2unix
%{_bindir}/mac2unix
%{_mandir}/*/*
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Mon Apr 20 2009 pth@suse.de
- Don't destroy original file if the output is on a different file
system (bnc#488261).
* Tue Dec 09 2008 schwab@suse.de
- Fix last change.
* Mon Sep 15 2008 ro@suse.de
- let mac2unix be a hardlink (instead of duplicate binary)
* Tue Apr 11 2006 pth@suse.de
- Make dos2unix preserve file modes (bugzilla #119350).
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Oct 05 2005 dmueller@suse.de
- add norootforbuild
* Mon Aug 12 2002 bk@suse.de
- update to dos2unix-3.1(no longer uses hd2u, but real dos2unix)
* Wed Jun 19 2002 postadal@suse.cz
- new package dos2unix verison 0.8.0