aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-10-13 14:38:35 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-10-13 15:01:25 -0700
commite2d351778467ff337433c3442838e8528532b497 (patch)
tree7f47aa6f958dbe44cbf989c17322d521a25a983d
parent0d69f66641de77fe026bc2ea35bc3e6c1edcab77 (diff)
downloadgrv-master.tar.gz
grv-master.tar.xz
grv-master.zip
Specfiles don't like dashes, and add --as-neededHEADmaster
-rw-r--r--autoconf/m4/pa_add_ldflags.m49
-rw-r--r--configure.ac3
-rw-r--r--grv.spec.in9
-rwxr-xr-xmkrel14
4 files changed, 30 insertions, 5 deletions
diff --git a/autoconf/m4/pa_add_ldflags.m4 b/autoconf/m4/pa_add_ldflags.m4
new file mode 100644
index 0000000..0a80d34
--- /dev/null
+++ b/autoconf/m4/pa_add_ldflags.m4
@@ -0,0 +1,9 @@
+dnl --------------------------------------------------------------------------
+dnl PA_ADD_LDFLAGS(variable, flag [,actual_flag])
+dnl
+dnl Attempt to add the given option to xFLAGS, if it doesn't break
+dnl compilation. If the option to be tested is different than the
+dnl option that should actually be added, add the option to be
+dnl actually added as a second argument.
+dnl --------------------------------------------------------------------------
+AC_DEFUN([PA_ADD_LDFLAGS], [PA_ADD_FLAGS(LDFLAGS, [$1], [$2])])
diff --git a/configure.ac b/configure.ac
index 3c0a6ce..6be486c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,6 +51,9 @@ dnl assume all compilers support common, and this will help find those
dnl problems. This also works around an OSX linker problem.
PA_ADD_CFLAGS([-fno-common])
+dnl Don't link if we don't need it
+PA_ADD_LDFLAGS([-Wl,--as-needed])
+
dnl Compiler intrinsics
PA_ADD_HEADERS(intrin.h)
PA_HAVE_FUNC(__builtin_expect, (1,1))
diff --git a/grv.spec.in b/grv.spec.in
index 4e32a25..608f459 100644
--- a/grv.spec.in
+++ b/grv.spec.in
@@ -1,12 +1,12 @@
Summary: "Grävning" - a port of an old game with sucky graphics
Name: grv
-Version: @@VERSION@@
-Release: 1
+Version: @@VER1@@
+Release: @@VER2@@%{?dist}
Group: Games
License: GPLv2
Packager: H. Peter Anvin <hpa@zytor.com>
URL: https://www.zytor.com/pub/games/grv
-Source: grv-%{version}.tar.xz
+Source: grv-@@VERSION@@.tar.xz
Buildroot: /tmp/grv-root
BuildRequires: SDL-devel
@@ -22,7 +22,7 @@ the game was written for text mode. This is a straight port of the
an Internet high score server.
%prep
-%setup
+%setup -q -n grv-@@VERSION@@
%build
%configure
@@ -31,6 +31,7 @@ make %{?_smp_mflags}
%install
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
install -m 755 grv $RPM_BUILD_ROOT/%{_bindir}
+mkdir -p $RPM_BUILD_ROOT/%{_sbindir}
install -m 755 grvscored $RPM_BUILD_ROOT/%{_sbindir}
%clean
diff --git a/mkrel b/mkrel
index f9d1a3e..f7d689a 100755
--- a/mkrel
+++ b/mkrel
@@ -18,8 +18,20 @@ cd rel/"$pv"
cd "$pv"
echo "$ver" > version
./autogen.sh
+vnodash="$(echo "$ver" | sed -e 's/-/\./g')"
+ver1="$(echo "$ver" | cut -d- -f 1)"
+ver2="$(echo "$ver" | cut -d- -f 2- | sed -e 's/-/\./g')"
+if [ -z "$ver2" ]; then
+ ver2='0'
+else
+ ver2="0.$ver2"
+fi
for f in Info.plist grv.spec; do
- sed -e "s/@@VERSION@@/$ver/" "$f".in > "$f"
+ sed -e "s/@@VERSION@@/$ver/g" \
+ -e "s/@@VNODASH@@/$vnodash/g" \
+ -e "s/@@VER1@@/$ver1/g" \
+ -e "s/@@VER2@@/$ver2/g" \
+ < "$f".in > "$f"
done
cd ..
tar cvvf "$pv".tar "$pv"