File apache2-mod_mirrorbrain.spec of Package apache2-mod_mirrorbrain (Revision 16)
Currently displaying revision 16, show latest
1
#
2
# spec file for package mirrorbrain
3
#
4
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
5
# This file and all modifications and additions to the pristine
6
# package are under the same license as the package itself.
7
#
8
# Please submit bugfixes or comments via http://bugs.opensuse.org/
9
#
10
11
# norootforbuild
12
13
%define apxs /usr/sbin/apxs2
14
%define apache apache2
15
%define apache_libexecdir %(%{apxs} -q LIBEXECDIR)
16
%define apache_sysconfdir %(%{apxs} -q SYSCONFDIR)
17
%define apache_includedir %(%{apxs} -q INCLUDEDIR)
18
%define apache_serverroot %(%{apxs} -q PREFIX)
19
%define apache_localstatedir %(%{apxs} -q LOCALSTATEDIR)
20
%define apache_mmn %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN)
21
Name: mirrorbrain
22
Summary: A download redirector and metalink generator
23
BuildRequires: apache2-devel apache2-prefork GeoIP GeoIP-devel apache2-webthings-collection python-devel
24
# to build a man page, we need to have the script functional, and thus we need more stuff
25
# but python-cmdln is not available
26
#BuildRequires: help2man python-cmdln
27
Url: http://mirrorbrain.org/
28
Packager: Peter Poeml, mirrorbrain at mirrorbrain.org
29
Version: 2.11.3
30
Release: 1
31
License: Apache License 2.0, GPL
32
Group: Productivity/Networking/Web/Servers
33
#
34
# v=2.7; rm -rf mirrorbrain-$v; svn export -q 'https://forgesvn1.novell.com/svn/opensuse/trunk/tools/download-redirector-v2' mirrorbrain-$v; tar czf mirrorbrain-$v.tar.gz mirrorbrain-$v
35
Source: http://mirrorbrain.org/files/releases/mirrorbrain-%{version}.tar.gz
36
#
37
BuildRoot: %{_tmppath}/%{name}-%{version}-build
38
39
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
40
41
%description
42
This apache module redirects clients to mirror servers, using an SQL backend,
43
and generates metalinks.
44
45
See http://mirrorbrain.org/
46
47
The package contains also
48
* tools to maintain the mirror database
49
* mirror monitoring
50
* mirror scanning
51
52
(The tools should be split into a subpackage in fact...)
53
54
Author: Peter Poeml <poeml@suse.de>
55
56
%package -n apache2-mod_mirrorbrain
57
License: Apache License 2.0, GPL
58
Summary: MirrorBrain redirector Apache module
59
Obsoletes: apache2-mod_zrkadlo
60
Group: Productivity/Networking/Web/Servers
61
# see http://mirrorbrain.org/requirements
62
Requires: apache2 >= 2.2.6
63
Requires: %{apache_mmn}
64
Requires: libapr-util1 >= 1.3.0
65
Requires: GeoIP apache2-mod_geoip
66
#
67
# for mod_form
68
Requires: apache2-webthings-collection
69
# building with memcache support:
70
%if %{?build_with_memcache:1}0
71
BuildRequires: apache2-mod_memcache
72
Requires: apache2-mod_memcache
73
%define memcache_cflags -DWITH_MEMCACHE
74
%else
75
%define memcache_cflags %nil
76
%endif
77
Autoreqprov: on
78
79
80
%description -n apache2-mod_mirrorbrain
81
Utilities provided by the MirrorBrain framework to maintain the database and
82
scan mirrors.
83
84
85
%package tools
86
License: Apache License 2.0, GPL
87
Summary: MirrorBrain utilities
88
Group: Productivity/Networking/Web/Servers
89
Requires: python-psycopg2 python-sqlobject python-cmdln
90
Requires: GeoIP
91
92
%description tools
93
Utilities provided by the MirrorBrain framework to maintain the database and
94
scan mirrors.
95
96
97
%package scanner
98
License: Apache License 2.0, GPL
99
Summary: MirrorBrain scanner
100
Group: Productivity/Networking/Web/Servers
101
Requires: perl-Config-IniFiles perl-libwww-perl perl-Digest-MD4 perl-DBD-Pg
102
103
%description scanner
104
Utilities provided by the MirrorBrain framework to maintain the database and
105
scan mirrors.
106
107
108
109
%prep
110
%setup -n mirrorbrain-%{version}
111
112
%build
113
cd mod_mirrorbrain
114
%{apxs} -c -Wc,"%memcache_cflags -Wall -g" mod_mirrorbrain.c
115
cd ../mod_autoindex_mb
116
%{apxs} -c -Wc,"%memcache_cflags -Wall -g" mod_autoindex_mb.c
117
cd ../tools
118
gcc $RPM_OPT_FLAGS -Wall -lGeoIP -o geoiplookup_continent geoiplookup_continent.c
119
gcc $RPM_OPT_FLAGS -Wall -lGeoIP -o geoiplookup_city geoiplookup_city.c
120
cd ../mirrordoctor
121
CFLAGS="%{optflags}" \
122
%{__python} setup.py build
123
124
125
%install
126
mkdir -p $RPM_BUILD_ROOT/%{apache_libexecdir}
127
cp -p mod_mirrorbrain/.libs/mod_mirrorbrain.so $RPM_BUILD_ROOT/%{apache_libexecdir}
128
cp -p mod_autoindex_mb/.libs/mod_autoindex_mb.so $RPM_BUILD_ROOT/%{apache_libexecdir}
129
# tools
130
install -D -m 755 tools/geoiplookup_continent $RPM_BUILD_ROOT/%{_bindir}/geoiplookup_continent
131
install -D -m 755 tools/geoiplookup_city $RPM_BUILD_ROOT/%{_bindir}/geoiplookup_city
132
install -D -m 755 tools/rsyncinfo.py $RPM_BUILD_ROOT/%{_bindir}/rsyncinfo
133
install -D -m 755 tools/rsyncusers $RPM_BUILD_ROOT/%{_bindir}/rsyncusers
134
install -D -m 755 tools/metalink-hasher.py $RPM_BUILD_ROOT/%{_bindir}/metalink-hasher
135
install -D -m 755 tools/geoip-lite-update $RPM_BUILD_ROOT/%{_bindir}/geoip-lite-update
136
install -D -m 755 tools/create_timestamp $RPM_BUILD_ROOT/%{_bindir}/create_timestamp
137
install -D -m 755 tools/scanner.pl $RPM_BUILD_ROOT/%{_bindir}/scanner
138
install -D -m 755 mirrorprobe/mirrorprobe.py $RPM_BUILD_ROOT/%{_bindir}/mirrorprobe
139
cd mirrordoctor
140
%{__python} setup.py install --prefix=%{_prefix} --root %{buildroot}
141
ln -s mirrordoctor.py %{buildroot}/%{_bindir}/mirrordoctor
142
ln -s mirrordoctor.py %{buildroot}/%{_bindir}/mb
143
# man page for mb tool
144
#%{buildroot}/%{_bindir}/mb --version
145
#help2man --no-info %{buildroot}/%{_bindir}/mb > mb.1
146
# Icons
147
mkdir -p $RPM_BUILD_ROOT/usr/share/mirrorbrain
148
cp -a famfamfam_flag_icons $RPM_BUILD_ROOT/usr/share/mirrorbrain/
149
150
151
152
153
%files
154
%defattr(-,root,root)
155
%doc COPYING FAQ TODO
156
%doc mod_autoindex_mb/NOTICE
157
%doc mod_mirrorbrain/*.conf
158
%doc sql
159
160
%files -n apache2-mod_mirrorbrain
161
%defattr(-,root,root)
162
%{apache_libexecdir}/mod_autoindex_mb.so
163
%{apache_libexecdir}/mod_mirrorbrain.so
164
165
%files tools
166
%defattr(-,root,root)
167
%{python_sitelib}/*
168
%{_bindir}/create_timestamp
169
%{_bindir}/geoip-lite-update
170
%{_bindir}/geoiplookup_city
171
%{_bindir}/geoiplookup_continent
172
%{_bindir}/mb
173
%{_bindir}/metalink-hasher
174
%{_bindir}/mirrordoctor
175
%{_bindir}/mirrordoctor.py
176
%{_bindir}/mirrorprobe
177
%{_bindir}/rsyncinfo
178
%{_bindir}/rsyncusers
179
# Icons
180
/usr/share/mirrorbrain
181
182
%files scanner
183
%defattr(-,root,root)
184
%{_bindir}/scanner
185
186
187
188
189
%changelog -n apache2-mod_mirrorbrain
190