update to sarg-2.4.0

build with -fcommon, it is not really sanely patchable to avoid
This commit is contained in:
sthen 2021-02-22 21:56:25 +00:00
parent 7c5102fe76
commit b2b0be0321
10 changed files with 109 additions and 66 deletions

View File

@ -1,24 +1,26 @@
# $OpenBSD: Makefile,v 1.31 2020/09/27 21:19:40 kmos Exp $
# $OpenBSD: Makefile,v 1.32 2021/02/22 21:56:25 sthen Exp $
COMMENT= Squid Analysis Report Generator
DISTNAME= sarg-2.3.11
DISTNAME= sarg-2.4.0
CATEGORIES= www
REVISION= 1
HOMEPAGE= http://sarg.sourceforge.net/
# GPLv2+
PERMIT_PACKAGE= Yes
WANTLIB= c gd iconv intl m pcre
WANTLIB += bz2 c gd iconv intl lzma m pcre z
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sarg/}
LIB_DEPENDS= devel/gettext,-runtime \
LIB_DEPENDS= archivers/bzip2 \
devel/gettext,-runtime \
devel/pcre \
graphics/gd
CFLAGS+= -fcommon
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --sysconfdir=${SYSCONFDIR}/sarg \
--enable-sargphp=${VARBASE}/www/htdocs/sarg-php \

View File

@ -1,2 +1,2 @@
SHA256 (sarg-2.3.11.tar.gz) = 0Pj777X9xxbnXHeFJdlqye72ItPelNqNcOK9x6uB2qI=
SIZE (sarg-2.3.11.tar.gz) = 1346884
SHA256 (sarg-2.4.0.tar.gz) = tMoPQfZGdnO0xlxnmLRKiIbwgYDAVesRw3qW38KMtcM=
SIZE (sarg-2.4.0.tar.gz) = 1371812

View File

