[packages/nml] - cleaned up build/install process

qboosh qboosh at pld-linux.org
Sat Apr 19 08:49:03 CEST 2025


commit 4e22263ad9e5bff104758717b04b225c4e92847b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Apr 19 07:32:18 2025 +0200

    - cleaned up build/install process

 nml.spec | 40 +++++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 21 deletions(-)
---
diff --git a/nml.spec b/nml.spec
index 5b16b4c..58c193e 100644
--- a/nml.spec
+++ b/nml.spec
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_without	tests	# regression tests
+
 Summary:	Convert meta-language to openttd's grf and/or nfo files
 Summary(pl.UTF-8):	Konwersja meta-języka do plików grf i/lub nfo dla openttd
 Name:		nml
@@ -8,14 +12,13 @@ Group:		Applications
 Source0:	https://github.com/OpenTTD/nml/releases/download/%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	fd26c9d416f3ceaa481fa293c190520b
 URL:		https://dev.openttdcoop.org/projects/nml
-BuildRequires:	python3-pillow
+BuildRequires:	python3-modules >= 1:3.5
+BuildRequires:	python3-pillow >= 3.4
 BuildRequires:	python3-ply
 BuildRequires:	python3-setuptools
 BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.234
-Requires:	python3-pillow
-Requires:	python3-ply
-Requires:	python3-setuptools
+BuildRequires:	rpmbuild(macros) >= 1.714
+Requires:	python3-modules >= 1:3.5
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -30,33 +33,28 @@ czemu kodowanie newgrf staje się prostsze.
 %setup -q
 
 %build
-%{__make} -j1
-%{__make} -j1 extensions
+%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
+%{__make} -C regression
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__python3} setup.py install \
-	--skip-build \
-	--optimize=2 \
-	--prefix=%{_prefix} \
-	--root=$RPM_BUILD_ROOT
+%py3_install
 
 install -D docs/nmlc.1 $RPM_BUILD_ROOT%{_mandir}/man1/nmlc.1
 
-# The actual python code is not being installed?!?
-install -d $RPM_BUILD_ROOT%{py3_sitescriptdir}/nml
-cp -rp nml/* $RPM_BUILD_ROOT%{py3_sitescriptdir}/nml/
-
-%py_postclean
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
+%doc README.md docs/changelog.txt docs/index.html
 %attr(755,root,root) %{_bindir}/nmlc
-%doc docs/*.txt
 %{_mandir}/man1/nmlc.1*
-%{py3_sitedir}/*
-%{py3_sitescriptdir}/%{name}/
+%attr(755,root,root) %{py3_sitedir}/nml_lz77.cpython-*.so
+%{py3_sitedir}/nml
+%{py3_sitedir}/nml-%{version}-py*.egg-info
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nml.git/commitdiff/4e22263ad9e5bff104758717b04b225c4e92847b



More information about the pld-cvs-commit mailing list