%global luaver 5.2 %global lualibdir %{_libdir}/lua/%{luaver} %global commit f44f95461404328062597ad6438b2a140bac098a %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: lua-cmsgpack Version: 0.3.1 Release: 1.git%{shortcommit}%{?dist} Summary: Self contained Lua MessagePack C implementation License: BSD URL: https://github.com/antirez/%{name} Source0: %{url}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz BuildRequires: lua-devel Requires: lua >= %{luaver} %description MessagePack implementation and bindings for Lua 5.1/5.2 in a self contained C file without external dependencies. %prep %setup -q -n %{name}-%{commit} %build gcc %{optflags} -o cmsgpack.so -shared -fPIC lua_cmsgpack.c %install mkdir -p %{buildroot}%{lualibdir} install -p -m0644 cmsgpack.so %{buildroot}%{lualibdir} %files %doc README.md %{lualibdir}/* %changelog * Wed Jul 09 2014 Igor Gnatenko - 0.3.1-1.gitf44f954 - Initial package