summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-19 10:44:56 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-19 10:52:31 -0700
commita8eace2b79b1068e54c4af93c41b6e58ba879b83 (patch)
treee6367327d6507c73bb2b0fde18d78535f90af800
parentf3eea3d53955e39b63a753434c938d21a2b6f943 (diff)
downloadnasm-a8eace2b79b1068e54c4af93c41b6e58ba879b83.tar.gz
nasm-a8eace2b79b1068e54c4af93c41b6e58ba879b83.tar.bz2
nasm-a8eace2b79b1068e54c4af93c41b6e58ba879b83.zip
Modernize nasm.spec.in and make it closer to the Fedora version
-rw-r--r--nasm.spec.in65
1 files changed, 32 insertions, 33 deletions
diff --git a/nasm.spec.in b/nasm.spec.in
index b00bf4b..2c68268 100644
--- a/nasm.spec.in
+++ b/nasm.spec.in
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
%define nasm_version @@NASM_VER@@
Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax
Name: nasm
@@ -10,6 +11,9 @@ URL: http://nasm.sourceforge.net/
BuildRoot: /tmp/rpm-build-nasm
Prefix: %{_prefix}
BuildPrereq: perl
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires(post): /sbin/install-info
+Requires(preun): /sbin/install-info
%package doc
Summary: Extensive documentation for NASM
@@ -35,7 +39,7 @@ is sometimes used with the Netwide Assembler (NASM). These tools
include linker, library manager, loader, and information dump.
%prep
-%setup -n nasm-%{nasm_version}
+%setup -q -n nasm-%{nasm_version}
%build
%configure
@@ -43,51 +47,46 @@ make %{?_smp_mflags} everything
%install
rm -rf "$RPM_BUILD_ROOT"
-mkdir -p "$RPM_BUILD_ROOT"
mkdir -p "$RPM_BUILD_ROOT"/%{_bindir}
mkdir -p "$RPM_BUILD_ROOT"/%{_mandir}/man1
mkdir -p "$RPM_BUILD_ROOT"/%{_infodir}
-DOC="$RPM_BUILD_ROOT"%{_docdir}
-mkdir -p "$DOC"
-mkdir -p "$DOC"/rdoff
-rm -f "$RPM_BUILD_ROOT"/%{_infodir}/nasm.*
-make INSTALLROOT="$RPM_BUILD_ROOT" \
- docdir=%{_docdir} \
- infodir=%{_infodir} \
- install_everything
-gzip -9 "$RPM_BUILD_ROOT"/%{_infodir}/nasm.*
-gzip -9 "$DOC"/*.txt "$DOC"/*.ps
-cp AUTHORS CHANGES COPYING README TODO doc/*.doc "$DOC"
-cp rdoff/README "$DOC"/rdoff
-cp rdoff/doc/* "$DOC"/rdoff
+mkdir -p "$RPM_BUILD_ROOT"/usr/tempdoc
+%makeinstall install_everything docdir="$RPM_BUILD_ROOT"/usr/tempdoc
+cp -a $RPM_BUILD_ROOT/usr/tempdoc/html \
+ $RPM_BUILD_ROOT/usr/tempdoc/nasmdoc.{ps,txt,pdf} .
+gzip -9f nasmdoc.{ps,txt}
+# remove unpackaged files from the buildroot
+rm -rf $RPM_BUILD_ROOT%{_prefix}/tempdoc
%clean
rm -rf "$RPM_BUILD_ROOT"
-%post doc
-/sbin/install-info %{_infodir}/nasm.info.gz %{_infodir}/dir
+%post
+/sbin/install-info %{_infodir}/nasm.info.gz %{_infodir}/dir || :
-%preun doc
+%preun
if [ $1 = 0 ]; then
- /sbin/install-info --delete %{_infodir}/nasm.info.gz %{_infodir}/dir
+ /sbin/install-info --delete %{_infodir}/nasm.info.gz %{_infodir}/dir || :
fi
%files
-%attr(-,root,root) %{_bindir}/nasm
-%attr(-,root,root) %{_bindir}/ndisasm
-%attr(-,root,root) %doc %{_mandir}/man1/nasm.1*
-%attr(-,root,root) %doc %{_mandir}/man1/ndisasm.1*
+%defattr(-,root,root)
+%doc AUTHORS CHANGES README TODO
+%{_bindir}/nasm
+%{_bindir}/ndisasm
+%{_mandir}/*/*
+%{_infodir}/nasm.info*.gz
%files doc
-%attr(-,root,root) %doc %{_infodir}/nasm.info*.gz
-%attr(-,root,root) %doc %{_docdir}/*
+%defattr(-,root,root)
+%doc html nasmdoc.txt.gz nasmdoc.pdf nasmdoc.ps.gz
%files rdoff
-%attr(-,root,root) %{_bindir}/ldrdf
-%attr(-,root,root) %{_bindir}/rdf2bin
-%attr(-,root,root) %{_bindir}/rdf2com
-%attr(-,root,root) %{_bindir}/rdf2ihx
-%attr(-,root,root) %{_bindir}/rdfdump
-%attr(-,root,root) %{_bindir}/rdflib
-%attr(-,root,root) %{_bindir}/rdx
-%attr(-,root,root) %doc %{_docdir}/rdoff/*
+%defattr(-,root,root)
+%{_bindir}/ldrdf
+%{_bindir}/rdf2bin
+%{_bindir}/rdf2com
+%{_bindir}/rdf2ihx
+%{_bindir}/rdfdump
+%{_bindir}/rdflib
+%{_bindir}/rdx