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