

    Read this file to get some information on how to work with and access
    your repository.


($ means user-shell, # means root-shell)

Uploading packages:
-------------------

The easiest way is, to copy the package files into incoming-dir ($inputdir)
or distinput-dirs (%distinputdirs). But there are 2 tools, which can do the
job for you: dput and dupload. Both will only work, if the package has a
.changes file (binary-only packages must still be copied the "manual" way).

Here are some example-entries for ~/.dput.cf (see also man dput.cf, to
understand the settings/options used in these examples; replace my_* examples
with values, which fit your environment/systems):

   example 1: upload to a local repository
   usage: dput my_local_repository my_package.changes
   /--------------------------------------------------------------------------
	[my_local_repository]
	fqdn = localhost
	method = local
	incoming = /var/lib/debarchiver/incoming
	allow_unsigned_uploads = 0
   \--------------------------------------------------------------------------

   example 2: upload to a remote/local FTP-server using passive-ftp
   usage: dput my_ftp_server my_package.changes
   /--------------------------------------------------------------------------
	[my_ftp_server]
	fqdn = my_ftp.domain.tld
	method = ftp
	login = my_user_name
	incoming = /var/lib/debarchiver/incoming
	allow_unsigned_uploads = 0
	passive_ftp = 1
   \--------------------------------------------------------------------------

   example 3: upload to a remote server using SCP, SSH-server is listening on
              port 2222 and uses authentification by public-key
   usage: dput my_ssh_server my_package.changes
   /--------------------------------------------------------------------------
	[my_ssh_server]
	fqdn = my_domain.tld
	login = my_user
	method = scp
	ssh_config_options = Host=my_domain.tld
	 IdentityFile2 /home/my_user/.ssh/my_id_dsa
	 Port=2222
	 incoming = /var/lib/debarchiver/incoming
	allow_unsigned_uploads = 0
   \--------------------------------------------------------------------------

Please note: /etc/dput.cf knows some default identifiers (the part in
brackets). Use different identifiers for your rule-sets.

If you want to upload a package into distinput-dirs (see README), then you
need to adjust 'incoming'. Please note, that every upload creates or expands
my_package.upload. So maybe you need to remove the .upload-file, if you see:

	$ dput my_location my_package.changes
	    Already uploaded to my_location
	    Doing nothing for my_package.changes


Accessing the repository locally with file://:
----------------------------------------------

Add the lines, which fit your repository structure, to your
/etc/apt/sources.list:

deb file:/var/lib/debarchiver stable main contrib non-free
deb file:/var/lib/debarchiver testing main contrib non-free
deb file:/var/lib/debarchiver unstable main contrib non-free
deb file:/var/lib/debarchiver experimental main contrib non-free
deb file:/var/lib/debarchiver woody main contrib non-free
deb file:/var/lib/debarchiver sarge main contrib non-free
deb file:/var/lib/debarchiver etch main contrib non-free
deb file:/var/lib/debarchiver lenny main contrib non-free
deb file:/var/lib/debarchiver squeeze main contrib non-free
deb file:/var/lib/debarchiver sid main contrib non-free


Accessing the repository by http://:
------------------------------------

To make your repository public and/or allow access with http://, add the
following lines to a (virtual) server of your choice.

   /--------------------------------------------------------------------------
	Alias /debian /var/lib/debarchiver
	
    <Directory /var/lib/debarchiver>
        Options Indexes FollowSymLinks MultiViews +Includes
        
        # forbid access to user files
        <Files ~ "^\.(devscripts|viminfo|bash.*)$">
            AllowOverride None
            Order deny,allow
            Deny from all
        </Files>

        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
	
    # forbid access to .gnupg
    <Directory /var/lib/debarchiver/.gnupg>
        AllowOverride None
        Order deny,allow
        Deny from all
    </Directory>
   \--------------------------------------------------------------------------

You could also make /var/lib/debarchiver/dists an aliased path. Decide at your
own - what you prefer.

Be aware of the following problem: If you decided to enable signature checking
for incoming packages (see README.gnupg), then you maybe have user
directories (.gnupg) and user files (.bash_history, .devscripts) in
/var/lib/debarchiver. Use the above rules to forbid access OR change the
archive-dir or the home-dir for debarchiver (see README.gnupg), which is the
cleaner solution.


Optional: Generate website with package overview:
-------------------------------------------------

Maybe you want to provide a website, which gives an overview of available
packages. The PHP parser script 'parse-apt-files.inc' (originally written by
Jarno Elonen [1] and released into public domain) can do this for you. A
version, which should work with debarchiver generated repositories is
currently avaiable at http://debian.wgdd.de/debian/parse-apt-files.inc.

********************** Please note ! *****************************************
*                                                                            *
* Only download and use software if you are sure, it is doing, what you      *
* expect it to do - for your own safety! What I want to say: I can't         *
* guarantee anything about this script.                                      *
*                                                                            *
* [1] http://elonen.iki.fi/                                                  *
******************************************************************************

Copy this script into /var/lib/debarchiver. Now create
/var/lib/debarchiver/index.php with the following content:

   /--------------------------------------------------------------------------
	<? echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>Debian packages in my unofficial Debian repository</title>
	</head>
	<body>
		<?php
		include_once("parse-apt-files.inc");
		
		echo "<h2>Packages in sid (unstable)</h2>";
		parse_and_list(
			Array("dists/sid/main/binary-i386/Packages.gz",
				  "dists/sid/contrib/binary-i386/Packages.gz",
				  "dists/sid/non-free/binary-i386/Packages.gz"),
			Array("dists/sid/main/source/Sources.gz",
				  "dists/sid/contrib/source/Sources.gz",
				  "dists/sid/non-free/source/Sources.gz"),
			"dists/sid/installed");
		?>
	</body>
	</html>
   \--------------------------------------------------------------------------

Run a browser to see the result at http://your.domain.tld/debian/index.php.

It is possible, that you will see a warning, if you set

	php_admin_value safe_mode on

In this case, do a

	# chown debarchiver.debarchiver parse-apt-files.inc index.php

or try another solution by using suphp Apache mod. 

The above file is only an example which will show the packages in Sid.
Feel free to customize it and enjoy the possibilities of this famous script.

