reorg files in sub-packages
authorAnas Nashif <anas.nashif@intel.com>
Mon, 14 Jan 2013 16:12:39 +0000 (08:12 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Sun, 3 Feb 2013 00:44:44 +0000 (16:44 -0800)
packaging/rpm.spec
packaging/rpmsort [deleted file]
packaging/symset-table [deleted file]

index 79530c9b17f4750d7c56a3f5abb5f3e2b42f693a..ee3d049a8019f9154646cfd7131c24cd0a86d185 100644 (file)
@@ -1,3 +1,5 @@
+%define rpmhome /usr/lib/rpm
+
 Name:           rpm
 BuildRequires:  binutils
 BuildRequires:  bzip2
@@ -38,8 +40,6 @@ Source0:        rpm-%{version}.tar.bz2
 Source1:               db-4.8.30.tar.bz2
 Source2:           db-4.8.30-integration.dif
 Source4:        rpm-tizen_macros
-Source5:        rpmsort
-Source6:        symset-table
 Source8:        rpmconfigcheck
 Source13:          find-docs.sh
 Source22:          device-sec-policy
@@ -183,14 +183,13 @@ rm -f %{buildroot}/usr/lib/rpmpopt
 rm -rf %{buildroot}%{_mandir}/{fr,ja,ko,pl,ru,sk}
 rm -f %{buildroot}%{_prefix}/share/locale/de/LC_MESSAGES/rpm.mo
 rm -f %{buildroot}/usr/lib/rpm/cpanflute %{buildroot}/usr/lib/rpm/cpanflute2
-install -m 755 %{SOURCE5} %{buildroot}/usr/lib/rpm
-install -m 755 %{SOURCE6} %{buildroot}/usr/lib/rpm
 install -m 755 scripts/find-supplements{,.ksyms} %{buildroot}/usr/lib/rpm
 install -m 755 scripts/firmware.prov %{buildroot}/usr/lib/rpm
 install -m 755 scripts/debuginfo.prov %{buildroot}/usr/lib/rpm
 rm -f %{buildroot}/usr/lib/locale %{buildroot}/usr/lib/rpmrc
 mkdir -p %{buildroot}/etc/rpm
 chmod 755 %{buildroot}/etc/rpm
+mkdir -p %{buildroot}%{rpmhome}/macros.d
 # remove some nonsense or non-working scripts
 pushd %{buildroot}/usr/lib/rpm/
 for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
@@ -227,15 +226,27 @@ rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion va
 %doc   COPYING GROUPS
        /etc/rpm
        /bin/rpm
-       /usr/bin/*
-        %exclude /usr/bin/rpmbuild
-       /usr/lib/rpm
+%{_bindir}/rpm2cpio
+%{_bindir}/rpmdb
+%{_bindir}/rpmkeys
+%{_bindir}/rpmquery
+%{_bindir}/rpmverify
+%{_bindir}/rpmqpack
+%attr(0755, root, root) %dir %{rpmhome}
+%{rpmhome}/macros
+%{rpmhome}/macros.d
+%{rpmhome}/rpmpopt*
+%{rpmhome}/rpmrc
+%{rpmhome}/tizen/macros
+%{rpmhome}/tizen_macros
+%{rpmhome}/rpm.supp
+%{rpmhome}/tgpg
+%{rpmhome}/platform
+
 %dir   %{_libdir}/rpm-plugins
        %{_libdir}/rpm-plugins/exec.so
        %{_libdir}/librpm.so.*
-       %{_libdir}/librpmbuild.so.*
        %{_libdir}/librpmio.so.*
-       %{_libdir}/librpmsign.so.*
 %doc   %{_mandir}/man[18]/*.[18]*
 %dir   /var/lib/rpm
 %dir   %attr(755,root,root) /usr/src/packages/BUILD
@@ -248,11 +259,33 @@ rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion va
 
 %files build
 %defattr(-,root,root)
-/usr/bin/rpmbuild
+%{_bindir}/rpmbuild
+%{_bindir}/gendiff
+%{_bindir}/rpmspec
+%{_bindir}/rpmsign
+
+%{_libdir}/librpmbuild.so.*
+%{_libdir}/librpmsign.so.*
+%{rpmhome}/tizen/find-*
+%{rpmhome}/brp-*
+%{rpmhome}/find-supplements*
+%{rpmhome}/check-*
+%{rpmhome}/debugedit
+%{rpmhome}/find-debuginfo.sh
+%{rpmhome}/find-lang.sh
+%{rpmhome}/*provides*
+%{rpmhome}/*requires*
+%{rpmhome}/*deps*
+%{rpmhome}/*.prov
+%{rpmhome}/*.req
+%{rpmhome}/macros.*
+%{rpmhome}/fileattrs
+
 
 %files devel
 %defattr(644,root,root,755)
-       /usr/include/rpm
+%{_bindir}/rpmgraph
+/usr/include/rpm
         %{_libdir}/librpm.so
         %{_libdir}/librpmbuild.so
         %{_libdir}/librpmio.so
diff --git a/packaging/rpmsort b/packaging/rpmsort
deleted file mode 100644 (file)
index 75629fc..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#! /usr/bin/perl -w
-
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-# USA.
-
-use Getopt::Long qw(:config gnu_getopt);
-
-sub do_rpm_cmp_versions {
-    my ($evr1, $evr2) = @_;
-
-    sub _rpm_cmp {
-       my ($s1, $s2) = @_;
-
-       return defined $s1 <=> defined $s2
-           unless defined $s1 && defined $s2;
-
-       my ($r, $x1, $x2);
-       do {
-           $s1 =~ s/^[^a-zA-Z0-9]+//;
-           $s2 =~ s/^[^a-zA-Z0-9]+//;
-           if ($s1 =~ /^\d/ || $s2 =~ /^\d/) {
-               $s1 =~ s/^(0*(\d*))//;  $x1 = $2;
-               return -1 if $1 eq '';
-               $s2 =~ s/^(0*(\d*))//;  $x2 = $2;
-               return 1 if $1 eq '';
-               $r = length $x1 <=> length $x2 || $x1 cmp $x2;
-           } else {
-               $s1 =~ s/^([a-zA-Z]*)//;  $x1 = $1;
-               $s2 =~ s/^([a-zA-Z]*)//;  $x2 = $1;
-               return 0
-                   if $x1 eq '' && $x2 eq '';
-               $r = $x1 cmp $x2;
-           }
-       } until $r;
-       return $r;
-    }
-
-    my ($e1, $v1, $r1) = $evr1 =~ /^(?:(\d*):)?(.*?)(?:-([^-]*))?$/;
-    my ($e2, $v2, $r2) = $evr2 =~ /^(?:(\d*):)?(.*?)(?:-([^-]*))?$/;
-    my $r = _rpm_cmp($e1 || 0, $e2 || 0);
-    $r = _rpm_cmp($v1, $v2)
-       unless $r;
-    $r = _rpm_cmp($r1, $r2)
-       unless $r;
-    return $r;
-}
-
-my $reorder = sub { return @_ };
-my $key = 0;
-my $test = 0;
-
-sub rpm_cmp_versions {
-       my ($evr1, $evr2) = @_;
-
-       chomp($evr1, $evr2);
-       my $res1 = do_rpm_cmp_versions($evr1, $evr2);
-       if ($test) {
-               open(my $fd, '-|', 'zypper', '--terse', 'versioncmp',
-                       $evr1, $evr2) or die "zypper: $!\n";
-               my $res2 = <$fd>;
-               close($fd) or die "zypper: $!\n";
-               chomp $res2;
-               if ($res1 != $res2) {
-                       my @operators = qw(< == >);
-                       my $op1 = $operators[$res1 + 1];
-                       my $op2 = $operators[$res2 + 1];
-
-                       print STDERR "BUG: $evr1 $op1 $evr2 vs. zypper: $evr1 $op2 $evr2\n";
-               }
-       }
-       return $res1;
-}
-
-GetOptions ("r|reverse"            => sub { $reorder = sub { return reverse @_ } },
-           "k|key=i"       => \$key,
-           "test"        => \$test)
-or do {
-    print STDERR "Usage $0 [-r, --reverse] [-k N, --key=N] [--test]\n";
-    exit 1;
-};
-
-if ($key == 0) {
-    # Sort by entire lines
-    map { print } &$reorder(sort { rpm_cmp_versions($a, $b) } <>);
-} else {
-    # Sort by field $key
-    my @data = map { [(split)[$key-1], $_] } <>;
-    map { print } &$reorder(map { $_->[1] }
-        sort { rpm_cmp_versions($a->[0], $b->[0]) } @data);
-}
diff --git a/packaging/symset-table b/packaging/symset-table
deleted file mode 100644 (file)
index c94a61c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-
-# Create a table of all symbol sets defined in all /boot/symsets*.tar.gz
-# files.
-#
-# Format:
-#   kernelrelease/modver/symbol <tab> symset <tab> symset_hash
-#
-# This table is needed for computing the appropriate Requires: tags for
-# kernel module packages.
-
-tmpdir=$(mktemp -t -d ${0##*/}.XXXXXX)
-trap "cd / ; rm -rf $tmpdir" EXIT
-cd $tmpdir
-
-shopt -s nullglob
-for symsets in /boot/symsets-*.tar.gz; do
-    zcat $symsets \
-    | tar xf -
-done
-
-for symsets in *; do
-    krel=${symsets#symsets-}
-    for symset in $symsets/*; do
-       class=${symset##*/} ; class=${class%.*}
-       hash=${symset##*.}
-       awk '
-       BEGIN { FS = "\t" ; OFS = "\t" }
-       { sub(/0x0*/, "", $1)
-         print krel "/" $1 "/" $2, class, hash }
-       ' krel="$krel" class="$class" hash="$hash" $symset
-    done
-done
-
-# vim:shiftwidth=4 softtabstop=4