From eccca299521804cf8a354ee6209965aa03400fd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 4 Nov 2018 05:43:43 +0200 Subject: [PATCH] add lua subpackage --- apk-tools.spec | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/apk-tools.spec b/apk-tools.spec index 543d4ae..afac454 100644 --- a/apk-tools.spec +++ b/apk-tools.spec @@ -1,3 +1,7 @@ +# +# Conditional build: +%bcond_with lua # build without tests + Summary: Alpine Package Keeper - package manager for alpine Name: apk-tools Version: 2.10.1 @@ -10,6 +14,7 @@ Patch0: 0001-fix-strncpy-bounds-errors.patch Patch1: 0002-include-sys-sysmacros.h-for-makedev-definition.patch Patch2: 0001-add-support-for-openssl-1.1.patch URL: https://git.alpinelinux.org/cgit/apk-tools/ +BuildRequires: lua52-devel BuildRequires: openssl-devel BuildRequires: tar >= 1:1.22 BuildRequires: xz @@ -20,6 +25,13 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description Package manager for Alpine Linux. +%package lua +Summary: Lua module for apk-tools +Group: Base + +%description lua +Lua module for apk-tools. + %prep %setup -q %patch0 -p1 @@ -27,6 +39,14 @@ Package manager for Alpine Linux. %patch2 -p1 %build +generate_config() { +cat <<-EOF + FULL_VERSION=%{version}-%{release} + LUAAPK=%{?with_lua:YesPlease} + export LUAAPK +EOF +} +generate_config > config.mk %{__make} %install @@ -43,3 +63,10 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %attr(755,root,root) %{_sbindir}/apk + +%if %{with lua} +%files lua +%defattr(644,root,root,755) +# XXX: parent dir not packaged +%{_prefix}/lib/lua/5.2/apk.so +%endif -- 2.44.0