diff --git a/.gitignore b/.gitignore index 05b5955..d53e182 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /wordgrinder-0.6.tar.gz +/wordgrinder-0.7.1.tar.gz diff --git a/fedora_build.patch b/fedora_build.patch deleted file mode 100644 index 146d459..0000000 --- a/fedora_build.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git a/Makefile b/Makefile -index 7967eef..f63e7f3 100644 ---- a/Makefile -+++ b/Makefile -@@ -12,7 +12,16 @@ WINCC = mingw32-gcc.exe - WINDRES = windres.exe - MAKENSIS = makensis - --USE_LUAJIT = n -+# Do we build with debug symbols? -+DEBUGINFO = n -+ -+# Detect Fedora systems and adjust accordingly -+ifneq ($(wildcard /etc/fedora-release),) -+ # Fedora uses lua 5.3, so we'll use luaJIT instead -+ USE_LUAJIT = y -+else -+ USE_LUAJIT = n -+endif - - ifneq ($(findstring Windows,$(OS)),) - OS = windows -@@ -35,8 +44,14 @@ else - LIBROOT := /usr/lib - INCROOT := /usr - ifeq ($(USE_LUAJIT),y) -- LUA_INCLUDE := $(INCROOT)/include/luajit-2.0 -+ # Fedora 26 uses a newer version of luaJIT, so check for that -+ ifneq ($(wildcard $(INCROOT)/include/luajit-2.1),) -+ LUA_INCLUDE := $(INCROOT)/include/luajit-2.1 -+ else -+ LUA_INCLUDE := $(INCROOT)/include/luajit-2.0 -+ endif - LUA_LIB := -lluajit-5.1 -+ LUA_PATH := $(hide)/bin/lua-5.1 - # The ImmutabliseArray() code, used by the debug version of - # WordGrinder to ensure we don't modify stuff we shouldn't, - # uses new 5.2 metamethods and doesn't work on LuaJIT. -@@ -44,6 +59,7 @@ else - else - LUA_INCLUDE := $(INCROOT)/include/lua5.2 - LUA_LIB := -llua5.2 -+ LUA_PATH := $(hide)lua - TESTER = bin/wordgrinder-debug - endif - -@@ -74,6 +90,10 @@ override CFLAGS += \ - -fdata-sections \ - --std=gnu99 - -+ifeq ($(DEBUGINFO),y) -+ override CFLAGS += -g -+endif -+ - override LDFLAGS += \ - - WININSTALLER := bin/WordGrinder\ $(VERSION)\ setup.exe -@@ -160,7 +180,7 @@ LUASCRIPTS := \ - $(OBJ)/luascripts.c: $(LUASCRIPTS) - @echo SCRIPTS - @mkdir -p $(OBJ) -- $(hide)lua tools/multibin2c.lua script_table $^ > $@ -+ $(LUA_PATH) tools/multibin2c.lua script_table $^ > $@ - - clean:: - @echo CLEAN $(OBJ)/luascripts.c diff --git a/sources b/sources index 9e85314..a32d0cb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (wordgrinder-0.6.tar.gz) = 3548522d883f68a6b8d657295f2be52550b347c4a975c55fa9f97b62ee8c7a4a54d02bf1e4fb97b8656701aa1451a8eb2bdda29d052891e519cbb98f463608c6 +SHA512 (wordgrinder-0.7.1.tar.gz) = 9976ade4be5264ae1afccd7a7fe4e321414919c5b6fbd6a0db4d024dc35721a8e6530f51176f24e9c17eff735b633ffd281de68802a76da54207a1c3dba0fd05 diff --git a/strip.patch b/strip.patch new file mode 100644 index 0000000..35dfe0c --- /dev/null +++ b/strip.patch @@ -0,0 +1,116 @@ +From adb12983d77374737e543072adb8e938b417e244 Mon Sep 17 00:00:00 2001 +From: David Given +Date: Sat, 4 Nov 2017 11:11:25 +0100 +Subject: [PATCH] Add a WANT_STRIPPED_BINARIES makefile flag which controls + whether binaries are stripped before installation or not (as Fedora wants + unstripped binaries). + +Closes: #46 +--- + Makefile | 7 ++++++- + build.lua | 35 ++++++++++++++++++++++++----------- + 2 files changed, 30 insertions(+), 12 deletions(-) + +diff --git a/Makefile b/Makefile +index 3c013af..9766123 100644 +--- a/Makefile ++++ b/Makefile +@@ -77,6 +77,10 @@ LUABITOP_PACKAGE ?= builtin + MINIZIP_PACKAGE ?= builtin + UTHASH_PACKAGE ?= builtin + ++# Do you want your binaries stripped on installation? ++ ++WANT_STRIPPED_BINARIES ?= yes ++ + # =========================================================================== + # END OF CONFIGURATION OPTIONS + # =========================================================================== +@@ -134,13 +138,14 @@ $(OBJDIR)/build.ninja:: $(LUA_INTERPRETER) build.lua Makefile + OBJDIR="$(OBJDIR)" \ + UTHASH_PACKAGE="$(UTHASH_PACKAGE)" \ + VERSION="$(VERSION)" \ ++ WANT_STRIPPED_BINARIES="$(WANT_STRIPPED_BINARIES)" \ + WINCC="$(WINCC)" \ + WINDRES="$(WINDRES)" \ + XFT_PACKAGE="$(XFT_PACKAGE)" \ + + clean: + @echo CLEAN +- @rm -rf $(OBJDIR) ++ @rm -rf $(OBJDIR) bin + + ifeq ($(LUA_INTERPRETER),$(OBJDIR)/lua) + $(LUA_INTERPRETER): src/c/emu/lua-5.1.5/*.[ch] +diff --git a/build.lua b/build.lua +index fed80c4..1efa772 100644 +--- a/build.lua ++++ b/build.lua +@@ -351,6 +351,12 @@ function install_file(mode, src, dest) + installables[#installables+1] = dest + end + ++-- Sanity check ++ ++if (not WANT_STRIPPED_BINARIES) or (WANT_STRIPPED_BINARIES == "") then ++ WANT_STRIPPED_BINARIES = "yes" ++end ++ + -- Detect what tools we have available. + + io.write("Windows toolchain: ") +@@ -504,28 +510,35 @@ if want_frontend("x11") or want_frontend("curses") then + end + print("The preferred Lua package is: '"..LUA_PACKAGE.."'") + ++ local function strip_binary(binary) ++ if WANT_STRIPPED_BINARIES == "yes" then ++ local stripped = binary.."-stripped" ++ emit("build ", stripped, ": strip ", binary) ++ allbinaries[#allbinaries+1] = stripped ++ binary = stripped ++ end ++ ++ return binary ++ end ++ + local preferred_test + local preferred_curses + local preferred_x11 +- local stripped_curses +- local stripped_x11 + if want_frontend("curses") then + preferred_curses = "bin/wordgrinder-"..package_name(LUA_PACKAGE).."-curses-release" + preferred_test = "test-"..package_name(LUA_PACKAGE).."-curses-debug" +- stripped_curses = preferred_curses.."-stripped" +- emit("build ", stripped_curses, ": strip ", preferred_curses) +- allbinaries[#allbinaries+1] = stripped_curses +- install_file("755", stripped_curses, DESTDIR..BINDIR.."/wordgrinder") ++ ++ preferred_curses = strip_binary(preferred_curses) ++ install_file("755", preferred_curses, DESTDIR..BINDIR.."/wordgrinder") + end + if want_frontend("x11") then + preferred_x11 = "bin/xwordgrinder-"..package_name(LUA_PACKAGE).."-x11-release" + if not preferred_test then + preferred_test = "test-"..package_name(LUA_PACKAGE).."-x11-debug" + end +- stripped_x11 = preferred_x11.."-stripped" +- emit("build ", stripped_x11, ": strip ", preferred_x11) +- allbinaries[#allbinaries+1] = stripped_x11 +- install_file("755", stripped_x11, DESTDIR..BINDIR.."/xwordgrinder") ++ ++ preferred_x11 = strip_binary(preferred_x11) ++ install_file("755", preferred_x11, DESTDIR..BINDIR.."/xwordgrinder") + end + install_file("644", "bin/wordgrinder.1", DESTDIR..MANDIR.."/man1/wordgrinder.1") + install_file("644", "README.wg", DESTDIR..DOCDIR.."/wordgrinder/README.wg") +@@ -534,7 +547,7 @@ if want_frontend("x11") or want_frontend("curses") then + emit(" date = ", DATE) + emit(" version = ", VERSION) + +- emit("build all: phony bin/wordgrinder.1 ", stripped_curses or "", " ", stripped_x11 or "", " ", preferred_test) ++ emit("build all: phony bin/wordgrinder.1 ", preferred_curses or "", " ", preferred_x11 or "", " ", preferred_test) + emit("build install: phony all ", table.concat(installables, " ")) + end + diff --git a/wordgrinder.spec b/wordgrinder.spec index bab4ba4..528f036 100644 --- a/wordgrinder.spec +++ b/wordgrinder.spec @@ -1,6 +1,6 @@ Name: wordgrinder -Version: 0.6 -Release: 6%{?dist} +Version: 0.7.1 +Release: 1%{?dist} Summary: A command line word processor License: MIT @@ -8,16 +8,14 @@ URL: http://cowlark.com/wordgrinder %global pkgid %{name}-%{version} Source: https://github.com/davidgiven/%{name}/archive/%{name}-%{version}.tar.gz -# Patch the Makefile to work with Fedora technology and policy -Patch1: fedora_build.patch - -BuildRequires: gcc make ncurses-devel -BuildRequires: luajit luajit-devel compat-lua-libs compat-lua-devel compat-lua lua-filesystem-compat -BuildRequires: zlib-devel libXft-devel -Requires: ncurses luajit lua-filesystem-compat +BuildRequires: gcc make ncurses-devel ninja-build +BuildRequires: lua-devel lua-libs lua lua-filesystem +BuildRequires: zlib-devel libXft-devel +Requires: ncurses lua-filesystem # luaJIT is not available on all architectures -ExcludeArch: s390x ppc64 ppc64le +#ExcludeArch: s390x ppc64 ppc64le +Patch1: strip.patch %description WordGrinder is a Unicode-aware character cell word processor that runs in a terminal (or a Windows console). It is designed to get the hell out of your way @@ -28,37 +26,52 @@ not point and click. It is not a desktop publisher. It is not a text editor. It does not do fonts and it barely does styles. What it does do is words. It's designed for writing text. It gets out of your way and lets you type +%package x11 +Summary: X11 version of WordGrinder +Requires: %name = %version-%release +Requires: libX11 +%description x11 +An X11 version of the WordGrinder word processor. + %prep -%setup -q -n %{name}-%{name}-%{version} +%setup -q -n %{name}-%{version} %patch1 -p1 ############################################################################### %build -make %{?_smp_mflags} DEBUGINFO=y +CFLAGS=-g PREFIX=$RPM_BUILD_ROOT/%{_prefix} OBJDIR=$RPM_BUILD_ROOT/tmp WANT_STRIPPED_BINARIES=no make %{?_smp_mflags} ############################################################################### %install make install PREFIX=$RPM_BUILD_ROOT/%{_prefix} +#make install ############################################################################### %files -%license COPYING +%license licenses/COPYING.WordGrinder %_bindir/wordgrinder %_docdir/wordgrinder/README.wg %_mandir/man1/wordgrinder.1* +%files x11 +%license licenses/COPYING.WordGrinder +%_bindir/xwordgrinder ############################################################################### %changelog +* Sun Nov 05 2017 Ben Cotton - 0.7.1-1 +- Update to latest upstream release +- Remove unneeded dependences, which allows us more build arches +- Split the X11 version into an optional subpackage + * Thu Aug 03 2017 Fedora Release Engineering - 0.6-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 0.6-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - * Thu Jul 06 2017 Ben Cotton - 0.6-4 - Fix debuginfo issues