#50608 Issue 50199 - Disable perl by default
Merged 3 months ago by mhonek. Opened 5 months ago by mhonek.
mhonek/389-ds-base fix-rpmspec-without-perl  into  master

file modified
+113 -87

@@ -59,6 +59,12 @@ 

  PERL_ON = 0

  endif

  

+ if ENABLE_LEGACY

+ LEGACY_ON = 1

+ else

+ LEGACY_ON = 0

+ endif

+ 

  if CLANG_ENABLE

  CLANG_ON = 1

  CLANG_LDFLAGS = -latomic

@@ -340,13 +346,16 @@ 

  sbin_PROGRAMS = ns-slapd ldap-agent

  

  bin_PROGRAMS = dbscan \

- 	infadd \

  	ldclt \

+ 	pwdhash

+ if ENABLE_LEGACY

+ bin_PROGRAMS += \

+ 	infadd \

  	ldif \

  	migratecred \

  	mmldif \

- 	pwdhash \

  	rsearch

+ endif

  

  # ----------------------------------------------------------------------------------------

  # This odd looking definition is to keep the libraries in ORDER that they are needed. rsds

@@ -659,9 +668,12 @@ 

  #------------------------

  config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \

  	$(srcdir)/ldap/schema/slapd-collations.conf \

- 	ldap/admin/src/template-initconfig \

  	ldap/servers/snmp/ldap-agent.conf

  

+ if ENABLE_LEGACY

+ config_DATA += ldap/admin/src/template-initconfig

+ endif

+ 

  # the schema files in this list are either not

  # standard schema, not tested, or not compatible

  # with the default schema e.g. there is

@@ -743,9 +755,14 @@ 

  

  schema_DATA = $(srcdir)/ldap/schema/99user.ldif

  

- libexec_SCRIPTS = ldap/admin/src/scripts/ds_selinux_enabled \

- 	ldap/admin/src/scripts/ds_selinux_port_query \

- 	wrappers/ds_systemd_ask_password_acl

+ libexec_SCRIPTS =

+ if ENABLE_PERL

+ libexec_SCRIPTS += ldap/admin/src/scripts/ds_selinux_enabled \

+ 	ldap/admin/src/scripts/ds_selinux_port_query

+ endif

+ if SYSTEMD

+ libexec_SCRIPTS += wrappers/ds_systemd_ask_password_acl

+ endif

  

  install-data-hook:

  	if [ "$(srcdir)" != "." ]; then cp -r $(srcdir)/src/cockpit src ; fi

@@ -755,10 +772,30 @@ 

  	mkdir -p $(DESTDIR)$(metainfodir)

  	rsync -up src/cockpit/389-console/org.port389.cockpit_console.metainfo.xml $(DESTDIR)$(metainfodir)/org.port389.cockpit_console.metainfo.xml

  

+ sbin_SCRIPTS =

  if ENABLE_PERL

- sbin_SCRIPTS = ldap/admin/src/scripts/setup-ds.pl \

+ sbin_SCRIPTS += ldap/admin/src/scripts/setup-ds.pl \

  	ldap/admin/src/scripts/migrate-ds.pl \

  	ldap/admin/src/scripts/remove-ds.pl \

+ 	ldap/admin/src/scripts/bak2db.pl \

+ 	ldap/admin/src/scripts/db2bak.pl \

+ 	ldap/admin/src/scripts/db2index.pl \

+ 	ldap/admin/src/scripts/db2ldif.pl \

+ 	ldap/admin/src/scripts/fixup-linkedattrs.pl \

+ 	ldap/admin/src/scripts/fixup-memberof.pl \

+ 	ldap/admin/src/scripts/cleanallruv.pl \

+ 	ldap/admin/src/scripts/ldif2db.pl \

+ 	ldap/admin/src/scripts/ns-accountstatus.pl \

+ 	ldap/admin/src/scripts/ns-activate.pl \

+ 	ldap/admin/src/scripts/ns-inactivate.pl \

+ 	ldap/admin/src/scripts/ns-newpwpolicy.pl \

+ 	ldap/admin/src/scripts/schema-reload.pl \

+ 	ldap/admin/src/scripts/syntax-validate.pl \

+ 	ldap/admin/src/scripts/usn-tombstone-cleanup.pl \

+ 	ldap/admin/src/scripts/verify-db.pl

