%{!?luaver: %global luaver %(lua -e "print(string.sub(_VERSION, 5))" || echo 0)} %global luapkgdir %{_datadir}/lua/%{luaver} %global luacompatver 5.1 %global luacompatpkgdir %{_datadir}/lua/%{luacompatver} Name: lua-mmdb Version: 0.2 Release: 1%{?dist} Summary: Maxmind database parser for Lua License: MIT URL: https://github.com/daurnimator/mmdblua Source0: https://github.com/daurnimator/mmdblua/archive/v%{version}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: lua %description A Lua library for reading MaxMind's Geolocation database format. %if 0%{?fedora} || 0%{?rhel} > 7 %package -n compat-%{name} Summary: Maxmind database parser for Lua %{luacompatver} Requires: compat-lua-compat53 %description -n compat-%{name} A Lua library for reading MaxMind's Geolocation database format. %endif %prep %setup -q -n mmdblua-%{version} %install install -d -m 0755 %{buildroot}/%{luapkgdir}/mmdb install -p -m 0644 mmdb/init.lua %{buildroot}/%{luapkgdir}/mmdb/init.lua %if 0%{?fedora} || 0%{?rhel} > 7 install -d -m 0755 %{buildroot}/%{luacompatpkgdir}/mmdb install -p -m 0644 mmdb/init.lua %{buildroot}/%{luacompatpkgdir}/mmdb/init.lua %endif %files %doc example.lua %license LICENSE.md %{luapkgdir}/mmdb %if 0%{?fedora} || 0%{?rhel} > 7 %files -n compat-%{name} %doc example.lua %license LICENSE.md %{luacompatpkgdir}/mmdb %endif %changelog * Tue Apr 02 2019 Tomas Krizek - 0.4.0-1 - Initial package for Fedora 28+ and EPEL 7