Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98c0ab336f |
@@ -9,16 +9,21 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
PWD := $(shell pwd)
|
PWD := $(shell pwd)
|
||||||
PACKAGE := $(shell echo $(PWD)|sed 's/.*\///')
|
|
||||||
SNAPDIR = $(PWD)/SNAP
|
SNAPDIR = $(PWD)/SNAP
|
||||||
ROOT = $(PWD)/ROOT
|
ROOT = $(PWD)/ROOT
|
||||||
|
|
||||||
# This allows the package Makefile to override the name
|
# This will set PACKAGE only if the package itself has
|
||||||
# of the package file. Added for the kernel package
|
# not provided a package name
|
||||||
# though could be useful for others
|
|
||||||
|
|
||||||
ifndef SNAP
|
ifndef PACKAGE
|
||||||
SNAP := $(PACKAGE)-$(VERSION).snap
|
PACKAGE := $(shell echo $(PWD)|sed 's/.*\///')
|
||||||
|
endif
|
||||||
|
|
||||||
|
# This defines the name of the package file unless
|
||||||
|
# specified
|
||||||
|
|
||||||
|
ifndef PKGFILE
|
||||||
|
PKGFILE := $(PACKAGE)-$(VERSION).snap
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SNAPINFO = $(SNAPDIR)/snapinfo
|
SNAPINFO = $(SNAPDIR)/snapinfo
|
||||||
@@ -31,7 +36,7 @@ FILES = $(SNAPDIR)/files.tar.gz
|
|||||||
# if we find that not to be supplied we're going to
|
# if we find that not to be supplied we're going to
|
||||||
# assume that the SRCPKG is the same as the PACKAGE
|
# assume that the SRCPKG is the same as the PACKAGE
|
||||||
|
|
||||||
ifndef SRCPKG)
|
ifndef SRCPKG
|
||||||
SRCPKG := $(PACKAGE)
|
SRCPKG := $(PACKAGE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -41,19 +46,19 @@ ifndef VERSION
|
|||||||
$(error VERSION is not set)
|
$(error VERSION is not set)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(SNAP): $(SNAPINFO) $(FILES)
|
$(PKGFILE): $(SNAPINFO) $(FILES)
|
||||||
@if [ -f $(SNAP) ]; then \
|
@if [ -f $(PKGFILE) ]; then \
|
||||||
rm -v $(SNAP); \
|
rm -v $(PKGFILE); \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ar cvr $(SNAP) $(SNAPINFO) $(MANIFEST); \
|
@ar cvr $(PKGFILE) $(SNAPINFO) $(MANIFEST); \
|
||||||
if [ -f $(USHER) ]; then \
|
if [ -f $(USHER) ]; then \
|
||||||
chmod +x $(USHER); \
|
chmod +x $(USHER); \
|
||||||
ar cvr $(SNAP) $(USHER); \
|
ar cvr $(PKGFILE) $(USHER); \
|
||||||
fi; \
|
fi; \
|
||||||
ar cvr $(SNAP) $(FILES)
|
ar cvr $(PKGFILE) $(FILES)
|
||||||
|
|
||||||
@echo "Successfully built $(SNAP)"
|
@echo "Successfully built $(PKGFILE)"
|
||||||
|
|
||||||
$(SNAPINFO): $(MANIFEST)
|
$(SNAPINFO): $(MANIFEST)
|
||||||
@>$(SNAPINFO)
|
@>$(SNAPINFO)
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ use constant VERFILE => eval {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
use constant {
|
use constant {
|
||||||
VERSION => '0.9',
|
VERSION => '0.10',
|
||||||
SNAPDIR => TARGET . '/var/lib/snap',
|
SNAPDIR => TARGET . '/var/lib/snap',
|
||||||
PKGDIR => TARGET . '/var/lib/snap/packages',
|
PKGDIR => TARGET . '/var/lib/snap/packages',
|
||||||
INSTDIR => TARGET . '/var/lib/snap/installed',
|
INSTDIR => TARGET . '/var/lib/snap/installed',
|
||||||
|
|||||||
@@ -84,6 +84,15 @@ foreach my $package ( @$packages ) {
|
|||||||
$package->install();
|
$package->install();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $virtfs ) {
|
||||||
|
if ( $pid = fork() ) {
|
||||||
|
waitpid( $pid, 0 );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
exec( "chroot " . Snap->TARGET . " passwd" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtfs( 'umount' );
|
virtfs( 'umount' );
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user