+ endif

+ if ENABLE_LEGACY

+ sbin_SCRIPTS += \

  	ldap/admin/src/scripts/start-dirsrv \

  	ldap/admin/src/scripts/stop-dirsrv \

  	ldap/admin/src/scripts/restart-dirsrv \

@@ -776,35 +813,19 @@ 

  	ldap/admin/src/scripts/suffix2instance \

  	ldap/admin/src/scripts/upgradednformat \

  	ldap/admin/src/scripts/vlvindex \

- 	ldap/admin/src/scripts/bak2db.pl \

- 	ldap/admin/src/scripts/db2bak.pl \

- 	ldap/admin/src/scripts/db2index.pl \

- 	ldap/admin/src/scripts/db2ldif.pl \

- 	ldap/admin/src/scripts/fixup-linkedattrs.pl \

- 	ldap/admin/src/scripts/fixup-memberof.pl \

- 	ldap/admin/src/scripts/cleanallruv.pl \

- 	ldap/admin/src/scripts/ldif2db.pl \

- 	ldap/admin/src/scripts/ns-accountstatus.pl \

- 	ldap/admin/src/scripts/ns-activate.pl \

- 	ldap/admin/src/scripts/ns-inactivate.pl \

- 	ldap/admin/src/scripts/ns-newpwpolicy.pl \

- 	ldap/admin/src/scripts/schema-reload.pl \

- 	ldap/admin/src/scripts/syntax-validate.pl \

- 	ldap/admin/src/scripts/usn-tombstone-cleanup.pl \

- 	ldap/admin/src/scripts/verify-db.pl \

  	ldap/admin/src/scripts/dbverify \

  	ldap/admin/src/scripts/upgradedb \

  	ldap/admin/src/scripts/dbmon.sh

  endif

  

  bin_SCRIPTS = \

- 	wrappers/repl-monitor \

  	ldap/admin/src/scripts/readnsstate

  

  if ENABLE_PERL

  bin_SCRIPTS += ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \

  	wrappers/cl-dump \

  	ldap/admin/src/scripts/cl-dump.pl \

+ 	wrappers/repl-monitor \

  	ldap/admin/src/scripts/repl-monitor.pl

  endif

  

@@ -931,69 +952,74 @@ 

  # man pages

  #------------------------

  dist_man_MANS = man/man1/dbscan.1 \

-         man/man1/cl-dump.1 \

-         man/man1/cl-dump.pl.1 \

-         man/man1/dbgen.pl.1 \

-         man/man1/ds-logpipe.py.1 \

-         man/man1/ds-replcheck.1 \

-         man/man1/infadd.1 \

-         man/man1/ldap-agent.1 \

-         man/man1/ldclt.1 \

-         man/man1/ldif.1 \

-         man/man1/logconv.pl.1 \

-         man/man1/migratecred.1 \

-         man/man1/mmldif.1 \

-         man/man1/pwdhash.1 \

-         man/man1/repl-monitor.1 \

-         man/man1/repl-monitor.pl.1 \

-         man/man1/rsearch.1 \

-         man/man1/readnsstate.1 \

-         man/man5/99user.ldif.5 \

-         man/man8/migrate-ds.pl.8 \

-         man/man8/ns-slapd.8 \

-         man/man8/restart-dirsrv.8 \

-         man/man8/setup-ds.pl.8 \

-         man/man8/start-dirsrv.8 \

-         man/man8/stop-dirsrv.8 \

-         man/man8/status-dirsrv.8 \

-         man/man8/bak2db.8 \

-         man/man8/bak2db.pl.8 \

-         man/man5/certmap.conf.5 \

-         man/man8/cleanallruv.pl.8 \

-         man/man8/dbverify.8 \

-         man/man8/db2bak.8 \

-         man/man8/db2bak.pl.8 \

-         man/man8/db2ldif.8 \

-         man/man8/db2ldif.pl.8 \

-         man/man8/db2index.8 \

-         man/man8/db2index.pl.8 \

-         man/man8/fixup-linkedattrs.pl.8 \

-         man/man8/fixup-memberof.pl.8 \

-         man/man8/ldif2db.8 \

-         man/man8/ldif2db.pl.8 \

-         man/man8/dbmon.sh.8 \

-         man/man5/dirsrv.5 \

