diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/create-recipe | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/scripts/create-recipe b/scripts/create-recipe index aba9ac37d9..776c91dd9d 100755 --- a/scripts/create-recipe +++ b/scripts/create-recipe | |||
| @@ -35,7 +35,8 @@ use File::Basename qw(basename dirname); | |||
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | my $name = ""; | 37 | my $name = ""; |
| 38 | my $version = "TO BE FILLED IN"; | 38 | my $predef_version = "TO BE FILLED IN"; |
| 39 | my $version = $predef_version; | ||
| 39 | my $description = ""; | 40 | my $description = ""; |
| 40 | my $summary = ""; | 41 | my $summary = ""; |
| 41 | my $url = ""; | 42 | my $url = ""; |
| @@ -809,7 +810,7 @@ sub process_configure_ac | |||
| 809 | # $name = $1; | 810 | # $name = $1; |
| 810 | } | 811 | } |
| 811 | } | 812 | } |
| 812 | if (defined($acinit[1])) { | 813 | if (defined($acinit[1]) and $version eq $predef_version) { |
| 813 | my $ver = $acinit[1]; | 814 | my $ver = $acinit[1]; |
| 814 | $ver =~ s/\[//g; | 815 | $ver =~ s/\[//g; |
| 815 | $ver =~ s/\]//g; | 816 | $ver =~ s/\]//g; |
| @@ -835,7 +836,7 @@ sub process_configure_ac | |||
| 835 | # $name = $1; | 836 | # $name = $1; |
| 836 | } | 837 | } |
| 837 | } | 838 | } |
| 838 | if (defined($acinit[1])) { | 839 | if (defined($acinit[1]) and $version eq $predef_version) { |
| 839 | my $ver = $acinit[1]; | 840 | my $ver = $acinit[1]; |
| 840 | $ver =~ s/\[//g; | 841 | $ver =~ s/\[//g; |
| 841 | $ver =~ s/\]//g; | 842 | $ver =~ s/\]//g; |
| @@ -1536,7 +1537,7 @@ sub guess_name_from_url { | |||
| 1536 | } | 1537 | } |
| 1537 | my $tarfile = $spliturl[0]; | 1538 | my $tarfile = $spliturl[0]; |
| 1538 | 1539 | ||
| 1539 | if ($tarfile =~ /(.*?)\-([0-9\.\-\~]+)[-\.].*?\.tar/) { | 1540 | if ($tarfile =~ /(.*?)\-([0-9\.\-\~]+.*?)\.tar/) { |
| 1540 | $name = $1; | 1541 | $name = $1; |
| 1541 | $version = $2; | 1542 | $version = $2; |
| 1542 | $version =~ s/\-/\_/g; | 1543 | $version =~ s/\-/\_/g; |
| @@ -1687,8 +1688,8 @@ sub write_bbfile | |||
| 1687 | print BBFILE "\"\n\n"; | 1688 | print BBFILE "\"\n\n"; |
| 1688 | 1689 | ||
| 1689 | if (@license <= 0) { | 1690 | if (@license <= 0) { |
| 1690 | print "Can NOT get license from package itself.\n"; | 1691 | print "Can NOT get license from package source files.\n"; |
| 1691 | print "Please update the license and license file manually.\n"; | 1692 | print "Please update the LICENSE and LIC_FILES_CHKSUM manually.\n"; |
| 1692 | } | 1693 | } |
| 1693 | 1694 | ||
| 1694 | if (@buildreqs > 0) { | 1695 | if (@buildreqs > 0) { |
| @@ -1704,7 +1705,7 @@ sub write_bbfile | |||
| 1704 | } | 1705 | } |
| 1705 | print BBFILE "\"\n\n"; | 1706 | print BBFILE "\"\n\n"; |
| 1706 | print BBFILE "SRC_URI[md5sum] = \"$md5sum\"\n"; | 1707 | print BBFILE "SRC_URI[md5sum] = \"$md5sum\"\n"; |
| 1707 | print BBFILE "SRC_URI[sha256sum] = \"$sha256sum\"\n"; | 1708 | print BBFILE "SRC_URI[sha256sum] = \"$sha256sum\"\n\n"; |
| 1708 | 1709 | ||
| 1709 | if (@inherits) { | 1710 | if (@inherits) { |
| 1710 | print BBFILE "inherit "; | 1711 | print BBFILE "inherit "; |
| @@ -1800,9 +1801,17 @@ foreach (@tgzfiles) { | |||
| 1800 | # this is a step backwards in time that is just silly. | 1801 | # this is a step backwards in time that is just silly. |
| 1801 | # | 1802 | # |
| 1802 | 1803 | ||
| 1804 | my @sourcetars = <$orgdir/$outputdir/*\.tar\.bz2 $orgdir/$outputdir/*\.tar\.gz>; | ||
| 1805 | if ( length @sourcetars == 0) { | ||
| 1806 | print "Can NOT find source tarball. Exiting...\n"; | ||
| 1807 | exit (1); | ||
| 1808 | } | ||
| 1809 | if (defined($sourcetars[0]) and $sourcetars[0] =~ ".*\.tar\.bz2") { | ||
| 1810 | system("cd $tmpdir; tar -jxf $sourcetars[0] &>/dev/null"); | ||
| 1811 | } elsif (defined($sourcetars[0]) and $sourcetars[0] =~ ".*\.tar\.gz") { | ||
| 1812 | system("cd $tmpdir; tar -zxf $sourcetars[0] &>/dev/null"); | ||
| 1813 | } | ||
| 1803 | 1814 | ||
| 1804 | system("cd $tmpdir; tar -jxf $orgdir/$outputdir/*\.tar\.bz2 &>/dev/null"); | ||
| 1805 | system("cd $tmpdir; tar -zxf $orgdir/$outputdir/*\.tar\.gz &>/dev/null"); | ||
| 1806 | print "Parsing content ....\n"; | 1815 | print "Parsing content ....\n"; |
| 1807 | my @dirs = <$tmpdir/*>; | 1816 | my @dirs = <$tmpdir/*>; |
| 1808 | foreach (@dirs) { | 1817 | foreach (@dirs) { |
| @@ -1827,7 +1836,7 @@ if ( -e "$dir/configure" ) { | |||
| 1827 | $configure = ""; | 1836 | $configure = ""; |
| 1828 | } | 1837 | } |
| 1829 | 1838 | ||
| 1830 | my @files = <$dir/configure.*>; | 1839 | my @files = <$dir/configure\.*>; |
| 1831 | 1840 | ||
| 1832 | my $findoutput = `find $dir -name "configure.ac" 2>/dev/null`; | 1841 | my $findoutput = `find $dir -name "configure.ac" 2>/dev/null`; |
| 1833 | my @findlist = split(/\n/, $findoutput); | 1842 | my @findlist = split(/\n/, $findoutput); |
