Ptcha nakładasz przy kompilacji ze źródeł. W niektórych distrach (jak np. arch, gentoo) jest to ułatwione. W openSUSE, możesz pewnie jakoś tam edytować plik SPEC RPM’a…albo po prostu nałożyć patcha na źródła i skompilować.
tar xvf sarg-2.2.5
cd sarg-2.2.5
patch -p1 < ścieżka-do-patcha
./configure \
--prefix="/etc" \
--sysconfdir="/etc/sarg" \
--enable-bindir="/usr/bin" \
--enable-mandir="/usr/man" \
--enable-sysconfdir="/etc/sarg" \
--enable-htmldir="/home/httpd/html"
Ścieżki oczywiści wg uznań..nie wiem jak wygląda dokładnie struktura katalogów w openSUSE
make
make install
suse:/mnt/dane/sarg-2.2.5# make
gcc -g util.o log.o report.o topuser.o email.o sort.o html.o totger.o index.o getconf.o usage.o decomp.o ip2name.o useragent.o exclude.o convlog.o totday.o repday.o datafile.o indexonly.o splitlog.o lastlog.o topsites.o siteuser.o css.o smartfilter.o denied.o authfail.o language.o charset.o squidguard_log.o squidguard_report.o auth.o download.o grepday.o dansguardian_log.o dansguardian_report.o realtime.o -o sarg
log.o: In function `main':
/mnt/dane/sarg-2.2.5/log.c:1545: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/log.c:1545: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/log.c:1546: undefined reference to `WEXITSTATUS'
topuser.o: In function `topuser':
/mnt/dane/sarg-2.2.5/topuser.c:205: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/topuser.c:205: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/topuser.c:206: undefined reference to `WEXITSTATUS'
email.o: In function `geramail':
/mnt/dane/sarg-2.2.5/email.c:155: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/email.c:155: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/email.c:156: undefined reference to `WEXITSTATUS'
sort.o: In function `sort_users_log':
/mnt/dane/sarg-2.2.5/sort.c:167: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/sort.c:167: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/sort.c:168: undefined reference to `WEXITSTATUS'
sort.o: In function `tmpsort':
/mnt/dane/sarg-2.2.5/sort.c:106: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/sort.c:106: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/sort.c:107: undefined reference to `WEXITSTATUS'
html.o: In function `htmlrel':
/mnt/dane/sarg-2.2.5/html.c:485: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/html.c:485: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/html.c:486: undefined reference to `WEXITSTATUS'
index.o: In function `make_index':
/mnt/dane/sarg-2.2.5/index.c:253: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/index.c:253: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/index.c:295: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/index.c:295: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/index.c:350: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/index.c:350: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/index.c:392: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/index.c:392: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/index.c:254: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/index.c:351: undefined reference to `WEXITSTATUS'
useragent.o: In function `useragent':
/mnt/dane/sarg-2.2.5/useragent.c:128: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/useragent.c:128: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/useragent.c:274: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/useragent.c:218: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/useragent.c:218: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/useragent.c:273: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/useragent.c:273: undefined reference to `WEXITSTATUS'
totday.o: In function `day_totalize':
/mnt/dane/sarg-2.2.5/totday.c:60: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/totday.c:60: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/totday.c:61: undefined reference to `WEXITSTATUS'
lastlog.o: In function `mklastlog':
/mnt/dane/sarg-2.2.5/lastlog.c:73: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/lastlog.c:73: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/lastlog.c:74: undefined reference to `WEXITSTATUS'
topsites.o: In function `topsites':
/mnt/dane/sarg-2.2.5/topsites.c:83: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/topsites.c:83: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/topsites.c:84: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/topsites.c:195: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/topsites.c:195: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/topsites.c:196: undefined reference to `WEXITSTATUS'
siteuser.o: In function `siteuser':
/mnt/dane/sarg-2.2.5/siteuser.c:74: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/siteuser.c:74: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/siteuser.c:75: undefined reference to `WEXITSTATUS'
smartfilter.o: In function `smartfilter_report':
/mnt/dane/sarg-2.2.5/smartfilter.c:77: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/smartfilter.c:77: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/smartfilter.c:78: undefined reference to `WEXITSTATUS'
authfail.o: In function `authfail_report':
/mnt/dane/sarg-2.2.5/authfail.c:68: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/authfail.c:68: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/authfail.c:69: undefined reference to `WEXITSTATUS'
squidguard_log.o: In function `squidguard_log':
/mnt/dane/sarg-2.2.5/squidguard_log.c:300: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/squidguard_log.c:300: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/squidguard_log.c:301: undefined reference to `WEXITSTATUS'
dansguardian_log.o: In function `dansguardian_log':
/mnt/dane/sarg-2.2.5/dansguardian_log.c:164: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/dansguardian_log.c:164: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/dansguardian_log.c:165: undefined reference to `WEXITSTATUS'
realtime.o: In function `getlog':
/mnt/dane/sarg-2.2.5/realtime.c:114: undefined reference to `WIFEXITED'
/mnt/dane/sarg-2.2.5/realtime.c:114: undefined reference to `WEXITSTATUS'
/mnt/dane/sarg-2.2.5/realtime.c:115: undefined reference to `WEXITSTATUS'
collect2: ld returned 1 exit status
make: *** [sarg] Error 1
suse:/mnt/dane/sarg-2.2.5#
Gdzieś znalazłem, żeby sprawdzić, czy w /include/conf.h jest dołączony sys/wait.h i wyglada na to, że jest. Mimo to, nie rozpoznaje WIFEXITED i WEXITSTATUS. Można coś z tym zrobić?
Po wielu próbach w końcu dałem za wygraną. Postawiłem drugą maszynę na SUSE11.1 , zrobiłem update’y i nagle wszystko zaczęło działać. Nie musiałem nawet dogrywać tego patch’a.