More CHANGES that were never documented properly.
[platform/upstream/nasm.git] / nasm.spec.in
1 Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax
2 Name: nasm
3 Version: @@VERSION@@
4 Release: 1
5 Copyright: LGPL
6 Group: Development/Languages
7 Source: ftp://download.sourceforge.net/pub/sourceforge/nasm/nasm-%{version}.tar.bz2
8 URL: http://nasm.2y.net/
9 BuildRoot: /tmp/rpm-build-nasm
10 Prefix: /usr
11 BuildPrereq: perl
12 BuildArchitectures: noarch %{_arch}
13
14 %package doc
15 Summary: Extensive documentation for NASM
16 Group: Development/Languages
17 Prereq: /sbin/install-info
18
19 %package rdoff
20 Summary: Tools for the RDOFF binary format, sometimes used with NASM.
21 Group: Development/Tools
22
23 %description
24 NASM is the Netwide Assembler, a free portable assembler for the Intel
25 80x86 microprocessor series, using primarily the traditional Intel
26 instruction mnemonics and syntax.
27
28 %description doc
29 Extensive documentation for the Netwide Assembler, NASM, in HTML,
30 info, PostScript and text formats.
31
32 %description rdoff
33 Tools for the operating-system independent RDOFF binary format, which
34 is sometimes used with the Netwide Assembler (NASM).  These tools
35 include linker, library manager, loader, and information dump.
36
37 %prep
38 %setup
39
40 %build
41 CFLAGS="$RPM_OPT_FLAGS" LDFLAGS=-s ./configure --prefix=/usr
42 make everything
43
44 %install
45 rm -rf "$RPM_BUILD_ROOT"
46 mkdir -p "$RPM_BUILD_ROOT"
47 mkdir -p "$RPM_BUILD_ROOT"/usr/bin
48 mkdir -p "$RPM_BUILD_ROOT"/usr/man/man1
49 mkdir -p "$RPM_BUILD_ROOT"/usr/info
50 DOC="$RPM_BUILD_ROOT"/usr/doc/nasm-%{version}
51 mkdir -p "$DOC"
52 mkdir -p "$DOC"/rdoff
53 rm -f "$RPM_BUILD_ROOT"/usr/info/nasm.*
54 make INSTALLROOT="$RPM_BUILD_ROOT" docdir=/usr/doc/nasm-%{version} install_everything
55 gzip -9 "$RPM_BUILD_ROOT"/usr/info/nasm.*
56 gzip -9 "$DOC"/*.txt "$DOC"/*.ps
57 cp AUTHORS CHANGES COPYING README TODO doc/*.doc "$DOC"
58 cp rdoff/README "$DOC"/rdoff
59 cp rdoff/doc/* "$DOC"/rdoff
60
61 %clean
62 rm -rf "$RPM_BUILD_ROOT"
63
64 %post doc
65 /sbin/install-info "$RPM_INSTALL_PREFIX"/info/nasm.info.gz "$RPM_INSTALL_PREFIX"/info/dir
66
67 %preun doc
68 if [ $1 = 0 ]; then
69   /sbin/install-info --delete "$RPM_INSTALL_PREFIX"/info/nasm.info.gz "$RPM_INSTALL_PREFIX"/info/dir
70 fi
71
72 %ifarch noarch
73
74 %files doc
75 %attr(-,root,root) %doc /usr/info/nasm.info*.gz
76 %attr(-,root,root) %doc /usr/doc/nasm-%{version}/*
77
78 %else
79
80 %files
81 %attr(-,root,root)      /usr/bin/nasm
82 %attr(-,root,root)      /usr/bin/ndisasm
83 %attr(-,root,root) %doc /usr/man/man1/nasm.1*
84 %attr(-,root,root) %doc /usr/man/man1/ndisasm.1*
85
86 %files rdoff
87 %attr(-,root,root)      /usr/bin/ldrdf
88 %attr(-,root,root)      /usr/bin/rdf2bin
89 %attr(-,root,root)      /usr/bin/rdf2com
90 %attr(-,root,root)      /usr/bin/rdfdump
91 %attr(-,root,root)      /usr/bin/rdflib
92 %attr(-,root,root)      /usr/bin/rdx
93 %attr(-,root,root) %doc /usr/doc/nasm-%{version}/rdoff/*
94
95 %endif