[MPlayer-dev-eng] [PATCH] Installing docs/manpage during make

sr seru at gmx.net
Sun Jan 5 01:06:24 CET 2003


El sáb, 04 de ene de 2003, a las 10:15:32 +0100, Arpi dijo:
> Hi,
> 
> > El sáb, 04 de ene de 2003, a las 05:55:08 +0100, sr dijo:
> > > Updated the patch so it can be applied to current cvs and did some further fixes.
> > That one was broken because I used an also broken patch to apply original changes. 
> > Anyways, here's a fixed, double-checked one :)
> > 
> > One question though: shouldn't the manpages be gzipped? something like 'gzip -9c mplayer.1 > mplayer.1.gz' during make install.
> > 
> > I hope you'll finally apply the patch now :)
> 
> maybe if you coudl tell what the patch does...
duh :) installs html docs, tech docs, README, ChangeLog, AUTHORS  to PREFIX/doc/mplayer
in addition installs english man page to PREFIX/man/man1 and translated manpages to PREFIX/{de,fr,zn_CN,...}/man/man1
> 
> >  if x86 ; then
> > @@ -1558,7 +1567,6 @@
> >  fi
> >  echores "$_i18n"
> >  
> > -
> >  # Checking for setlocale() ...
> >  # CSAK EGY MARADHAT - A HEGYLAKO
> >  # Nemnem. a TV Maci !
> > @@ -1578,7 +1586,6 @@
> >  fi
> >  echores "$_setlocale"
> >  
> > -
> >  echocheck "language"
> >  test -z "$LINGUAS" && LINGUAS="en"
> >  if test -f "help/help_mp-${LINGUAS}.h" ; then
> 
> please avoid useless cosmetics
sorry, fixed that in attached patch
> 
> > @@ -1590,6 +1597,45 @@
> >  _mp_help="help/help_mp-${LINGUAS}.h"
> >  test -f $_mp_help || die "$_mp_help not found"
> >  
> > +echocheck "html docs"
> > +test -z "$DOCS_INSTALL" && DOCS_INSTALL=$DOCS_LANGUAGES_DEFAULT
> > +if test "`echo $DOCS_INSTALL | grep zh_CN`" ; then
> > + _install_docs_cn=yes
> > +else
> > + _install_docs_cn=no
> > +fi
> > +if test "`echo $DOCS_INSTALL | grep en`" ; then
> > + _install_docs_en=yes
> > +else
> > + _install_docs_en=no
> > +fi
> > +if test "`echo $DOCS_INSTALL | grep de`" ; then
> > + _install_docs_de=yes
> > +else
> > + _install_docs_de=no
> > +fi
> > +if test "`echo $DOCS_INSTALL | grep fr`" ; then
> > + _install_docs_fr=yes
> > +else
> > + _install_docs_rf=no
> > +fi
> > +if test "`echo $DOCS_INSTALL | grep hu`" ; then
> > + _install_docs_hu=yes
> > +else
> > + _install_docs_hu=no
> > +fi
> > +if test "`echo $DOCS_INSTALL | grep it`" ; then
> > + _install_docs_it=yes
> > +else
> > + _install_docs_it=no
> > +fi
> > +if test "`echo $DOCS_INSTALL | grep pl`" ; then
> > + _install_docs_pl=yes
> > +else
> > + _install_docs_pl=no
> > +fi
> > +echores "using ${DOCS_INSTALL}"
> > +
> 
> WTF is this?
> why don't you parse out the list, instead of adding 5 lines per language
> here and half page per language in makefile?
Have a look at the new patch I attached, configure surely looks better,
but i'm too stupid to shorten up the Makefile (really)
Makefile programming is even worse than MS Basic
> 
> there must be a more elegant/shorter/optimal/cleverer solution.
any suggestions??? maybe you could have a quick look at it?
> 
> 
> A'rpi / Astral & ESP-team
> 
> --
> Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.241
diff -u -r1.241 Makefile
--- Makefile	27 Dec 2002 16:02:44 -0000	1.241
+++ Makefile	5 Jan 2003 00:08:05 -0000
@@ -246,43 +246,121 @@
 ifeq ($(SHARED_PP),yes)
 	$(MAKE) install -C postproc 
 endif
-	if test ! -d $(BINDIR) ; then mkdir -p $(BINDIR) ; fi
+# Install binary
+	$(INSTALL) -m 755 -d $(BINDIR)
 	$(INSTALL) -m 755 $(INSTALLSTRIP) $(PRG) $(BINDIR)/$(PRG)
+ifeq ($(MENCODER),yes)
+	$(INSTALL) -m 755 $(INSTALLSTRIP) $(PRG_MENCODER) $(BINDIR)/$(PRG_MENCODER)
+endif
 ifeq ($(GUI),yes)
 	-ln -sf $(PRG) $(BINDIR)/gmplayer
 endif
-	if test ! -d $(MANDIR)/man1 ; then mkdir -p $(MANDIR)/man1; fi
+# Install manpages
+	$(INSTALL) -m 755 -d $(MANDIR)/de
+	$(INSTALL) -m 755 -d $(MANDIR)/fr
+	$(INSTALL) -m 755 -d $(MANDIR)/pl
+	$(INSTALL) -m 755 -d $(MANDIR)/hu
+	$(INSTALL) -m 755 -d $(MANDIR)/man1
+	$(INSTALL) -m 755 -d $(MANDIR)/de/man1
+	$(INSTALL) -m 755 -d $(MANDIR)/fr/man1
+	$(INSTALL) -m 755 -d $(MANDIR)/hu/man1
+	$(INSTALL) -m 755 -d $(MANDIR)/pl/man1
 	$(INSTALL) -c -m 644 DOCS/mplayer.1 $(MANDIR)/man1/mplayer.1
-ifeq ($(MENCODER),yes)
-	$(INSTALL) -m 755 $(INSTALLSTRIP) $(PRG_MENCODER) $(BINDIR)/$(PRG_MENCODER)
-	-ln -sf mplayer.1 $(MANDIR)/man1/mencoder.1
-endif
-	@if test ! -d $(DATADIR) ; then mkdir -p $(DATADIR) ; fi
-	@if test ! -d $(DATADIR)/font ; then mkdir -p $(DATADIR)/font ; fi
+	$(INSTALL) -c -m 644 DOCS/German/mplayer.1 $(MANDIR)/de/man1/mplayer.1
+	$(INSTALL) -c -m 644 DOCS/French/mplayer.1 $(MANDIR)/fr/man1/mplayer.1
+	$(INSTALL) -c -m 644 DOCS/Hungarian/mplayer.1 $(MANDIR)/hu/man1/mplayer.1
+	$(INSTALL) -c -m 644 DOCS/Polish/mplayer.1 $(MANDIR)/pl/man1/mplayer.1
+	@echo ".so mplayer.1" > DOCS/mencoder.1
+	$(INSTALL) -c -m 644 DOCS/mencoder.1 $(MANDIR)/man1
+	$(INSTALL) -c -m 644 DOCS/mencoder.1 $(MANDIR)/de/man1
+	$(INSTALL) -c -m 644 DOCS/mencoder.1 $(MANDIR)/fr/man1
+	$(INSTALL) -c -m 644 DOCS/mencoder.1 $(MANDIR)/hu/man1
+	$(INSTALL) -c -m 644 DOCS/mencoder.1 $(MANDIR)/pl/man1
+# Install README, AUTHORS, ChangeLog, html and tech docs
+	$(INSTALL) -m 755 -d $(DOCSDIR)
+	$(INSTALL) -c -m 644 README $(DOCSDIR)
+	$(INSTALL) -c -m 644 AUTHORS $(DOCSDIR)
+	$(INSTALL) -c -m 644 ChangeLog $(DOCSDIR)
+ifeq ($(INSTALL_DOCS_EN),yes)
+	@for docs in DOCS/*.html; do \
+		$(INSTALL) -m 644 $$docs $(DOCSDIR); \
+	done  
+endif
+ifeq ($(INSTALL_DOCS_CN),yes)
+	$(INSTALL) -m 755 -d $(DOCSDIR)/Chinese
+	@for docs in DOCS/Chinese/*.html; do \
+		$(INSTALL) -m 644 $$docs $(DOCSDIR)/Chinese; \
+	done
+endif
+ifeq ($(INSTALL_DOCS_DE),yes)
+	$(INSTALL) -m 755 -d $(DOCSDIR)/German
+	@for docs in DOCS/German/*.html; do \
+		$(INSTALL) -m 644 $$docs $(DOCSDIR)/German; \
+	done
+endif
+ifeq ($(INSTALL_DOCS_FR),yes)
+	$(INSTALL) -m 755 -d $(DOCSDIR)/French
+	@for docs in DOCS/French/*.html; do \
+	$(INSTALL) -m 644 $$docs $(DOCSDIR)/French; \
+	done
+endif
+ifeq ($(INSTALL_DOCS_HU),yes)
+	$(INSTALL) -m 755 -d $(DOCSDIR)/Hungarian
+	@for docs in DOCS/Hungarian/*.html; do \
+		$(INSTALL) -m 644 $$docs $(DOCSDIR)/Hungarian; \
+	done
+endif
+ifeq ($(INSTALL_DOCS_IT),yes)
+	$(INSTALL) -m 755 -d $(DOCSDIR)/Italian
+	@for docs in DOCS/Italian/*.html; do \
+		$(INSTALL) -m 644 $$docs $(DOCSDIR)/Italian; \
+	done
+endif
+ifeq ($(INSTALL_DOCS_PL),yes)
+	$(INSTALL) -m 755 -d $(DOCSDIR)/Polish
+	@for docs in DOCS/Polish/*.html; do \
+		$(INSTALL) -m 644 $$docs $(DOCSDIR)/Polish; \
+	done
+endif
+	$(INSTALL) -m 755 -d $(DOCSDIR)/tech
+	$(INSTALL) -m 755 -d $(DOCSDIR)/tech/realcodecs
+	@for techdocs in `find DOCS/tech/ -type f -maxdepth 1`; do \
+		$(INSTALL) -m 644 $$techdocs $(DOCSDIR)/tech; \
+	done
+	@for realcodecs in `find DOCS/tech/realcodecs -type f -maxdepth 1`; do \
+               $(INSTALL) -m 644 $$realcodecs $(DOCSDIR)/tech/realcodecs; \
+	done
+	@echo "*** Installed documentation to $(DOCSDIR)"
+# Install fonts, skins
+	$(INSTALL) -m 755 -d $(DATADIR)
+	$(INSTALL) -m 755 -d $(DATADIR)/font
 	@if test ! -f $(DATADIR)/font/font.desc ; then \
 	echo "*** Download font at http://www.mplayerhq.hu/homepage/dload.html" ; \
 	echo "*** for OSD/Subtitles support and extract to $(DATADIR)/font/" ; \
 	fi
 ifeq ($(GUI),yes)
-	@if test ! -d $(DATADIR)/Skin ; then mkdir -p $(DATADIR)/Skin ; fi
+	$(INSTALL) -m 755 -d $(DATADIR)/Skin
 	@echo "*** Download skin(s) at http://www.mplayerhq.hu/homepage/dload.html"
 	@echo "*** for GUI, and extract to $(DATADIR)/Skin/"
 endif
-	@if test ! -d $(CONFDIR) ; then mkdir -p $(CONFDIR) ; fi
+# Install codecs
+	$(INSTALL) -m 755 -d $(CONFDIR)
 	@if test -f $(CONFDIR)/codecs.conf.old ; then mv -f $(CONFDIR)/codecs.conf.old $(CONFDIR)/codecs.conf.older ; fi
 	@if test -f $(CONFDIR)/codecs.conf ; then mv -f $(CONFDIR)/codecs.conf $(CONFDIR)/codecs.conf.old ; fi
 	$(INSTALL) -c -m 644 etc/codecs.conf $(CONFDIR)/codecs.conf
+# Install libmpdvdkit
 ifeq ($(DVDKIT_SHARED),yes)
 ifeq ($(DVDKIT2),yes)
-	if test ! -d $(LIBDIR) ; then mkdir -p $(LIBDIR) ; fi
+	$(INSTALL) -m 755 -d $(LIBDIR)
 	$(INSTALL) -m 755 $(INSTALLSTRIP) libmpdvdkit2/libmpdvdkit.so $(LIBDIR)/libmpdvdkit.so
 else
 ifeq ($(DVDKIT),yes)
-	if test ! -d $(LIBDIR) ; then mkdir -p $(LIBDIR) ; fi
+	$(INSTALL) -m 755 -d $(LIBDIR)
 	$(INSTALL) -m 755 $(INSTALLSTRIP) libmpdvdkit/libmpdvdkit.so $(LIBDIR)/libmpdvdkit.so
 endif
 endif
 endif
+# Install fibmap_mplayer
 ifeq ($(CSS_USE),yes)
 	@echo "The following task requires root privileges. If it fails don't panic,"
 	@echo "however it means you can't use fibmap_mplayer."
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.632
diff -u -r1.632 configure
--- configure	4 Jan 2003 02:40:49 -0000	1.632
+++ configure	5 Jan 2003 00:08:19 -0000
@@ -106,6 +106,7 @@
 esac
 
 LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s/help\/help_mp-\(..\).h/\1/g" |sed "s/help\/help_mp-\(.....\).h/\1/g"`
+DOCS_LANGUAGES_ALL="de en fr hu it pl zh_CN"
 
 for parm in "$@" ; do
   if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
@@ -124,8 +125,10 @@
                          data files (fonts, skins) [PREFIX/share/mplayer]
   --mandir=DIR           use this prefix for installing manpages [PREFIX/man]
   --confdir=DIR          use this prefix for installing configuration files
-                         [same as datadir]
+                         [PREFIX/share/mplayer]
   --libdir=DIR           use this prefix for object code libraries [PREFIX/lib]
+  --docsdir=DIR          use this prefix for installing the documentation 
+                         [PREFIX/doc/mplayer]
 
 Optional features:
   --disable-mencoder     disable mencoder (a/v encoder) compilation [enable]
@@ -225,6 +228,8 @@
                          options with --enable-static="-lslang -lncurses"
   --language=xx          select a language (for translated messages/gui) [en]
                          (Available: $LANGUAGES)
+  --docs-languages=xx    select html docs to be installed 
+                         [$DOCS_LANGUAGES_DEFAULT]
   --enable-shared-pp     install & use shared postprocessing lib
   --install-path=PATH    the path to a custom install program (useful if
                          your OS uses a GNU-incompatible install utility by
@@ -1246,6 +1251,9 @@
   --language=*)
     LINGUAS=`echo $ac_option | cut -d '=' -f 2`
     ;;
+  --docs-languages=*)
+    DOCS_INSTALL=`echo $ac_option | cut -d '=' -f 2`
+    ;;
   --with-libdvdnav=*)
     _dvdnavdir=`echo $ac_option | cut -d '=' -f 2`
     _dvdnav=yes
@@ -1391,6 +1399,7 @@
 test -z "$_mandir" && _mandir="$_prefix/man"
 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
 test -z "$_libdir" && _libdir="$_prefix/lib"
+test -z "$_docsdir" && _docsdir="$_prefix/doc/mplayer"
 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
 
 if x86 ; then
@@ -1590,6 +1599,17 @@
 _mp_help="help/help_mp-${LINGUAS}.h"
 test -f $_mp_help || die "$_mp_help not found"
 
+echocheck "html docs"
+test -z "$DOCS_INSTALL" && DOCS_INSTALL=$DOCS_LANGUAGES_ALL
+for lang in $DOCS_LANGUAGES_ALL ; do
+  if test "`echo $DOCS_INSTALL | grep $lang`" ; then
+   eval _install_docs_$lang=yes
+  else
+   eval _install_docs_$lang=no
+  fi
+done
+echores "using ${DOCS_INSTALL}"
+
 echocheck "enable sighandler"
 if test "$_sighandler" = yes ; then
   _def_sighandler='#define ENABLE_SIGHANDLER 1'
@@ -4727,6 +4747,7 @@
 MANDIR = \$(DESTDIR)$_mandir
 CONFDIR = \$(DESTDIR)$_confdir
 LIBDIR = \$(DESTDIR)$_libdir
+DOCSDIR = \$(DESTDIR)$_docsdir
 #AR = ar
 CC = $_cc
 AWK = $_awk
@@ -4847,6 +4868,15 @@
 GTK_LIBS =  $_ld_static $_ld_gui
 GUI = $_gui
 DEBUG = -DDEBUG
+
+# --- Install international HTML docs ---
+INSTALL_DOCS_CN = $_install_docs_zh_CN
+INSTALL_DOCS_DE = $_install_docs_de
+INSTALL_DOCS_EN = $_install_docs_en
+INSTALL_DOCS_FR = $_install_docs_fr
+INSTALL_DOCS_HU = $_install_docs_hu
+INSTALL_DOCS_IT = $_install_docs_it
+INSTALL_DOCS_PL = $_install_docs_pl
 
 EOF
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030105/afdde460/attachment.pgp>


More information about the MPlayer-dev-eng mailing list