Bug 212098 - Use autoconf to generate task perl script templates
Use autoconf to generate task perl script templates
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Command Line Utilities (Show other bugs)
1.0.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Noriko Hosoi
Viktor Ashirov
:
Depends On:
Blocks: 152373 240316
  Show dependency treegraph
 
Reported: 2006-10-24 20:29 EDT by Noriko Hosoi
Modified: 2015-12-07 11:51 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 11:51:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
cvs diffs configure.ac m4/{db.m4,mozldap.m4} (2.97 KB, patch)
2006-10-25 14:08 EDT, Noriko Hosoi
no flags Details | Diff
diffs between template-*.pl and template-*.pl.in files (11.40 KB, text/plain)
2006-10-25 14:19 EDT, Noriko Hosoi
no flags Details
cvs diffs (ldapserver - revised) (2.90 KB, patch)
2006-10-25 16:28 EDT, Noriko Hosoi
no flags Details | Diff
cvs commit message (6.14 KB, text/plain)
2006-10-25 16:39 EDT, Noriko Hosoi
no flags Details
cvs diff configure.ac Makefile.am (2.42 KB, patch)
2006-10-25 18:34 EDT, Noriko Hosoi
no flags Details | Diff
cvs diffs (ldapserver) (32.94 KB, patch)
2006-10-26 02:37 EDT, Noriko Hosoi
no flags Details | Diff
.in files for the server shell scripts (11.14 KB, text/plain)
2006-10-26 02:52 EDT, Noriko Hosoi
no flags Details
cvs diff Makefile.am (3.02 KB, patch)
2006-10-26 13:33 EDT, Noriko Hosoi
no flags Details | Diff
cvs commit message (5.61 KB, text/plain)
2006-10-26 13:48 EDT, Noriko Hosoi
no flags Details
cvs diff branding/{fedora,rhds}/brandver.dat (3.58 KB, patch)
2006-10-26 14:15 EDT, Noriko Hosoi
no flags Details | Diff
sample install info file (1.06 KB, text/plain)
2006-10-26 14:25 EDT, Noriko Hosoi
no flags Details
cvs commit message ({fedora,rhds}/brandver.dat) (616 bytes, text/plain)
2006-10-26 16:16 EDT, Noriko Hosoi
no flags Details

  None (edit)
Description Noriko Hosoi 2006-10-24 20:29:38 EDT
Description of problem:
Instead of hardcoding the paths of mozldap, libdb, dirsec libs and tools, set
them via autoconf.
Comment 1 Noriko Hosoi 2006-10-25 14:08:37 EDT
Created attachment 139372 [details]
cvs diffs configure.ac m4/{db.m4,mozldap.m4}

Files:
 configure.ac
 m4/db.m4
 m4/mozldap.m4

Changes:
1) added template files to AC_CONFIG_FILES list
2) added db_bindir and ldapsdk_bindir to pass their tools path to the template
files.	The paths are hardcoded for now.

Notes:
1. The templates' in files are being added in the next attachment.
2. The template files are not "installed" now.
Comment 2 Noriko Hosoi 2006-10-25 14:19:18 EDT
Created attachment 139374 [details]
diffs between template-*.pl and template-*.pl.in files

Files:
template-bak2db.pl.in		 template-ns-activate.pl.in
template-cl-dump.pl.in* 	 template-ns-inactivate.pl.in
template-db2bak.pl.in		 template-ns-newpwpolicy.pl.in*
template-db2index.pl.in 	 template-repl-monitor-cgi.pl.in*
template-db2ldif.pl.in		 template-repl-monitor.pl.in*
template-ldif2db.pl.in		 template-verify-db.pl.in
template-ns-accountstatus.pl.in

Description:
Since only the paths are replaced by autoconf, attaching just the diff output.
Comment 3 Rich Megginson 2006-10-25 14:45:17 EDT
Ok.
Comment 4 Nathan Kinder 2006-10-25 15:11:35 EDT
Looks good.
Comment 5 Noriko Hosoi 2006-10-25 16:28:47 EDT
Created attachment 139403 [details]
cvs diffs (ldapserver - revised)

I removed template-dsml-active.pl from configure.ac, which does not have any
substitution (and more likely, ldapserver does not have to install the script?)

+AC_CONFIG_FILES([ldap/admin/src/scripts/template-dsml-activate.pl])
Comment 6 Noriko Hosoi 2006-10-25 16:39:54 EDT
Created attachment 139406 [details]
cvs commit message

Reviewed by Rich and Nathan (Thank you!!)

Checked in into HEAD.
Comment 7 Noriko Hosoi 2006-10-25 18:34:49 EDT
Created attachment 139419 [details]
cvs diff configure.ac Makefile.am

Files:
  configure.ac
  MAkefile.am

Changes;
1) added task perl script templates to "install" at
@sysconfdir@@scripttemplatedir@ to Makefile.am
2) added scripttemplatedir = /fedora-ds/script-templates to configure.ac

Question: changing these files, Makefile.in and configure are also updated.  Am
I supposed to check them in?
M Makefile.am
M Makefile.in
M configure
M configure.ac
Comment 8 Nathan Kinder 2006-10-25 19:02:46 EDT
There are a few things that need to be changed.

