Subject: CVS: Makefile improvements

From: Bernhard Reiter <[email-masked]>
Date: Mon, 21 Feb 2005 23:31:31 +0100

I have made a couple of improvements to the build system in CVS.
Now it is a lot easier for me to test the translations
and I saw statist in Portugese and Spanish: Very nice!

---

From: Jakson Aquino <[email-masked]>
Date: Tue, 22 Feb 2005 12:00:13 -0300 (ART)

Hi Bernhard,

>Jakson: If you like, I can give you CVS writte
access, this probably
>will make it easier for you to update the
translations.

Yes, I do. I can update the .po files before the next
release of Statist.

>Which version of msgmerge is needed at least?
>msgmerge (GNU gettext) 0.10.40
>does not have the -U flag,
>and msgmerge (GNU gettext-tools) 0.13.1 has it.

I'm sorry, but I don't know. I use Fedora Core 2,
which comes with msgmerge (GNU gettext-tools) 0.14.1.

I wrote the Makefile for the po directory after
reading some tutorials on gettext and the gettext info
pages. Looking at the po directory of some programs, I
could see that they have a very complicated Makefile
(probably written automatically by some tool). The po
directories also come with .gmo files. Regarding the
.gmo files, the gettext info page says:

  "Files ending with `.gmo' are really MO files, when
   it is known that these files use the GNU format"

Since some people might not have the gettext tools, I
can change the Makefile to produce the object files
with the extension .gmo, and, install them as .mo.
While shipping Statist, we could include the already
compiled .gmo files.

>Another possible improvement would be to use one
place
>to configure the installation prefix
"/usr/share/locale"
>and document it. 

Well, you already solved this with the Makefile.inc.
The ideal is that the user can choose the PREFIX and
everything else becomes automatically set. Perhaps we
still can make some small changes in the Makefiles:

Makefile.inc
------------------------------------------------------
#if you have root privileges choose one of the
following prefixes:
#PREFIX = /usr/local
PREFIX  = /usr

#if you can't become root, uncomment the following
line:
#PREFIX = $$HOME
------------------------------------------------------

src/Makefile
------------------------------------------------------
INSTALLDIR = $(PREFIX)/bin
LOCALEDIR = $(PREFIX)/share/locale
DOCDIR = $(PREFIX)/share/doc/statist

EXTRACFLAGS = -DLOCALEDIR='"$(LOCALE)"' >> PROBLEM
HERE! <<

install: $(MAIN)
	install -d $(PREFIX)/bin
	install -s statist $(PREFIX)/bin/
	(cd ../doc; make PREFIX=$(PREFIX) install)
	(cd ../po; make PREFIX=$(LOCALE) install)

uninstall:
	rm -f $(PREFIX)/bin/statist
	(cd ../doc; make PREFIX=$(PREFIX) uninstall)
	(cd ../po; make PREFIX=$(LOCALE) uninstall)

------------------------------------------------------

po/Makefile:
------------------------------------------------------
#PREFIX = $(PREFIX)/share/locale

POSTFIX = /LC_MESSAGES/
POSTFIXMO = $(POSTFIX)/statist.mo

install:
	install -d $(PREFIX)/pt_BR$(POSTFIX)
	install -d $(PREFIX)/de$(POSTFIX)
	install -d $(PREFIX)/es$(POSTFIX)
	install -d $(PREFIX)/it$(POSTFIX)
	cp pt_BR.gmo $(PREFIX)/pt_BR$(POSTFIXMO)
	cp de_DE.gmo $(PREFIX)/de$(POSTFIXMO)
	cp es_ES.gmo $(PREFIX)/es$(POSTFIXMO)
	cp it_IT.gmo $(PREFIX)/it$(POSTFIXMO)

uninstall:
	rm -f $(PREFIX)/pt_BR$(POSTFIXMO)
	rm -f $(PREFIX)/de$(POSTFIXMO)
	rm -f $(PREFIX)/es$(POSTFIXMO)
	rm -f $(PREFIX)/it$(POSTFIXMO)

------------------------------------------------------

The only problem that I got with the above lines was
that EXTRACFLAGS = -DLOCALEDIR='"$(LOCALE)"' didn't
work. That's, EXTRACFLAGS didn't become
"/usr/share/locale". If the user isn't using the
default "/usr" prefix, it'll have to set both PREFIX
and EXTRACFLAGS.

Best,

Jakson

 --- Bernhard Reiter <[email-masked]>
> and I saw statist in Portugese and Spanish: Very

_______________________________________________________ 
Yahoo! Acesso Grátis - Instale o discador do Yahoo! agora. http://br.acesso.yahoo.com/ - Internet rápida e grátis

---

From: Bernhard Reiter <[email-masked]>
Date: Tue, 22 Feb 2005 16:25:17 +0100

Am 22. Feb 2005 um 12:00:13 schrieb Jakson Aquino:
> Yes, I do. 

Send me your ssh1 key in personal email.
The access is similiar to
http://freegis.org/grass/howto_grass-sshcvs.en.html

	Bernhard

---

From: Bernhard Reiter <[email-masked]>
Date: Tue, 22 Feb 2005 17:19:59 +0100

Hi Jakson,

> While shipping Statist, we could include the already

Yes, we would make to create the .gmo or .mo files
before packing the tarball.
A "dist" target would be perfect for this.

> everything else becomes automatically set. 

Yes, I solved this after writing the email.
We might want to think about calling the po/Makefile
from the src/Makefile to unify this further.
There is no real need to decend to two directories.

> Perhaps we

I think we should better explain this "root" non-root issues
in the documentation, as those instructions are generic and will be
known to many administrators.

> src/Makefile

Did you mean
	EXTRACFLAGS = -DLOCALEDIR='"$(LOCALEDIR)"'
?

> "/usr/share/locale". 

Just from what I saw: Where did you define LOCALE? ;)

	Bernhard