get-orig-source rule question...
Ancoron Luciferis
ancoron at chaoslayer.de
Thu May 28 01:39:13 BST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi there,
I've currently working on fixing the last issue that REVU raises for my
first package: http://revu.ubuntuwire.com/p/sblim-cmpi-fsvol
I have written a small script to download the latest version of the package:
#!/bin/sh
PKGNAME="sblim-cmpi-fsvol"
echo "Creating temporary directory ..."
mkdir DL_TMP || exit 1
cd DL_TMP
echo "Retrieving versions for package ${PKGNAME} ..."
wget -qO files.tmp
"http://sourceforge.net/project/showfiles.php?group_id=128809&package_id=144611"
|| exit 1
echo "Extracting download URI for latest package version ..."
sed -e '/downloads\.sourceforge\.net/!d' -e
"s/.\+\(http.*downloads\.sourceforge\.net[^']\+\).\+/\1/;q" files.tmp >
filename.tmp || exit 1
echo "Extracting basename of package ..."
PKGBASENAME="`sed -e 's/.\+\(sblim.\+\)\.tar\.bz2/\1/' filename.tmp`"
echo "Extracting version of package ..."
PKGVERSION="`sed -e 's/.\+fsvol\-\(.\+\)\.tar\.bz2/\1/' filename.tmp`"
echo "Downloading the latest package ..."
wget -qO ${PKGBASENAME}.tar.bz2 `cat filename.tmp` || exit 1
echo "Creating ${PKGNAME}_${PKGVERSION}.orig.tar.gz package ..."
bunzip2 ${PKGBASENAME}.tar.bz2 || exit 1
gzip -9 ${PKGBASENAME}.tar || exit 1
mv ${PKGBASENAME}.tar.gz ../${PKGNAME}_${PKGVERSION}.orig.tar.gz || exit 1
cd ..
rm -r DL_TMP
^^ That one first looks into the files page of the package, extracts the
link for the latest version, downloads it and then builds a orig.tar.gz
(as the package is provided as a tar.bz2)
A first integration into the rules file looks like this:
get-orig-source:
echo "Creating temporary directory ..."
mkdir DL_TMP || exit 1
cd DL_TMP
echo "Retrieving versions for package ${PKGNAME} ..."
wget -qO files.tmp
"http://sourceforge.net/project/showfiles.php?group_id=128809&package_id=144611"
|| exit 1
echo "Extracting download URI for latest package version ..."
sed -e '/downloads\.sourceforge\.net/!d' -e
"s/.\+\(http.*downloads\.sourceforge\.net[^']\+\).\+/\1/;q" files.tmp >
filename.tmp || exit 1
echo "Extracting basename of package ..."
PKGBASENAME = `sed -e 's/.\+\(sblim.\+\)\.tar\.bz2/\1/' filename.tmp`
echo "Extracting version of package ..."
PKGVERSION = `sed -e 's/.\+fsvol\-\(.\+\)\.tar\.bz2/\1/' filename.tmp`
echo "Downloading the latest package ..."
wget -qO $(PKGBASENAME).tar.bz2 `cat filename.tmp` || exit 1
echo "Creating ${PKGNAME}_${PKGVERSION}.orig.tar.gz package ..."
bunzip2 $(PKGBASENAME).tar.bz2 || exit 1
gzip -9 $(PKGBASENAME).tar || exit 1
mv $(PKGBASENAME).tar.gz ../../$(PKGNAME)_$(PKGVERSION).orig.tar.gz ||
exit 1
cd ..
rm -r DL_TMP
The main question I have is:
What happens if the version number changes (e.g. from currently 1.4.4 to
1.4.5)? As the debian directory and its files are located inside the
extracted directory of the package will those be automatically copied
into the new directory?
E.g. before:
sblim-cmpi-fsvol-1.4.4/debian/rules
...would become...
sblim-cmpi-fsvol-1.4.5/debian/rules
...without any other change by the package maintainer?
Thanx for any clarification.
Ancoron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkod3SUACgkQHwxOsqv2bG07NwCdHI/D+6pZtfDZgH13sfUQ3XS2
gCsAn1q8HiJwrwEMOgJye//vtqoMZsJ8
=6x3E
-----END PGP SIGNATURE-----
More information about the Ubuntu-motu
mailing list