| 1 | package BlankOnDev::Repo; | ||
| 2 | use strict; | ||
| 3 | use warnings FATAL => 'all'; | ||
| 4 | |||
| 5 | # Impor Module : | ||
| 6 | use BlankOnDev::Utils::file; | ||
| 7 | |||
| 8 | # Version : | ||
| 9 | our $VERSION = '0.1005';; | ||
| 10 | |||
| 11 | # Subroutine for Read Repository : | ||
| 12 | # ------------------------------------------------------------------------ | ||
| 13 | sub read { | ||
| 14 | my ($self, $dir_dev) = @_; | ||
| 15 | my $locfile_repo = '/etc/apt/sources.list'; | ||
| 16 | |||
| 17 | # Read Sources list : | ||
| 18 | |||
| 19 | } | ||
| 20 | # Subroutine for update database repository on local system : | ||
| 21 | # ------------------------------------------------------------------------ | ||
| 22 | sub update { | ||
| 23 | # repo update : | ||
| 24 | system('sudo apt-get update'); | ||
| 25 | } | ||
| 26 | # Subroutine for install packages before build : | ||
| 27 | # ------------------------------------------------------------------------ | ||
| 28 | sub pkg_build { | ||
| 29 | my $self = shift; | ||
| 30 | my $depend = get_pkg_support(); | ||
| 31 | my $build_pkg = $depend->{'build'}; | ||
| 32 | my $git_depkg = $depend->{'bzr'}; | ||
| 33 | my $bzr_depkg = $depend->{'git'}; | ||
| 34 | |||
| 35 | # Update Before Install : | ||
| 36 | update(); | ||
| 37 | system("sudo apt-get install -y $build_pkg"); | ||
| 38 | system("sudo apt-get install -y $git_depkg"); | ||
| 39 | system("sudo apt-get install -y $bzr_depkg"); | ||
| 40 | |||
| 41 | return 1; | ||
| 42 | } | ||
| 43 | # Subroutine for Get dependensi : | ||
| 44 | # ------------------------------------------------------------------------ | ||
| 45 | sub get_pkg_support { | ||
| 46 | my %data = ( | ||
| 47 | 'build' => 'devscripts build-essential fakeroot debhelper gnupg pbuilder dh-make dpkg-dev dpatch equivs lintian quilt dh-make-perl git-core bzr rng-tools haveged apt-rdepends', | ||
| 48 | 'bzr' => 'bzr-fastimport', | ||
| 49 | 'git' => 'bzr-git', | ||
| 50 | ); | ||
| 51 | return \%data; | ||
| 52 | } | ||
| 53 | # Subroutine for repo address : | ||
| 54 | # ------------------------------------------------------------------------ | ||
| 55 | sub address { | ||
| 56 | my @data = ( | ||
| 57 | 'repo.ridon.id' | ||
| 58 | ); | ||
| 59 | return \@data; | ||
| 60 | } | ||
| 61 | 1; |