[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] docdir
From: |
Jean Delvare |
Subject: |
[Quilt-dev] docdir |
Date: |
Wed, 7 Dec 2011 12:09:24 +0100 |
User-agent: |
KMail/1.12.4 (Linux/2.6.32.46-0.3-pae; KDE/4.3.5; i686; ; ) |
Hi all,
I would like to fix an issue with docdir when building/installing quilt,
and am seeking for opinions and comments.
Initially my problem is that quilt doesn't install its documentation
where I (Suse packager) would like it to, and it won't let me change it
through configure options, so I have to patch Makefile.in when building
the package. This has a maintenance cost I'd like to get rid of. The
cause of the problem is that
$(docdir)/$(PACKAGE)-$(VERSION)
is being hard-coded 6 times in Makefile.in, so you have to change it
that many times if you want a different location. And I do want to
change it because the standard path for documentation files on Suse (and
Debian, FWIW) is /usr/share/doc/$(PACKAGE) and not
/usr/share/doc/$(PACKAGE)-$(VERSION) [1].
While trying to solve this first problem, I noticed two additional
problems, which are related so I believe that all three problems should
be solved at once.
Problem #2 is that ./configure --help says:
--docdir=DIR documentation root [DATAROOTDIR/doc/quilt]
but the default value of $(docdir) is actually set to $(datadir)/doc
later in the configure script. This is both misleading and a lack of
flexibility (back to problem #1).
Problem #3 is that ./configure also looks at $RPM_DOC_DIR and uses that
as the default value for $(docdir) if defined. It seems wrong to me that
an upstream source package should care about package management specific
things. Even though I know rpm is part of the LSB, it would seem more
logical to me that the quilt.spec file of an rpm-based distribution
would call ./configure --docdir=${RPM_DOC_DIR}/quilt if needed (which is
currently not possible due to the Makefile.in implementation, see
problem #1), and the configure script itself wouldn't contain references
to rpm. As a matter of fact, I couldn't find any other configure script
which looks at $RPM_DOC_DIR, and I'm not quite sure why quilt would be
different in this respect.
Andreas, according to git blame, you did add this part of configure.ac:
dnl Determine where package documentation is supposed to go
if test -n "$RPM_DOC_DIR" ; then
docdir="$RPM_DOC_DIR"
else
docdir='$(datadir)/doc'
fi
The commit message did not really enlighten me. Can you please explain
what problem you were trying to solve? I'd like to get rid of the above,
as doing so (plus other adjustments) solves all 3 problems.
[1] As far as I can see, the naming scheme used by Suse and Debian is
also what autoconf-generated configure scripts use by default, which
makes it a de-facto standard IMHO.
The patch I have in mind goes along these lines:
---
Makefile.in | 13 +++++++------
configure.ac | 7 +------
2 files changed, 8 insertions(+), 12 deletions(-)
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,7 @@
PACKAGE := @PACKAGE_NAME@
VERSION := @PACKAGE_VERSION@
RELEASE := @PACKAGE_RELEASE@
+PACKAGE_TARNAME := @PACKAGE_TARNAME@
PACKAGE_BUGREPORT := @PACKAGE_BUGREPORT@
prefix := @prefix@
@@ -213,7 +214,7 @@ doc/quilt.1: doc/quilt.1.in $(QUILT:%=qu
;; \
address@hidden@*) \
echo "$$line" | \
- $(SED) -e 's:@DOCSUBDIR''@:$(docdir)/$(PACKAGE)-$(VERSION):g' \
+ $(SED) -e 's:@DOCSUBDIR''@:$(docdir):g' \
;; \
*) \
echo "$$line" \
@@ -272,7 +273,7 @@ $(patsubst %.in,%,$(wildcard bin/*.in qu
-e 's:@RELEASE''@:$(RELEASE):g' \
-e 's:@ETCDIR''@:$(etcdir):g' \
-e 's:@LOCALEDIR''@:$(localedir):g' \
- -e 's:@DOCSUBDIR''@:$(docdir)/$(PACKAGE)-$(VERSION):g' \
+ -e 's:@DOCSUBDIR''@:$(docdir):g' \
$< > $@
@$(if $(filter-out $<,$(NON_EXEC_IN)),chmod +x $@)
@@ -331,11 +332,11 @@ endif
$(INSTALL) -d $(BUILD_ROOT)$(libdir)/$(PACKAGE)
$(INSTALL) -m 755 $(LIB:%=lib/%) $(BUILD_ROOT)$(libdir)/$(PACKAGE)/
- $(INSTALL) -d $(BUILD_ROOT)$(docdir)/$(PACKAGE)-$(VERSION)/
+ $(INSTALL) -d $(BUILD_ROOT)$(docdir)/
$(INSTALL) -m 644 doc/README \
- $(BUILD_ROOT)$(docdir)/$(PACKAGE)-$(VERSION)/
+ $(BUILD_ROOT)$(docdir)/
$(INSTALL) -m 644 doc/quilt.pdf doc/README.MAIL \
- $(BUILD_ROOT)$(docdir)/$(PACKAGE)-$(VERSION)/
+ $(BUILD_ROOT)$(docdir)/
$(INSTALL) -d $(BUILD_ROOT)$(mandir)/man1
$(INSTALL) -m 644 $(MAN1) $(BUILD_ROOT)$(mandir)/man1/
@@ -373,7 +374,7 @@ uninstall ::
$(notdir $(MAN1))) \
$(BUILD_ROOT)$(etcdir)/bash_completion.d/quilt \
$(BUILD_ROOT)$(etcdir)/quilt.quiltrc \
- $(BUILD_ROOT)$(docdir)/$(PACKAGE)-$(VERSION)/ \
+ $(BUILD_ROOT)$(docdir)/ \
$(BUILD_ROOT)$(emacsdir)/quilt.el
check: $(TESTS:test/%.test=test/.%.ok)
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,7 @@ AC_REVISION ($Revision: 1.84 $)
PACKAGE_RELEASE=1
AC_SUBST(PACKAGE_RELEASE)
+AC_SUBST(PACKAGE_TARNAME)
dnl Setup for backup-files compilation
AC_HEADER_STDC
@@ -370,12 +371,6 @@ if test $USE_NLS = no ; then
fi
AC_SUBST(USE_NLS)
-dnl Determine where package documentation is supposed to go
-if test -n "$RPM_DOC_DIR" ; then
- docdir="$RPM_DOC_DIR"
-else
- docdir='$(datadir)/doc'
-fi
AC_SUBST(docdir)
dnl Check for rpmbuild (v4) vs. rpm (v3)
Comments welcome.
--
Jean Delvare
Suse L3
- [Quilt-dev] docdir,
Jean Delvare <=