1 |
%define name imspector |
2 |
%define version 0.9 |
3 |
%define release %mkrel 18 |
4 |
|
5 |
%if %mdkversion < 200900 |
6 |
%define ldflags -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id |
7 |
%endif |
8 |
|
9 |
Name: %{name} |
10 |
Version: %{version} |
11 |
Release: %{release} |
12 |
Summary: Multiple IM transparent proxy |
13 |
License: GPLv2+ |
14 |
Group: Networking/Other |
15 |
URL: http://www.imspector.org/ |
16 |
Source0: http://www.imspector.org/downloads/%{name}-20101229.tar.gz |
17 |
Source1: imspector.sysconfig |
18 |
Source2: imspector.init |
19 |
Patch0: imspector-make.patch |
20 |
Patch1: imspector-main.patch |
21 |
Patch2: imspector-conf.patch |
22 |
Patch3: multiple-lines.patch |
23 |
Patch4: imspector-0.9-openssl-1.0.patch |
24 |
Patch5: imspector-0.9-link.patch |
25 |
BuildRequires: openssl-devel >= 0.9.7 |
26 |
BuildRequires: mysql-devel |
27 |
BuildRequires: postgresql-devel |
28 |
BuildRequires: sqlite3-devel |
29 |
Requires: webserver |
30 |
Requires: openssl |
31 |
Requires(post): rpm-helper |
32 |
%if %mdkversion < 201010 |
33 |
Requires(postun): rpm-helper |
34 |
%endif |
35 |
BuildRoot: %{_tmppath}/%{name}-%{version} |
36 |
|
37 |
|
38 |
%description |
39 |
IMSpector is an Instant Messenger proxy with monitoring, blocking and |
40 |
content-filtering capabilities. Currently it supports MSN, Jabber/XMPP, AIM, |
41 |
ICQ, Yahoo, IRC and Gadu-Gadu to different degrees. MSN is the principle |
42 |
protocol, as it is the most popular these days, at least in the UK where I'm |
43 |
based. The supported platforms are at present Linux and BSD when using the pf |
44 |
firewall, but porting to other UNIXs should be trivial. It is able to log to |
45 |
plain files, as well as several types of SQL database including MySQL, SQLite |
46 |
and PostreSQL. |
47 |
|
48 |
%package mysql |
49 |
Summary: Imspector MySQL log support |
50 |
Group: Networking/Other |
51 |
Requires: %{name} |
52 |
|
53 |
%description mysql |
54 |
This package gives imspector mysql logging capabilities. |
55 |
|
56 |
%package postgresql |
57 |
Summary: Imspector PostgreSQL log support |
58 |
Group: Networking/Other |
59 |
Requires: %{name} |
60 |
|
61 |
%description postgresql |
62 |
This package gives imspector postgresql logging capabilities. |
63 |
|
64 |
%package sqlite |
65 |
Summary: Imspector MySQL log support |
66 |
Group: Networking/Other |
67 |
Requires: %{name} |
68 |
|
69 |
%description sqlite |
70 |
This package gives imspector sqlite logging and auto-messeging capabilities. |
71 |
|
72 |
%prep |
73 |
|
74 |
%setup -q -n imspector |
75 |
%patch0 -p0 -b .make |
76 |
%patch1 -p0 -b .notusr |
77 |
%patch2 -p0 -b .config |
78 |
%patch3 -p1 -b .multiple_lines_at_config |
79 |
%patch4 -p0 -b .ssl |
80 |
%patch5 -p0 -b .link |
81 |
|
82 |
cat imspector.conf|sed -r 's|/usr/lib|%{_libdir}|' > imspector.conf.1 |
83 |
rm -f imspector.conf |
84 |
mv imspector.conf.1 imspector.conf |
85 |
|
86 |
%build |
87 |
%make CXX="g++ %optflags %ldflags" |
88 |
%make mysqlloggingplugin.so CXX="g++ %optflags" |
89 |
%make postgresqlloggingplugin.so CXX="g++ %optflags" |
90 |
%make sqliteloggingplugin.so CXX="g++ %optflags" |
91 |
%make dbresponderplugin.so CXX="g++ %optflags" |
92 |
|
93 |
%install |
94 |
%{__rm} -rf %{buildroot} |
95 |
|
96 |
%makeinstall |
97 |
install -d %{buildroot}%{_var}/www/cgi-bin |
98 |
mv contrib/imspector.cgi %{buildroot}%{_var}/www/cgi-bin/ |
99 |
|
100 |
%{__mkdir_p} %{buildroot}%{_var}/log/imspector |
101 |
%{__mkdir_p} %{buildroot}%{_var}/lib/imspector |
102 |
|
103 |
# provide a simple apache config |
104 |
%{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d/ |
105 |
cat > %{buildroot}/etc/httpd/conf/webapps.d/imspector.conf << EOF |
106 |
<Location /cgi-bin/imspector.cgi> |
107 |
Order allow,deny |
108 |
Allow from all |
109 |
</Location> |
110 |
EOF |
111 |
|
112 |
%{__mkdir_p} %{buildroot}%{_initrddir} |
113 |
%{__mkdir_p} %{buildroot}%{_sysconfdir}/sysconfig |
114 |
install -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/imspector |
115 |
install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/imspector |
116 |
|
117 |
|
118 |
%clean |
119 |
%{__rm} -rf %{buildroot} |
120 |
|
121 |
%preun |
122 |
%_preun_service imspector |
123 |
|
124 |
%pre |
125 |
%_pre_useradd imspector %{_var}/lib/imspector /bin/false |
126 |
#%_pre_groupadd imspector |
127 |
|
128 |
%postun |
129 |
%_postun_userdel imspector |
130 |
%_postun_groupdel imspector |
131 |
%if %mdkversion < 201010 |
132 |
%_postun_webapp |
133 |
%endif |
134 |
|
135 |
%post |
136 |
%if %mdkversion < 201010 |
137 |
%_post_webapp |
138 |
%endif |
139 |
%_create_ssl_certificate imspector |
140 |
%_post_service imspector |
141 |
|
142 |
%files |
143 |
%defattr(0755,root,root) |
144 |
%doc COPYING INSTALL README |
145 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/imspector |
146 |
%attr(0755,root,root) %{_initrddir}/imspector |
147 |
%dir %{_sysconfdir}/imspector |
148 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/imspector/acl.txt |
149 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/imspector/badwords.txt |
150 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/imspector/imspector.conf |
151 |
%{_sbindir}/imspector |
152 |
%dir %{_libdir}/imspector |
153 |
%{_libdir}/imspector/aclfilterplugin.so |
154 |
%{_libdir}/imspector/badwordsfilterplugin.so |
155 |
%{_libdir}/imspector/catsloggingplugin.so |
156 |
%{_libdir}/imspector/censordfilterplugin.so |
157 |
%{_libdir}/imspector/debugloggingplugin.so |
158 |
%{_libdir}/imspector/fileloggingplugin.so |
159 |
%{_libdir}/imspector/ggprotocolplugin.so |
160 |
%{_libdir}/imspector/httpsprotocolplugin.so |
161 |
%{_libdir}/imspector/icqprotocolplugin.so |
162 |
%{_libdir}/imspector/ircprotocolplugin.so |
163 |
%{_libdir}/imspector/jabberprotocolplugin.so |
164 |
%{_libdir}/imspector/miscfilterplugin.so |
165 |
%{_libdir}/imspector/msnprotocolplugin.so |
166 |
%{_libdir}/imspector/yahooprotocolplugin.so |
167 |
%{_libdir}/libimspector.so |
168 |
%{_var}/www/cgi-bin/imspector.cgi |
169 |
%attr(-,imspector,imspector) %{_var}/lib/imspector |
170 |
%attr(-,imspector,imspector) %{_var}/log/imspector |
171 |
%config(noreplace) %{_sysconfdir}/httpd/conf/webapps.d/imspector.conf |
172 |
|
173 |
%files mysql |
174 |
%{_libdir}/imspector/mysqlloggingplugin.so |
175 |
|
176 |
%files postgresql |
177 |
%{_libdir}/imspector/postgresqlloggingplugin.so |
178 |
|
179 |
%files sqlite |
180 |
%{_libdir}/imspector/sqliteloggingplugin.so |
181 |
%{_libdir}/imspector/dbresponderplugin.so |
182 |
|
183 |
|