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