File mg.spec of Package mg

#
# spec file for package mg
#
# Copyright (c) 2016 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:           mg
Version:        20160118
Release:        0
License:        SUSE-Public-Domain
Summary:        Emacs-like text editor
Url:            http://homepage.boetes.org/software/mg/
Group:          Productivity/Text/Editors
Source:         http://homepage.boetes.org/software/mg/mg-%{version}.tar.gz
Patch0:         mg-GNUmakefile.patch
Patch1:         mg-ttyio-TCSASOFT.patch
Patch2:         mg-fgetln.patch
BuildRequires:  pkg-config ncurses-devel libbsd-devel
# This is for SLE 11 builds
%if 0%{?suse_version} == 1110
BuildRequires:  gcc48
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
mg is intended to be a small, fast, and portable editor for people who
can't (or don't want to) run emacs for one reason or another, or are
not familiar with the vi(1) editor. It is compatible with emacs
because there shouldn't be any reason to learn more editor types than
emacs or vi(1).

%prep
%setup -q
%patch0 -p 1
%patch1 -p 1
%patch2

%build
%if 0%{?suse_version} == 1110
export CC="gcc-4.8"
export LDFLAGS="-lrt"
%endif
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot} %{?_smp_mflags}

%files
%defattr(-,root,root)
%doc
%{_bindir}/mg
%{_mandir}/man1/mg.1.gz

%changelog
openSUSE Build Service is sponsored by