aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in8
-rw-r--r--nasm.spec.in47
-rwxr-xr-xversion.pl12
3 files changed, 41 insertions, 26 deletions
diff --git a/Makefile.in b/Makefile.in
index 1a43f551..ab8973d4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -93,6 +93,9 @@ version.h: version version.pl
version.mac: version version.pl
$(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
+version.sed: version version.pl
+ $(PERL) $(srcdir)/version.pl sed < $(srcdir)/version > version.sed
+
# This source file is generated from the standard macros file
# `standard.mac' by another Perl script. Again, it's part of the
# standard distribution.
@@ -187,9 +190,8 @@ tar: dist
spec: nasm.spec
-nasm.spec: nasm.spec.in version version.pl
- sed -e s/@@VERSION@@/`cat $(srcdir)/version`/g \
- < nasm.spec.in > nasm.spec
+nasm.spec: nasm.spec.in version.sed
+ sed -f version.sed < nasm.spec.in > nasm.spec
splint:
splint -weak *.c
diff --git a/nasm.spec.in b/nasm.spec.in
index 8b46c1e8..11a8e076 100644
--- a/nasm.spec.in
+++ b/nasm.spec.in
@@ -1,13 +1,14 @@
+%define nasm_version @@NASM_VER@@
Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax
Name: nasm
-Version: @@VERSION@@
+Version: @@NASM_MANGLED_VER@@
Release: 1
License: LGPL
Group: Development/Languages
-Source: ftp://download.sourceforge.net/pub/sourceforge/nasm/nasm-%{version}.tar.bz2
+Source: ftp://download.sourceforge.net/pub/sourceforge/nasm/nasm-%{nasm_version}.tar.bz2
URL: http://nasm.sourceforge.net/
BuildRoot: /tmp/rpm-build-nasm
-Prefix: /usr
+Prefix: %{_prefix}
BuildPrereq: perl
%package doc
@@ -37,21 +38,21 @@ include linker, library manager, loader, and information dump.
%setup
%build
-CFLAGS="$RPM_OPT_FLAGS" LDFLAGS=-s ./configure --prefix=/usr
-make everything
+%configure
+%make %{?_smp_mflags} everything
%install
rm -rf "$RPM_BUILD_ROOT"
mkdir -p "$RPM_BUILD_ROOT"
-mkdir -p "$RPM_BUILD_ROOT"/usr/bin
-mkdir -p "$RPM_BUILD_ROOT"/usr/man/man1
+mkdir -p "$RPM_BUILD_ROOT"/%{_bindir}
+mkdir -p "$RPM_BUILD_ROOT"/%{_mandir}/man1
mkdir -p "$RPM_BUILD_ROOT"/%{_infodir}
-DOC="$RPM_BUILD_ROOT"/usr/doc/nasm-%{version}
+DOC="$RPM_BUILD_ROOT"%{_docdir}
mkdir -p "$DOC"
mkdir -p "$DOC"/rdoff
-rm -f "$RPM_BUILD_ROOT"/usr/info/nasm.*
+rm -f "$RPM_BUILD_ROOT"/%{_infodir}/nasm.*
make INSTALLROOT="$RPM_BUILD_ROOT" \
- docdir=/usr/doc/nasm-%{version} \
+ docdir=%{_docdir} \
infodir=%{_infodir} \
install_everything
gzip -9 "$RPM_BUILD_ROOT"/%{_infodir}/nasm.*
@@ -72,21 +73,21 @@ if [ $1 = 0 ]; then
fi
%files
-%attr(-,root,root) /usr/bin/nasm
-%attr(-,root,root) /usr/bin/ndisasm
-%attr(-,root,root) %doc /usr/man/man1/nasm.1*
-%attr(-,root,root) %doc /usr/man/man1/ndisasm.1*
+%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*
%files doc
%attr(-,root,root) %doc %{_infodir}/nasm.info*.gz
-%attr(-,root,root) %doc /usr/doc/nasm-%{version}/*
+%attr(-,root,root) %doc %{_docdir}/*
%files rdoff
-%attr(-,root,root) /usr/bin/ldrdf
-%attr(-,root,root) /usr/bin/rdf2bin
-%attr(-,root,root) /usr/bin/rdf2com
-%attr(-,root,root) /usr/bin/rdf2ihx
-%attr(-,root,root) /usr/bin/rdfdump
-%attr(-,root,root) /usr/bin/rdflib
-%attr(-,root,root) /usr/bin/rdx
-%attr(-,root,root) %doc /usr/doc/nasm-%{version}/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/*
diff --git a/version.pl b/version.pl
index 21ba8666..6f3da058 100755
--- a/version.pl
+++ b/version.pl
@@ -77,6 +77,9 @@ if ($is_rc) {
$nasm_id = ($nmaj << 24)+($nmin << 16)+($nsmin << 8)+$nplvl;
+$mangled_ver = sprintf("%d.%02d.%02d", $nmaj, $nmin, $nsmin);
+$mangled_ver .= '.'.$nplvl if ($nplvl != 0);
+
if ( $what eq 'h' ) {
print "#ifndef NASM_VERSION_H\n";
print "#define NASM_VERSION_H\n";
@@ -94,6 +97,15 @@ if ( $what eq 'h' ) {
printf "%%define __NASM_PATCHLEVEL__ %d\n", $nplvl;
printf "%%define __NASM_VERSION_ID__ 0%08Xh\n", $nasm_id;
printf "%%define __NASM_VER__ \"%s\"\n", $line;
+} elsif ( $what eq 'sed' ) {
+ printf "s/\@\@NASM_MAJOR\@\@/%d/g\n", $nmaj;
+ printf "s/\@\@NASM_MINOR\@\@/%d/g\n", $nmin;
+ printf "s/\@\@NASM_SUBMINOR\@\@/%d/g\n", $nsmin;
+ printf "s/\@\@NASM_PATCHLEVEL\@\@/%d/g\n", $nplvl;
+ printf "s/\@\@NASM_VERSION_ID\@\@/%d/g\n", $nasm_id;
+ printf "s/\@\@NASM_VERSION_XID\@\@/0x%08x/g\n", $nasm_id;
+ printf "s/\@\@NASM_VER\@\@/%s/g\n", $line;
+ printf "s/\@\@NASM_MANGLED_VER\@\@/%s/g\n", $mangled_ver;
} elsif ( $what eq 'id' ) {
print $nasm_id, "\n"; # Print ID in decimal
} elsif ( $what eq 'xid' ) {