- Moved away from versioned directory for better tracking
- Modified usher to set root password if not already set - Modified snap to deal with circular dependencies properly - Now snap properly checks exit value for usher postinst
This commit is contained in:
12
SRC/snap/Makefile
Normal file
12
SRC/snap/Makefile
Normal file
@@ -0,0 +1,12 @@
|
||||
dirs:
|
||||
install -d -v -m 755 $(DESTDIR)/etc
|
||||
install -d -v -m 755 $(DESTDIR)/usr/{bin,share/snap}
|
||||
|
||||
files:
|
||||
install -v -m 644 snap_version $(DESTDIR)/etc/snap_version
|
||||
install -v -m 644 snap.conf $(DESTDIR)/etc/snap.conf
|
||||
install -v -m 755 snap $(DESTDIR)/usr/bin/snap
|
||||
install -v -m 644 Makefile.snaplinux \
|
||||
$(DESTDIR)/usr/share/snap/Makefile.snaplinux
|
||||
|
||||
install: dirs files
|
||||
90
SRC/snap/Makefile.snaplinux
Normal file
90
SRC/snap/Makefile.snaplinux
Normal file
@@ -0,0 +1,90 @@
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation here:
|
||||
# (http://www.gnu.org/licenses/gpl-2.0.html)
|
||||
#
|
||||
# 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.
|
||||
|
||||
PWD := $(shell pwd)
|
||||
PACKAGE := $(shell echo $(PWD)|sed 's/.*\///')
|
||||
SNAPDIR = $(PWD)/SNAP
|
||||
ROOT = $(PWD)/ROOT
|
||||
|
||||
SNAP = $(PACKAGE)-$(VERSION).snap
|
||||
SNAPINFO = $(SNAPDIR)/snapinfo
|
||||
MANIFEST = $(SNAPDIR)/manifest
|
||||
USHER = $(SNAPDIR)/usher
|
||||
FILES = $(SNAPDIR)/files.tar.gz
|
||||
|
||||
# The following values must be set in the Makefile for the package
|
||||
|
||||
ifndef VERSION
|
||||
$(error VERSION is not set)
|
||||
endif
|
||||
|
||||
$(SNAP): $(SNAPINFO) $(FILES)
|
||||
@if [ -f $(SNAP) ]; then \
|
||||
rm -v $(SNAP); \
|
||||
fi
|
||||
|
||||
@ar cvr $(SNAP) $(SNAPINFO) $(MANIFEST); \
|
||||
if [ -f $(USHER) ]; then \
|
||||
chmod +x $(USHER); \
|
||||
ar cvr $(SNAP) $(USHER); \
|
||||
fi; \
|
||||
ar cvr $(SNAP) $(FILES)
|
||||
|
||||
@echo "Successfully built $(SNAP)"
|
||||
|
||||
$(SNAPINFO): $(MANIFEST)
|
||||
@>$(SNAPINFO)
|
||||
$(eval BYTES := $(shell gzip -l $(FILES)|tail -1|awk '{print $$2}'))
|
||||
|
||||
@printf "package: $(PACKAGE)\nversion: $(VERSION)\n" > $(SNAPINFO) && \
|
||||
printf "depends: $(DEPENDS)\narch: $(ARCH)\nbytes: $(BYTES)\n" \
|
||||
>> $(SNAPINFO) && \
|
||||
printf "url: $(URL)\ndescription: $(DESC)\n" >> $(SNAPINFO)
|
||||
|
||||
$(MANIFEST): $(FILES)
|
||||
@>$(MANIFEST)
|
||||
|
||||
rootfiles=`cd $(ROOT) && find ! -path .|sed 's/^\.\///'|sort -r`; \
|
||||
while read -r file; do \
|
||||
info=`ls -ld "$(ROOT)/$$file"`; \
|
||||
perm=`echo $$info|awk '{print $$1}'`; \
|
||||
type=`echo $$perm|head -c1`; \
|
||||
sha='________________________________________'; \
|
||||
if [ $$type = 'c' ]; then \
|
||||
size=0; \
|
||||
fi; \
|
||||
if [ -f "$(ROOT)/$$file" ]; then \
|
||||
sha=`sha1sum "$(ROOT)/$$file"|awk '{print $$1}'`; \
|
||||
fi; \
|
||||
printf "$$sha\t$$perm\t$$file\n" >> $(MANIFEST); \
|
||||
done <<< "$$rootfiles"
|
||||
|
||||
$(FILES): $(ROOT)
|
||||
# Remove any perllocal.pod to avoid conflicts
|
||||
# Should try to properly fix this some time...
|
||||
|
||||
@find $(ROOT) -name perllocal.pod -exec rm {} \;
|
||||
|
||||
@find $(ROOT) -type f | while read -r file; do \
|
||||
type=`file -i $$file|sed 's/.*: //'`; \
|
||||
case $$type in \
|
||||
*'/x-executable; charset=binary') \
|
||||
strip --strip-unneeded $$file \
|
||||
;; \
|
||||
*'/x-object; charset=binary') \
|
||||
strip --strip-debug $$file \
|
||||
;; \
|
||||
*'/x-sharedlib; charset=binary') \
|
||||
strip --strip-debug $$file \
|
||||
;; \
|
||||
esac; \
|
||||
done
|
||||
@cd $(ROOT) && tar cvzf $(FILES) *
|
||||
|
||||
22
SRC/snap/group
Normal file
22
SRC/snap/group
Normal file
@@ -0,0 +1,22 @@
|
||||
root:x:0:
|
||||
bin:x:1:daemon
|
||||
sys:x:2:
|
||||
kmem:x:3:
|
||||
tape:x:4:
|
||||
tty:x:5:
|
||||
daemon:x:6:
|
||||
floppy:x:7:
|
||||
disk:x:8:
|
||||
lp:x:9:
|
||||
dialout:x:10:
|
||||
audio:x:11:
|
||||
video:x:12:
|
||||
utmp:x:13:
|
||||
usb:x:14:
|
||||
cdrom:x:15:
|
||||
adm:x:16:
|
||||
messagebus:x:18:
|
||||
input:x:24:
|
||||
mail:x:34:
|
||||
nogroup:x:99:
|
||||
users:x:999:
|
||||
5
SRC/snap/passwd
Normal file
5
SRC/snap/passwd
Normal file
@@ -0,0 +1,5 @@
|
||||
root:x:0:0:root:/root:/bin/bash
|
||||
bin:x:1:1:bin:/dev/null:/bin/false
|
||||
daemon:x:6:6:Daemon User:/dev/null:/bin/false
|
||||
messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false
|
||||
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
|
||||
2049
SRC/snap/snap
Executable file
2049
SRC/snap/snap
Executable file
File diff suppressed because it is too large
Load Diff
6
SRC/snap/snap.conf
Normal file
6
SRC/snap/snap.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
[general]
|
||||
snapdir = var/snap
|
||||
pkgfile = packages.gz
|
||||
|
||||
[sources]
|
||||
default = http://packages.snaplinux.org/
|
||||
2060
SRC/snap/snap.inprogress
Normal file
2060
SRC/snap/snap.inprogress
Normal file
File diff suppressed because it is too large
Load Diff
1
SRC/snap/snap_version
Normal file
1
SRC/snap/snap_version
Normal file
@@ -0,0 +1 @@
|
||||
0.0alpha0
|
||||
Reference in New Issue
Block a user