We should not be installing the "template-*.pl" files from "$(srcdir)" in
Makefile.am.  The files that configure generates from the "template-*.in" fiels
will be generated in the build area, not the source area (unless you are
building directly from the ldapserver directory).  You should just remove
"$(srcdir)/" from the list of files specified in the "task_SCRIPTS" variable. 
We should also remove the old "template-*.pl" files from the source tree as soon
as we stop building with the old Makefiles.

As for your question about Makefile.in and configure, you should check them in.
 I usually don't send them out for review as the diffs for them are always huge
whenever they are regenerated.
Comment 9 Rich Megginson 2006-10-25 22:32:51 EDT
When you change configure.ac, Makefile.am, or one of the .m4 files, you should run
autoreconf -vfi
in the ldapserver directory to make sure all of the files are generated
properly.  Then check in those files, plus Makefile.in and configure (and
possibly aclocal.m4).  You may have to use cvs checkin -f to force a file to be
committed if all autoreconf did was to change the file's timestamp.
Comment 10 Noriko Hosoi 2006-10-26 02:37:36 EDT
Created attachment 139439 [details]
cvs diffs (ldapserver)

Files:
 Makefile.am
 configure.ac
 ldap/admin/src/create_instance.c
 ldap/admin/src/scripts/template-verify-db.pl.in
 (diffs are not attached)
 Makefile.in
 configure

Changes:
1) removed $(srcdir)/ as Nathan pointed out in the Comment #8.
2) autotoolized the shell-based scripts in the instance directory (e.g.,
start-slapd).  This was needed since dirsec and mozldap libraries are not in
the same directory or in the rpath any more. (attaching the *.in files next) fi

3) fixed a typo (found .o in the source list)

I could launch the server on my RHEL4 box!
$ perl usr/lib/fedora-ds/ds_newinst.pl	/tmp/install.inf 
Success!  Your new directory server instance was created


We should not be installing the "template-*.pl" files from "$(srcdir)" in
Makefile.am.  The files that configure generates from the "template-*.in" fiels

will be generated in the build area, not the source area (unless you are
building directly from the ldapserver directory).  You should just remove
"$(srcdir)/" from the list of files specified in the "task_SCRIPTS" variable.
Comment 11 Noriko Hosoi 2006-10-26 02:52:44 EDT
Created attachment 139440 [details]
.in files for the server shell scripts

New Files:
template-bak2db.in
template-db2bak.in
template-db2index.in
template-db2ldif.in
template-ldif2db.in
template-ldif2ldap.in
template-monitor.in
template-restoreconfig.in
template-saveconfig.in
template-start-slapd.in
template-stop-slapd.in
template-suffix2instance.in
template-upgradedb.in
template-vlvindex.in

Changes:
. set dirsec library paths in the shell scripts.
Comment 12 Rich Megginson 2006-10-26 10:35:29 EDT
Ok.
Comment 13 Nathan Kinder 2006-10-26 11:44:03 EDT
Looks good, but you don't need to define "newinstdir" in Makefile.am since it's
the same as "serverdir".  You can just add "ds_newinst.pl" to "server_SCRIPTS"
instead.
Comment 14 Noriko Hosoi 2006-10-26 13:33:25 EDT
Created attachment 139492 [details]
cvs diff Makefile.am

Changed ds_newinst.pl install directory to use serverdir as Nathan pointed out
in the review.

> but you don't need to define "newinstdir" in Makefile.am since it's
the same as "serverdir".  You can just add "ds_newinst.pl" to "server_SCRIPTS"
instead.
Comment 15 Noriko Hosoi 2006-10-26 13:48:18 EDT
Created attachment 139494 [details]
cvs commit message

Reviewed by Rich and Nathan (Thank you!!)

Checked in into HEAD.
Comment 16 Noriko Hosoi 2006-10-26 14:15:56 EDT
Created attachment 139497 [details]
cvs diff branding/{fedora,rhds}/brandver.dat

Files:
  branding/fedora/brandver.dat
  branding/rhds/brandver.dat

Changes:
1) added configure.ac
2) commented out *.spec (branding script fails)
Comment 17 Noriko Hosoi 2006-10-26 14:25:23 EDT
Created attachment 139498 [details]
sample install info file

Basically, I'm using the same info file generated by setup except one line in
[General]
prefix=  /export/servers/ds72_core

If prefix and ServerRoot do not exist, new instance is created from root. 
(that is, /usr/lib/<brand>-ds/slapd-<id>.)
Comment 18 Noriko Hosoi 2006-10-26 16:16:39 EDT
Created attachment 139523 [details]
cvs commit message ({fedora,rhds}/brandver.dat)

Reviewed by Nathan (Thank you!!)

Checked in into HEAD
Comment 19 Noriko Hosoi 2007-11-29 17:39:13 EST
Checked source tree/location:
$ pwd
/share/dev4/ds/ds80/builds/20071129.1/earthquake_rhel4/ldapserver/ldap/admin/src/scripts

In the directory, there is only one template perl script which is not processed
by autoconf, but the script is not supported on 8.0 (DSML related).
$ ls template*.pl
template-dsml-activate.pl

I.e., verified.

Related bug:
Summary: clean up template-scriptname which is derived from template-scriptname.in
https://bugzilla.redhat.com/show_bug.cgi?id=229576 

Note You need to log in before you can comment on or make changes to this bug.