[lua-ldoc] Import package.
Thomas Moschny
thm at fedoraproject.org
Wed Jan 30 16:59:20 UTC 2013
commit 6093eb7b9fb8f59b067c63c6c4ac8cb694d310ce
Author: Thomas Moschny <thm at fedoraproject.org>
Date: Wed Jan 30 17:56:48 2013 +0100
Import package.
.gitignore | 1 +
LDoc-1.3.3-destdir.patch | 37 +++++++++++++++++++
lua-ldoc.spec | 91 ++++++++++++++++++++++++++++++++++++++++++++++
sources | 1 +
4 files changed, 130 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..d4e1621 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/1.3.3.tar.gz
diff --git a/LDoc-1.3.3-destdir.patch b/LDoc-1.3.3-destdir.patch
new file mode 100644
index 0000000..7caeda1
--- /dev/null
+++ b/LDoc-1.3.3-destdir.patch
@@ -0,0 +1,37 @@
+diff --git a/makefile b/makefile
+index dc1314d..7e797cb 100644
+--- a/makefile
++++ b/makefile
+@@ -6,22 +6,22 @@ LUA_SHAREDIR=$(LUA_PREFIX)/share/lua/5.1
+ ldoc:
+
+ install: install_parts
+- echo "lua $(LUA_SHAREDIR)/ldoc.lua \$$*" > $(LUA_BINDIR)/ldoc
+- chmod +x $(LUA_BINDIR)/ldoc
++ echo "lua $(LUA_SHAREDIR)/ldoc.lua \$$*" > $(DESTDIR)$(LUA_BINDIR)/ldoc
++ chmod +x $(DESTDIR)$(LUA_BINDIR)/ldoc
+
+ install_luajit: install_parts
+- echo "luajit $(LUA_SHAREDIR)/ldoc.lua \$$*" > $(LUA_BINDIR)/ldoc
+- chmod +x $(LUA_BINDIR)/ldoc
++ echo "luajit $(LUA_SHAREDIR)/ldoc.lua \$$*" > $(DESTDIR)$(LUA_BINDIR)/ldoc
++ chmod +x $(DESTDIR)$(LUA_BINDIR)/ldoc
+
+ install_parts:
+- mkdir -p $(LUA_SHAREDIR)
+- cp ldoc.lua $(LUA_SHAREDIR)
+- cp -r ldoc $(LUA_SHAREDIR)
++ mkdir -p $(DESTDIR)$(LUA_SHAREDIR)
++ cp ldoc.lua $(DESTDIR)$(LUA_SHAREDIR)
++ cp -r ldoc $(DESTDIR)$(LUA_SHAREDIR)
+
+ uninstall:
+- -rm $(LUA_SHAREDIR)/ldoc.lua
+- -rm -r $(LUA_SHAREDIR)/ldoc
+- -rm $(LUA_BINDIR)/ldoc
++ -rm $(DESTDIR)$(LUA_SHAREDIR)/ldoc.lua
++ -rm -r $(DESTDIR)$(LUA_SHAREDIR)/ldoc
++ -rm $(DESTDIR)$(LUA_BINDIR)/ldoc
+
+ test: test-basic test-example test-md test-tables
+
diff --git a/lua-ldoc.spec b/lua-ldoc.spec
new file mode 100644
index 0000000..088b1da
--- /dev/null
+++ b/lua-ldoc.spec
@@ -0,0 +1,91 @@
+%global luaver 5.1
+%global luapkgdir %{_datadir}/lua/%{luaver}
+
+Name: lua-ldoc
+Version: 1.3.3
+Release: 1%{?dist}
+BuildArch: noarch
+Summary: Lua documentation generator
+# the included css code is BSD licensed
+License: MIT and BSD
+URL: https://github.com/stevedonovan/ldoc
+Source0: https://github.com/stevedonovan/LDoc/archive/%{version}.tar.gz
+# see https://github.com/stevedonovan/LDoc/pull/39
+Patch0: lua-ldoc/LDoc-1.3.3-destdir.patch
+BuildRequires: lua >= %{luaver}
+BuildRequires: lua-markdown
+BuildRequires: lua-penlight
+Requires: lua >= %{luaver}
+Requires: lua-penlight
+
+%global __requires_exclude_from %{_docdir}
+
+%description
+LDoc is a second-generation documentation tool that can be used as a
+replacement for LuaDoc. It is mostly compatible with LuaDoc, except
+that certain workarounds are no longer needed. For instance, it is not
+so married to the idea that Lua modules should be defined using the
+module function.
+
+
+%package doc
+Summary: Docs for lua-ldoc
+Requires: %{name} = %{version}-%{release}
+
+%description doc
+%{summary}
+
+
+%prep
+%setup -q -n LDoc-%{version}
+%patch0 -p1
+
+
+%build
+# nothing to do here
+
+
+%install
+mkdir -p %{buildroot}%{luapkgdir}
+mkdir -p %{buildroot}%{_bindir}
+make install \
+ "LUA_SHAREDIR=%{luapkgdir}" \
+ "LUA_BINDIR=%{_bindir}" \
+ "DESTDIR=%{buildroot}"
+
+# fix scripts
+sed -i %{buildroot}%{_bindir}/ldoc -e '1i#!/bin/sh'
+sed -i %{buildroot}%{luapkgdir}/ldoc.lua -e '1{/^#!/d}'
+
+# create documentation
+lua ldoc.lua .
+markdown.lua readme.md > readme.html
+
+# fix permissions
+chmod u=rwX,go=rX -R out
+
+# fix line-endings
+sed -i 's/\r//' COPYRIGHT
+
+
+%files
+%doc COPYRIGHT readme.html
+%{_bindir}/ldoc
+%{luapkgdir}/ldoc
+%{luapkgdir}/ldoc.lua
+
+
+%files doc
+%doc out/*
+
+
+%changelog
+* Wed Jan 30 2013 Thomas Moschny <thomas.moschny at gmx.de> - 1.3.3-1
+- Update to 1.3.3.
+
+* Wed Jan 9 2013 Thomas Moschny <thomas.moschny at gmx.de> - 1.3.1-2
+- Fix requirements.
+- Move docs to a separate package.
+
+* Fri Jan 4 2013 Thomas Moschny <thomas.moschny at gmx.de> - 1.3.1-1
+- New package.
diff --git a/sources b/sources
index e69de29..fb71542 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+c803bb5473e39ae60dc089a1fe3eba1f 1.3.3.tar.gz
More information about the scm-commits
mailing list