2017-07-14 11:02:20 +00:00
|
|
|
#
|
2017-07-14 11:10:06 +00:00
|
|
|
# spec file for package lua-mpack
|
2017-07-14 11:02:20 +00:00
|
|
|
#
|
2024-02-22 09:56:16 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2017-07-14 11:02:20 +00:00
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2020-07-06 19:07:37 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-07-14 11:02:20 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
2017-07-14 11:10:06 +00:00
|
|
|
%define flavor @BUILD_FLAVOR@
|
2017-07-14 11:02:20 +00:00
|
|
|
%define libmpack_version 1.0.5
|
2021-02-18 17:51:15 +00:00
|
|
|
%define mod_name mpack
|
2025-10-13 15:29:56 +02:00
|
|
|
Version: 1.0.12
|
2017-07-14 11:02:20 +00:00
|
|
|
Release: 0
|
|
|
|
|
Summary: Implementation of MessagePack for Lua 5.1
|
|
|
|
|
License: MIT
|
|
|
|
|
Group: Development/Libraries/Other
|
2020-07-06 19:07:37 +00:00
|
|
|
URL: https://github.com/libmpack/libmpack-lua
|
2025-10-13 15:29:56 +02:00
|
|
|
Source: https://github.com/libmpack/libmpack-lua/archive/refs/tags/%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz
|
|
|
|
|
# libmpack source is necessary to build lua-mpack, need to package mpack to Factory
|
|
|
|
|
Source1: https://github.com/libmpack/libmpack/archive/refs/tags/%{libmpack_version}.tar.gz#/libmpack-%{libmpack_version}.tar.gz
|
|
|
|
|
# PATCH-FIX-UPSTREAM luajit-build.patch gh#libmpack/libmpack-lua!34 mcepl@suse.com
|
|
|
|
|
# Add #define to mask Lua API 5.1 / 5.2 incompatibility
|
|
|
|
|
Patch2: luajit-build.patch
|
2017-07-14 11:10:06 +00:00
|
|
|
BuildRequires: %{flavor}-devel
|
2017-07-14 11:02:20 +00:00
|
|
|
BuildRequires: gcc
|
|
|
|
|
BuildRequires: libtool
|
2025-10-13 15:29:56 +02:00
|
|
|
BuildRequires: pkgconfig
|
2024-02-22 09:56:16 +00:00
|
|
|
BuildRequires: lua-macros
|
2017-07-14 11:10:06 +00:00
|
|
|
Requires: %{flavor}
|
2021-02-18 17:51:15 +00:00
|
|
|
%lua_provides
|
2017-07-14 11:10:06 +00:00
|
|
|
%if "%{flavor}" == ""
|
2021-02-18 17:51:15 +00:00
|
|
|
Name: lua-%{mod_name}
|
2017-07-14 11:10:06 +00:00
|
|
|
ExclusiveArch: do_not_build
|
2017-07-15 07:33:54 +00:00
|
|
|
%else
|
2021-02-18 17:51:15 +00:00
|
|
|
Name: %{flavor}-%{mod_name}
|
2017-07-14 11:10:06 +00:00
|
|
|
%endif
|
2017-07-14 11:02:20 +00:00
|
|
|
|
|
|
|
|
%description
|
2017-07-14 11:10:06 +00:00
|
|
|
mpack is a binary serialization/RPC library that implements both the msgpack
|
|
|
|
|
and msgpack-rpc specifications.
|
2017-07-14 11:02:20 +00:00
|
|
|
|
|
|
|
|
%prep
|
2024-02-22 09:56:16 +00:00
|
|
|
%autosetup -p1 -n libmpack-lua-%{version}
|
2017-07-14 11:02:20 +00:00
|
|
|
|
2025-10-13 15:29:56 +02:00
|
|
|
( mkdir -p "mpack-src" && cd "mpack-src"
|
|
|
|
|
tar --extract --strip-components=1 --file %{SOURCE1} )
|
2017-07-14 11:02:20 +00:00
|
|
|
|
|
|
|
|
# Fix lua directory.
|
2017-07-14 11:10:06 +00:00
|
|
|
sed -i 's|LUA_CMOD_INSTALLDIR :=.*|LUA_CMOD_INSTALLDIR := $(shell echo "%{lua_archdir}")|g' Makefile
|
2017-07-14 11:02:20 +00:00
|
|
|
|
|
|
|
|
%build
|
2023-01-25 21:14:25 +00:00
|
|
|
make %{?_make_output_sync} %{?_smp_mflags} \
|
2017-07-14 11:17:50 +00:00
|
|
|
USE_SYSTEM_LUA=yes \
|
2025-10-13 15:29:56 +02:00
|
|
|
USE_SYSTEM_MPACK=no \
|
|
|
|
|
LUA_IMPL="lua" \
|
|
|
|
|
CFLAGS="%{optflags} -fPIC %(pkgconf --cflags --libs lua)"
|
2017-07-14 11:02:20 +00:00
|
|
|
|
|
|
|
|
%install
|
2025-10-13 15:29:56 +02:00
|
|
|
%make_install USE_SYSTEM_LUA=yes \
|
|
|
|
|
LUA_CMOD_INSTALLDIR="%{lua_archdir}"
|
2017-07-14 11:02:20 +00:00
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%doc mpack-src/LICENSE-MIT README.md
|
2025-10-13 15:29:56 +02:00
|
|
|
%{lua_archdir}/mpack.so
|
2017-07-14 11:02:20 +00:00
|
|
|
|
|
|
|
|
%changelog
|