Revision: 5537 http://ipcop.svn.sourceforge.net/ipcop/?rev=5537&view=rev Author: marcoson Date: 2011-03-20 09:20:25 +0000 (Sun, 20 Mar 2011)
Log Message: ----------- Added Squid language pack for localized error messages Modified Paths: -------------- ipcop/trunk/make.sh Added Paths: ----------- ipcop/trunk/config/rootfiles/common/squid-langpack ipcop/trunk/lfs/squid-langpack Added: ipcop/trunk/config/rootfiles/common/squid-langpack =================================================================== --- ipcop/trunk/config/rootfiles/common/squid-langpack (rev 0) +++ ipcop/trunk/config/rootfiles/common/squid-langpack 2011-03-20 09:20:25 UTC (rev 5537) @@ -0,0 +1,2 @@ +usr/lib/squid/errors +usr/lib/squid/errors.ipcop Added: ipcop/trunk/lfs/squid-langpack =================================================================== --- ipcop/trunk/lfs/squid-langpack (rev 0) +++ ipcop/trunk/lfs/squid-langpack 2011-03-20 09:20:25 UTC (rev 5537) @@ -0,0 +1,142 @@ +############################################################################### +# This file is part of the IPCop Firewall. # +# # +# IPCop 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. # +# # +# IPCop 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 IPCop; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Makefiles are based on LFSMake, which is # +# Copyright (C) 2002 Rod Roard <r...@sunsetsystems.com> # +# # +# Modifications by: # +# ??-12-2003 Mark Wormgoor < m...@wormgoor.com> # +# - Modified Makefile for IPCop build # +# # +# $Id$ +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +PKG_NAME = squid-langpack +VER = 20110317 +HOST_ARCH = all +OTHER_SRC = yes + +THISAPP = $(PKG_NAME)-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = http://www.squid-cache.org/Versions/langpack +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) +ERRMSG_DIR = /usr/lib/squid/errors + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 0b85906cb0243ee53ccd06ba965a158f + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +IPCOP_ERR_STYLE_CODE = <style type="text/css"><!--body{background-color:\#e0e0e0;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;margin-width:0px;margin-height:0px;font-family:verdana,sans-serif}pre{font-family:sans-serif}--></style> + +IPCOP_ERR_BODY_CODE = <table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-color:\#000000"> <tr><td><img src="http://%h:81/images/blacklogo.png" width="480" height="72" alt="IPCop Firewall" /></td></tr> </table> <blockquote> + +IPCOP_ERR_POST_CODE = <div id="footer"> <p></p> <small><address>Generated %T by %h (%s)</address></small> </blockquote> <p></p> </div> </body> </html> + +$(TARGET) : $(firstword $(MAKEFILE_LIST)) + @$(PREBUILD) + + # Clean up existing squid built-in error files + rm -rf $(ERRMSG_DIR) + mkdir -p $(ERRMSG_DIR) + + # Extract squid error files for all languages + cd $(ERRMSG_DIR) && tar xzf $(DIR_DL)/$(DL_FILE) + + # Delete all unneeded files and directories + find $(ERRMSG_DIR) -maxdepth 1 -type f -delete + rm -rf $(ERRMSG_DIR)/templates + + # Preparing built-in error files for IPCop modification + rm -rf $(ERRMSG_DIR).ipcop + cp -rp $(ERRMSG_DIR) $(ERRMSG_DIR).ipcop + + # Adding IPCop design to the built-in error files + + # sed step 1) + # - replace spaces between tags with line feeds + + # sed step 2) + # - remove all empty lines + # - remove the H1 header tag (if any) + + # sed step 3) + # - replace the entire STYLE tag + + # sed step 4) + # - insert a table with IPCop graphics after the BODY tag + + # sed step 5) + # - disable built-in footer + + # sed step 6) + # - add a new footer and close the BODY and HTML tags + + for LANGUAGE in $(ERRMSG_DIR).ipcop/* ; do \ + if test -d $${LANGUAGE} ; then \ + for ERRMSG_FILE in $${LANGUAGE}/* ; do \ + if test -f $${ERRMSG_FILE} ; then \ + sed -i -e 's/> />\n/g' $${ERRMSG_FILE} ; \ + sed -i -e 's/^ *//' -e '/^$$/d' -e '/^<h1>.*<\/h1>/d' $${ERRMSG_FILE} ; \ + sed -i -e '/<style/ c\$(IPCOP_ERR_STYLE_CODE)' $${ERRMSG_FILE} ; \ + sed -i -e '/<body>/ a\$(IPCOP_ERR_BODY_CODE)' $${ERRMSG_FILE} ; \ + sed -i -e '/<div id="footer">/,$$d' $${ERRMSG_FILE} ; \ + sed -i -e '$$a\$(IPCOP_ERR_POST_CODE)' $${ERRMSG_FILE} ; \ + fi ; \ + done ; \ + fi ; \ + done + + @$(POSTBUILD) Property changes on: ipcop/trunk/lfs/squid-langpack ___________________________________________________________________ Added: svn:keywords + Id Modified: ipcop/trunk/make.sh =================================================================== --- ipcop/trunk/make.sh 2011-03-20 09:11:13 UTC (rev 5536) +++ ipcop/trunk/make.sh 2011-03-20 09:20:25 UTC (rev 5537) @@ -1847,6 +1847,7 @@ chroot_make sqlite chroot_make squid chroot_make squid-graph + chroot_make squid-langpack chroot_make tcpdump chroot_make traceroute chroot_make ulogd This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn