summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-23 18:33:53 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-23 18:33:53 -0700
commitcf96845bf645266d7ec6e77a92086c8ed7a7803f (patch)
treeaa9a9c30e26ed993a34ff166deecd1c563bca62d
parent3e555483b30c6f0bd4b348861f694f73e487c134 (diff)
downloadnasm-cf96845bf645266d7ec6e77a92086c8ed7a7803f.tar.gz
nasm.spec: sync with Fedora spec file, auto-generate Perl depends
Sync up with how the Fedora spec file has evolved. Auto-generate the Perl build dependencies. Add --enable-lto: it makes especally the rdoff files much smaller. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--Makefile.in13
-rw-r--r--nasm.spec.in46
2 files changed, 30 insertions, 29 deletions
diff --git a/Makefile.in b/Makefile.in
index b377b79c..6764f961 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -348,6 +348,7 @@ clean:
$(RM_F) nasm-*-installer-*.exe
$(RM_F) tags TAGS
$(RM_F) nsis/arch.nsh
+ $(RM_F) perlbreq.si
$(RM_F) $(RDFPROGS) $(RDF2BINLINKS)
distclean: clean
@@ -417,8 +418,16 @@ tar: dist
spec: nasm.spec
-nasm.spec: nasm.spec.in version.sed
- sed -f version.sed < nasm.spec.in > nasm.spec
+ALLPERLSRC := $(shell find $(srcdir) -type f -name '*.p[lh]')
+
+perlbreq.si: $(ALLPERLSRC)
+ sed -n -r -e 's/^use[[:space:]]+([^[:space:];]+).*$$/Build-Requires: perl(\1)/p' $(ALLPERLSRC) | \
+ sed -r -e '/perl\((strict|warnings)\)/d' | \
+ sort | uniq > perlbreq.si || ( rm -f perlbreq.si ; false )
+
+nasm.spec: nasm.spec.in version.sed perlbreq.si
+ sed -f version.sed -e '/@@PERLBUILDREQS@@/r perlbreq.si' \
+ < nasm.spec.in > nasm.spec || ( rm -f nasm.spec ; false )
splint:
splint -weak *.c
diff --git a/nasm.spec.in b/nasm.spec.in
index 9ca198ea..1d1e6d7d 100644
--- a/nasm.spec.in
+++ b/nasm.spec.in
@@ -3,16 +3,22 @@
Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax
Name: nasm
Version: @@NASM_MANGLED_VER@@
-Release: 0
+Release: 0%{?dist}
License: BSD
Group: Development/Languages
Source: http://www.nasm.us/pub/nasm/releasebuilds/%{nasm_version}/nasm-%{nasm_version}.tar.xz
URL: http://www.nasm.us/
BuildRoot: /tmp/rpm-build-nasm
Prefix: %{_prefix}
-BuildRequires: perl, asciidoc, xmlto, ghostscript, perl-Font-TTF
-BuildRequires: adobe-source-sans-pro-fonts, adobe-source-code-pro-fonts
-BuildRequires: fontconfig, xz
+@@PERLBUILDREQS@@
+BuildRequires: autoconf
+BuildRequires: asciidoc
+BuildRequires: xmlto
+BuildRequires: ghostscript
+BuildRequires: fontconfig
+BuildRequires: adobe-source-sans-pro-fonts
+BuildRequires: adobe-source-code-pro-fonts
+BuildRequires: xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%package doc
@@ -41,26 +47,18 @@ include linker, library manager, loader, and information dump.
%setup -q -n nasm-%{nasm_version}
%build
-%configure --disable-pdf-compression
+autoreconf
+%configure --disable-pdf-compression --enable-lto
make %{?_smp_mflags} everything
+xz -9ef doc/nasmdoc.pdf
%install
rm -rf "$RPM_BUILD_ROOT"
mkdir -p "$RPM_BUILD_ROOT"/%{_bindir}
mkdir -p "$RPM_BUILD_ROOT"/%{_mandir}/man1
-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.pdf .
-xz -9ef nasmdoc.pdf
-# remove unpackaged files from the buildroot
-rm -rf $RPM_BUILD_ROOT%{_prefix}/tempdoc
-
-%clean
-rm -rf "$RPM_BUILD_ROOT"
+make INSTALLROOT="$RPM_BUILD_ROOT" install install_rdf
%files
-%defattr(-,root,root)
%doc AUTHORS CHANGES README TODO
%{_bindir}/nasm
%{_bindir}/ndisasm
@@ -68,11 +66,9 @@ rm -rf "$RPM_BUILD_ROOT"
%{_mandir}/man1/ndisasm.1*
%files doc
-%defattr(-,root,root)
-%doc html nasmdoc.pdf.xz
+%doc doc/html doc/nasmdoc.pdf.xz
%files rdoff
-%defattr(-,root,root)
%{_bindir}/ldrdf
%{_bindir}/rdf2bin
%{_bindir}/rdf2com
@@ -83,11 +79,7 @@ rm -rf "$RPM_BUILD_ROOT"
%{_bindir}/rdflib
%{_bindir}/rdx
%{_mandir}/man1/ldrdf.1*
-%{_mandir}/man1/rdf2bin.1*
-%{_mandir}/man1/rdf2com.1*
-%{_mandir}/man1/rdf2ihx.1*
-%{_mandir}/man1/rdf2ith.1*
-%{_mandir}/man1/rdf2srec.1*
-%{_mandir}/man1/rdfdump.1*
-%{_mandir}/man1/rdflib.1*
-%{_mandir}/man1/rdx.1*
+%{_mandir}/man1/rd*.1*
+
+# This is the upstream spec file; the change log is in git
+%changelog