Commit 4068afb3 authored by James Larrowe's avatar James Larrowe Committed by Ed Reel

Added dpkg.rb to Packages directory. (#2327)

* Added dpkg.rb to Packages directory.

* Added alias to fix issue of dpkg installing packages on root directory.

* Change double quote and backslash to single quote "just in case"

* Fixed file formatting errors

* No need to remount ~/ as execute

* Removed unnecessary dependencies

* Added echo to ~/.bashrc line to make alias persistent

* Fixed error in which ~/.bashrc line was quoted

* Reverting changes from previous commit

* Changed default dpkg root directory from /usr/local to \#{CREW_PREFIX}

* Removed #{CREW_PREFIX} tag, single quotes necessary

* Made dpkg more universal, including support for zsh and fish

* Added symlink from /usr/ to /usr/local/usr

* Added diversity for architectues, packages now automatically install to /usr/local. Close to final product, still working out the
kinks.

* Reduced size, added symlink from /usr/local to /usr/local/usr/local. All good and ready to go!

* Replaced exact paths with environment variables.

* Fixed errors on file layout (Hopefully!)

* Fixed file format

* Added line to touch /var/lib/dpkg/status.

* Fixed issue where dpkg status file wasn't being tracked

* Too many changes to be listed in a commit. See for yourself [here.](https://github.com/JL2210/chromebrew/tree/dpkg/packages/dpkg.rb)

* Moved line to touch dpkg status file to postinstall.

* Added more thorough explanation on how to install packages.

* Changed root install directory to /usr/local.
Fixed issue where the dpkg status file would be overwritten during upgrade.
Removed annoying dependency check.

* Installing dpkg now works if you haven't installed it before
parent 58268b1b
require 'package'
class Dpkg < Package
description 'A medium-level package manager for Debian'
homepage 'https://anonscm.debian.org/git/dpkg/'
version '1.19.0.5-test'
source_url 'https://salsa.debian.org/dpkg-team/dpkg/-/archive/1.19.0.5/dpkg-1.19.0.5.tar.gz'
source_sha256 'd38308afcd5d7896bbd1f946875b90f9d8510a8a96b44e4f14e781285e5d9641'
depends_on 'icu4c' => :build
def self.build
system "git clone https://salsa.debian.org/dpkg-team/dpkg.git"
Dir.chdir ("dpkg") do
system "git checkout 1.19.0.5"
system "autoreconf -i -f"
system "./configure --libdir=#{CREW_LIB_PREFIX} --prefix=#{CREW_PREFIX}"
system "make"
end
end
def self.preinstall
if File.exists? "#{CREW_PREFIX}/var/lib/dpkg/status" then
system "mv #{CREW_PREFIX}/var/lib/dpkg/status #{CREW_PREFIX}/var/lib/dpkg/status.old"
end
end
def self.install
Dir.chdir ("dpkg") do
system "make install DESTDIR=#{CREW_DEST_DIR}"
system "mkdir -p #{CREW_DEST_PREFIX}/usr/"
system "ln -s #{CREW_PREFIX} #{CREW_DEST_PREFIX}/usr/local"
system "mkdir -p #{CREW_DEST_PREFIX}/var/lib/dpkg/"
system "touch #{CREW_DEST_PREFIX}/var/lib/dpkg/status"
end
Dir.chdir ("#{CREW_DEST_PREFIX}/bin") do
system 'mv dpkg dpkg-run'
system "echo '#!/bin/bash' > dpkg"
system "echo 'dpkg-run --force-depends --root=#{CREW_PREFIX} \"$@\"' >> dpkg"
system 'chmod a+x dpkg'
end
end
def self.postinstall
if File.exists? "#{CREW_PREFIX}/var/lib/dpkg/status.old" then
system "cat #{CREW_PREFIX}/var/lib/dpkg/status.old >> #{CREW_PREFIX}/var/lib/dpkg/status"
system "rm #{CREW_PREFIX}/var/lib/dpkg/status.old"
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment