DEPTH           = ../..
topsrcdir       = @top_srcdir@
srcdir          = @srcdir@
VPATH           = @srcdir@

include $(DEPTH)/config/autoconf.mk

APP_NAME = $(MOZ_APP_DISPLAYNAME)

_AVAILABLE_LOCALES =\
    en-US \
    fr-FR \
    zh-CN \
    es-ES \
    cs \
    de-DE \
    he-IL \
    it-IT \
    ja-JP \
    zh-TW \
    nl \
    ko \
    sl \
    pl \
    $(NULL)
    
libs::$(_AVAILABLE_LOCALES)
	mkdir -p $(FINAL_TARGET)/distribution/extensions
	rm -f $(FINAL_TARGET)/distribution/extensions/*.xpi
	rm -f $(srcdir)/*.xpi
	$(foreach f,$^, cd $(srcdir)/`basename $f`; zip -qr ../langpack-`basename $f`@bluegriffon.org.xpi `find . -type f | grep -v svn` ;)
	$(foreach f,$^, cd $(topsrcdir)/bluegriffon/locales/`basename $f`; zip -qr $(topsrcdir)/bluegriffon/langpacks/langpack-`basename $f`@bluegriffon.org.xpi `find . -type f | grep -v svn` ;)
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
	$(INSTALL) $(srcdir)/*.xpi $(DIST)/$(APP_NAME).app/Contents/MacOS/distribution/extensions
else
	$(INSTALL) $(srcdir)/*.xpi $(DIST)/bin/distribution/extensions
endif

include $(topsrcdir)/config/rules.mk

