Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=6fe4594992a64e863a94d4f63651c0660e5c11d9

commit 6fe4594992a64e863a94d4f63651c0660e5c11d9
Author: Christian Hamar alias krix <[EMAIL PROTECTED]>
Date:   Tue Mar 25 15:52:22 2008 +0100

squidguard-1.3-1-x86_64
* New package / Initial import
- Tested at my computer, blocking worked well with squid

diff --git a/source/network-extra/squidguard/FrugalBuild 
b/source/network-extra/squidguard/FrugalBuild
new file mode 100644
index 0000000..e65c4d2
--- /dev/null
+++ b/source/network-extra/squidguard/FrugalBuild
@@ -0,0 +1,44 @@
+# Compiling Time: 0.08 SBU
+# Maintainer: Christian Hamar alias krix <[EMAIL PROTECTED]>
+
+pkgname=squidguard
+pkgver=1.3
+pkgrel=1
+pkgdesc="Combined filter, redirector and access controller plugin for Squid."
+url="http://www.squidguard.org";
+depends=('db')
+rodepends=('squid')
+makedepends=('flex')
+groups=('network-extra')
+archs=('i686' 'x86_64')
+_F_archive_name="squidGuard"
+up2date="lynx -dump http://www.squidguard.org/Downloads/ | Flasttar"
+source=(http://www.squidguard.org/Downloads/$_F_archive_name-$pkgver.tar.gz 
bugfix.patch README.frugalware \
+       makefile-destdirfix.patch squidGuard-simple.conf)
+sha1sums=('4a1e359679f328cff5970e92e93cc94236ead6c7' \
+          'e95686d742ee448497ec9104f7bd162f0451606a' \
+          'aaeff6c70ecca9026b5d1cb92f46642029114e2f' \
+          'b0269b6e8d1be1c30264302a1d3ac9d3f71000e0' \
+          '5ad25bcf8203b4106a40476a5453e67cc04edf7c')
+
+build()
+{
+       Fpatchall
+       Fmake --with-sg-logdir=/var/log/squidGuard/ 
--with-sg-config=/etc/squidGuard/squidGuard.conf \
+               --with-sg-dbhome=/var/lib/squidGuard/db
+       Fmkdir /etc/squidGuard/
+       Fmkdir /usr/bin
+       Fmkdir /var/log/squidGuard
+       Fmakeinstall
+       cp $Fsrcdir/$_F_archive_name-$pkgver/samples/sample.conf 
$Fdestdir/etc/squidGuard/squidGuard.conf || Fdie
+       chmod 644 $Fdestdir/etc/squidGuard/squidGuard.conf || Fdie
+       Fdoc README.frugalware
+       # wtf? :)
+       Frm /usr/squidGuard
+       # Fixup for proxy user/group
+       chown -R 105:105 $Fdestdir/var/log/squidGuard/ || Fdie
+       chown -R 105:105 $Fdestdir/var/lib/squidGuard/ || Fdie
+       Fcp squidGuard-simple.conf /etc/squidGuard/
+}
+
+# optimization ok
diff --git a/source/network-extra/squidguard/README.frugalware 
b/source/network-extra/squidguard/README.frugalware
new file mode 100644
index 0000000..8131d0d
--- /dev/null
+++ b/source/network-extra/squidguard/README.frugalware
@@ -0,0 +1,22 @@
+Small FAQ for using squidGuard :)
+---------------------------------
+
+You can update or create your DB files with the following command:
+  squidGuard -C all
+               ( these files / dirs can be found at /var/lib/squidGuard/db/ )
+
+Don't forget to do a:
+  chown -R proxy.proxy /var/lib/squidGuard/
+
+-------------
+--- WARNING: You need to DO DB generation before you can use squidGuard from 
squid!!!
+-------------
+
+By default squidGuard is disabled, you need to enable it in squid.conf. Add 
this line at the end of squid.conf:
+  redirect_program /usr/bin/squidGuard -c /etc/squidGuard/squidGuard.conf
+
+You can find a squidGuard-simple.conf in /etc/squidGuard/ directory. And dont 
forget to check
+http://www.squidguard.org/ website for URL/DOMAIN blacklists if you need!
+
+Regards
+-krix-
diff --git a/source/network-extra/squidguard/bugfix.patch 
b/source/network-extra/squidguard/bugfix.patch
new file mode 100644
index 0000000..38e139e
--- /dev/null
+++ b/source/network-extra/squidguard/bugfix.patch
@@ -0,0 +1,135 @@
+diff -Naur squidGuard-1.3.orig/src/sgDb.c squidGuard-1.3/src/sgDb.c
+--- squidGuard-1.3.orig/src/sgDb.c     2008-03-25 09:19:56.000000000 +0100
++++ squidGuard-1.3/src/sgDb.c  2007-11-16 21:10:47.000000000 +0100
+@@ -1,10 +1,12 @@
+ /*
+   By accepting this notice, you agree to be bound by the following
+   agreements:
+-
+-  This software product, squidGuard, is copyrighted (C) 1998-2007
+-  by Christine Kronberg, Shalla Secure Services. All rights reserved.
+-
++
++  This software product, squidGuard, is copyrighted (C) 1998 by
++  ElTele Øst AS, Oslo, Norway, with all rights reserved.
++  With December 27th 2006 all rights moved to Christine Kronberg,
++  Shalla Secure Services.
++
+   This program is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License (version 2) as
+   published by the Free Software Foundation.  It is distributed in the
+@@ -287,29 +289,75 @@
+   return result;
+ }
+
++static int stdoutisatty;
++
++#if __STDC__
++void startProgressBar()
++#else
++void startProgressBar()
++#endif
++{
++  stdoutisatty = isatty(STDOUT_FILENO);
++
++  if(1 == stdoutisatty)
++  {
++    /* do nothing */
++  }
++  else
++  {
++    printf("    [");
++    fflush(stdout);
++  }
++  return;
++}
++
+ #if __STDC__
+-void drawProgressBar(float prog)
++void finishProgressBar()
+ #else
+-void drawProgressBar(prog)
++void finishProgressBar()
++#endif
++{
++  if(1 == stdoutisatty)
++  {
++    printf("\n");
++  }
++  else
++  {
++    printf("] 100 %% done\n");
++  }
++  fflush(stdout);
++  return;
++}
++
++#if __STDC__
++void updateProgressBar(float prog)
++#else
++void updateProgressBar(prog)
+       float prog;
+ #endif
+ {
+-  int j,k=0;
+-  k = (int)(prog * 50.0);
+-  printf("    [");
+-  for(j=0; j<50; j++)
++  if(1 == stdoutisatty)
+   {
+-    if(j <= k)
++    int j,k=0;
++    k = (int)(prog * 50.0);
++    printf("\r");fflush(stdout);
++    printf("    [");
++    for(j=0; j<50; j++)
++    {
++      if(j <= k)
+         printf("=");
+-    else
++      else
+         printf(" ");
++    }
++    printf("] %d %% done", (int)(prog*100.0));fflush(stdout);
+   }
+-  printf("] %d %% done", (int)(prog*100.0));fflush(stdout);
+-  for(j=0; j<1000000; j++) {/*slow down to make progress bar more obvious*/}
+-  
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");fflush(stdout);
+-  
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");fflush(stdout);
+-  
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");fflush(stdout);
+-  
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");fflush(stdout);
++  else
++  {
++    if(((int)(prog*100.0) % 100) == 0)
++      printf(".");fflush(stdout);
++  }
++
++  return;
+ }
+
+ #if __STDC__
+@@ -340,13 +388,14 @@
+
+   fstat(fileno(fp), &fpst);
+   fpsz = fpst.st_size;
++  startProgressBar();
+
+   memset(&Db->key, 0, sizeof(DBT));
+   memset(&Db->data, 0, sizeof(DBT));
+   while(fgets(line, sizeof(line), fp) != NULL){
+
+     lnsz += strlen(line);
+-    drawProgressBar((float)lnsz/(float)fpsz);
++    updateProgressBar((float)lnsz/(float)fpsz);
+
+     if(*line == '#')
+       continue;
+@@ -418,7 +467,7 @@
+   if(update){
+     sgLogError("update: added %d entries, deleted %d 
entries",entries,deleted);
+   }
+-  printf("\n");
++  finishProgressBar();
+   Db->entries = entries;
+   fclose(fp);
+ }
diff --git a/source/network-extra/squidguard/makefile-destdirfix.patch 
b/source/network-extra/squidguard/makefile-destdirfix.patch
new file mode 100644
index 0000000..a0f69ad
--- /dev/null
+++ b/source/network-extra/squidguard/makefile-destdirfix.patch
@@ -0,0 +1,68 @@
+diff -Naur squidGuard-1.3.orig/Makefile.in squidGuard-1.3/Makefile.in
+--- squidGuard-1.3.orig/Makefile.in    2008-03-25 15:19:59.000000000 +0100
++++ squidGuard-1.3/Makefile.in 2008-03-25 15:20:15.000000000 +0100
+@@ -48,32 +48,17 @@
+ install-conf:
+       @echo Installing configuration file  ;
+       @if [ ! -d $(prefix)/squidGuard ]; then \
+-              $(MKINSTALLDIRS) $(prefix)/squidGuard ; \
+-              echo Created directory $(prefix)/squidGuard ; \
+-              chown -R $(SQUIDUSER) $(prefix)/squidGuard || exit 1  ; \
+-              echo Assigned $(prefix)/squidGuard to user $(SQUIDUSER) ; \
++              $(MKINSTALLDIRS) $(DESTDIR)/$(prefix)/squidGuard ; \
++              echo Created directory $(DESTDIR)/$(prefix)/squidGuard ; \
+       fi ;
+       @if [ ! -d $(dbhomedir) ]; then \
+-              $(MKINSTALLDIRS) $(dbhomedir) ; \
+-              echo Created directory $(dbhomedir) ; \
+-              chown -R $(SQUIDUSER) $(dbhomedir) || exit 1 ; \
+-              echo Assigned $(dbhomedir) to user $(SQUIDUSER) ; \
++              $(MKINSTALLDIRS) $(DESTDIR)/$(dbhomedir) ; \
++              echo Created directory $(DESTDIR)/$(dbhomedir) ; \
+       fi ;
+       @if [ ! -d $(logdir) ]; then \
+-              $(MKINSTALLDIRS) $(logdir) ; \
+-              echo Created directory $(logdir) ; \
+-              chown -R $(SQUIDUSER) $(logdir) || exit 1 ; \
+-              echo Assigned $(logdir) to user $(SQUIDUSER) ; \
++              $(MKINSTALLDIRS) $(DESTDIR)/$(logdir) ; \
++              echo Created directory $(DESTDIR)/$(logdir) ; \
+       fi ;
+-      @if test ! -f $(configfile); then \
+-              cp samples/sample.conf $(configfile) || exit 1  ; \
+-              echo Copied sample squidGuard.conf ; \
+-              chmod 644 $(configfile) || exit 1 ; \
+-              echo $(configfile) is now readable ; \
+-              echo The initial configuration is complete. ; \
+-      else \
+-              echo Configuration file found. Not changing anything ; \
+-      fi;
+       @echo ;
+       @echo Congratulation. SquidGuard is sucessfully installed. ;
+       @echo ;
+@@ -81,9 +66,9 @@
+ install-build:
+       @echo Installing squidGuard
+       @if [ ! -d $(bindir) ]; then \
+-              $(MKINSTALLDIRS) $(bindir) ; \
++              $(MKINSTALLDIRS) $(DESTDIR)/$(bindir) ; \
+       fi ; \
+-      cp src/squidGuard $(bindir) || exit 1 ;  \
++      cp src/squidGuard $(DESTDIR)/$(bindir) || exit 1 ;  \
+       echo Done. ;
+
+ clean::
+diff -Naur squidGuard-1.3.orig/src/Makefile.in squidGuard-1.3/src/Makefile.in
+--- squidGuard-1.3.orig/src/Makefile.in        2008-03-25 15:19:59.000000000 
+0100
++++ squidGuard-1.3/src/Makefile.in     2008-03-25 15:20:04.000000000 +0100
+@@ -103,8 +103,8 @@
+
+ install.bin:: squidGuard
+       @echo making $@ in `basename \`pwd\``
+-      @$(MKDIR) $(bindir) $(logdir) $(cfgdir)
+-      $(INSTALL_PROGRAM) squidGuard $(bindir)/squidGuard
++      @$(MKDIR) $(DESTDIR)/$(bindir) $(DESTDIR)/$(logdir) $(DESTDIR)/$(cfgdir)
++      $(INSTALL_PROGRAM) squidGuard $(DESTDIR)/$(bindir)/squidGuard
+
+ uninstall.bin::
+       @echo making $@ in `basename \`pwd\``
diff --git a/source/network-extra/squidguard/squidGuard-simple.conf 
b/source/network-extra/squidguard/squidGuard-simple.conf
new file mode 100644
index 0000000..4edf86d
--- /dev/null
+++ b/source/network-extra/squidguard/squidGuard-simple.conf
@@ -0,0 +1,19 @@
+#
+# CONFIG FILE FOR SQUIDGUARD
+#
+
+dbhome /var/lib/squidGuard/db
+logdir /var/log/squidGuard/
+
+destination porn {
+       domainlist porn/domains
+       urllist porn/urls
+       log porn.log
+}
+
+acl {
+       default {
+               pass !porn all
+               redirect http://localhost
+       }
+}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to