%global date 20171219 %global commit0 c0a3c751e5f07a05c6faad21000fce256e24ff39 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global the_owner srdgame Name: librs232 Version: 1.0.3 Release: 2.%{date}git%{shortcommit0}%{?dist} Summary: Library for serial communications over RS-232 with Lua bindings License: MIT Url: https://github.com/%{the_owner}/%{name}/ Source: https://github.com/%{the_owner}/%{name}/archive/%{commit0}.tar.gz#/%{name}-%{version}-%{date}git%{shortcommit0}.tar.gz # Replace obsoleted m4 macro. # Upstrem reference: https://github.com/srdgame/librs232/pull/3 Patch0: https://github.com/%{the_owner}/%{name}/commit/08ba5b7178f4cb2a0185617c13f11898fd0c8e6c.patch#/%{name}-%{version}-replace-obsoleted-marco.patch BuildRequires: /usr/bin/git BuildRequires: gcc BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: lua >= 5.1 BuildRequires: lua-devel >= 5.1 %description %{name} is a multi-platform library that provides support for communicating over serial ports (e.g. RS-232). It also provides Lua bindings. %package devel Summary: Development files for %{name} License: MIT Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains C header files for developing applications that use %{name} library. %package -n lua-%{name} Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Lua bindings for %{name} License: MIT Requires: lua(abi) = %{lua_version} %description -n lua-%{name} The lua-%{name} package provides Lua binding for %{name} library. It allows Lua programs to communicate over serial ports. %prep %autosetup -S git -n %{name}-%{commit0} export LUA_INCLUDE= ./autogen.sh %configure --disable-static %build %make_build %install %make_install # Remove unneeded .la files find %{buildroot} -name '*.la' -exec rm {} \; %files %license COPYING %doc AUTHORS doc/example.lua %{_libdir}/*.so.* %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files devel %{_libdir}/*.so %{_includedir}/%{name} %{_libdir}/pkgconfig/%{name}*.pc %files -n lua-%{name} %{lua_libdir}/*.so %changelog * Thu Dec 21 2017 Damian Wrobel - 1.0.3-2.20171219gitc0a3c75 - Drop patch upstream merged * Tue Sep 26 2017 Damian Wrobel - 1.0.3-1.20160327git4de45dd - Initial RPM release.