From: biao716.wang Date: Wed, 13 May 2020 08:18:03 +0000 (+0900) Subject: Add debian for tools usage X-Git-Tag: accepted/tools/devbase/tools/legacy/20240422.110918^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29ec9f8128e658bc1883c2c99ce43b2d550a90ee;p=tools%2Fyum.git Add debian for tools usage createrepo paakcage will use it Change-Id: I37d09429cba7467c8637b1bb2750d4bcd5a823d6 Signed-off-by: biao716.wang --- diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100755 index 0000000..caa8290 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,21 @@ +yum for Debian +-------------- +Yum requires a working rpm installation. By default the rpm package does not +create a completely working one lest beginners shoot themselves in the foot. + +You should: + - mkdir /var/lib/rpm + - rpm --initdb +prior to using yum. + +Be aware that the only usage of yum in Debian is to perform chroot (Xen, UML) +of Fedora, RHEL, CentOS, etc. installs. We, at GPLHost, use a specific +bootstrap script for doing this with CentOS. Such script is shipped with +DTC-Xen (also in Debian). + +This package was not, is not, and will never be, a replacement for apt-get when +using Debian or any other .deb based distribution. So please, do NOT ask about +it, or do not send any bug entry for this, or you'll get flamed for not reading +the README.Debian as anyone should. + + -- Thomas Goirand Sat, 26 Dec 2009 13:05:37 +0800 diff --git a/debian/README.source b/debian/README.source new file mode 100755 index 0000000..ef78689 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,3 @@ +This package uses the old dpatch system, and not yet Quilt, so it's easy to +backport to Lenny. Please bare with me. As soon as Squeeze will be out, I'll +switch to using the more powerful Quilt format for the next Debian release. diff --git a/debian/changelog b/debian/changelog new file mode 100755 index 0000000..31a956e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +yum (3.4.3-0) experimental; urgency=low + + * Add debian. + + -- Biao Wang Wed, 21 May 2020 15:37:12 +0000 diff --git a/debian/compat b/debian/compat new file mode 100755 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100755 index 0000000..856b00e --- /dev/null +++ b/debian/control @@ -0,0 +1,40 @@ +Source: yum +Section: admin +Priority: extra +Maintainer: Thomas Goirand +Uploaders: Mike Miller +Build-Depends: debhelper (>= 9), python-all (>= 2.6.6-3~), python, python-dev +Build-Depends-Indep: intltool +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/yum.git +Vcs-Git: git://anonscm.debian.org/collab-maint/yum.git +Standards-Version: 3.9.4 +Homepage: http://yum.baseurl.org/ + +Package: yum +Architecture: all +Depends: python (>= 2.5) | python-celementtree, + python-libxml2, + python-rpm, + python-sqlite, + python-sqlitecachec, + python-urlgrabber, + rpm (>= 4.4.1), + ${misc:Depends}, + ${python:Depends}, + ${shlibs:Depends} +Description: Advanced front-end for rpm + Yum (Yellow dog Updater, Modified) is an automatic updater and package + installer/remover for rpm systems. It automatically computes dependencies + and figures out what things should occur to install packages. It makes it + easier to maintain groups of machines without having to manually update + each one using rpm. + . + Features include: + . + * Multiple Repositories + * Simple config file + * Correct dependency calculation + * Fast operation + * rpm-consistent behavior + * comps.xml group support, including multiple repository groups + * Simple interface diff --git a/debian/copyright b/debian/copyright new file mode 100755 index 0000000..f52507d --- /dev/null +++ b/debian/copyright @@ -0,0 +1,81 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: yum +Upstream-Contact: yum development +Source: http://yum.baseurl.org/ + +Files: debian/* +Copyright: (c) 2008-2009, Thomas Goirand + (c) 2005-2006, Anand Kumria +License: LGPL-2.1+ + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) + any later version. + . + This library 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 Lesser General Public License for more + details. + . + You should have received a copy of the GNU Lesser General Public License along + with this library; if not, write to the Free Software Foundation, Inc., 51 + Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the complete text of the GNU Lesser General Public License + (LGPL) v2.1 may be found in /usr/share/common-licenses/LGPL-2.1 + +Files: * +Copyright: (c) 2003-2004, Seth Vidal, Duke University + (c) 2005-2009, Seth Vidal + . + YUM aythors, list taken from the upstream AUTHORS file, email addresses taken + from the mailing list (as there was none in the + AUTHORS file) where patches are sent and few names added from there: + . + Seth Vidal (lead) + Jeremy Katz + Adrian Likins + Matthew Miller + Michael Stenner + Icon Riabitsev + Ryan Tomayko + Paul Nasrat + Robert G. Brown + Hollis Blanchard + Grigory Bakunov + Menno Smits + Gijs Hollestelle + Terje Rosten + Luke Macken + James Bowes + Tim Lauridsen + Florian Festi + Jack Neely + James Antill + Panu Matilainen + Tambet Ingo + Mike Bonnet + Ville-Pekka Vainio + Ville Skyttä + . + Original Yup people: + Bryan Stillwell + Stephen Edie + Dan Burcaw + Troy Bengegerdes +License: GPL-2+ + This package 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 package 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 package; if not, write to the Free Software Foundation, Inc., 51 Franklin + St, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the complete text of the GNU General Public License can be + found in /usr/share/common-licenses/GPL-2 diff --git a/debian/dirs b/debian/dirs new file mode 100755 index 0000000..4511b67 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,3 @@ +etc/yum/repos.d +var/cache/yum +var/lib/yum diff --git a/debian/docs b/debian/docs new file mode 100755 index 0000000..8c6c743 --- /dev/null +++ b/debian/docs @@ -0,0 +1,7 @@ +debian/README.source +debian/README.Debian +FAQ +PLUGINS +README +TODO +AUTHORS diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100755 index 0000000..0848de8 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,6 @@ +[DEFAULT] +upstream-branch = upstream-sid +debian-branch = debian-sid + +[git-buildpackage] +export-dir = ../build-area/ diff --git a/debian/patches/02_Get-correct-rpmdb-path-from-rpm-configuration.patch b/debian/patches/02_Get-correct-rpmdb-path-from-rpm-configuration.patch new file mode 100755 index 0000000..1143a0e --- /dev/null +++ b/debian/patches/02_Get-correct-rpmdb-path-from-rpm-configuration.patch @@ -0,0 +1,54 @@ +Description: Get correct rpmdb path from rpm configuration +Author: Mike Miller +Forwarded: http://lists.baseurl.org/pipermail/yum-devel/2012-June/009354.html + +--- a/yum/rpmsack.py ++++ b/yum/rpmsack.py +@@ -222,6 +222,11 @@ class RPMDBPackageSack(PackageSackBase): + self._persistdir = root + '/' + persistdir + else: + self._persistdir = persistdir ++ if hasattr(rpm, 'expandMacro'): ++ dbpath = rpm.expandMacro('%_dbpath') ++ else: ++ dbpath = '/var/lib/rpm' ++ self._rpmdbpath = os.path.normpath(root + '/' + dbpath) + self._have_cached_rpmdbv_data = None + self._cached_conflicts_data = None + # Store the result of what happens, if a transaction completes. +@@ -325,7 +330,7 @@ class RPMDBPackageSack(PackageSackBase): + + # We are keeping some data from before, and sometimes (Eg. remove only) + # we never open the rpmdb again ... so get the mtime now. +- rpmdbfname = self.root + "/var/lib/rpm/Packages" ++ rpmdbfname = self._rpmdbpath + "/Packages" + self._cached_rpmdb_mtime = os.path.getmtime(rpmdbfname) + + def _safe_del(x, y): +@@ -1049,7 +1054,7 @@ class RPMDBPackageSack(PackageSackBase): + # http://lists.rpm.org/pipermail/rpm-maint/2007-November/001719.html + # ...if anything gets implemented, we should change. + rpmdbvfname = self._cachedir + "/version" +- rpmdbfname = self.root + "/var/lib/rpm/Packages" ++ rpmdbfname = self._rpmdbpath + "/Packages" + + if os.path.exists(rpmdbvfname) and os.path.exists(rpmdbfname): + # See if rpmdb has "changed" ... +@@ -1072,7 +1077,7 @@ class RPMDBPackageSack(PackageSackBase): + if self._cached_rpmdb_mtime is None: + return # We haven't loaded any packages!!! + +- rpmdbfname = self.root + "/var/lib/rpm/Packages" ++ rpmdbfname = self._rpmdbpath + "/Packages" + if not os.path.exists(rpmdbfname): + return # haha + +@@ -1268,7 +1273,7 @@ class RPMDBPackageSack(PackageSackBase): + self._name2pkg.setdefault(po.name, []).append(po) + self._tup2pkg[po.pkgtup] = po + if self.__cache_rpmdb__ and self._cached_rpmdb_mtime is None: +- rpmdbfname = self.root + "/var/lib/rpm/Packages" ++ rpmdbfname = self._rpmdbpath + "/Packages" + self._cached_rpmdb_mtime = os.path.getmtime(rpmdbfname) + + return po diff --git a/debian/patches/fixes-AttributeError-module-object-has-no-attribute-uses_fragment.patch b/debian/patches/fixes-AttributeError-module-object-has-no-attribute-uses_fragment.patch new file mode 100755 index 0000000..a279099 --- /dev/null +++ b/debian/patches/fixes-AttributeError-module-object-has-no-attribute-uses_fragment.patch @@ -0,0 +1,40 @@ +Description: urlparse: AttributeError: 'module' object has no attribute 'uses_fragment' +Author: Johannes Graumann +Bug-Debian: http://bugs.debian.org/679067 +Forwarded: no + +diff --git a/yum/packages.py b/yum/packages.py +index 5ef9951..3d81745 100644 +--- a/yum/packages.py ++++ b/yum/packages.py +@@ -39,7 +39,12 @@ from constants import * + from operator import itemgetter + + import urlparse +-urlparse.uses_fragment.append("media") ++ ++try: ++ urlparse.uses_fragment.append("media") ++except AttributeError, err: ++ print err ++ + from urlgrabber.grabber import URLGrabber, URLGrabError + + try: +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index e5e9ece..3e6d78a 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -19,7 +19,11 @@ import re + import time + import types + import urlparse +-urlparse.uses_fragment.append("media") ++ ++try: ++ urlparse.uses_fragment.append("media") ++except AttributeError, err: ++ print err + + import Errors + from urlgrabber.grabber import URLGrabber diff --git a/debian/patches/series b/debian/patches/series new file mode 100755 index 0000000..aa7feab --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +fixes-AttributeError-module-object-has-no-attribute-uses_fragment.patch +02_Get-correct-rpmdb-path-from-rpm-configuration.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..d1766df --- /dev/null +++ b/debian/rules @@ -0,0 +1,84 @@ +#!/usr/bin/make -f + +#export DH_VERBOSE=1 + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + +#Architecture +build-arch: build +build: build-indep +build-indep: build-indep-stamp +build-indep-stamp: configure-stamp + + # Add here commands to compile the indep part of the package. + #$(MAKE) doc + $(MAKE) + touch build-indep-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-indep-stamp + + # Delete po/yum.pot so it doesn't polute the diff.gz + #rm -f po/yum.pot + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) clean + + dh_clean + +install: install-indep +install-indep: + dh_testdir + dh_testroot + dh_prep + dh_installdirs -i + + $(MAKE) install DESTDIR=$(CURDIR)/debian/yum + + # Remove all traces of yum-cron and yum-updatesd from the package. + rm -rf $(CURDIR)/debian/yum/etc/rc.d + rm -rf $(CURDIR)/debian/yum/etc/yum/yum-updatesd.conf + rm -rf $(CURDIR)/debian/yum/etc/dbus-1 + rm -rf $(CURDIR)/debian/yum/etc/cron.daily + rm -rf $(CURDIR)/debian/yum/etc/sysconfig + rm -f $(CURDIR)/debian/yum/usr/sbin/yum-updatesd + rm -f $(CURDIR)/debian/yum/usr/share/man/man*/yum-updatesd* + rm -f $(CURDIR)/debian/yum/usr/share/yum-cli/yumupd.py* + rmdir $(CURDIR)/debian/yum/usr/sbin + if [ -d $(CURDIR)/debian/yum/usr/lib/python2.7/site-packages ] ; then \ + mv $(CURDIR)/debian/yum/usr/lib/python2.7/site-packages $(CURDIR)/debian/yum/usr/lib/python2.7/dist-packages ; \ + fi + +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_python2 --skip-private + dh_python2 /usr/share/yum-cli + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture independant packages using the common target. +binary-indep: build-indep install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +binary: binary-indep +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure diff --git a/debian/yum-doc.docs b/debian/yum-doc.docs new file mode 100755 index 0000000..299950c --- /dev/null +++ b/debian/yum-doc.docs @@ -0,0 +1,2 @@ +#DOCS# +