From f136505e9c8e7d76998c48bbfb776744d5e62b8e Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 7 Dec 2011 15:14:55 +0100 Subject: [PATCH] pkg-get: Initial import. Added repgen patch --- pkg-get/.footprint | 10 +++ pkg-get/.md5sum | 2 + pkg-get/Pkgfile | 17 +++++ pkg-get/README | 22 ++++++ pkg-get/pkg-get.patch | 12 +++ pkg-get/pkg-repgen.patch | 158 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 221 insertions(+) create mode 100644 pkg-get/.footprint create mode 100644 pkg-get/.md5sum create mode 100644 pkg-get/Pkgfile create mode 100644 pkg-get/README create mode 100644 pkg-get/pkg-get.patch create mode 100644 pkg-get/pkg-repgen.patch diff --git a/pkg-get/.footprint b/pkg-get/.footprint new file mode 100644 index 0000000..21ec495 --- /dev/null +++ b/pkg-get/.footprint @@ -0,0 +1,10 @@ +drwxr-xr-x root/root etc/ +-rw-r--r-- root/root etc/pkg-get.conf +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/bin/ +-rwxr-xr-x root/root usr/bin/pkg-get +-rwxr-xr-x root/root usr/bin/pkg-repgen +drwxr-xr-x root/root usr/man/ +drwxr-xr-x root/root usr/man/man8/ +-rw-r--r-- root/root usr/man/man8/pkg-get.8.gz +-rw-r--r-- root/root usr/man/man8/pkg-repgen.8.gz diff --git a/pkg-get/.md5sum b/pkg-get/.md5sum new file mode 100644 index 0000000..3203354 --- /dev/null +++ b/pkg-get/.md5sum @@ -0,0 +1,2 @@ +5ee169f2f99fc501387219b6b96ca9ef pkg-get-0.4.5.tar.gz +c3fb4f7ca868903da78d316be77cca16 pkg-get.patch diff --git a/pkg-get/Pkgfile b/pkg-get/Pkgfile new file mode 100644 index 0000000..4adb073 --- /dev/null +++ b/pkg-get/Pkgfile @@ -0,0 +1,17 @@ +# Description: Package management tool for CRUX Linux +# URL: http://www.varlock.com +# Maintainer: Jose V Beneyto, sepen at crux dot nu +# Packager: Simone Rota, sip at crux dot nu +# Depends on: perl + +name=pkg-get +version=0.4.5 +release=2 +source=(http://www.varlock.com/files/$name-$version.tar.gz \ + $name.patch) + +build() { + cd $name-$version + patch -p1 -i $SRC/$name.patch + make PREFIX=$PKG/usr CFGDIR=$PKG/etc install +} diff --git a/pkg-get/README b/pkg-get/README new file mode 100644 index 0000000..86d06fc --- /dev/null +++ b/pkg-get/README @@ -0,0 +1,22 @@ + +README for pkg-get + + +REQUERIMENTS + + To use pkg-repgen you'll need prt-get to be installed. + + +IMPORTANT + + The PKGREPO file format chaged a bit from 0.3.3, + please regenerate your repositories with pkg-repgen + + the /etc/pkg-get.conf options slightly changed + in version 0.3.0 in order to handle multiple + repositories. + + pkg-get is beta software. I did not have much + time to test it, expecially latest features + added (locking, pre-post install scripts, printf). + diff --git a/pkg-get/pkg-get.patch b/pkg-get/pkg-get.patch new file mode 100644 index 0000000..a323c64 --- /dev/null +++ b/pkg-get/pkg-get.patch @@ -0,0 +1,12 @@ +diff -Nru pkg-get-0.4.5.orig/scripts/pkg-get.pl pkg-get-0.4.5/scripts/pkg-get.pl +--- pkg-get-0.4.5.orig/scripts/pkg-get.pl 2006-07-13 05:04:11.000000000 +0200 ++++ pkg-get-0.4.5/scripts/pkg-get.pl 2006-07-17 13:01:37.524719500 +0200 +@@ -943,7 +943,7 @@ + printf("%-19s %-19s %-19s\n\n","Package","Installed","Available in the repositories"); + $gotdiff = 1; + } +- printf("%-19s %-19s %-19s %-19s\n", $pkg{'name'}, $pkg{'instversion'}, $pkg{'version'}."-".$pkg{'release'}); ++ printf("%-19s %-19s %-19s\n", $pkg{'name'}, $pkg{'instversion'}, $pkg{'version'}."-".$pkg{'release'}); + } elsif ($all) { # yeah, it blows, at least avoid to read the locked state twice. + if ($gotdiff == 0){ + print "Differences between installed packages and packages repo:\n\n"; diff --git a/pkg-get/pkg-repgen.patch b/pkg-get/pkg-repgen.patch new file mode 100644 index 0000000..8cc65e3 --- /dev/null +++ b/pkg-get/pkg-repgen.patch @@ -0,0 +1,158 @@ +diff --git a/Makefile b/Makefile +index 4327a7a..f8e4cd9 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,5 +1,7 @@ + NAME=pkg-get +-VERSION="0.4.5" ++VERSION="0.4.6" ++ ++DESTDIR= + + PREFIX=/usr + CFGDIR=/etc +@@ -7,11 +9,11 @@ CFGDIR=/etc + all: + @echo "Use 'make install' to install pkg-get" + +-man: ++man: + makeman doc/pkg-get.8.txt + makeman doc/pkg-repgen.8.txt + man2ps doc/pkg-get.8 | ps2pdf14 - > doc/pkg-get.pdf +- ++ + dist: man + rm -rf ${NAME}-${VERSION} + mkdir ${NAME}-${VERSION} +@@ -22,12 +24,11 @@ dist: man + rm -rf ${NAME}-${VERSION} + + install: +- +- install -D -m 755 scripts/pkg-get.pl ${PREFIX}/bin/pkg-get +- install -D -m 755 scripts/pkg-repgen.pl ${PREFIX}/bin/pkg-repgen +- install -D -m 755 scripts/pkg-get.pl ${PREFIX}/bin/pkg-get +- install -D -m 644 doc/pkg-get.8 ${PREFIX}/man/man8/pkg-get.8 +- install -D -m 644 doc/pkg-get.conf ${CFGDIR}/pkg-get.conf +- install -D -m 644 doc/pkg-repgen.8 ${PREFIX}/man/man8/pkg-repgen.8 +- install -D -m 644 doc/pkg-get.8 ${PREFIX}/man/man8/pkg-get.8 ++ install -D -m 755 scripts/pkg-get.pl ${DESTDIR}${PREFIX}/bin/pkg-get ++ install -D -m 755 scripts/pkg-repgen.pl ${DESTDIR}${PREFIX}/bin/pkg-repgen ++ install -D -m 755 scripts/pkg-get.pl ${DESTDIR}${PREFIX}/bin/pkg-get ++ install -D -m 644 doc/pkg-get.8 ${DESTDIR}${PREFIX}/man/man8/pkg-get.8 ++ install -D -m 644 doc/pkg-get.conf ${DESTDIR}${CFGDIR}/pkg-get.conf ++ install -D -m 644 doc/pkg-repgen.8 ${DESTDIR}${PREFIX}/man/man8/pkg-repgen.8 ++ install -D -m 644 doc/pkg-get.8 ${DESTDIR}${PREFIX}/man/man8/pkg-get.8 + +diff --git a/doc/pkg-repgen.8 b/doc/pkg-repgen.8 +index 17d0609..30b58fc 100644 +--- a/doc/pkg-repgen.8 ++++ b/doc/pkg-repgen.8 +@@ -22,6 +22,10 @@ packages are specified. + .SH OPTIONS + .TP + .B ++\fB--prtdir\fP=PATH ++use prtdir to override the default used by prt-get ++.TP ++.B + \fB--header\fP=FILE + insert FILE at the beginning of the html index + .TP +@@ -36,6 +40,8 @@ use the specified title for the index page + \fBpkg-repgen\fP + .PP + \fBpkg-repgen\fP kdebase kdelibs ++.pp ++\fBpkg-repgen\fP --prtdir=/tmp/mytestrepo --header=/tmp/header.html + .SH AUTHORS + Simone Rota + index generation code adapted from Jukka Heino's portspage +diff --git a/scripts/pkg-repgen.pl b/scripts/pkg-repgen.pl +index 2743ce4..0aa4e16 100755 +--- a/scripts/pkg-repgen.pl ++++ b/scripts/pkg-repgen.pl +@@ -13,8 +13,9 @@ use warnings; + use strict; + use Getopt::Long; + ++our $prtget = "/usr/bin/prt-get"; our $prtdir; + our $title = "CRUX Packages"; our $header; our $footer; +-GetOptions("title=s"=>\$title, "header=s"=>\$header, "footer=s"=>\$footer); ++GetOptions("prtdir=s"=>\$prtdir, "title=s"=>\$title, "header=s"=>\$header, "footer=s"=>\$footer); + + if ($#ARGV >= 0) { # single packages + pkgrepo_single(); +@@ -22,6 +23,9 @@ if ($#ARGV >= 0) { # single packages + pkgread(); + pkginst(); + } else { ++ if ($prtdir) { ++ $prtget = "$prtget --no-std-config --config-set=\"prtdir $prtdir\""; ++ } + pkgrepo(); + pkgdeps(); + pkgread(); +@@ -40,7 +44,7 @@ sub pkgdeps_single { + my $found = 0; + my $package = $packages[0]; + $package =~ s/#.*//; +- my $deps = `prt-get printf "%e" --filter="$package"`; ++ my $deps = `$prtget printf "%e" --filter="$package"`; + if ($deps ne "") { + my $isnew = `grep "$p .*:" PKGDEPS`; + if ($isnew eq ""){ # package is new, put deps at the end. +@@ -74,10 +78,10 @@ sub pkgrepo_single { + my $du = (-s $package); + my $md5 = `md5sum $package`; + $md5 =~ s/ .*$|\n//g; +- my $des=`prt-get printf %d --filter="$name"`; ++ my $des=`$prtget printf %d --filter="$name"`; + $des =~ s/:/ /g; + if ($des eq ""){$des = "N.A."}; +- my $flags=`prt-get printf %E:%O:%R --filter="$name"`; ++ my $flags=`$prtget printf %E:%O:%R --filter="$name"`; + if ($flags eq "") {$flags = "no:no:no"} + my $isnew = `grep "$p#" PKGREPO`; + if ($isnew eq ""){ # package is new, put it at the end +@@ -107,7 +111,7 @@ sub pkgdeps { + open (my $fh, '>PKGDEPS'); + foreach my $package (@packages) { + $package =~ s/#.*//; +- my $deps = `prt-get printf "%e" --filter="$package"`; ++ my $deps = `$prtget printf "%e" --filter="$package"`; + if ($deps ne "") { + printf $fh "%-30s : %-s\n", $package, $deps; + } +@@ -133,10 +137,10 @@ sub pkgrepo { + my $du = (-s $package); + my $md5 = `md5sum $package`; + $md5 =~ s/ .*$|\n//g; +- my $des=`prt-get printf %d --filter="$name"`; ++ my $des=`$prtget printf %d --filter="$name"`; + $des =~ s/:/ /g; + if ($des eq ""){$des = "N.A."}; +- my $flags=`prt-get printf %E:%O:%R --filter="$name"`; ++ my $flags=`$prtget printf %E:%O:%R --filter="$name"`; + if ($flags eq "") {$flags = "no:no:no"} + printf $fh "%-s:%-s:%-s:%-s:%-s\n", $package,$du,$md5,$des,$flags; + my $version = $package; +@@ -167,7 +171,7 @@ sub pkgread { + print $fh "# README files for repository. Do NOT remove this line.\n"; + foreach my $package (@packages) { + $package =~ s/#.*//; +- my $path = `prt-get path $package`; ++ my $path = `$prtget path $package`; + $path =~ s/\n//g; + if (-f "$path/README"){ + print $fh "##### PKGREADME: $package\n"; +@@ -195,7 +199,7 @@ sub pkginst { + my @packages = glob("*#*.pkg.tar.gz"); + foreach my $package (@packages) { + $package =~ s/#.*//; +- my $path = `prt-get path $package`; ++ my $path = `$prtget path $package`; + $path =~ s/\n//g; + my $normal= $package; + $normal =~ s/[^[:alnum:]]/_/g; -- 2.26.2