summaryrefslogtreecommitdiff
path: root/bfilter.spec
blob: 0de397974e71628a69bbc49c389343c0cfa88250 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# Conditional build:
%bcond_with	gui	# Enable GTK+ UI (doesn't build)
#
Summary:	A filtering Web proxy
Summary(pl):	Filtrujące proxy WWW
Name:		bfilter
Version:	0.9.4
Release:	1
License:	GPL v2+
Group:		Networking/Daemons
Source0:	http://dl.sourceforge.net/bfilter/%{name}-%{version}.tar.gz
# Source0-md5:	72ca85565bd4c556b06e3a264c0c24f1
Source1:	%{name}.init
URL:		http://bfilter.sf.net
BuildRequires:	libsigc++12-devel
BuildRequires:	libstdc++-devel
BuildRequires:	pkgconfig
BuildRequires:	popt-devel
BuildRequires:	zlib-devel
BuildRequires:	rpmbuild(macros) >= 1.202
BuildRequires:	broken-pre-scriptlet(fix user/group)
Requires(post):	/usr/sbin/groupadd
Requires(post):	/usr/sbin/useradd
Requires(post,preun):	/sbin/chkconfig
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
BFilter is a filtering web proxy. It was originally intended for
removing banner ads only, but at some point it has been extended to
remove popups and webbugs. Its main advantage over the similar tools
is its heuristic ad detection algorithm.

%description -l pl
BFilter jest filtrującym proxy WWW. Pierwotnie miał on filtrować tylko
bannery, jednak rozszerzono go o usuwanie popupów i innych reklam.
Główną jego przewagą nad innymi tego rodzaju narzędziami jest
heurystyczny algorytm rozpoznawania reklam.

%prep
%setup -q

%build
%configure \
	--with%{!?with_gui:out}-gui
%{__make}

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/etc/rc.d/init.d

%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT

install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# XXX: unify
# TODO register uid/gid in uid_gid.db.txt
%groupadd -r -g XXX -f %{name}
%useradd -r -u XXX -s /bin/false -d / -M -g %{name} -c 'BFilter filtering proxy' %{name}

%post
/sbin/chkconfig --add %{name}
if [ -f /var/lock/subsys/%{name} ]; then
	/etc/rc.d/init.d/%{name} restart 1>&2
else
	echo "Type \"/etc/rc.d/init.d/%{name} start\" to start %{name}." 1>&2
fi

%preun
if [ "$1" = "0" ]; then
	if [ -f /var/lock/subsys/%{name} ]; then
		/etc/rc.d/init.d/%{name} stop 1>&2
	fi
	/sbin/chkconfig --del %{name}
fi

%files
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog NEWS README doc/*.html doc/*.png
%attr(755,root,root) %{_bindir}/%{name}
%attr(754,root,root) /etc/rc.d/init.d/%{name}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/config
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/rules.local
%{_sysconfdir}/%{name}/config.default
%{_sysconfdir}/%{name}/rules