summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice van der Pot <griffon26@gentoo.org>2005-06-02 06:33:24 +0000
committerMaurice van der Pot <griffon26@gentoo.org>2005-06-02 06:33:24 +0000
commit1d2038461122b956d46b36d853a728de44d91de3 (patch)
treeb8346b9fb42439adea51669b5a7c76ef0a339a75 /net-proxy
parentmark ~ppc (diff)
downloadgentoo-2-1d2038461122b956d46b36d853a728de44d91de3.tar.gz
gentoo-2-1d2038461122b956d46b36d853a728de44d91de3.tar.bz2
gentoo-2-1d2038461122b956d46b36d853a728de44d91de3.zip
Initial import of http-replicator
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'net-proxy')
-rw-r--r--net-proxy/http-replicator/ChangeLog15
-rw-r--r--net-proxy/http-replicator/Manifest9
-rw-r--r--net-proxy/http-replicator/files/digest-http-replicator-3.01
-rwxr-xr-xnet-proxy/http-replicator/files/http-replicator-3.0-callrepcacheman-0.13
-rwxr-xr-xnet-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.21249
-rwxr-xr-xnet-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.33249
-rw-r--r--net-proxy/http-replicator/files/http-replicator-3.0.conf46
-rwxr-xr-xnet-proxy/http-replicator/files/http-replicator-3.0.init22
-rw-r--r--net-proxy/http-replicator/http-replicator-3.0.ebuild62
-rw-r--r--net-proxy/http-replicator/metadata.xml8
10 files changed, 664 insertions, 0 deletions
diff --git a/net-proxy/http-replicator/ChangeLog b/net-proxy/http-replicator/ChangeLog
new file mode 100644
index 000000000000..dae0433e732f
--- /dev/null
+++ b/net-proxy/http-replicator/ChangeLog
@@ -0,0 +1,15 @@
+# ChangeLog for net-proxy/http-replicator
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/http-replicator/ChangeLog,v 1.1 2005/06/02 06:33:24 griffon26 Exp $
+
+ 02 Jun 2005; Maurice van der Pot <griffon26@gentoo.org> ChangeLog:
+ +files/http-replicator-3.0-callrepcacheman-0.1,
+ +files/http-replicator-3.0-repcacheman-0.21,
+ +files/http-replicator-3.0-repcacheman-0.33,
+ +files/http-replicator-3.0.conf, +files/http-replicator-3.0.init,
+ +metadata.xml, +http-replicator-3.0.ebuild:
+ Initial import of http-replicator, a caching proxy that can be used
+ for distfile mirroring on a LAN.
+ Http-replicator by Gertjan van Zwieten <gertjanvanzwieten@fastmail.fm>
+ Ebuild and cache manager by Tom Poplawski <poplawtm@earthlink.net>
+
diff --git a/net-proxy/http-replicator/Manifest b/net-proxy/http-replicator/Manifest
new file mode 100644
index 000000000000..0410098ee2f8
--- /dev/null
+++ b/net-proxy/http-replicator/Manifest
@@ -0,0 +1,9 @@
+MD5 2e613c2c7ea7d5141d103aea9e883690 http-replicator-3.0.ebuild 1767
+MD5 7f864f339d692405288113afa5f26752 metadata.xml 225
+MD5 91539f937990f0b5b739905069bf4655 ChangeLog 703
+MD5 ba1bdb64c5a2a89f25600f0d02104876 files/http-replicator-3.0.conf 1703
+MD5 3b237680eab681845544ad4b43015e5d files/http-replicator-3.0.init 657
+MD5 1ebb63eb67b5ce575bb5e353973ed225 files/http-replicator-3.0-callrepcacheman-0.1 86
+MD5 ba5c3e1ca90a9ce2906848f1610f57bb files/http-replicator-3.0-repcacheman-0.21 6207
+MD5 5782ef4e5e91ea204e7507aa162bf04d files/http-replicator-3.0-repcacheman-0.33 6227
+MD5 322c5051fc17850a386f30fc56c752ce files/digest-http-replicator-3.0 70
diff --git a/net-proxy/http-replicator/files/digest-http-replicator-3.0 b/net-proxy/http-replicator/files/digest-http-replicator-3.0
new file mode 100644
index 000000000000..4bbedc4df290
--- /dev/null
+++ b/net-proxy/http-replicator/files/digest-http-replicator-3.0
@@ -0,0 +1 @@
+MD5 7d8d69175a5dc3d470273b1e508a27f3 http-replicator_3.0.tar.gz 19481
diff --git a/net-proxy/http-replicator/files/http-replicator-3.0-callrepcacheman-0.1 b/net-proxy/http-replicator/files/http-replicator-3.0-callrepcacheman-0.1
new file mode 100755
index 000000000000..14cd0a70a53b
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0-callrepcacheman-0.1
@@ -0,0 +1,3 @@
+#! /bin/bash
+source /etc/conf.d/http-replicator
+/usr/bin/repcacheman.py $GENERAL_OPTS
diff --git a/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.21 b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.21
new file mode 100755
index 000000000000..4499fb8a0f38
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.21
@@ -0,0 +1,249 @@
+#! /usr/bin/python
+#
+# repcacheman ver 0.21
+#
+# Cache Manager for Http-Replicator
+# deletes duplicate files in PORTDIR.
+# imports authenticated (md5 + listed in portage)
+# files from PORTDIR to replicator's cache directory.
+#
+# MD5, and database routines ripped from Portage
+# All else, Copyright(C)2004 Tom Poplawski (poplawtm@earthlink.net)
+# Distributed under the terms of the GNU General Public License v2
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+
+import os,string,pwd,sys,optparse
+
+if os.getuid():
+ print"Must be root"
+ sys.exit(1)
+
+# sys.path = ["/usr/lib/portage/pym"]+sys.path
+
+
+# Perform the Checksum on a file
+def perform_checksum(filename):
+ import md5
+ myfilename=filename
+ f = open(myfilename, 'rb')
+ blocksize=327680
+ data = f.read(blocksize)
+ sum = md5.new()
+ while data:
+ sum.update(data)
+ data = f.read(blocksize)
+ f.close()
+
+ return (sum.hexdigest())
+
+
+# Import http-replicator settings
+
+parser = optparse.OptionParser()
+parser.add_option('-d', '--dir', type='string', default="/var/cache/http-replicator", help='http-replicators cache DIR')
+parser.add_option('-u','--user', type='string', default="portage", help='http-replicator USER')
+options, args = parser.parse_args() # parse command line
+DIR=options.dir
+USER=options.user
+
+user=USER
+if user:
+ try:
+ uid=pwd.getpwnam(user)[2]
+ gid=pwd.getpwnam(user)[3]
+ except:
+ print "User \'" + user + "\' Doesn't exist on system - edit config or add user to system."
+ sys.exit(1)
+
+
+else:
+ print "Error\n\tunable to get USER from /etc/http-replicator.conf"
+ sys.exit(1)
+
+# DIR is replicator's cache directory
+dir=DIR+"/"
+
+if os.path.isdir(dir):
+ newdir=0
+else:
+ print"\n\nBegin Http-Replicator Setup...."
+ try:
+ os.makedir(dir)
+ print "\tcreated " + dir
+ newdir=1
+ except:
+ print "\tcreate " + dir + " failed"
+ print '\terror:', sys.exc_info()[1]
+ sys.exit(1)
+ try:
+ os.chown(dir,uid,gid)
+ print "\tchanged owner of " + dir + " to " + user
+ except:
+ print "\tchange owner " + dir + " to " + user + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+print "\n\nReplicator's cache directory: " + dir
+
+# Portage settings
+import portage
+distdir=portage.settings["DISTDIR"]+"/"
+if distdir:
+ print "Portage's DISTDIR: " + distdir
+else:
+ print"Unable to get Portage's DISTDIR"
+ sys.exit(1)
+
+print "\nComparing directories...."
+
+# Create filecmp object with
+import filecmp
+dc=filecmp.dircmp (distdir,dir,['cvs-src'])
+print "Done!"
+
+#def __getattr__(self,common):
+#print dc.left_only
+
+dupes=dc.common
+
+deleted=0
+if dupes:
+ print "\nDeleting duplicate file(s) in " + distdir
+
+ for s in dupes:
+ print s
+ try:
+ os.remove(distdir + s )
+ deleted +=1
+ except:
+ print "\tdelete " + distdir + s + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+ print "Done!"
+
+newfiles=dc.left_only
+if newfiles:
+ print "\nNew files in DISTDIR:"
+ for s in newfiles:
+ print s
+ print"\nChecking authenticity and integrity of new files..."
+ print "Searching for ebuilds's ...."
+
+ md5_list = {}
+
+ # get all ebuilds?
+ ebuildlist = []
+ for mycp in portage.db["/"]["porttree"].dbapi.cp_all():
+ ebuildlist += portage.db["/"]["porttree"].dbapi.cp_list(mycp)
+ ebuildlist.sort()
+
+ print "Done!"
+ print "\nFound " + str(len(ebuildlist)) + " ebuilds."
+
+# mycpv =app-admin/ulogd-0.89
+# pv = ulogd-0.89
+
+ print "\nExtracting the checksums...."
+ for mycpv in ebuildlist:
+ pv = string.split(mycpv, "/")[-1]
+
+
+ # lookup each ebuild digest and md5sums
+ digestpath = portage.db["/"]["porttree"].dbapi.findname(mycpv)
+ digestpath = os.path.dirname(digestpath)+"/files/digest-"+pv
+ md5sums = portage.digestParseFile(digestpath)
+
+ if md5sums == None:
+ portage.writemsg("Missing digest: %s\n" % mycpv)
+ md5sums = {}
+
+ for x in md5sums.keys():
+ if x[0] == '/':
+ del md5sums[x]
+
+
+ for k, v in md5sums.iteritems():
+ md5_list[k]= v
+
+
+
+ del ebuildlist
+ print "Done!\n\nVerifying checksum's...."
+
+ added=0
+ rejected=0
+ suspect=0
+ missing=0
+
+ for file in newfiles:
+
+ if not md5_list.has_key (file):
+ print "\nWARNING " + file + " is not in portage!!!\n"
+ suspect +=1
+ continue
+ myfile=distdir + file
+ if os.path.isdir(myfile):
+ print "\nskipping directory:",myfile
+ continue
+ mymd5=perform_checksum(myfile)
+
+ print myfile
+# print "md5 is " + mymd5
+
+ t= md5_list[file]
+ if t[0]:
+ if t[0] == mymd5:
+ print "MD5 OK"
+ try:
+ os.rename(distdir+file,dir+file)
+ added += 1
+ except:
+ try:
+ import shutil
+ shutil.copyfile(distdir+file,dir+file)
+ added += 1
+ os.remove(distdir+file)
+ except:
+ print "\tmove/copy " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ continue
+ try:
+ os.chown(dir+file,uid,gid)
+ except:
+ print "\tchown " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ else:
+ print "CORRUPT or INCOMPLETE "
+ rejected +=1
+ else:
+ missing +=1
+ print "\nEbuild missing digest for " +file
+
+
+print "\nSUMMARY:\nFound " + str(len(dupes)) + " duplicate file(s)."
+print "\tDeleted " + str(deleted) + " dupe(s)."
+if newfiles:
+ print "Found " + str(len(newfiles)) + " new file(s)."
+ print "\tAdded " + str(added) + " of those file(s) to the cache."
+ print "\tRejected " + str(rejected) + " corrupt or incomplete file(s)."
+ if missing:
+ print "\tCan't check " +str(missing) + " file(s) because of missing digest."
+ if suspect:
+ print "\t" + str(suspect) + " Unknown file(s) that are not listed in portage\
+\n\tYou may want to delete them yourself...."
+if newdir:
+ print"\n\nexecute:\n/etc/init.d/http-replicator start"
+ print"to run http-replicator.\n\nexecute:\nrc-update add http-replicator default"
+ print"to make http-replicator start at boot"
+ print"\n\nexecute:\n/usr/bin/repcacheman\nafter emerge's on the server to delete"
+ print"dup files and add new files to the cache"
+print "\n\nDone!\n\n" \ No newline at end of file
diff --git a/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.33 b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.33
new file mode 100755
index 000000000000..09212017da3e
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.33
@@ -0,0 +1,249 @@
+#! /usr/bin/python
+#
+# repcacheman ver 0.33
+#
+# Cache Manager for Http-Replicator
+# deletes duplicate files in PORTDIR.
+# imports authenticated (md5 + listed in portage)
+# files from PORTDIR to replicator's cache directory.
+#
+# MD5, and database routines ripped from Portage
+# All else, Copyright(C)2004 Tom Poplawski (poplawtm@earthlink.net)
+# Distributed under the terms of the GNU General Public License v2
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+
+import os,string,pwd,sys,optparse
+
+if os.getuid():
+ print"Must be root"
+ sys.exit(1)
+
+# sys.path = ["/usr/lib/portage/pym"]+sys.path
+
+
+# Perform the Checksum on a file
+def perform_checksum(filename):
+ import md5
+ myfilename=filename
+ f = open(myfilename, 'rb')
+ blocksize=327680
+ data = f.read(blocksize)
+ sum = md5.new()
+ while data:
+ sum.update(data)
+ data = f.read(blocksize)
+ f.close()
+
+ return (sum.hexdigest())
+
+
+# Import http-replicator settings
+
+parser = optparse.OptionParser()
+parser.add_option('-d', '--dir', type='string', default="/var/cache/http-replicator", help='http-replicators cache DIR')
+parser.add_option('-u','--user', type='string', default="portage", help='http-replicator USER')
+options, args = parser.parse_args() # parse command line
+DIR=options.dir
+USER=options.user
+
+user=USER
+if user:
+ try:
+ uid=pwd.getpwnam(user)[2]
+ gid=pwd.getpwnam(user)[3]
+ except:
+ print "User \'" + user + "\' Doesn't exist on system - edit config or add user to system."
+ sys.exit(1)
+
+
+else:
+ print "Error\n\tunable to get USER from /etc/http-replicator.conf"
+ sys.exit(1)
+
+# DIR is replicator's cache directory
+dir=DIR+"/"
+
+if os.path.isdir(dir) :
+ newdir=0
+else :
+ print"\n\nBegin Http-Replicator Setup...."
+ try:
+ os.makedirs(dir)
+ print "\tcreated " + dir
+ newdir=1
+ except:
+ print "\tcreate " + dir + " failed"
+ print '\terror:', sys.exc_info()[1]
+ sys.exit(1)
+ try:
+ os.chown(dir,uid,gid)
+ print "\tchanged owner of " + dir + " to " + user
+ except:
+ print "\tchange owner " + dir + " to " + user + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+print "\n\nReplicator's cache directory: " + dir
+
+# Portage settings
+import portage
+distdir=portage.settings["DISTDIR"]+"/"
+if distdir:
+ print "Portage's DISTDIR: " + distdir
+else:
+ print"Unable to get Portage's DISTDIR"
+ sys.exit(1)
+
+print "\nComparing directories...."
+
+# Create filecmp object with
+import filecmp
+dc=filecmp.dircmp (distdir,dir,['cvs-src','.locks'])
+print "Done!"
+
+#def __getattr__(self,common):
+#print dc.left_only
+
+dupes=dc.common
+
+deleted=0
+if dupes:
+ print "\nDeleting duplicate file(s) in " + distdir
+
+ for s in dupes:
+ print s
+ try:
+ os.remove(distdir + s )
+ deleted +=1
+ except:
+ print "\tdelete " + distdir + s + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+ print "Done!"
+
+newfiles=dc.left_only
+if newfiles:
+ print "\nNew files in DISTDIR:"
+ for s in newfiles:
+ print s
+ print"\nChecking authenticity and integrity of new files..."
+ print "Searching for ebuilds's ...."
+
+ md5_list = {}
+
+ # get all ebuilds?
+ ebuildlist = []
+ for mycp in portage.db["/"]["porttree"].dbapi.cp_all():
+ ebuildlist += portage.db["/"]["porttree"].dbapi.cp_list(mycp)
+ ebuildlist.sort()
+
+ print "Done!"
+ print "\nFound " + str(len(ebuildlist)) + " ebuilds."
+
+# mycpv =app-admin/ulogd-0.89
+# pv = ulogd-0.89
+
+ print "\nExtracting the checksums...."
+ for mycpv in ebuildlist:
+ pv = string.split(mycpv, "/")[-1]
+
+
+ # lookup each ebuild digest and md5sums
+ digestpath = portage.db["/"]["porttree"].dbapi.findname(mycpv)
+ digestpath = os.path.dirname(digestpath)+"/files/digest-"+pv
+ md5sums = portage.digestParseFile(digestpath)
+
+ if md5sums == None:
+ portage.writemsg("Missing digest: %s\n" % mycpv)
+ md5sums = {}
+
+ for x in md5sums.keys():
+ if x[0] == '/':
+ del md5sums[x]
+
+
+ for k, v in md5sums.iteritems():
+ md5_list[k]= v
+
+
+
+ del ebuildlist
+ print "Done!\n\nVerifying checksum's...."
+
+ added=0
+ rejected=0
+ suspect=0
+ missing=0
+
+ for file in newfiles:
+
+ if not md5_list.has_key (file):
+ print "\nWARNING " + file + " is not in portage!!!\n"
+ suspect +=1
+ continue
+ myfile=distdir + file
+ if os.path.isdir(myfile):
+ print "\nskipping directory:",myfile
+ continue
+ mymd5=perform_checksum(myfile)
+
+ print myfile
+# print "md5 is " + mymd5
+
+ t= md5_list[file]
+ if t["MD5"]:
+ if t["MD5"] == mymd5:
+ print "MD5 OK"
+ try:
+ os.rename(distdir+file,dir+file)
+ added += 1
+ except:
+ try:
+ import shutil
+ shutil.copyfile(distdir+file,dir+file)
+ added += 1
+ os.remove(distdir+file)
+ except:
+ print "\tmove/copy " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ continue
+ try:
+ os.chown(dir+file,uid,gid)
+ except:
+ print "\tchown " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ else:
+ print "CORRUPT or INCOMPLETE "
+ rejected +=1
+ else:
+ missing +=1
+ print "\nEbuild missing digest for " +file
+
+
+print "\nSUMMARY:\nFound " + str(len(dupes)) + " duplicate file(s)."
+print "\tDeleted " + str(deleted) + " dupe(s)."
+if newfiles:
+ print "Found " + str(len(newfiles)) + " new file(s)."
+ print "\tAdded " + str(added) + " of those file(s) to the cache."
+ print "\tRejected " + str(rejected) + " corrupt or incomplete file(s)."
+ if missing:
+ print "\tCan't check " +str(missing) + " file(s) because of missing digest."
+ if suspect:
+ print "\t" + str(suspect) + " Unknown file(s) that are not listed in portage\
+\n\tYou may want to delete them yourself...."
+if newdir:
+ print"\n\nexecute:\n/etc/init.d/http-replicator start"
+ print"to run http-replicator.\n\nexecute:\nrc-update add http-replicator default"
+ print"to make http-replicator start at boot"
+ print"\n\nexecute:\n/usr/bin/repcacheman\nafter emerge's on the server to delete"
+ print"dup files and add new files to the cache"
+print "\n\nDone!\n\n" \ No newline at end of file
diff --git a/net-proxy/http-replicator/files/http-replicator-3.0.conf b/net-proxy/http-replicator/files/http-replicator-3.0.conf
new file mode 100644
index 000000000000..6dcc076ad9fd
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0.conf
@@ -0,0 +1,46 @@
+## Config file for http-replicator
+## sourced by init scripts automatically
+## GENERAL_OPTS used by repcacheman
+## DAEMON_OPTS used by http-replicator
+
+
+## Set the cache dir
+GENERAL_OPTS="--dir /var/cache/http-replicator"
+
+## Change UID/GID to user after opening the log and pid file.
+## 'user' must have read/write access to cache dir:
+GENERAL_OPTS="$GENERAL_OPTS --user portage"
+
+## Don't change or comment this out:
+DAEMON_OPTS="$GENERAL_OPTS"
+
+## Do you need a proxy to reach the internet?
+## This will forward requests to an external proxy server:
+## Use one of the following, not both:
+#DAEMON_OPTS="$DAEMON_OPTS --external somehost:1234"
+#DAEMON_OPTS="$DAEMON_OPTS --external username:password@host:port"
+
+## Local dir to serve clients. Great for serving binary packages
+## See PKDIR and PORTAGE_BINHOST settings in 'man make.conf'
+## --alias /path/to/serve:location will make /path/to/serve
+## browsable at http://http-replicator.com:port/location
+DAEMON_OPTS="$DAEMON_OPTS --alias /usr/portage/packages/All:All"
+
+## Dir to hold the log file:
+DAEMON_OPTS="$DAEMON_OPTS --log /var/log/http-replicator.log"
+
+## Make the log messages less and less verbose.
+## Up to four times to make it extremely quiet.
+#DAEMON_OPTS="$DAEMON_OPTS --quiet"
+#DAEMON_OPTS="$DAEMON_OPTS --quiet"
+
+## Make the log messages extra verbose for debugging.
+#DAEMON_OPTS="$DAEMON_OPTS --debug"
+
+## The ip addresses from which access is allowed. Can be used as many times
+## as necessary. Access from localhost is allowed by default.
+DAEMON_OPTS="$DAEMON_OPTS --ip 192.168.*.*"
+DAEMON_OPTS="$DAEMON_OPTS --ip 10.*.*.*"
+
+## The proxy port on which the server listens for http requests:
+DAEMON_OPTS="$DAEMON_OPTS --port 8080"
diff --git a/net-proxy/http-replicator/files/http-replicator-3.0.init b/net-proxy/http-replicator/files/http-replicator-3.0.init
new file mode 100755
index 000000000000..c2a7a33215ca
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0.init
@@ -0,0 +1,22 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/http-replicator/files/http-replicator-3.0.init,v 1.1 2005/06/02 06:33:24 griffon26 Exp $
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting Http-Replicator"
+ start-stop-daemon --start --pidfile /var/run/http-replicator.pid --name http-replicator \
+ --startas /usr/bin/http-replicator -- -s -f --pid /var/run/http-replicator.pid --daemon $DAEMON_OPTS
+ eend $? "Failed to start Http-Replicator"
+}
+
+stop() {
+ ebegin "Stopping Http-Replicator"
+ start-stop-daemon --stop --pidfile /var/run/http-replicator.pid --name http-replicator \
+ --signal 2 --oknodo
+ eend $? "Failed to stop Http-Replicator"
+}
diff --git a/net-proxy/http-replicator/http-replicator-3.0.ebuild b/net-proxy/http-replicator/http-replicator-3.0.ebuild
new file mode 100644
index 000000000000..9c0044153c8b
--- /dev/null
+++ b/net-proxy/http-replicator/http-replicator-3.0.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/http-replicator/http-replicator-3.0.ebuild,v 1.1 2005/06/02 06:33:24 griffon26 Exp $
+
+DESCRIPTION="Proxy cache for Gentoo packages"
+HOMEPAGE="http://gertjan.freezope.org/"
+SRC_URI="http://gertjan.freezope.org/replicator/${PN}_${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+DEPEND=">=dev-lang/python-2.3"
+
+src_compile() {
+ einfo "No compilation necessary"
+}
+
+src_install(){
+ # Daemon and repcacheman into /usr/bin
+ exeinto /usr/bin
+ doexe http-replicator
+ newexe ${FILESDIR}/http-replicator-3.0-callrepcacheman-0.1 repcacheman
+ if has_version '>=sys-apps/portage-2.0.51'; then
+ newexe ${FILESDIR}/http-replicator-3.0-repcacheman-0.33 repcacheman.py
+ else
+ newexe ${FILESDIR}/http-replicator-3.0-repcacheman-0.21 repcacheman.py
+ fi
+
+ # Config file into /etc/conf.d
+ insinto /etc/conf.d
+ newins ${FILESDIR}/http-replicator-3.0.conf http-replicator
+
+ # Docs
+ dodoc README debian/changelog
+
+ # init.d scripts
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/http-replicator-3.0.init http-replicator
+
+ # Man Page - Not Gentooified yet
+ doman http-replicator.1
+
+ insinto /etc/logrotate.d
+ newins debian/logrotate http-replicator
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Before starting http-replicator, please follow the next few steps:"
+ einfo "- modify /etc/conf.d/http-replicator if required"
+ einfo "- run /usr/bin/repcacheman to set up the cache"
+ einfo "- add http_proxy=\"http://serveraddress:8080\" to make.conf on"
+ einfo " the server as well as on the client machines"
+ einfo "- make sure GENTOO_MIRRORS in /etc/make.conf starts with several"
+ einfo " good http mirrors"
+ einfo
+ einfo "For more information please refer to the following forum thread:"
+ einfo " http://forums.gentoo.org/viewtopic-t-173226.html"
+ einfo
+}
diff --git a/net-proxy/http-replicator/metadata.xml b/net-proxy/http-replicator/metadata.xml
new file mode 100644
index 000000000000..651c3a888c39
--- /dev/null
+++ b/net-proxy/http-replicator/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer>
+ <email>griffon26@gentoo.org</email>
+</maintainer>
+</pkgmetadata>