File lua-ldbus.spec of Package lua-ldbus

#
# spec file for package lua-ldbus
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define flavor @BUILD_FLAVOR@
%define mod_name ldbus
Version:        0.0+git20161023.e277e22
Release:        0
Summary:        Lua bindings to dbus
License:        MIT
Group:          Development/Libraries/Other
Url:            https://github.com/daurnimator/ldbus/
Source:         lua-ldbus-%{version}.tar.xz
BuildRequires:  %{flavor}-devel
BuildRequires:  pkgconfig(dbus-1)
Requires:       %{flavor}
%if "%{flavor}" == "lua53"
Provides:       lua-%{mod_name} = %{version}
Obsoletes:      lua-%{mod_name} < %{version}
%endif
%if "%{flavor}" == ""
Name:           lua-%{mod_name}
ExclusiveArch:  do_not_build
%else
Name:           %{flavor}-%{mod_name}
%endif

%description
ldbus is a C binding to dbus for Lua.

%prep
%setup -q -n lua-ldbus-%{version}
%if "%{flavor}" == "lua52"
sed -i -e "s/lua5.3/lua5.2/" src/Makefile
%endif
%if "%{flavor}" == "lua51"
sed -i -e "s/lua5.3/lua5.1/" src/Makefile
%endif

%build
cd src
make

%install
cd src
%make_install LUA_LIBDIR='$(DESTDIR)%{lua_archdir}'

%files
%doc LICENSE
%{lua_archdir}/ldbus.so

%changelog
openSUSE Build Service is sponsored by