commit bf2b7f1a956c3f0bc03bf56fd14b34a31536f5f0
Author: Jan Palus <[email protected]>
Date:   Wed Dec 11 01:01:11 2024 +0100

    add systemd bcond

 erlang.spec | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/erlang.spec b/erlang.spec
index 07665f8..c6439ab 100644
--- a/erlang.spec
+++ b/erlang.spec
@@ -11,6 +11,7 @@
 %bcond_with    java            # with Java support
 %bcond_without odbc            # without unixODBC support
 %bcond_without doc             # build documentation
+%bcond_without systemd         # systemd support
 #
 
 %define                otp             %(echo %version | cut -f1 -d.)
@@ -50,15 +51,14 @@ BuildRequires:      openssl-tools
 BuildRequires: perl-base
 BuildRequires: rpm-build >= 4.6
 BuildRequires: rpmbuild(macros) >= 2.007
-BuildRequires: systemd-devel
+%{?with_systemd:BuildRequires: systemd-devel}
 BuildRequires: xorg-lib-libX11-devel
 %if %{with odbc}
 BuildRequires: unixODBC-devel
 %else
 BuildConflicts:        unixODBC-devel
 %endif
-Requires:      systemd-units >= 38
-Requires(post,preun,postun):   systemd-units >= 38
+%{?with_systemd:Requires:      systemd-units >= 38}
 Provides:      erlang(OTP) = %otp
 Provides:      erlang(OTP) = %{lua:print(macros.otp - 1)}
 Provides:      erlang(OTP) = %{lua:print(macros.otp - 2)}
@@ -113,6 +113,7 @@ Dokumentacja do Erlanga.
 %endif
        --disable-silent-rules \
        --enable-smp-support \
+       %{__enable_disable systemd} \
        --with-javac%{!?with_java:=no} \
        --with-ssl-lib-subdir=%{_lib}
 
@@ -137,10 +138,12 @@ env ERL_LIBS="$RPM_BUILD_ROOT%{_libdir}/erlang/lib" \
                DESTDIR=$RPM_BUILD_ROOT
 %endif
 
+%if %{with systemd}
 install -D -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/epmd.service
 install -D -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/epmd.socket
 install -D -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/[email protected]
 install -D -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/[email protected]
+%endif
 
 %{__sed} -i -e"s#$RPM_BUILD_ROOT##" \
        $RPM_BUILD_ROOT%{_libdir}/%{name}/bin/{erl,start,start_erl}
@@ -177,15 +180,21 @@ install -d 
$RPM_BUILD_ROOT%{_datadir}/%{name}/erts-%{erts_version}
 rm -rf $RPM_BUILD_ROOT
 
 %post
+%if %{with systemd}
 %systemd_post epmd.service
 %systemd_post [email protected]
+%endif
 
 %preun
+%if %{with systemd}
 %systemd_preun epmd.service
 %systemd_preun [email protected]
+%endif
 
 %postun
+%if %{with systemd}
 %systemd_reload
+%endif
 
 %files -f lib.list
 %defattr(644,root,root,755)
@@ -249,10 +258,12 @@ rm -rf $RPM_BUILD_ROOT
 %{?with_doc:%{_libdir}/%{name}/doc}
 %{_libdir}/%{name}/erts-%{erts_version}/doc
 
+%if %{with systemd}
 %{systemdunitdir}/epmd.service
 %{systemdunitdir}/epmd.socket
 %{systemdunitdir}/[email protected]
 %{systemdunitdir}/[email protected]
+%endif
 
 %if %{with doc}
 %files doc
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/erlang.git/commitdiff/bf2b7f1a956c3f0bc03bf56fd14b34a31536f5f0

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to