@ -1,12 +1,14 @@
$OpenBSD: patch-convlog_c,v 1.5 2012/11/21 21:42:07 rpe Exp $
--- convlog.c.orig Wed Nov 14 21:04:07 2012
+++ convlog.c Wed Nov 14 21:06:25 2012
@@ -40,7 +40,7 @@ void convlog(const char *arq, char *df, int dfrom, int
$OpenBSD: patch-convlog_c,v 1.6 2021/02/22 21:56:25 sthen Exp $
Index: convlog.c
--- convlog.c.orig
+++ convlog.c
@@ -40,7 +40,7 @@ void convlog(const char *arq, char df, const struct Re
longline line;
if(arq[0] == '\0')
if (arq[0] == '\0')
- arq="/var/log/squid/access.log";
+ arq="/var/squid/logs/access.log";
if (arq[0]=='-' && arq[1]=='\0') {
fp_in=stdin;
if ((fp_in=FileObject_Open(arq))==NULL) {
debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),arq,FileObject_GetLastOpenError());

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-decomp_c,v 1.1 2021/02/22 21:56:25 sthen Exp $
Index: decomp.c
--- decomp.c.orig
+++ decomp.c
@@ -486,7 +486,7 @@ FileObject *decomp(const char *arq)
ssize_t nread;
// guess file type
- fd=open(arq,O_RDONLY | O_LARGEFILE);
+ fd=open(arq,O_RDONLY);
if (fd==-1) {
debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),arq,strerror(errno));
exit(EXIT_FAILURE);

View File

@ -1,39 +1,41 @@
$OpenBSD: patch-log_c,v 1.4 2012/11/21 21:42:07 rpe Exp $
--- log.c.orig Wed Nov 14 21:03:33 2012
+++ log.c Wed Nov 14 21:06:25 2012
@@ -223,7 +223,7 @@ int main(int argc,char *argv[])
$OpenBSD: patch-log_c,v 1.5 2021/02/22 21:56:25 sthen Exp $
Index: log.c
--- log.c.orig
+++ log.c
@@ -136,7 +136,7 @@ int main(int argc,char *argv[])
RedirectorLogFormat[0]='\0';
NRedirectorLogs=0;
for (ilf=0 ; ilf<ILF_Last ; ilf++) ilf_count[ilf]=0;
- snprintf(ExcludeCodes,sizeof(ExcludeCodes),"%s/exclude_codes",SYSCONFDIR);
+ snprintf(ExcludeCodes,sizeof(ExcludeCodes),"%s/sarg/exclude_codes",SYSCONFDIR);
strcpy(GraphDaysBytesBarColor,"orange");
strcpy(BgColor,"#ffffff");
strcpy(TxColor,"#000000");
@@ -237,7 +237,7 @@ int main(int argc,char *argv[])
strcpy(LogoTextColor,"#006699");
@@ -151,7 +151,7 @@ int main(int argc,char *argv[])
strcpy(FontSize,"9px");
strcpy(TempDir,"/tmp");
TempDirPath[0] = '\0';
- strcpy(OutputDir,"/var/www/html/squid-reports");
+ strcpy(OutputDir,"/var/www/htdocs/squid-reports");
AnonymousOutputFiles=false;
Ip2Name=false;
strcpy(DateFormat,"u");
@@ -542,7 +542,7 @@ int main(int argc,char *argv[])
DateFormat='u';
@@ -452,7 +452,7 @@ int main(int argc,char *argv[])
if(debug) debuga(_("Init\n"));
if (debug) debuga(__FILE__,__LINE__,_("Init\n"));
- if(ConfigFile[0] == '\0') snprintf(ConfigFile,sizeof(ConfigFile),"%s/sarg.conf",SYSCONFDIR);
+ if(ConfigFile[0] == '\0') snprintf(ConfigFile,sizeof(ConfigFile),"%s/sarg/sarg.conf",SYSCONFDIR);
if(access(ConfigFile, R_OK) != 0) {
debuga(_("Cannot open config file: %s - %s\n"),ConfigFile,strerror(errno));
- if (ConfigFile[0] == '\0') snprintf(ConfigFile,sizeof(ConfigFile),"%s/sarg.conf",SYSCONFDIR);
+ if (ConfigFile[0] == '\0') snprintf(ConfigFile,sizeof(ConfigFile),"%s/sarg/sarg.conf",SYSCONFDIR);
if (access(ConfigFile, R_OK) != 0) {
debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),ConfigFile,strerror(errno));
exit(EXIT_FAILURE);
@@ -585,7 +585,7 @@ int main(int argc,char *argv[])
IndexTree=INDEX_TREE_FILE;
if(NAccessLog == 0) {
- strcpy(AccessLog[0],"/var/log/squid/access.log");
+ strcpy(AccessLog[0],"/var/squid/logs/access.log");
NAccessLog++;
}
@@ -484,7 +484,7 @@ int main(int argc,char *argv[])
if (AccessLog==NULL) {
AccessLog=FileList_Create();
- if (!FileList_AddFile(AccessLog,"/var/log/squid/access.log")) {
+ if (!FileList_AddFile(AccessLog,"/var/squid/logs/access.log")) {
debuga(__FILE__,__LINE__,_("Not enough memory to store the input log file names\n"));
exit(EXIT_FAILURE);
}

View File

@ -1,16 +1,18 @@
$OpenBSD: patch-sarg_conf,v 1.4 2014/10/05 17:35:24 rpe Exp $
--- sarg.conf.orig Sat Oct 4 10:48:55 2014
+++ sarg.conf Sat Oct 4 10:50:25 2014
@@ -4,7 +4,7 @@
# Where is the access.log file
# sarg -l file
$OpenBSD: patch-sarg_conf,v 1.5 2021/02/22 21:56:25 sthen Exp $
Index: sarg.conf
--- sarg.conf.orig
+++ sarg.conf
@@ -17,7 +17,7 @@
# If some files are passed on the command line with "sarg -l file" or
# "sarg file", the files listed here are ignored.
#
-#access_log /usr/local/squid/var/logs/access.log
+#access_log /var/squid/logs/access.log
# TAG: graphs yes|no
# Use graphics where is possible.
@@ -17,7 +17,7 @@
@@ -30,7 +30,7 @@
# The full path to the TTF font file to use to create the graphs. It is required
# if graphs is set to yes.
#
@ -19,7 +21,7 @@ $OpenBSD: patch-sarg_conf,v 1.4 2014/10/05 17:35:24 rpe Exp $
# TAG: title
# Especify the title for html page.
@@ -117,7 +117,7 @@
@@ -147,7 +147,7 @@
# The reports will be saved in that directory
# sarg -o dir
#
@ -28,7 +30,7 @@ $OpenBSD: patch-sarg_conf,v 1.4 2014/10/05 17:35:24 rpe Exp $
# TAG: anonymous_output_files yes/no
# Use anonymous file and directory names in the report. If it is set to
@@ -309,7 +309,7 @@
@@ -364,7 +364,7 @@
# Only codes matching exactly one of the line is rejected. The
# comparison is not case sensitive.
#
@ -37,7 +39,7 @@ $OpenBSD: patch-sarg_conf,v 1.4 2014/10/05 17:35:24 rpe Exp $
# TAG: replace_index string
# Replace "index.html" in the main index file with this string
@@ -545,7 +545,7 @@
@@ -632,7 +632,7 @@
# Generate reports from SquidGuard logs.
# Use 'none' to disable.
# You can use sarg -L filename to use an alternate squidGuard log.
@ -46,7 +48,7 @@ $OpenBSD: patch-sarg_conf,v 1.4 2014/10/05 17:35:24 rpe Exp $
#
#squidguard_conf none
@@ -555,7 +555,7 @@
@@ -642,7 +642,7 @@
# If this option is specified, it takes precedence over squidguard_conf.
# The command line option -L override this option.
#
@ -55,7 +57,7 @@ $OpenBSD: patch-sarg_conf,v 1.4 2014/10/05 17:35:24 rpe Exp $
# TAG: redirector_filter_out_date on|off
# This option replaces squidguard_ignore_date and redirector_ignore_date whose names were not
@@ -591,13 +591,13 @@
@@ -678,13 +678,13 @@
#
#parsed_output_log none
@ -71,7 +73,7 @@ $OpenBSD: patch-sarg_conf,v 1.4 2014/10/05 17:35:24 rpe Exp $
# TAG: displayed_values bytes|abbreviation
# how the values will be displayed in reports.
@@ -630,7 +630,7 @@
@@ -717,7 +717,7 @@
# Sarg will create sarg-php directory with some PHP modules:
# - sarg-squidguard-block.php - add urls from user reports to squidGuard DB
#
@ -80,7 +82,7 @@ $OpenBSD: patch-sarg_conf,v 1.4 2014/10/05 17:35:24 rpe Exp $
# TAG: block_it module_url
# This tag allow you to pass urls from user reports to a cgi or php module,
@@ -638,7 +638,7 @@
@@ -725,7 +725,7 @@
#
# Eg.: block_it /sarg-php/sarg-block-it.php
# sarg-block-it is a php that will append a url to a flat file.
@ -89,12 +91,12 @@ $OpenBSD: patch-sarg_conf,v 1.4 2014/10/05 17:35:24 rpe Exp $
# in $filename variable, and chown to a httpd owner.
#
# sarg will pass http://module_url?url=url
@@ -788,7 +788,7 @@
@@ -896,7 +896,7 @@
# 65.52.00.00/14 *.mail.live.com
# re:/\.dropbox\.com(:443)?/ dropbox
# re:/([\w-]+)\.(\w*[a-zA-Z]\w*)(?::\d+)?$/\1.\2
# re:/([\w-]+)\.(\w*[a-zA-Z]\w*)(?::\d+)?$/ \1.\2
-#hostalias /usr/local/sarg/hostalias
+#hostalias /etc/sarg/hostalias
# TAG: keep_temp_log yes|no
# Keep temporary files created by sarg to produce its reports. The normal
# TAG: useralias
# The name of a text file containing the user names one per line and the

View File

@ -1,12 +1,14 @@
$OpenBSD: patch-splitlog_c,v 1.5 2012/11/21 21:42:07 rpe Exp $
--- splitlog.c.orig Wed Nov 14 21:04:27 2012
+++ splitlog.c Wed Nov 14 21:06:25 2012
@@ -76,7 +76,7 @@ void splitlog(const char *arq, const char *df, int dfr
$OpenBSD: patch-splitlog_c,v 1.6 2021/02/22 21:56:25 sthen Exp $
Index: splitlog.c
--- splitlog.c.orig
+++ splitlog.c
@@ -76,7 +76,7 @@ void splitlog(const char *arq, char df, const struct R
}
if(arq[0] == '\0')
if (arq[0] == '\0')
- arq="/var/log/squid/access.log";
+ arq="/var/squid/logs/access.log";
if (arq[0]=='-' && arq[1]=='\0') {
fp_in=stdin;
if ((fp_in=decomp(arq))==NULL) {
debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),arq,FileObject_GetLastOpenError());

View File

@ -1,6 +1,8 @@
$OpenBSD: patch-usage_c,v 1.1 2012/11/21 21:42:07 rpe Exp $
--- usage.c.orig Wed Nov 14 21:04:00 2012
+++ usage.c Wed Nov 14 21:06:25 2012
$OpenBSD: patch-usage_c,v 1.2 2021/02/22 21:56:25 sthen Exp $
Index: usage.c
--- usage.c.orig
+++ usage.c
@@ -37,7 +37,7 @@ void usage(const char *prog)
puts (_(" --css Output the internal CSS"));
puts (_(" -d DATE Date range to include in the report: from-until dd/mm/yyyy-dd/mm/yyyy"));

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-util_c,v 1.1 2021/02/22 21:56:25 sthen Exp $
Index: util.c
--- util.c.orig
+++ util.c
@@ -402,7 +402,7 @@ int is_absolute(const char *path)
int PortableMkDir(const char *path,int mode)
{
-#if defined(__linux__)
+#if defined(__linux__) || defined(__OpenBSD__)
int mkerror=mkdir(path,mode);
#else //mingw
(void)mode;

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.5 2012/11/21 21:42:07 rpe Exp $
@comment $OpenBSD: PLIST,v 1.6 2021/02/22 21:56:25 sthen Exp $
@bin bin/sarg
@man man/man1/sarg.1
share/examples/sarg/
@ -24,12 +24,15 @@ share/examples/sarg/images/sarg-squidguard-block.png
share/examples/sarg/images/sarg.png
@sample ${SYSCONFDIR}/sarg/images/sarg.png
share/examples/sarg/sarg-php/
share/examples/sarg/sarg-php/language.php
share/examples/sarg/sarg-php/locale/
share/examples/sarg/sarg-php/locale/en_EN/
share/examples/sarg/sarg-php/locale/en_EN/LC_MESSAGES/
share/examples/sarg/sarg-php/locale/en_EN/LC_MESSAGES/messages.mo
share/examples/sarg/sarg-php/locale/en_EN/LC_MESSAGES/messages.po
share/examples/sarg/sarg-php/locale/es/
share/examples/sarg/sarg-php/locale/es/LC_MESSAGES/
share/examples/sarg/sarg-php/locale/es/LC_MESSAGES/messages.mo
share/examples/sarg/sarg-php/locale/es/LC_MESSAGES/messages.po
share/examples/sarg/sarg-php/locale/fr/
share/examples/sarg/sarg-php/locale/fr/LC_MESSAGES/
share/examples/sarg/sarg-php/locale/fr/LC_MESSAGES/messages.mo