-         man/man5/dirsrv.systemd.5 \

-         man/man8/dn2rdn.8 \

-         man/man8/ldif2ldap.8 \

-         man/man8/monitor.8 \

-         man/man8/ns-accountstatus.pl.8 \

-         man/man8/ns-newpwpolicy.pl.8 \

-         man/man8/ns-activate.pl.8 \

-         man/man8/ns-inactivate.pl.8 \

-         man/man8/remove-ds.pl.8 \

-         man/man8/restoreconfig.8 \

-         man/man8/saveconfig.8 \

-         man/man8/schema-reload.pl.8 \

-         man/man5/slapd-collations.conf.5 \

-         man/man8/suffix2instance.8 \

-         man/man8/syntax-validate.pl.8 \

-         man/man5/template-initconfig.5 \

-         man/man8/upgradednformat.8 \

-         man/man8/upgradedb.8 \

-         man/man8/usn-tombstone-cleanup.pl.8 \

-         man/man8/vlvindex.8 \

-         man/man8/verify-db.pl.8

+ 	man/man1/ds-logpipe.py.1 \

+ 	man/man1/ds-replcheck.1 \

+ 	man/man1/ldap-agent.1 \

+ 	man/man1/ldclt.1 \

+ 	man/man1/logconv.pl.1 \

+ 	man/man1/pwdhash.1 \

+ 	man/man1/readnsstate.1 \

+ 	man/man5/99user.ldif.5 \

+ 	man/man8/ns-slapd.8 \

+ 	man/man5/certmap.conf.5 \

+ 	man/man5/dirsrv.5 \

+ 	man/man5/dirsrv.systemd.5 \

+ 	man/man5/slapd-collations.conf.5

+ if ENABLE_LEGACY

+ dist_man_MANS += \

+ 	man/man1/infadd.1 \

+ 	man/man1/ldif.1 \

+ 	man/man1/migratecred.1 \

+ 	man/man1/mmldif.1 \

+ 	man/man1/rsearch.1

+ endif

+ if ENABLE_PERL

+ dist_man_MANS += man/man1/cl-dump.1 \

+ 	man/man1/cl-dump.pl.1 \

+ 	man/man1/dbgen.pl.1 \

+ 	man/man1/repl-monitor.1 \

+ 	man/man1/repl-monitor.pl.1 \

+ 	man/man8/migrate-ds.pl.8 \

+ 	man/man8/restart-dirsrv.8 \

+ 	man/man8/setup-ds.pl.8 \

+ 	man/man8/start-dirsrv.8 \

+ 	man/man8/stop-dirsrv.8 \

+ 	man/man8/status-dirsrv.8 \

+ 	man/man8/bak2db.8 \

+ 	man/man8/bak2db.pl.8 \

+ 	man/man8/cleanallruv.pl.8 \

+ 	man/man8/dbverify.8 \

+ 	man/man8/db2bak.8 \

+ 	man/man8/db2bak.pl.8 \

+ 	man/man8/db2ldif.8 \

+ 	man/man8/db2ldif.pl.8 \

+ 	man/man8/db2index.8 \

+ 	man/man8/db2index.pl.8 \

+ 	man/man8/fixup-linkedattrs.pl.8 \

+ 	man/man8/fixup-memberof.pl.8 \

+ 	man/man8/ldif2db.8 \

+ 	man/man8/ldif2db.pl.8 \

+ 	man/man8/dbmon.sh.8 \

+ 	man/man8/dn2rdn.8 \

+ 	man/man8/ldif2ldap.8 \

+ 	man/man8/monitor.8 \

+ 	man/man8/ns-accountstatus.pl.8 \

+ 	man/man8/ns-newpwpolicy.pl.8 \

+ 	man/man8/ns-activate.pl.8 \

+ 	man/man8/ns-inactivate.pl.8 \

+ 	man/man8/remove-ds.pl.8 \

+ 	man/man8/restoreconfig.8 \

+ 	man/man8/saveconfig.8 \

+ 	man/man8/schema-reload.pl.8 \

+ 	man/man8/suffix2instance.8 \

+ 	man/man8/syntax-validate.pl.8 \

+ 	man/man8/upgradednformat.8 \

+ 	man/man8/upgradedb.8 \

+ 	man/man8/usn-tombstone-cleanup.pl.8 \

+ 	man/man8/vlvindex.8 \

+ 	man/man8/verify-db.pl.8 \

+ 	man/man5/template-initconfig.5

+ endif

  

  #------------------------

  # updates

file modified
+11 -1

@@ -204,8 +204,18 @@ 

  AM_CONDITIONAL(CLANG_ENABLE,test "$enable_clang" = "yes")

  

  

+ AC_MSG_CHECKING(for --enable-legacy)

+ AC_ARG_ENABLE(legacy, AS_HELP_STRING([--enable-legacy], [Enable deprecated legacy functionality (default: no)]),

+               [], [ enable_legacy=no ])

+ AC_MSG_RESULT($enable_legacy)

+ AC_SUBST([enable_legacy])

+ AM_CONDITIONAL(ENABLE_LEGACY,test "$enable_legacy" = "yes")

+ 

+ if test "$enable_legacy" = yes ; then

+   enable_perl=yes

+ fi

  AC_MSG_CHECKING(for --enable-perl)

- AC_ARG_ENABLE(perl, AS_HELP_STRING([--enable-perl], [Enable deprecated legacy perl and shell scripts (default: no)]),

+ AC_ARG_ENABLE(perl, AS_HELP_STRING([--enable-perl], [Enable deprecated legacy perl scripts (default: no)]),

                [], [ enable_perl=no ])

  AC_MSG_RESULT($enable_perl)

  AC_SUBST([enable_perl])

@@ -58,7 +58,7 @@ 

  

      ldif = '%s/dirsrv/data/Example.ldif' % topology_st.standalone.get_data_dir()

      import_ldif = topology_st.standalone.get_ldif_dir() + "/Example.ldif"

-     shutil.copyfile(ldif, import_ldif)

+     shutil.copy(ldif, import_ldif)

  

      import_task = ImportTask(topology_st.standalone)

      import_task.import_suffix_from_ldif(ldiffile=import_ldif, suffix=DEFAULT_SUFFIX)

file modified
+11 -12

@@ -26,7 +26,13 @@ 

  UBSAN_ON = 0

  

  RUST_ON = 0

+ 

+ # PERL_ON is deprecated and turns on the LEGACY_ON, this for not breaking people's workflows.

  PERL_ON = 1

+ LEGACY_ON = 0

+ ifeq ($(PERL_ON), 1)

+ 	LEGACY_ON = 1

+ endif

  

  clean:

  	rm -rf dist

@@ -89,7 +95,7 @@ 

  	-e s/__MSAN_ON__/$(MSAN_ON)/ \

  	-e s/__TSAN_ON__/$(TSAN_ON)/ \

  	-e s/__UBSAN_ON__/$(UBSAN_ON)/ \

- 	-e s/__PERL_ON__/$(PERL_ON)/ \

+ 	-e s/__LEGACY_ON__/$(LEGACY_ON)/ \

  	-e s/__CLANG_ON__/$(CLANG_ON)/ \

  	-e s/__BUNDLE_JEMALLOC__/$(BUNDLE_JEMALLOC)/ \

  	rpm/$(PACKAGE).spec.in > $(RPMBUILD)/SPECS/$(PACKAGE).spec

@@ -112,12 +118,11 @@ 

  	cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)*.src.rpm dist/srpms/

  	rm -rf $(RPMBUILD)

  

- patch_srpms: rpmroot srpmdistdir tarballs rpmbuildprep

+ patch: rpmroot

  	cp rpm/*.patch $(RPMBUILD)/SOURCES/

  	rpm/add_patches.sh rpm $(RPMBUILD)/SPECS/$(PACKAGE).spec

- 	rpmbuild --define "_topdir $(RPMBUILD)" -bs $(RPMBUILD)/SPECS/$(PACKAGE).spec

- 	cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)*.src.rpm dist/srpms/

- 	rm -rf $(RPMBUILD)

+ 

+ patch_srpms: | patch srpms

  

  rpms: rpmroot srpmdistdir rpmdistdir tarballs rpmbuildprep

  	rpmbuild --define "_topdir $(RPMBUILD)" -ba $(RPMBUILD)/SPECS/$(PACKAGE).spec

@@ -125,10 +130,4 @@ 

  	cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)*.src.rpm dist/srpms/

  	rm -rf $(RPMBUILD)

  

- patch_rpms: rpmroot srpmdistdir rpmdistdir tarballs rpmbuildprep

- 	cp rpm/*.patch $(RPMBUILD)/SOURCES/

- 	rpm/add_patches.sh rpm $(RPMBUILD)/SPECS/$(PACKAGE).spec

- 	rpmbuild --define "_topdir $(RPMBUILD)" -ba $(RPMBUILD)/SPECS/$(PACKAGE).spec

- 	cp $(RPMBUILD)/RPMS/*/*$(RPM_VERSION)$(RPM_VERSION_PREREL)*.rpm dist/rpms/

