[Pkg-octave-commit] r1266 - in octave-pkg-dev/trunk: . debian

Rafael Laboissiere rafael at alioth.debian.org
Mon Feb 25 16:29:18 UTC 2008


Author: rafael
Date: 2008-02-25 16:29:17 +0000 (Mon, 25 Feb 2008)
New Revision: 1266

Added:
   octave-pkg-dev/trunk/get-oct-pkg-src.pl
Modified:
   octave-pkg-dev/trunk/debian/install
   octave-pkg-dev/trunk/octave-pkg-dev.mk.in
Log:
* get-oct-pkg-src.pl: Add script
* octave-pkg-dev.mk.in: Call get-oct-pkg-src.pl in get-orig-source

Modified: octave-pkg-dev/trunk/debian/install
===================================================================
--- octave-pkg-dev/trunk/debian/install	2008-02-25 15:33:17 UTC (rev 1265)
+++ octave-pkg-dev/trunk/debian/install	2008-02-25 16:29:17 UTC (rev 1266)
@@ -1,4 +1,5 @@
-octave-pkg-dev.mk	usr/share/octave/debian/
-octave-pkg-dev.pl	usr/share/octave/debian/
-postinst		usr/share/octave/debian/
-prerm			usr/share/octave/debian/
+octave-pkg-dev.mk	usr/share/octave/debian
+octave-pkg-dev.pl	usr/share/octave/debian
+postinst		usr/share/octave/debian
+prerm			usr/share/octave/debian
+get-oct-pkg-src.pl	usr/share/octave/debian

Added: octave-pkg-dev/trunk/get-oct-pkg-src.pl
===================================================================
--- octave-pkg-dev/trunk/get-oct-pkg-src.pl	                        (rev 0)
+++ octave-pkg-dev/trunk/get-oct-pkg-src.pl	2008-02-25 16:29:17 UTC (rev 1266)
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -w
+
+# Copyright (c) 2008  Olafur Jens Sigurðsson <ojsbug at gmail.com>
+# Copyright (c) 2008  Rafael Laboissiere <rafael at debian.org>
+#
+# 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
+
+(my $prog = $0) =~ s:.*/::;
+
+open (CONTROL, "< ./debian/control")
+  or die "$prog:E: File ./debian/control not found\n";
+
+my $pkgname = "";
+while (<CONTROL>) {
+    if (/^Package: (.*)/) {
+        ($pkgname = $1) =~ s/^octave-//;
+        last;
+    }
+}
+
+$pkgname ne ""
+  or die "$prog:E: Cannot find package name in debian/control\n";
+
+my $pkgurl = "http://octave.sourceforge.net/packages.html";
+my $urlbase = "http://downloads.sourceforge.net/octave";
+
+open (PAGE, "curl --silent $pkgurl |");
+
+my @PKGS = ();
+while (<PAGE>) {
+    push (@PKGS, m{href="($urlbase/.*\.tar\.gz\?download)"}g)
+}
+
+my $download = (grep {/$pkgname/} @PKGS) [0];
+
+$download ne ""
+  or die "$prog:E: Tarball for $pkgname not found at SF site\n";
+
+(my $tarball = $download) =~ s/.*($pkgname-[\d.]+\.tar\.gz).*/$1/;
+
+if (-f $tarball) {
+    print "$prog:W: Tarball $tarball already downloaded\n";
+    exit 0;
+}
+
+system (qq {curl --location --silent --output $tarball "$download"}) == 0
+  or die "$prog:E: Cannot download $tarball from SF site\n";


Property changes on: octave-pkg-dev/trunk/get-oct-pkg-src.pl
___________________________________________________________________
Name: svn:executable
   + *

Modified: octave-pkg-dev/trunk/octave-pkg-dev.mk.in
===================================================================
--- octave-pkg-dev/trunk/octave-pkg-dev.mk.in	2008-02-25 15:33:17 UTC (rev 1265)
+++ octave-pkg-dev/trunk/octave-pkg-dev.mk.in	2008-02-25 16:29:17 UTC (rev 1266)
@@ -43,3 +43,6 @@
 
 clean::
 	rm -f build-stamp
+
+get-orig-source:
+	@perl $(shrpkg)/get-oct-pkg-src.pl




More information about the Pkg-octave-commit mailing list