%define nasm_version 2.09.08
%define download http://www.nasm.us/pub/nasm/releasebuilds
Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax
Summary(ja): Netwide アセンブラ: Intel ライクなシンタックスのポータブル x86 アセンブラ
Name: nasm
Version: %{nasm_version}
Release: 1%{?_dist_release}
License: LGPL
Group: Development/Languages
URL: http://nasm.sourceforge.net/
Source0: %{download}/%{nasm_version}/nasm-%{nasm_version}.tar.bz2
Source1: %{download}/%{nasm_version}/nasm-%{nasm_version}-xdoc.tar.bz2
BuildPrereq: perl, ghostscript, texinfo
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Vendor: Project Vine
Distribution: Vine Linux
Packager: owa

%package doc
Summary: Extensive documentation for NASM
SUmmary(ja): NASM のドキュメント
Group: Applications/Documentation
PreReq: install-info

%package rdoff
Summary: Tools for the RDOFF binary format, sometimes used with NASM.
Summary(ja): NASM で使われる RDOFF バイナリフォーマット用ツール
Group: Development/Tools

%description
NASM is the Netwide Assembler, a free portable assembler for the Intel
80x86 microprocessor series, using primarily the traditional Intel
instruction mnemonics and syntax.

%description -l ja
NASM は Netwide アセンブラです。Intel 80x86 プロセッサシリーズ用の
フリーでポータブルなアセンブラで、基本的に伝統的な Intel インストラクション
ニーモニックと文法を使います。

%description doc
Extensive documentation for the Netwide Assembler, NASM, in HTML,
info, PostScript and text formats.

%description doc -l ja
Netwide アセンブラ NASM のドキュメントです。
HTML、Info、ポストスクリプト、テキスト形式です。

%description rdoff
Tools for the operating-system independent RDOFF binary format, which
is sometimes used with the Netwide Assembler (NASM).  These tools
include linker, library manager, loader, and information dump.

%description rdoff -l ja
RDOFF バイナリフォーマットの OS 用のツールで、NASM が使います。
ここには、リンカ、ライブラリマネージャ、ローダ、ダンプが入っています。

%prep
%setup -q -n nasm-%{nasm_version} -b 1

%build
LDFLAGS=-s %configure

## don't use _smp_mflags (at 2.07.00)
#make %{?_smp_mflags} everything
make everything

%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
mkdir -p $RPM_BUILD_ROOT%{_infodir}
make INSTALLROOT="$RPM_BUILD_ROOT" docdir=%{_docdir}/nasm-doc install_everything
mkdir -p included-docs
cp -pr $RPM_BUILD_ROOT%{_docdir}/nasm-doc/* included-docs/
rm -rf $RPM_BUILD_ROOT%{_docdir}/nasm-doc

%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

%post doc
/sbin/install-info %{_infodir}/nasm.info.gz %{_infodir}/dir

%preun doc
if [ $1 = 0 ]; then
  /sbin/install-info --delete %{_infodir}/nasm.info.gz %{_infodir}/dir
fi


%files
%defattr(-,root,root)
%doc AUTHORS CHANGES ChangeLog INSTALL LICENSE README TODO
%{_bindir}/nasm
%{_bindir}/ndisasm
%{_mandir}/man1/*.1.gz

%files doc
%defattr(-,root,root)
%doc included-docs/*
%{_infodir}/nasm.info*

%files rdoff
%defattr(-,root,root)
%doc rdoff/README
%{_bindir}/ldrdf
%{_bindir}/rdf2bin
%{_bindir}/rdf2com
%{_bindir}/rdf2ihx
%{_bindir}/rdf2ith
%{_bindir}/rdf2srec
%{_bindir}/rdfdump
%{_bindir}/rdflib
%{_bindir}/rdx

%changelog
* Thu Apr 28 2011 Shu KONNO <owa@bg.wakwak.com> nasm-2.09.08-1
- updated nasm to nasm-2.09.08
- updated xdoc to nasm-2.09.08-xdoc

* Mon Nov 22 2010 Shu KONNO <owa@bg.wakwak.com> nasm-2.09.03-1
- updated nasm to nasm-2.09.03
- updated xdoc to nasm-2.09.03-xdoc

* Wed Sep 08 2010 Shu KONNO <owa@bg.wakwak.com> nasm-2.09.01-1
- updated nasm to nasm-2.09.01
- updated xdoc to nasm-2.09.01-xdoc

* Thu Sep 02 2010 Shu KONNO <owa@bg.wakwak.com> nasm-2.09-1
- updated nasm to nasm-2.09
- updated xdoc to nasm-2.09-xdoc

* Tue Mar 16 2010 Shu KONNO <owa@bg.wakwak.com> nasm-2.08.01-1
- updated nasm to nasm-2.08.01
- updated xdoc to nasm-2.08.01-xdoc

* Sat Sep 05 2009 Shu KONNO <owa@bg.wakwak.com> nasm-2.07.00-1
- updated nasm to nasm-2.07

* Mon Jul 13 2009 Shu KONNO <owa@bg.wakwak.com> nasm-2.06.00-1
- updated nasm to nasm-2.06
- added nasm-2.06-xdoc
- changed download url

* Tue Sep 30 2008 Shu KONNO <owa@bg.wakwak.com> nasm-2.04.00-1vl5
- updated nasm to nasm-2.04
- fixed typo of changelog version

* Sat Jun 14 2008 Shu KONNO <owa@bg.wakwak.com> nasm-2.03.00-1vl5
- updated nasm to nasm-2.03
- applied new versioning policy and spec in utf-8

* Fri Feb 22 2008 Shu KONNO <owa@bg.wakwak.com> nasm-2.02.00-0vl1
- updated nasm to nasm-2.02

* Mon Jan 28 2008 Shu KONNO <owa@bg.wakwak.com> nasm-2.01.00-0vl1
- updated nasm to nasm-2.01

* Thu Nov 29 2007 Shu KONNO <owa@bg.wakwak.com> nasm-2.0.0-0vl1
- updated nasm to nasm-2.00

* Sun Nov 25 2007 Shu KONNO <owa@bg.wakwak.com> nasm-2.0-0vl0rc1
- updated nasm to nasm-2.00rc1

* Sun Aug 20 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.98.39-0vl2
- drop stupid macros
- fix dependencies
  - add BuildRequires: texinfo
  - add BuildRequires: ghostscript instead of /usr/bin/ps2pdf
  - doc: add PreReq: install-info instead of /sbin/install-info
- chande doc's group to Applications/Documentation

* Sat Jun  4 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.98.39-0vl1
- new upstream release

* Wed Apr 21 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.98.38-0vl1
- updated to 0.98.38
- fixed %doc of nasm-doc 

* Thu Jul 17 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.98.36-0vl3
- fixed nasm-doc Group: Documentation
- changed URL:
- s/Copyright/License/

* Tue May 20 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.98.36-0vl2
- merged Vine Plus spec file and Vine Seed Plus spec file (sorry....)

* Thu May  1 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.98.36-0vl1
- update 0.98.36 based on sourceforge
 - change licence to LGPL
 - change URL
- add BuildPrereq: perl

* Tue Jan 27 2003 Masaki Shinomiya <shino@pos.to> 0.98.35-0vl1
- source upstream, new URL, doc files

* Sat Apr 14 2001 Shoji Matsumoto <shom@vinelinux.org> 0.98-0vl2
- add ja desc
- modify %files
- use %configure
- build for Seed

* Fri Dec 15 2000 Hirotaka Mizutani
      - 0.98-0vl1
      - updated for VineLinux2.1