- 	cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)*.src.rpm dist/srpms/

- 	rm -rf $(RPMBUILD)

+ patch_rpms: | patch rpms

file modified
+48 -51

@@ -28,7 +28,7 @@ 

  # This enables rust in the build.

  %global use_rust __RUST_ON__

  

- %global use_perl __PERL_ON__

+ %global use_legacy __LEGACY_ON__

  

  %define nspr_version 4.6

  %define nss_version 3.11

@@ -229,12 +229,12 @@ 

  are used by the main package and the -devel package.  This allows the -devel

  package to be installed with just the -libs package and without the main package.

  

+ %if %{use_legacy}

  %package          legacy-tools

  Summary:          Legacy utilities for 389 Directory Server (%{variant})

  Group:            System Environment/Daemons

  Obsoletes:        %{name} <= 1.4.0.9

  Requires:         %{name} = %{version}-%{release}

- %if %{use_perl}

  # for setup-ds.pl to support ipv6

  %if %{use_Socket6}

  Requires:         perl-Socket6

@@ -249,13 +249,12 @@ 

  %global __provides_exclude_from %{_libdir}/%{pkgname}/perl

  %global __requires_exclude perl\\((DSCreate|DSMigration|DSUpdate|DSUtil|Dialog|DialogManager|FileConn|Inf|Migration|Resource|Setup|SetupLog)

  %{?perl_default_filter}

- %endif

- # End use perl

  

  %description      legacy-tools

  Legacy (and deprecated) utilities for 389 Directory Server. This includes

  the old account management and task scripts. These are deprecated in favour of

  the dscreate, dsctl, dsconf and dsidm tools.

+ %endif  # use_legacy

  

  %package          devel

  Summary:          Development libraries for 389 Directory Server (%{variant})

@@ -358,8 +357,10 @@ 

  RUST_FLAGS="--enable-rust"

  %endif

  

- %if !%{use_perl}

- PERL_FLAGS="--disable-perl"

+ %if %{use_legacy}

+ LEGACY_FLAGS="--enable-legacy --enable-perl"

+ %else

+ LEGACY_FLAGS="--disable-legacy --disable-perl"

  %endif

  

  %if %{bundle_jemalloc}

@@ -381,9 +382,8 @@ 

             --with-systemdsystemconfdir=%{_sysconfdir}/systemd/system \

             --with-systemdgroupname=%{groupname} \

             --libexecdir=%{_libexecdir}/%{pkgname} \

-            $ASAN_FLAGS $MSAN_FLAGS $TSAN_FLAGS $UBSAN_FLAGS $RUST_FLAGS $PERL_FLAGS $CLANG_FLAGS \

-            --enable-cmocka \

-            --enable-perl

+            $ASAN_FLAGS $MSAN_FLAGS $TSAN_FLAGS $UBSAN_FLAGS $RUST_FLAGS $CLANG_FLAGS $LEGACY_FLAGS\

+            --enable-cmocka

  

  %if 0%{?rhel} > 7 || 0%{?fedora}

  # lib389

@@ -441,7 +441,7 @@ 

  rm -f $RPM_BUILD_ROOT%{_libdir}/libsvrcore.la

  

  

- %if %{use_perl}

+ %if %{use_legacy}

  # make sure perl scripts have a proper shebang

  sed -i -e 's|#{{PERL-EXEC}}|#!/usr/bin/perl|' $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/script-templates/template-*.pl

  %endif

@@ -520,10 +520,9 @@ 

  %postun snmp

  %systemd_postun_with_restart %{pkgname}-snmp.service

  

+ %if %{use_legacy}

  %post legacy-tools

  

- 

- %if %{use_perl}

  # START UPGRADE SCRIPT

  

  if [ -n "$DEBUGPOSTTRANS" ] ; then

@@ -579,10 +578,11 @@ 

      /bin/systemctl start $inst >> $output 2>&1 || :

  done

  #END UPGRADE

- %endif

  

  exit 0

  

+ %endif  # use_legacy

+ 

  %files

  %if %{bundle_jemalloc}

  %doc LICENSE LICENSE.GPLv3+ LICENSE.openssl README.jemalloc

@@ -598,9 +598,6 @@ 

  %config(noreplace)%{_sysconfdir}/%{pkgname}/config/slapd-collations.conf

  %config(noreplace)%{_sysconfdir}/%{pkgname}/config/certmap.conf

  %{_datadir}/%{pkgname}

- %exclude %{_datadir}/%{pkgname}/script-templates

- %exclude %{_datadir}/%{pkgname}/updates

- %exclude %{_datadir}/%{pkgname}/properties/*.res

  %{_datadir}/gdb/auto-load/*

  %{_unitdir}

  %{_bindir}/dbscan

@@ -611,8 +608,6 @@ 

  %{_mandir}/man1/ds-logpipe.py.1.gz

  %{_bindir}/ldclt

  %{_mandir}/man1/ldclt.1.gz

- %{_sbindir}/ldif2ldap

- %{_mandir}/man8/ldif2ldap.8.gz

  %{_bindir}/logconv.pl

  %{_mandir}/man1/logconv.pl.1.gz

  %{_bindir}/pwdhash

@@ -624,30 +619,6 @@ 

  %{_sbindir}/ns-slapd

  %{_mandir}/man8/ns-slapd.8.gz

  %{_libexecdir}/%{pkgname}/ds_systemd_ask_password_acl

- %{_sbindir}/bak2db

- %{_mandir}/man8/bak2db.8.gz

- %{_sbindir}/db2bak

- %{_mandir}/man8/db2bak.8.gz

- %{_sbindir}/db2index

- %{_mandir}/man8/db2index.8.gz

- %{_sbindir}/db2ldif

- %{_mandir}/man8/db2ldif.8.gz

- %{_sbindir}/dbverify

- %{_mandir}/man8/dbverify.8.gz

- %{_sbindir}/ldif2db

- %{_mandir}/man8/ldif2db.8.gz

- %{_sbindir}/restart-dirsrv

- %{_mandir}/man8/restart-dirsrv.8.gz

- %{_sbindir}/start-dirsrv

- %{_mandir}/man8/start-dirsrv.8.gz

- %{_sbindir}/status-dirsrv

- %{_mandir}/man8/status-dirsrv.8.gz

- %{_sbindir}/stop-dirsrv

- %{_mandir}/man8/stop-dirsrv.8.gz

- %{_sbindir}/upgradedb

- %{_mandir}/man8/upgradedb.8.gz

- %{_sbindir}/vlvindex

- %{_mandir}/man8/vlvindex.8.gz

  %{_mandir}/man5/99user.ldif.5.gz

  %{_mandir}/man5/certmap.conf.5.gz

  %{_mandir}/man5/slapd-collations.conf.5.gz

@@ -705,6 +676,7 @@ 

  %{_libdir}/%{pkgname}/librsds.so

  %endif

  

+ %if %{use_legacy}

  %files legacy-tools

  %doc LICENSE LICENSE.GPLv3+ LICENSE.openssl README.devel

  %{_bindir}/infadd

@@ -717,6 +689,39 @@ 

  %{_mandir}/man1/mmldif.1.gz

  %{_bindir}/rsearch

  %{_mandir}/man1/rsearch.1.gz

+ %{_libexecdir}/%{pkgname}/ds_selinux_enabled

+ %{_libexecdir}/%{pkgname}/ds_selinux_port_query

+ %config(noreplace)%{_sysconfdir}/%{pkgname}/config/template-initconfig

+ %{_mandir}/man5/template-initconfig.5.gz

+ %{_datadir}/%{pkgname}/properties/*.res

+ %{_datadir}/%{pkgname}/script-templates

+ %{_datadir}/%{pkgname}/updates

+ %{_sbindir}/ldif2ldap

+ %{_mandir}/man8/ldif2ldap.8.gz

+ %{_sbindir}/bak2db

+ %{_mandir}/man8/bak2db.8.gz

+ %{_sbindir}/db2bak

+ %{_mandir}/man8/db2bak.8.gz

+ %{_sbindir}/db2index

+ %{_mandir}/man8/db2index.8.gz

+ %{_sbindir}/db2ldif

+ %{_mandir}/man8/db2ldif.8.gz

+ %{_sbindir}/dbverify

+ %{_mandir}/man8/dbverify.8.gz

+ %{_sbindir}/ldif2db

+ %{_mandir}/man8/ldif2db.8.gz

+ %{_sbindir}/restart-dirsrv

+ %{_mandir}/man8/restart-dirsrv.8.gz

+ %{_sbindir}/start-dirsrv

+ %{_mandir}/man8/start-dirsrv.8.gz

+ %{_sbindir}/status-dirsrv

+ %{_mandir}/man8/status-dirsrv.8.gz

+ %{_sbindir}/stop-dirsrv

+ %{_mandir}/man8/stop-dirsrv.8.gz

+ %{_sbindir}/upgradedb

+ %{_mandir}/man8/upgradedb.8.gz

+ %{_sbindir}/vlvindex

+ %{_mandir}/man8/vlvindex.8.gz

  %{_sbindir}/monitor

  %{_mandir}/man8/monitor.8.gz

  %{_sbindir}/dbmon.sh

@@ -731,14 +736,6 @@ 

  %{_mandir}/man8/suffix2instance.8.gz

  %{_sbindir}/upgradednformat

  %{_mandir}/man8/upgradednformat.8.gz

- %{_libexecdir}/%{pkgname}/ds_selinux_enabled

- %{_libexecdir}/%{pkgname}/ds_selinux_port_query

- %if %{use_perl}

- %config(noreplace)%{_sysconfdir}/%{pkgname}/config/template-initconfig

- %{_mandir}/man5/template-initconfig.5.gz

- %{_datadir}/%{pkgname}/properties/*.res

- %{_datadir}/%{pkgname}/script-templates

- %{_datadir}/%{pkgname}/updates

  %{_mandir}/man1/dbgen.pl.1.gz

  %{_bindir}/repl-monitor

  %{_mandir}/man1/repl-monitor.1.gz

@@ -788,7 +785,7 @@ 

  %{_sbindir}/verify-db.pl

  %{_mandir}/man8/verify-db.pl.8.gz

  %{_libdir}/%{pkgname}/perl

- %endif

+ %endif  # use_legacy

  

  %files snmp

  %doc LICENSE LICENSE.GPLv3+ LICENSE.openssl README.devel

Bug Description: Setting PERL_ON=0 in 389-ds-base.spec.in still builds with Perl
due to the fix in PR #50200.

Fix Description: Implement changes as discussed after merging PR #50200, that is
changing logic for the use_perl conditional and removing --enable-perl that
overridden everything.

Additionally, some changes need to be made to which files are being installed
when building with/without Perl.

Relates https://pagure.io/389-ds-base/issue/50199
Relates https://pagure.io/389-ds-base/pull-request/50200

Author: Matus Honek mhonek@redhat.com

Review by: ???

start-dirsrv, db2ldif, etc, these scripts do not use perl, they are shell scripts.

These are shell scripts, why are they under "if perl"?

Because they aren't needed with lib389, and we shouldn't be maintaining them any longer? I think that's why I included them in the exclusion.

Thanks William for reminding me, first I thought I went nuts back then. Yeah, the problem is we don't have a concept of "legacy-tools" in the build system, only in the SPEC file. However, once you build something you should also install it in the SPEC file (yeah, you could just remove these after building but that ain't much transparent given SPEC build should be as close to pure build as possible).

So a question might be: Do we want to introduce the concept of "legacy-tools" into the build system?

It might be a nicer line than perl vs lib389, because really it's legacy (perl + sh) vs lib389. But I wish william of the past had of thought about this better and made it --disable-legacy instead of --disable-perl.

So my issue is that we already have the legacy tool subpackage, then inside of the legacy tools we differentiate the perl scripts. So it's already mismatched IMO. So what do we need a "if perl" check for? It should be legacy tools or no legacy tools, right?

So my issue is that we already have the legacy tool subpackage, then inside of the legacy tools we differentiate the perl scripts. [...]

I agree. I just dealt with whatever was present at the time.

[...] So it's already mismatched IMO. So what do we need a "if perl" check for? It should be legacy tools or no legacy tools, right?

I think so. Would it hurt/make sense, if we made the --disable-perl be an alias for a new --disable-legacy (just for the backwards compatibility I mean). The --disable-perl wouldn't affect just the Perl tools but it still might be an acceptable compromise. What do you think?

So my issue is that we already have the legacy tool subpackage, then inside of the legacy tools we differentiate the perl scripts. [...]

I agree. I just dealt with whatever was present at the time.

Understood, I am not criticising what you did. It's just this "if perl" is confusing for everyone :-)

[...] So it's already mismatched IMO. So what do we need a "if perl" check for? It should be legacy tools or no legacy tools, right?

I think so. Would it hurt/make sense, if we made the --disable-perl be an alias for a new --disable-legacy (just for the backwards compatibility I mean). The --disable-perl wouldn't affect just the Perl tools but it still might be an acceptable compromise. What do you think?

Well, why don't we just remove the subpackage when we are ready to finally remove it? Why do we even need a flag? I get that right now it's broken, but I don't really see the purpose/need of it anyway. Thoughts?

Well, why don't we just remove the subpackage when we are ready to finally remove it? Why do we even need a flag? I get that right now it's broken, but I don't really see the purpose/need of it anyway. Thoughts?

I understand the desire to kill it with fire, but I think we need to have an option (disabled by default) to build with the subpackage for some foreseeable future. At least during RHDS 11.0 -> 11.1 cycle. We haven't got any feedback from customers (because RHDS 11.0 is not out yet), so we can't be over confident with the removal of the legacy tools. We need to have a smooth migration path not only for customers but for us too: we need to make sure that our tooling and automation works without legacy tools, and if not, have a kill switch to bring these tools back.

How about we have a --disable-scripts flag, and we can manage it that way? SUSE is a bit less hand tied here as we only just introduced 389, so we have shipped with --disable-perl meaning "disable legacy", but I tottaly get your support needs.

Then you can move the sh tools to that legacy pkg and remove it for a future release?

Well, why don't we just remove the subpackage when we are ready to finally remove it? Why do we even need a flag? I get that right now it's broken, but I don't really see the purpose/need of it anyway. Thoughts?

I understand the desire to kill it with fire, but I think we need to have an option (disabled by default) to build with the subpackage for some foreseeable future. At least during RHDS 11.0 -> 11.1 cycle. We haven't got any feedback from customers (because RHDS 11.0 is not out yet), so we can't be over confident with the removal of the legacy tools. We need to have a smooth migration path not only for customers but for us too: we need to make sure that our tooling and automation works without legacy tools, and if not, have a kill switch to bring these tools back.

I'm not saying we need to remove the subpackage yet (nor am I in a rush to do so), but I don't see why just removing the perl scripts from the legacy tools serves a purpose. That's all I was trying to say.

So I guess, what's actionable here? What state do we want this to look like?

So, the basic point we agreed upon is having a flag in the configure.ac that will allow/disallow legacy tools altogether. I'd call it --enable-legacy if no one objects. For the sake of backwards compatibility I would keep the --enable-perl which would comprise the actual Perl tools and which would be automatically disabled once one disables the legacy tools. I'm currently shuffling the lines within the files to meet this logic. Once we sufficiently tested with --disable-legacy and are confident with actual removal implications, we can just remove the respective conditional sections.

Seems reasonable to me :)

@mhonek any update? This should not be taking this long. Can you please rebase the PR so we can see where you are at and help you?

rebased onto 00ce9bbacda6e32c9550a27f26615bcc45e59a71

3 months ago

I've rebased (since there is no point in comparing with the previous patch) to. Please, look if it makes sense. And sorry for the delays...

It all looks good to me, can you check that defaults.inf that is emitted by default still has "Perl_enabled = no" and with legacy_on is "perl_enabled = yes"? This will affect lib389/tests for qe (and especially rh).

It all looks good to me, can you check that defaults.inf that is emitted by default still has "Perl_enabled = no" and with legacy_on is "perl_enabled = yes"? This will affect lib389/tests for qe (and especially rh).

LGTM as well (taking into account @firstyear's comment)

rebased onto f701d18

3 months ago

The perl_enabled option is generated as expected. Thanks for the review guys.

Pull-Request has been merged by mhonek

3 months ago