diff -rwub apt-pkg/deb/debsystem.cc apt-pkg/deb/debsystem.cc
--- apt-pkg/deb/debsystem.cc	Fri Dec 10 18:13:27 2004
+++ apt-pkg/deb/debsystem.cc	Fri Dec 10 18:13:34 2004
@@ -162,8 +162,8 @@
       which is yet to be determined. The functions in pkgcachegen should
       be the only users of these */
    Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct
-   Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
-   Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
+   Cnf.CndSet("Dir::State::status","@PREFIX@/var/db/dpkg/status");
+   Cnf.CndSet("Dir::Bin::dpkg","@PREFIX@/bin/dpkg");
    
    return true;
 }
@@ -186,9 +186,9 @@
 signed debSystem::Score(Configuration const &Cnf)
 {
    signed Score = 0;
-   if (FileExists(Cnf.FindFile("Dir::State::status","/var/lib/dpkg/status")) == true)
+   if (FileExists(Cnf.FindFile("Dir::State::status","@PREFIX@/var/db/dpkg/status")) == true)
        Score += 10;
-   if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","/usr/bin/dpkg")) == true)
+   if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","@PREFIX@/bin/dpkg")) == true)
       Score += 10;
    if (FileExists("/etc/debian_version") == true)
       Score += 10;
diff -rwub apt-pkg/init.cc apt-pkg/init.cc
--- apt-pkg/init.cc	Fri Dec 10 18:13:27 2004
+++ apt-pkg/init.cc	Fri Dec 10 18:15:03 2004
@@ -40,23 +40,16 @@
    else
       Cnf.Set("APT::Architecture",COMMON_OS "-" COMMON_CPU);
    Cnf.Set("APT::Build-Essential::", "build-essential");
-   Cnf.Set("Dir","/");
+   Cnf.Set("Dir","@PREFIX@/");
    
    // State   
-   Cnf.Set("Dir::State","var/lib/apt/");
-   
-   /* Just in case something goes horribly wrong, we can fall back to the
-      old /var/state paths.. */
-   struct stat St;   
-   if (stat("/var/lib/apt/.",&St) != 0 &&
-       stat("/var/state/apt/.",&St) == 0)
-      Cnf.Set("Dir::State","var/state/apt/");
+   Cnf.Set("Dir::State","var/db/apt/state");
        
    Cnf.Set("Dir::State::lists","lists/");
    Cnf.Set("Dir::State::cdroms","cdroms.list");
    
    // Cache
-   Cnf.Set("Dir::Cache","var/cache/apt/");
+   Cnf.Set("Dir::Cache","var/db/apt/cache");
    Cnf.Set("Dir::Cache::archives","archives/");
    Cnf.Set("Dir::Cache::srcpkgcache","srcpkgcache.bin");
    Cnf.Set("Dir::Cache::pkgcache","pkgcache.bin");
@@ -69,7 +62,7 @@
    Cnf.Set("Dir::Etc::main","apt.conf");
    Cnf.Set("Dir::Etc::parts","apt.conf.d");
    Cnf.Set("Dir::Etc::preferences","preferences");
-   Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods");
+   Cnf.Set("Dir::Bin::methods","@PREFIX@/libexec/apt/methods");
 	      
    bool Res = true;
    
diff -rwub dselect/install dselect/install
--- dselect/install	Fri Dec 10 18:13:27 2004
+++ dselect/install	Fri Dec 10 18:13:34 2004
@@ -6,8 +6,8 @@
 # Get the configuration from /etc/apt/apt.conf
 CLEAN="prompt"
 OPTS="-f"
-APTGET="/usr/bin/apt-get"
-DPKG="/usr/bin/dpkg"
+APTGET="@PREFIX@/bin/apt-get"
+DPKG="@PREFIX@/bin/dpkg"
 DPKG_OPTS="--admindir=$1"
 APT_OPT0="-oDir::State::status=$1/status"
 APT_OPT1="-oDPkg::Options::=$DPKG_OPTS"
diff -rwub dselect/setup dselect/setup
--- dselect/setup	Fri Dec 10 18:13:27 2004
+++ dselect/setup	Fri Dec 10 18:13:34 2004
@@ -23,7 +23,7 @@
 my $vardir=$ARGV[0];
 my $method=$ARGV[1];
 my $option=$ARGV[2];
-my $config_file = '/etc/apt/sources.list';
+my $config_file = '@PREFIX@/apt/sources.list';
 
 my $boldon=`setterm -bold on`;
 my $boldoff=`setterm -bold off`;
diff -rwub dselect/update dselect/update
--- dselect/update	Fri Dec 10 18:13:27 2004
+++ dselect/update	Fri Dec 10 18:13:34 2004
@@ -7,13 +7,13 @@
 # Get the configuration from /etc/apt/apt.conf
 CLEAN="prompt"
 OPTS="-f"
-APTGET="/usr/bin/apt-get"
-APTCACHE="/usr/bin/apt-cache"
-DPKG="/usr/bin/dpkg"
+APTGET="@PREFIX@/bin/apt-get"
+APTCACHE="@PREFIX@/bin/apt-cache"
+DPKG="@PREFIX@/bin/dpkg"
 DPKG_OPTS="--admindir=$1"
 APT_OPT0="-oDir::State::status=$1/status"
 APT_OPT1="-oDPkg::Options::=$DPKG_OPTS"
-CACHEDIR="/var/cache/apt"
+CACHEDIR="@PREFIX@/var/db/apt"
 PROMPT="false"
 RES=`apt-config shell CLEAN DSelect::Clean OPTS DSelect::UpdateOptions \
 		      DPKG Dir::Bin::dpkg/f APTGET Dir::Bin::apt-get/f \
