[projects/template-specs] - added cmake and meson examples
qboosh
qboosh at pld-linux.org
Tue Mar 25 19:30:03 CET 2025
commit a03c6a67f0399225a8d8a12dbf4b329d83faf192
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Mar 25 19:12:09 2025 +0100
- added cmake and meson examples
template.spec | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
---
diff --git a/template.spec b/template.spec
index 1fc62fe..109c0b0 100644
--- a/template.spec
+++ b/template.spec
@@ -18,6 +18,13 @@ Source0: %{name}-%{version}.tar.gz
# Source1-md5: -
#Patch0: %{name}-DESTDIR.patch
URL: -
+# for cmake:
+#BuildRequires: cmake >= ?
+#BuildRequires: rpmbuild(macros) >= 1.605
+# for meson
+#BuildRequires: meson >= ?
+#BuildRequires: ninja >= 1.5
+#BuildRequires: rpmbuild(macros) >= 2.042
# if using noarch subpackage
#BuildRequires: rpm-build >= 4.6
%if %{with initscript}
@@ -132,9 +139,25 @@ find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
#%{__automake}
# if not running libtool or automake, but config.sub is too old:
#cp -f /usr/share/automake/config.sub .
+
+# autotools
%configure
%{__make}
+# cmake <3.13
+install -d build
+cd build
+%cmake ..
+%{__make}
+
+# cmake 3.13+
+%cmake -B build
+%{__make} -C build
+
+# meson
+%meson
+%meson_build
+
#%{__make} \
# CFLAGS="%{rpmcflags}" \
# LDFLAGS="%{rpmldflags}"
@@ -150,9 +173,17 @@ install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
%endif
#install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+# autotools or plain makefiles
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+# cmake
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+# meson
+%meson_install
+
%clean
rm -rf $RPM_BUILD_ROOT
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/template-specs.git/commitdiff/a03c6a67f0399225a8d8a12dbf4b329d83faf192
More information about the pld-cvs-commit
mailing list