# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2001 Sun Microsystems, Inc.  Used by permission.
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#

# END COPYRIGHT BLOCK

override BUILD_MODULE=HTTP_ADMIN
BUILD_ROOT = ../../..

include $(BUILD_ROOT)/nsconfig.mk
include ../rules.mk

MKDIR = mkdir -p

ifeq ($(OS), Windows_NT)
SWINGJARS = $(CLASS_DEST)/$(SWINGALL_JAR)
FIND      = $(BUILD_ROOT)/admserv/console/smartupdate/find
else
SWINGJARS = $(JFC_DIR)/$(JFC_VERSION)/$(SWINGALL_JAR)
FIND      = /bin/find
endif

JARVERSION = 10
LANGUAGE   = en

SMARTUPDATE_DIR = $(PACKAGE_DIR)/..

ADMINJAR        = admserv$(JARVERSION).jar
ADMINFILES      = com/netscape/management/admserv
ADMINJAR_EN	= $(ADMINJAR:.jar=_$(LANGUAGE).jar)
ADMINFILES_EN	:= $(shell cd $(CLASS_DIR) ; $(FIND) com/netscape/management/admserv -name '*.properties') \
		$(shell cd $(CLASS_DIR) ; $(FIND) com/netscape/management/admserv -name '*.gif') \
		$(shell cd $(CLASS_DIR) ; $(FIND) com/netscape/management/admserv -name '*.jpg')

all:
	-mkdir -p $(PACKAGE_DIR)
	cd $(CLASS_DIR) ; $(ZIP) -r  $(PACKAGE_DIR)/$(ADMINJAR) $(ADMINFILES) META-INF -x $(ADMINFILES_EN)
	cd $(CLASS_DIR) ; $(ZIP) -r  $(PACKAGE_DIR)/$(ADMINJAR_EN) $(ADMINFILES_EN) META-INF
	cd $(CLASS_DIR)/com/netscape/management/admserv ; $(ZIP) $(PACKAGE_DIR)/$(ADMINJAR) classes.env
	cp spacer.gif goto.gif start-console.html $(SMARTUPDATE_DIR)
