File yasm.spec of Package yasm

%define realname yasm
%define realver  1.3.0
%define srcext   tar.gz

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       %{?extraver:0.}1%{?rhel:.el%{rhel}}%{?fedora:.fc%{fedora}}
License:       Artistic-1.0 and BSD-2-Clause and BSD-3-Clause and GPL-2.0+ and LGPL-2.0+
Group:         Development/Languages/Other
URL:           http://yasm.tortall.net/
Summary:       Portable, retargetable assembler

# Build-time parameters
BuildRequires: cmake gcc-c++
BuildRequires: gettext
BuildRoot:     %{_tmppath}/%{name}-root
Source:        http://www.tortall.net/projects/yasm/releases/%{realname}-%{realver}%{?extraver}.%{srcext}

%description
Yasm is a complete rewrite of the NASM assembler under the “new” BSD License
(some portions are under other licenses, see COPYING for details).

Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS
assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O, RDOFF2,
COFF, Win32, and Win64 object formats, and generates source debugging
information in STABS, DWARF 2, and CodeView 8 formats.

%package devel
Group:         Development/Languages/C and C++
Summary:       Development files for %{name}
Requires:      %{name} = %{version}

%description devel
Development files for %{name}

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%{__sed} -ri '/LIBRARY DESTINATION/ s|^(.+)lib$|\1%{_lib}|' libyasm/CMakeLists.txt
%{__sed} -ri '/ARCHIVE DESTINATION/ s|^(.+)lib$|\1%{_lib}|' libyasm/CMakeLists.txt

%build
%configure \
 CFLAGS="%{optflags}" \
 CXXFLAGS="%{optflags}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all"
%{__make} %{?_smp_mflags}

%install
%{__install} -d -m755 %{buildroot}%{_mandir}/man1
%{__install} -d -m755 %{buildroot}%{_mandir}/man7
for man in *.1 *.7
do
  %{__install} -m644 ${man} %{buildroot}%{_mandir}/man${man##*.}/${man}
done
%{__make} install DESTDIR=%{buildroot}

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc AUTHORS COPYING GNU_GPL-2.0 GNU_LGPL-2.0 *.txt
%{_bindir}/*
%doc %{_mandir}/man1/*
%doc %{_mandir}/man7/*

%files devel
%defattr(-,root,root)
%dir %{_includedir}/libyasm
%{_includedir}/libyasm/*.h
%{_includedir}/*.h
%{_libdir}/*.a

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
openSUSE Build Service is sponsored by