Search
j0ke.net Open Build Service
>
Projects
>
Apache
:
Modules
>
apache2-mod_mirrorbrain
> mirrorbrain.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File mirrorbrain.spec of Package apache2-mod_mirrorbrain (Revision 25)
Currently displaying revision
25
,
show latest
# # spec file for package mirrorbrain # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild %if %{defined suse_version} %define apxs /usr/sbin/apxs2 BuildRequires: apache2-devel apache2-prefork apache2-worker %endif # %if %{defined centos_version} %define apxs /usr/sbin/apxs BuildRequires: httpd-devel %endif # BuildRequires: GeoIP GeoIP-devel apache2-mod_form BuildRequires: python-devel # %define apache apache2 %define apache_libexecdir %(%{apxs} -q LIBEXECDIR) %define apache_sysconfdir %(%{apxs} -q SYSCONFDIR) %define apache_includedir %(%{apxs} -q INCLUDEDIR) %define apache_serverroot %(%{apxs} -q PREFIX) %define apache_localstatedir %(%{apxs} -q LOCALSTATEDIR) %define apache_mmn %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN) # Name: mirrorbrain Summary: A download redirector and metalink generator # to build a man page, we need to have the script functional, and thus we need more stuff # but python-cmdln is not available #BuildRequires: help2man python-cmdln Url: http://mirrorbrain.org/ Packager: Peter Poeml, mirrorbrain at mirrorbrain.org Version: 2.14.0 Release: 0 License: Apache License 2.0, GPL Group: Productivity/Networking/Web/Servers # # v=2.8.1+r7675; rm -rf mirrorbrain-$v; osc rm *.tar.gz; svn export -q 'http://svn.mirrorbrain.org/svn/mirrorbrain/trunk' mirrorbrain-$v; tar czf mirrorbrain-$v.tar.gz mirrorbrain-$v; osc add mirrorbrain-$v.tar.gz Source: http://mirrorbrain.org/files/releases/mirrorbrain-%{version}.tar.gz # %if %{defined suse_version} PreReq: pwdutils %insserv_prereq %fillup_prereq %else PreReq: /usr/bin/getent /usr/bin/useradd /usr/bin/groupadd %endif # BuildRoot: %{_tmppath}/%{name}-%{version}-build %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True)")} %description This apache module redirects clients to mirror servers, using an SQL backend, and generates metalinks. See http://mirrorbrain.org/ Author: Peter Poeml <poeml@cmdline.net> %package -n apache2-mod_mirrorbrain License: Apache License 2.0, GPL Summary: MirrorBrain redirector Apache module Obsoletes: apache2-mod_zrkadlo Group: Productivity/Networking/Web/Servers # see http://mirrorbrain.org/requirements %if %{defined suse_version} Requires: apache2 >= 2.2.6 Requires: %{apache_mmn} Requires: libapr-util1 >= 1.3.0 Requires: libapr-util1-dbd-pgsql %else Requires: httpd %endif Requires: GeoIP apache2-mod_geoip # # for mod_form Requires: apache2-mod_form # building with memcache support: %if %{?build_with_memcache:1}0 BuildRequires: apache2-mod_memcache Requires: apache2-mod_memcache %define memcache_cflags -DWITH_MEMCACHE %else %define memcache_cflags %nil %endif # this module was was split off in a separate package with 2.10.1. Require it # so that existing installations will keep having it installed. # the requires can be removed later (let's say, a few months after October '09) Requires: apache2-mod_autoindex_mb Autoreqprov: on %description -n apache2-mod_mirrorbrain MirrorBrain is a scalable download redirector. This package contains mod_mirrorbrain, the Apache module which represents the core of MirrorBrain. %package -n apache2-mod_autoindex_mb License: Apache License 2.0, GPL Summary: Apache module generating directory indexes for MirrorBrain Group: Productivity/Networking/Web/Servers %if %{defined suse_version} Requires: %{apache_mmn} %else Requires: httpd %endif Requires: apache2-mod_mirrorbrain Autoreqprov: on %description -n apache2-mod_autoindex_mb This package contains mod_autoindex_mb, the Apache module which represents the core of MirrorBrain. This package contains mod_autoindex_mb, which is a patched mod_autoindex. It adds a little further capability as index option. It adds these two options: <IfModule mod_autoindex_mb.c> IndexOptions Metalink IndexOptions Mirrorlist </IfModule> The Metalink option adds a link named "Metalink" to the index, which links to the same file but with ".metalink" appended. The MirrorList option adds a link named "Mirrors" to the index, which links to the same resources but with "?mirrorlist" appended. %package tools License: Apache License 2.0, GPL Summary: MirrorBrain commandline tools Group: Productivity/Networking/Web/Servers Requires: python-mb python-cmdln python-sqlobject python-psycopg2 Requires: GeoIP %description tools MirrorBrain is a scalable download redirector. This package contains utilities provided by the MirrorBrain framework to maintain the database and scan mirrors. %package -n python-mb License: Apache License 2.0, GPL Summary: mb, a Python module used by the MirrorBrain commandline tools Group: Productivity/Networking/Web/Servers Requires: python-sqlobject python-psycopg2 Requires: GeoIP %if %{defined suse_version} %if 0%{?suse_version} < 110 Recommends: python-processing %endif %endif %description -n python-mb MirrorBrain is a scalable download redirector. This package contains a Python module (named "mb") for easily maintaining MirrorBrain. %package scanner License: Apache License 2.0, GPL Summary: MirrorBrain scanner Group: Productivity/Networking/Web/Servers Requires: perl-Config-IniFiles perl-libwww-perl perl-Digest-MD4 perl-DBD-Pg perl-TimeDate %description scanner MirrorBrain is a scalable download redirector. This package contains the mirror scanner. %prep %setup -q -n mirrorbrain-%{version} %build cd mod_mirrorbrain %{apxs} -c -Wc,"%memcache_cflags -Wall -g" -lm mod_mirrorbrain.c cd ../mod_autoindex_mb %{apxs} -c -Wc,"%memcache_cflags -Wall -g" mod_autoindex_mb.c cd ../tools gcc $RPM_OPT_FLAGS -Wall -o geoiplookup_continent geoiplookup_continent.c -lGeoIP gcc $RPM_OPT_FLAGS -Wall -o geoiplookup_city geoiplookup_city.c -lGeoIP cd ../mb CFLAGS="%{optflags}" \ %{__python} setup.py build %install mkdir -p $RPM_BUILD_ROOT/%{apache_libexecdir} cp -p mod_mirrorbrain/.libs/mod_mirrorbrain.so $RPM_BUILD_ROOT/%{apache_libexecdir} cp -p mod_autoindex_mb/.libs/mod_autoindex_mb.so $RPM_BUILD_ROOT/%{apache_libexecdir} # tools install -D -m 755 tools/geoiplookup_continent $RPM_BUILD_ROOT/%{_bindir}/geoiplookup_continent install -D -m 755 tools/geoiplookup_city $RPM_BUILD_ROOT/%{_bindir}/geoiplookup_city install -D -m 755 tools/bdecode $RPM_BUILD_ROOT/%{_bindir}/bdecode install -D -m 755 tools/rsyncinfo $RPM_BUILD_ROOT/%{_bindir}/rsyncinfo install -D -m 755 tools/rsyncusers $RPM_BUILD_ROOT/%{_bindir}/rsyncusers install -D -m 755 tools/metalink-hasher.py $RPM_BUILD_ROOT/%{_bindir}/metalink-hasher install -D -m 755 tools/geoip-lite-update $RPM_BUILD_ROOT/%{_bindir}/geoip-lite-update install -D -m 755 tools/create_timestamp $RPM_BUILD_ROOT/%{_bindir}/create_timestamp install -D -m 755 tools/null-rsync $RPM_BUILD_ROOT/%{_bindir}/null-rsync install -D -m 755 tools/scanner.pl $RPM_BUILD_ROOT/%{_bindir}/scanner install -D -m 755 mirrorprobe/mirrorprobe.py $RPM_BUILD_ROOT/%{_bindir}/mirrorprobe install -D -m 755 tools/mirrorprobe-logrotate $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/mirrorprobe cd mb %{__python} setup.py install --prefix=%{_prefix} --root %{buildroot} ln -s mb %{buildroot}/%{_bindir}/mirrordoctor # only for backwards compatibility; removal at end of 2010 # man page for mb tool #%{buildroot}/%{_bindir}/mb --version #help2man --no-info %{buildroot}/%{_bindir}/mb > mb.1 # Icons mkdir -p $RPM_BUILD_ROOT/usr/share/mirrorbrain cp -a famfamfam_flag_icons $RPM_BUILD_ROOT/usr/share/mirrorbrain/ # log directory mkdir -p $RPM_BUILD_ROOT/%{_var}/log/mirrorbrain %pre if ! /usr/bin/getent group mirrorbrain &>/dev/null; then echo "Creating mirrorbrain group" /usr/sbin/groupadd -r mirrorbrain fi if ! /usr/bin/getent passwd mirrorbrain &>/dev/null; then echo "Creating mirrorbrain user" /usr/sbin/useradd -o -g mirrorbrain -s /bin/bash -r -c "MirrorBrain user" \ -d /home/mirrorbrain -m mirrorbrain fi %post # move old mirrorprobe logfile to the new location # Update ? if [ ${1:-0} -gt 1 ]; then if [ -e /var/log/mirrorprobe.log ] && [ ! -e /var/log/mirrorbrain/mirrorprobe.log ]; then echo "moving /var/log/mirrorprobe.log to /var/log/mirrorbrain/" mv -v /var/log/mirrorprobe.log /var/log/mirrorbrain/ echo "creating symlink at the old location (/var/log/mirrorprobe.log). You may remove it." ln -sv /var/log/mirrorbrain/mirrorprobe.log /var/log/mirrorprobe.log # adjust config, if the defaults were in use if grep -q '^logfile = /var/log/mirrorprobe.log' /etc/mirrorbrain.conf &>/dev/null; then echo "adjusting /etc/mirrorbrain.conf" sed -i 's,^logfile = /var/log/mirrorprobe.log,logfile = /var/log/mirrorbrain/mirrorprobe.log,' /etc/mirrorbrain.conf echo "/etc/mirrorbrain.conf was migrated to the new location" fi fi # create missing database tables that are needed with 2.13.0 and later if test -e /etc/mirrorbrain.conf && test -x /usr/bin/mb; then echo "checking if new tables need to be added after upgrade" mb > /dev/null fi fi exit 0 %files %defattr(-,root,root) %doc COPYING FAQ TODO %doc mod_autoindex_mb/NOTICE %doc mod_mirrorbrain/*.conf %doc docs %doc sql %dir %attr(750,mirrorbrain,mirrorbrain) %{_var}/log/mirrorbrain %files -n apache2-mod_mirrorbrain %defattr(-,root,root) %{apache_libexecdir}/mod_mirrorbrain.so %files -n apache2-mod_autoindex_mb %defattr(-,root,root) %{apache_libexecdir}/mod_autoindex_mb.so %files tools %defattr(-,root,root) %{_bindir}/bdecode %{_bindir}/create_timestamp %{_bindir}/geoip-lite-update %{_bindir}/geoiplookup_city %{_bindir}/geoiplookup_continent %{_bindir}/metalink-hasher %{_bindir}/mirrordoctor %{_bindir}/mirrorprobe %{_bindir}/null-rsync %{_bindir}/rsyncinfo %{_bindir}/rsyncusers %config(noreplace) %{_sysconfdir}/logrotate.d/mirrorprobe # Icons /usr/share/mirrorbrain %files -n python-mb %defattr(-,root,root) %{_bindir}/mb %{python_sitearch}/* %files scanner %defattr(-,root,root) %{_bindir}/scanner %changelog -n mirrorbrain