mirror of
https://abf.rosa.ru/djam/makeself.git
synced 2025-02-22 17:02:58 +00:00
Automatic import for version 2.1.5
This commit is contained in:
commit
fca3f788f3
3 changed files with 326 additions and 0 deletions
2
.abf.yml
Normal file
2
.abf.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
sources:
|
||||
"makeself-2.1.5.tar.bz2": 15ffd5ddf392d553451872079fc02a60f2c50cf6
|
109
makeself.spec
Normal file
109
makeself.spec
Normal file
|
@ -0,0 +1,109 @@
|
|||
Summary: Generates a self-extractable archive from a directory
|
||||
Name: makeself
|
||||
Version: 2.1.5
|
||||
Release: %mkrel 3
|
||||
Source0: http://www.megastep.org/makeself/%{name}-%{version}.tar.bz2
|
||||
Source1: http://angst.cynapses.org/stripmakeself
|
||||
License: GPLv3
|
||||
Group: Archiving/Compression
|
||||
Url: http://www.megastep.org/makeself/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||
Requires: bzip2
|
||||
Requires: coreutils
|
||||
Requires: gnupg
|
||||
|
||||
%description
|
||||
Makeself is a small shell script that generates a self-extractable
|
||||
tar.gz archive from a directory. The resulting file appears as a shell
|
||||
script (many of those have a .run suffix), and can be launched as
|
||||
is. The archive will then uncompress itself to a temporary directory
|
||||
and an optional arbitrary command will be executed (for example an
|
||||
installation script). This is pretty similar to archives generated
|
||||
with WinZip Self-Extractor in the Windows world. Makeself archives
|
||||
also include checksums for integrity self-validation (CRC and/or MD5
|
||||
checksums).
|
||||
|
||||
The makeself.sh script itself is used only to create the archives from
|
||||
a directory of files. The resultant archive is actually a compressed
|
||||
(using gzip, bzip2, or compress) TAR archive, with a small shell
|
||||
script stub at the beginning. This small stub performs all the steps
|
||||
of extracting the files, running the embedded command, and removing
|
||||
the temporary files when it's all over. All what the user has to do to
|
||||
install the software contained in such an archive is to "run" the
|
||||
archive, i.e sh nice-software.run. I recommend using the "run" (which
|
||||
was introduced by some Makeself archives released by Loki Software) or
|
||||
"sh" suffix for such archives not to confuse the users, since they
|
||||
know it's actually shell scripts (with quite a lot of binary data
|
||||
attached to it though!).
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
cp -p %{SOURCE1} .
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT%{_bindir} \
|
||||
$RPM_BUILD_ROOT%{_mandir}/man1 \
|
||||
$RPM_BUILD_ROOT%{_datadir}/makeself/
|
||||
install -m 755 makeself.sh $RPM_BUILD_ROOT%{_bindir}/makeself
|
||||
install -m 755 makeself-header.sh $RPM_BUILD_ROOT%{_datadir}/makeself/makeself-header
|
||||
install -m 755 stripmakeself $RPM_BUILD_ROOT%{_bindir}/
|
||||
install -m 644 makeself.1 $RPM_BUILD_ROOT%{_mandir}/man1/
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc COPYING README TODO makeself.lsm
|
||||
%{_bindir}/*
|
||||
%{_mandir}/man1/*
|
||||
%{_datadir}/makeself/*
|
||||
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed May 04 2011 Oden Eriksson <oeriksson@mandriva.com> 2.1.5-3mdv2011.0
|
||||
+ Revision: 666361
|
||||
- mass rebuild
|
||||
|
||||
* Mon Dec 06 2010 Oden Eriksson <oeriksson@mandriva.com> 2.1.5-2mdv2011.0
|
||||
+ Revision: 612805
|
||||
- the mass rebuild of 2010.1 packages
|
||||
|
||||
* Mon Mar 08 2010 Sandro Cazzaniga <kharec@mandriva.org> 2.1.5-1mdv2010.1
|
||||
+ Revision: 516390
|
||||
- Update to 2.1.5
|
||||
|
||||
* Fri Sep 04 2009 Thierry Vignaud <tv@mandriva.org> 2.1.4-5mdv2010.0
|
||||
+ Revision: 429948
|
||||
- rebuild
|
||||
|
||||
* Mon Jul 28 2008 Thierry Vignaud <tv@mandriva.org> 2.1.4-4mdv2009.0
|
||||
+ Revision: 251795
|
||||
- rebuild
|
||||
|
||||
* Thu Jan 03 2008 Olivier Blin <oblin@mandriva.com> 2.1.4-2mdv2008.1
|
||||
+ Revision: 140944
|
||||
- restore BuildRoot
|
||||
|
||||
+ Thierry Vignaud <tv@mandriva.org>
|
||||
- kill re-definition of %%buildroot on Pixel's request
|
||||
|
||||
|
||||
* Wed Feb 14 2007 Lenny Cartier <lenny@mandriva.com> 2.1.4-2mdv2007.0
|
||||
+ Revision: 120926
|
||||
- Import makeself
|
||||
|
||||
* Sun Oct 01 2006 Giuseppe Ghibò <ghibo@mandriva.coM> 2.1.4-2mdk
|
||||
- Fixed in stripmakeself handling of archives beginning with empty lines
|
||||
(thanks to pixel).
|
||||
|
||||
* Tue May 16 2006 Giuseppe Ghibò <ghibo@mandriva.com> 2.1.4-1mdk
|
||||
- Initial release 2.1.4.
|
||||
- Merged Patch0 from Deb.
|
||||
|
215
stripmakeself
Normal file
215
stripmakeself
Normal file
|
@ -0,0 +1,215 @@
|
|||
#!/usr/bin/perl -w
|
||||
# stripmakeself - strip makeself off an archive
|
||||
# Copyright (C) 2002 Angst <Angst@8ung.at>
|
||||
#
|
||||
# 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.
|
||||
|
||||
# $Id: stripmakeself,v 1.5 2004/03/07 14:38:22 cvs Exp $
|
||||
|
||||
use strict;
|
||||
use Getopt::Long;
|
||||
use File::Temp qw/ tempdir /;
|
||||
use File::Basename;
|
||||
|
||||
my ($flagextract, $flagextracttmp, $flagsetup, $flaghelp, $flaglist, $flagdump) = 0;
|
||||
sub help
|
||||
{
|
||||
print "Strip makeself off an archive (tar.gz, tar.bz2 or tar)\n";
|
||||
print "Usage: $0 [OPTIONS] <FILE>\n";
|
||||
print "OPTIONS:\n";
|
||||
print " -x, --extract -> extract contained archive\n";
|
||||
print " -X -> extract contained archive into temporary dir\n";
|
||||
print " -l, --list -> list contained archive\n";
|
||||
print " -d, --dump -> dump contained archive to stdout\n";
|
||||
print " -s, --setup -> extract archive into temporary location and run loki-setup\n";
|
||||
print " -h, --help -> This screen\n";
|
||||
print "\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my ($cmdlist, $cmdextract) = undef;
|
||||
|
||||
my $bufsize = 4096 * 8;
|
||||
|
||||
sub untar
|
||||
{
|
||||
if(!defined $cmdextract)
|
||||
{
|
||||
print STDERR "I don't know how to extract this file\n";
|
||||
return;
|
||||
}
|
||||
local *TAR;
|
||||
print STDERR "extracting ...\n";
|
||||
open(TAR,"|$cmdextract") or die $!;
|
||||
my $buf;
|
||||
while(read(FILE,$buf,$bufsize))
|
||||
{
|
||||
print TAR $buf;
|
||||
}
|
||||
close TAR;
|
||||
}
|
||||
|
||||
sub listtar
|
||||
{
|
||||
if(!defined $cmdlist)
|
||||
{
|
||||
print STDERR "I don't know how to list this file\n";
|
||||
return;
|
||||
}
|
||||
local *TAR;
|
||||
open(TAR,"|$cmdlist") or die $!;
|
||||
my $buf;
|
||||
while(read(FILE,$buf,$bufsize))
|
||||
{
|
||||
print TAR $buf;
|
||||
}
|
||||
close TAR;
|
||||
}
|
||||
|
||||
# search through file for a known archive type. set extract and list commands.
|
||||
# return offset on success, -1 otherwise.
|
||||
sub getarchiveoffset
|
||||
{
|
||||
my ($byte, $pos, $buf);
|
||||
for($pos=tell(FILE);read(FILE,$byte,1);$pos++)
|
||||
{
|
||||
if($byte eq "\x1F")
|
||||
{
|
||||
if(read(FILE,$buf,2) == 2 && $buf eq "\x8B\x08")
|
||||
{
|
||||
print STDERR "gzip found at position $pos\n";
|
||||
seek(FILE,$pos,0);
|
||||
$cmdextract="tar -xzf -";
|
||||
$cmdlist="tar -tvzf -";
|
||||
return $pos;
|
||||
}
|
||||
seek(FILE,$pos+1,0);
|
||||
}
|
||||
if($byte eq 'B')
|
||||
{
|
||||
if(read(FILE,$buf,2) == 2 && $buf eq 'Zh')
|
||||
{
|
||||
print STDERR "bzip2 found at position $pos\n";
|
||||
seek(FILE,$pos,0);
|
||||
$cmdextract="tar -xjf -";
|
||||
$cmdlist="tar -tvjf -";
|
||||
return $pos;
|
||||
}
|
||||
seek(FILE,$pos+1,0);
|
||||
}
|
||||
if($byte eq 'u')
|
||||
{
|
||||
if(read(FILE,$buf,6) == 6 && $buf eq 'star ')
|
||||
{
|
||||
$pos-=257; # tar header
|
||||
print STDERR "tar found at position $pos\n";
|
||||
seek(FILE,$pos,0);
|
||||
$cmdextract="tar -xf -";
|
||||
$cmdlist="tar -tvf -";
|
||||
return $pos;
|
||||
}
|
||||
seek(FILE,$pos+1,0);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
Getopt::Long::Configure("no_ignore_case");
|
||||
GetOptions (
|
||||
"extract|x" => \$flagextract,
|
||||
"X" => \$flagextracttmp,
|
||||
"setup|s" => \$flagsetup,
|
||||
"list|l" => \$flaglist,
|
||||
"dump|d" => \$flagdump,
|
||||
"help|h" => \$flaghelp
|
||||
);
|
||||
|
||||
if($#ARGV<0 || $flaghelp)
|
||||
{
|
||||
help();
|
||||
}
|
||||
|
||||
my $file = shift @ARGV;
|
||||
|
||||
open (FILE,'<',$file) or die $!;
|
||||
|
||||
<FILE> =~ /#! ?\/bin\/sh\n/ or die "file is not a shell script";
|
||||
|
||||
my $offset = getarchiveoffset();
|
||||
if($offset < 0)
|
||||
{
|
||||
print STDERR "compression format not recognized\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if($flagextract || $flagextracttmp)
|
||||
{
|
||||
my $tmpdir = basename($file);
|
||||
if($flagextracttmp)
|
||||
{
|
||||
$tmpdir = tempdir($tmpdir.".XXXXX", TMPDIR => 1) or die $!;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpdir = $tmpdir.".d";
|
||||
mkdir ($tmpdir, 0777) or die $!;
|
||||
}
|
||||
|
||||
chdir($tmpdir) or die $!;
|
||||
|
||||
untar();
|
||||
|
||||
print STDOUT "files extracted in ",$tmpdir,"\n";
|
||||
exit 0;
|
||||
}
|
||||
elsif($flaglist)
|
||||
{
|
||||
listtar();
|
||||
exit 0;
|
||||
}
|
||||
elsif($flagdump)
|
||||
{
|
||||
my $buf;
|
||||
while(read(FILE,$buf,$bufsize))
|
||||
{
|
||||
print $buf;
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
elsif($flagsetup)
|
||||
{
|
||||
my $tmpdir = tempdir("stripmakeself.XXXXX", CLEANUP => 1, TMPDIR => 1) or die $!;
|
||||
|
||||
chdir($tmpdir) or die $!;
|
||||
|
||||
untar();
|
||||
close FILE;
|
||||
|
||||
if (! -e 'setup.data/setup.xml')
|
||||
{
|
||||
print STDERR "setup.data/setup.xml is not here\n";
|
||||
if( -e 'setupstuff.tar.gz' )
|
||||
{
|
||||
print STDERR "maybe it's in setupstuff.tar.gz?\n";
|
||||
system('tar -xzf setupstuff.tar.gz');
|
||||
print STDERR "yes, it is!\n" if(-e 'setup.data/setup.xml');
|
||||
}
|
||||
}
|
||||
|
||||
print STDERR "running loki-setup\n";
|
||||
|
||||
system("loki-setup");
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue