URL: https://github.com/freeipa/freeipa/pull/596 Author: HonzaCholasta Title: #596: spec file: support client-only build Action: synchronized
To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/596/head:pr596 git checkout pr596
From e7baeec9d594161b8e0ce1ce6c6fce9d6f1e6eba Mon Sep 17 00:00:00 2001 From: Jan Cholasta <jchol...@redhat.com> Date: Wed, 15 Mar 2017 09:30:14 +0100 Subject: [PATCH 1/2] spec file: support build without ipatests Build ipatests only if %with_ipatests RPM macro is specified. By default the macro is specified if ONLY_CLIENT is not specified. https://pagure.io/freeipa/issue/6517 --- freeipa.spec.in | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/freeipa.spec.in b/freeipa.spec.in index bbce246..738f875 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -2,6 +2,16 @@ # subpackages %{!?ONLY_CLIENT:%global ONLY_CLIENT 0} +# Build with ipatests +%if ! %{ONLY_CLIENT} + %global with_ipatests 1 +%endif +%if 0%{?with_ipatests} + %global with_ipatests_option --with-ipatests +%else + %global with_ipatests_option --without-ipatests +%endif + %if 0%{?rhel} %global with_python3 0 %else @@ -712,7 +722,7 @@ and integration with Active Directory based infrastructures (Trusts). If you are using IPA, you need to install this package. -%if ! %{ONLY_CLIENT} +%if 0%{?with_ipatests} %package -n python2-ipatests Summary: IPA tests and test tools @@ -780,7 +790,7 @@ This package contains tests that verify IPA functionality under Python 3. %endif # with_python3 -%endif # ONLY_CLIENT +%endif # with_ipatests %prep @@ -807,6 +817,7 @@ find \ -type f -exec grep -qsm1 '^#!.*\bpython' {} \; \ -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python2}|' {} \; %configure --with-vendor-suffix=-%{release} \ + %{with_ipatests_option} \ %{enable_pylint_option} \ %{?without_jslint_option} @@ -825,6 +836,7 @@ find \ -type f -exec grep -qsm1 '^#!.*\bpython' {} \; \ -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python3}|' {} \; %configure --with-vendor-suffix=-%{release} \ + %{with_ipatests_option} \ %{enable_pylint_option} \ %{?without_jslint_option} popd @@ -861,19 +873,26 @@ pushd %{_builddir}/freeipa-%{version}-python3 (cd ipaplatform && %make_install) (cd ipapython && %make_install) (cd ipaserver && %make_install) +%if 0%{?with_ipatests} (cd ipatests && %make_install) +%endif # with_ipatests popd +%if 0%{?with_ipatests} mv %{buildroot}%{_bindir}/ipa-run-tests %{buildroot}%{_bindir}/ipa-run-tests-%{python3_version} mv %{buildroot}%{_bindir}/ipa-test-config %{buildroot}%{_bindir}/ipa-test-config-%{python3_version} mv %{buildroot}%{_bindir}/ipa-test-task %{buildroot}%{_bindir}/ipa-test-task-%{python3_version} ln -s %{_bindir}/ipa-run-tests-%{python3_version} %{buildroot}%{_bindir}/ipa-run-tests-3 ln -s %{_bindir}/ipa-test-config-%{python3_version} %{buildroot}%{_bindir}/ipa-test-config-3 ln -s %{_bindir}/ipa-test-task-%{python3_version} %{buildroot}%{_bindir}/ipa-test-task-3 +%endif # with_ipatests + %endif # with_python3 # Python 2 installation %make_install + +%if 0%{?with_ipatests} mv %{buildroot}%{_bindir}/ipa-run-tests %{buildroot}%{_bindir}/ipa-run-tests-%{python2_version} mv %{buildroot}%{_bindir}/ipa-test-config %{buildroot}%{_bindir}/ipa-test-config-%{python2_version} mv %{buildroot}%{_bindir}/ipa-test-task %{buildroot}%{_bindir}/ipa-test-task-%{python2_version} @@ -884,7 +903,7 @@ ln -s %{_bindir}/ipa-test-task-%{python2_version} %{buildroot}%{_bindir}/ipa-tes ln -s %{_bindir}/ipa-run-tests-%{python2_version} %{buildroot}%{_bindir}/ipa-run-tests ln -s %{_bindir}/ipa-test-config-%{python2_version} %{buildroot}%{_bindir}/ipa-test-config ln -s %{_bindir}/ipa-test-task-%{python2_version} %{buildroot}%{_bindir}/ipa-test-task - +%endif # with_ipatests # remove files which are useful only for make uninstall find %{buildroot} -wholename '*/site-packages/*/install_files.txt' -exec rm {} \; @@ -1454,7 +1473,7 @@ fi %endif # with_python3 -%if ! %{ONLY_CLIENT} +%if 0%{?with_ipatests} %files -n python2-ipatests %defattr(-,root,root,-) @@ -1492,7 +1511,7 @@ fi %endif # with_python3 -%endif # ONLY_CLIENT +%endif # with_ipatests %changelog From 5a44e7c0e392393ca24703348e8616125f2dcf1b Mon Sep 17 00:00:00 2001 From: Jan Cholasta <jchol...@redhat.com> Date: Wed, 15 Mar 2017 07:48:29 +0100 Subject: [PATCH 2/2] spec file: support client-only build nspr-devel, nss-devel and openssl-devel are required for client-only build, move their respective BuildRequires from the server-specific BuildRequires section to the main BuildRequires section. Pass --enable-server or --disable-server to ./configure based on the value of %{ONLY_CLIENT}. Remove the `make client-check` call from %check, as the client-check target does not exist anymore. Always call `make check` instead. Do not package the /usr/share/ipa directory in freeipa-client-common, as it is not created in client-only build. https://pagure.io/freeipa/issue/6517 --- freeipa.spec.in | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/freeipa.spec.in b/freeipa.spec.in index 738f875..b589354 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -1,6 +1,11 @@ # Define ONLY_CLIENT to only make the ipa-client and ipa-python # subpackages %{!?ONLY_CLIENT:%global ONLY_CLIENT 0} +%if %{ONLY_CLIENT} + %global enable_server_option --disable-server +%else + %global enable_server_option --enable-server +%endif # Build with ipatests %if ! %{ONLY_CLIENT} @@ -96,6 +101,9 @@ BuildRequires: python3-devel BuildRequires: systemd # systemd-tmpfiles which is executed from make install requires apache user BuildRequires: httpd +BuildRequires: nspr-devel +BuildRequires: nss-devel +BuildRequires: openssl-devel BuildRequires: libini_config-devel BuildRequires: cyrus-sasl-devel %if ! %{ONLY_CLIENT} @@ -109,9 +117,6 @@ BuildRequires: samba-devel >= 2:4.0.0 %endif BuildRequires: libtalloc-devel BuildRequires: libtevent-devel -BuildRequires: nspr-devel -BuildRequires: nss-devel -BuildRequires: openssl-devel BuildRequires: libuuid-devel BuildRequires: libsss_idmap-devel # 1.14.0: sss_nss_getnamebycert (https://fedorahosted.org/sssd/ticket/2897) @@ -817,6 +822,7 @@ find \ -type f -exec grep -qsm1 '^#!.*\bpython' {} \; \ -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python2}|' {} \; %configure --with-vendor-suffix=-%{release} \ + %{enable_server_option} \ %{with_ipatests_option} \ %{enable_pylint_option} \ %{?without_jslint_option} @@ -836,6 +842,7 @@ find \ -type f -exec grep -qsm1 '^#!.*\bpython' {} \; \ -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python3}|' {} \; %configure --with-vendor-suffix=-%{release} \ + %{enable_server_option} \ %{with_ipatests_option} \ %{enable_pylint_option} \ %{?without_jslint_option} @@ -843,11 +850,7 @@ popd %endif # with_python3 %check -%if ! %{ONLY_CLIENT} make %{?_smp_mflags} check VERBOSE=yes LIBDIR=%{_libdir} -%else -make %{?_smp_mflags} client-check VERBOSE=yes LIBDIR=%{_libdir} -%endif # ONLY_CLIENT %install @@ -872,7 +875,9 @@ pushd %{_builddir}/freeipa-%{version}-python3 (cd ipalib && %make_install) (cd ipaplatform && %make_install) (cd ipapython && %make_install) +%if ! %{ONLY_CLIENT} (cd ipaserver && %make_install) +%endif # ONLY_CLIENT %if 0%{?with_ipatests} (cd ipatests && %make_install) %endif # with_ipatests @@ -1419,7 +1424,6 @@ fi %ghost %config(noreplace) %{_sysconfdir}/ipa/nssdb/secmod.db %ghost %config(noreplace) %{_sysconfdir}/ipa/nssdb/pwdfile.txt %ghost %config(noreplace) %{_sysconfdir}/pki/ca-trust/source/ipa.p11-kit -%dir %{_usr}/share/ipa %dir %{_localstatedir}/lib/ipa-client %dir %{_localstatedir}/lib/ipa-client/sysrestore %{_mandir}/man5/default.conf.5*
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code