Name: intelligentmirror Version: 0.5 Release: 3 Summary: Squid url rewriter to cache rpm/deb packages License: GPLv2+ Group: Applications/Internet URL: https://fedorahosted.org/intelligentmirror Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: python-iniparse python-urlgrabber Requires: squid %description IntelligentMirror can be used to create a mirror of static HTTP content on your local network. When you download something (say a software package) from Internet, it is stored/cached on a local machine on your network and subsequent downloads of that particular software package are supplied from the storage/cache of the local machine. This facilitate the efficient usage of bandwidth and also reduces the average download time. %package httpd Summary: Config of IntelligentMirror for httpd Group: Applications/Internet Requires: httpd %description httpd IntelligentMirror can be used to create a mirror of static HTTP content on your local network. When you download something (say a software package) from Internet, it is stored/cached on a local machine on your network and subsequent downloads of that particular software package are supplied from the storage/cache of the local machine. This facilitate the efficient usage of bandwidth and also reduces the average download time. This is the config of IntelligentMirror for httpd. %prep %setup %install rm -rf $RPM_BUILD_ROOT install -m 755 -d ${RPM_BUILD_ROOT}%{_sysconfdir} install -m 644 %{name}_sysconfig.conf -T ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf install -m 755 -d ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d install -m 644 %{name}_httpd.conf -T ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/%{name}.conf install -m 755 -d ${RPM_BUILD_ROOT}%{_datadir}/%{name} install -m 644 %{name}/* -t ${RPM_BUILD_ROOT}%{_datadir}/%{name} install -m 744 -d ${RPM_BUILD_ROOT}%{_mandir}/man8 install -m 644 %{name}.8.gz -T ${RPM_BUILD_ROOT}%{_mandir}/man8/%{name}.8.gz install -m 755 -d ${RPM_BUILD_ROOT}%{_localstatedir}/log/squid touch ${RPM_BUILD_ROOT}%{_localstatedir}/log/squid/%{name}.log install -m 755 -d ${RPM_BUILD_ROOT}%{_sbindir} install -m 755 update-im -T ${RPM_BUILD_ROOT}%{_sbindir}/update-im install -m 755 -d ${RPM_BUILD_ROOT}%{_sysconfdir}/squid cat > ${RPM_BUILD_ROOT}%{_sysconfdir}/squid/%{name}.conf < %{_sysconfdir}/squid/squid.conf cat >> %{_sysconfdir}/squid/squid.conf << EOF include %{_sysconfdir}/squid/%{name}.conf EOF restorecon %{_sysconfdir}/squid/%{name}.conf echo "Reloading squid service..." /sbin/service squid reload %post httpd echo "Reloading httpd service..." /sbin/service httpd reload %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc COPYING Readme %{_datadir}/%{name} %config(noreplace) %{_sysconfdir}/squid/%{name}.conf %config(noreplace) %{_sysconfdir}/%{name}.conf %{_mandir}/man8/%{name}.8* %ghost %{_localstatedir}/log/squid/%{name}.log %{_localstatedir}/spool/squid/%{name} %{_sbindir}/update-im %files httpd %defattr(-,root,root,-) %doc COPYING Readme %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf %changelog * Sat Dec 13 2008 bbbush - 0.5-3 - fix config for squid - include config in squid.conf - restorecon * Sat Dec 13 2008 bbbush - 0.5-2 - move python files to /usr/share/intelligentmirror/ - install default config - modify spec so one can build with normal user * Fri Sep 19 2008 Kulbir Saini Fixed spec file for package name specification. * Fri Sep 19 2008 Kulbir Saini Updated and corrected spec file. Also updated to new version 0.4. * Fri Sep 19 2008 Kulbir Saini Fixed the defunct process bug. Ready to cache debian packages as well. Introduced limits on package and cache sizes. Option to enable/disable caching rpm/deb packages are available now. * Tue Sep 16 2008 Kulbir Saini A few corrections in INSTALL file. * Mon Aug 25 2008 Kulbir Saini Implemented the new set of options. Also a lot of performance enhancement. IM is faster now. Deb caching working perfectly. * Sat Aug 23 2008 Kulbir Saini A new series of options has been proposed. Not implemented yet, but will be implemented very soon. * Tue Aug 19 2008 Kulbir Saini Working version with squid-2.6STABLE16 and above. Forked processes still defuct after download. Need to dig more to figure it out. * Wed Jun 25 2008 Kulbir Saini Bumped to version 0.2 * Wed Jun 25 2008 Kulbir Saini Fixed few bugs(proxy loops). Corrected configuration files. Added spec, README, INSTALL, conf files. Rearranged hierarchy. XMLRPCService is being used to share memory across the several instances of intelligentmirror. This fix the problem of looping for the same url while trying to fetch package from remote (because we use the same proxy server to fetch the package and that ends in loops). More options added to configuration files. Also, README and INSTALL files are added to for help. Manpage is also added. * Tue Jun 17 2008 Kulbir Saini Temporary directory for downloads is introduced. Package are first saved to temp_dir and then moved to cache_dir after a successful download. * Fri Jun 13 2008 Kulbir Saini Configuration file moved to /etc/sysconfig/intelligentmirror.conf . Config parser taken from yum source code. * Sun Jun 8 2008 Kulbir Saini Few bug fixes. Tested with squid. Everything seems to work fine :) * Sat Jun 7 2008 Kulbir Saini Packages are downloaded parallely in the background now and are not served from the cache for the first time. Special thanks to http://blog.buffis.com/?p=63 for daemon forking tutorial :) * Wed Jun 4 2008 Kulbir Saini Added support for handling errors while retrieving packages. * Tue Jun 3 2008 Kulbir Saini Changed logging system from simple file logging to the standard python logging. * Mon Jun 2 2008 Kulbir Saini Improved caching. Now package is checked for updates. Separate function added for testing on command line. Also included extensive logging. * Mon Jun 2 2008 Kulbir Saini intelligentmirror : Initial Commit Version 0.0