First check in

This commit is contained in:
2016-10-24 06:24:10 -05:00
commit d00d644fd5
12 changed files with 4405 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
# 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.
DEPENDS = bash,binutils,coreutils,gzip,perl,shadow,tar
ARCH = x86_64
URL =
DESC = This is the base of the snaplinux system
SNAPVER = sr0
ARCHIVE := ''
SRCDIR := $(PWD)/SRC/snap-*
PATCHDIR := $(PWD)/SRC/patches
VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER)
MAKEINST = make install
include /usr/share/snap/Makefile.snaplinux
$(ROOT): $(SRCDIR)/Makefile
@if [ -d $(ROOT) ]; then \
touch $(ROOT); \
else \
mkdir -v $(ROOT); \
fi
@cd $(SRCDIR); \
$(MAKEINST) DESTDIR=$(ROOT)
clean:
@rm -rvf $(ROOT) \
$(SNAPINFO) \
$(MANIFEST) \
$(FILES)
+3
View File
@@ -0,0 +1,3 @@
This is the directory where the manifest, snapinfo, and files.tar.gz
files will be created. It is also where the usher file should be
placed if it is required by the package.
Executable
+108
View File
@@ -0,0 +1,108 @@
#!/bin/bash
set -e
PASSWD="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"
GROUP="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:"
case $1 in
preinst)
echo "Creating base directory structure"
install -d -m 755 ${TARGET}/etc/{ld.so,conf.d,opt}
install -d -m 755 ${TARGET}/usr/bin
install -d -m 755 ${TARGET}/bin
install -d -m 755 ${TARGET}/boot
install -d -m 755 ${TARGET}/dev
install -d -m 755 ${TARGET}/home
install -d -m 755 ${TARGET}/lib
install -d -m 755 ${TARGET}/media/{cdrom,floppy}
install -d -m 755 ${TARGET}/mnt
install -d -m 755 ${TARGET}/opt
install -d -m 755 ${TARGET}/proc
install -d -m 750 ${TARGET}/root
install -d -m 755 ${TARGET}/run/lock
install -d -m 755 ${TARGET}/sbin
install -d -m 755 ${TARGET}/srv
install -d -m 755 ${TARGET}/sys
install -d -m 1777 ${TARGET}/tmp
install -d -m 755 ${TARGET}/usr/{bin,include,lib,libexec,local}
install -d -m 755 ${TARGET}/usr/local/{bin,include,lib,sbin,share}
install -d -m 755 \
${TARGET}/usr/local/share/{color,dict,doc,info,locale,man}
install -d -m 755 ${TARGET}/usr/local/share/man/man{1..8}
install -d -m 755 ${TARGET}/usr/local/share/{misc,terminfo,zoneinfo}
install -d -m 755 ${TARGET}/usr/local/src
install -d -m 755 ${TARGET}/usr/{sbin,share}
install -d -m 755 ${TARGET}/usr/share/{color,dict,doc,info,locale}
install -d -m 755 ${TARGET}/usr/share/man/man{1..8}
install -d -m 755 ${TARGET}/usr/share/{misc,snap,terminfo,zoneinfo}
install -d -m 755 ${TARGET}/usr/src
install -d -m 755 ${TARGET}/var/cache/nscd
install -d -m 755 ${TARGET}/var/lib/{color,locate,misc}
install -d -m 755 ${TARGET}/var/{local,log,mail,opt,snap,spool}
install -d -m 1777 ${TARGET}/var/tmp
install -m 600 /dev/null ${TARGET}/var/log/btmp
install -m 644 /dev/null ${TARGET}/var/log/wtmp
install -m 664 /dev/null ${TARGET}/var/log/lastlog
ln -sf /proc/self/mounts ${TARGET}/etc/mtab
ln -sf lib ${TARGET}/lib64
ln -sf lib ${TARGET}/usr/lib64
ln -sf lib ${TARGET}/usr/local/lib64
ln -sf /run/lock ${TARGET}/var/lock
ln -sf /run ${TARGET}/var/run
if [ ! -f ${TARGET}/etc/resolv.conf ]&&[ -f /etc/resolv.conf ]; then
echo "Copying resolv.conf from temporary system"
cp /etc/resolv.conf ${TARGET}/etc/resolv.conf
fi
if [ ! -f ${TARGET}/etc/passwd ]; then
echo "Creating /etc/passwd"
echo ${PASSWD} > ${TARGET}/etc/passwd
fi
if [ ! -f ${TARGET}/etc/group ]; then
echo "Creating /etc/group"
echo ${GROUP} > ${TARGET}/etc/group
fi
;;
postinst)
if [[ ${TARGET} ]]; then
echo "Refreshing snap"
chroot ${TARGET} snap refresh
fi
exit 0
;;
prerm)
exit 0
;;
postrm)
exit 0
;;
esac
+2
View File
@@ -0,0 +1,2 @@
Place any patch files here and preface each with a number indicating
the order of execution. Patch files are expected to use a .patch extension.
+12
View 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
+95
View File
@@ -0,0 +1,95 @@
# 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
BYTES = 0
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 ARCHIVE
$(error ARCHIVE is not set)
endif
ifndef SRCDIR
$(error SRCDIR is not set)
endif
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 du -sB1 $(ROOT)|awk '{print $$1}'))
@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)
@bytes=0; \
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 {} \;
@files=`find $(ROOT) -type f -exec file -i '{}' \;| grep \
'application/x-\(executable\|object\|sharedlib\);' | \
grep ' charset=binary'`; \
while read -r line; do \
file=`echo $$line|sed 's/: application\/x-.*//'`; \
if [ "$$file" != '' ]; then \
strip --strip-unneeded $$file; \
fi; \
done <<< "$$files"
@cd $(ROOT) && tar cvzf $(FILES) *
+22
View 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
View 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
+2050
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
[general]
snapdir = var/snap
pkgfile = packages.gz
[sources]
default = http://packages.snaplinux.org/
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
0.0alpha0