First check in

This commit is contained in:
2017-04-24 14:10:33 -05:00
commit 186426b518
11 changed files with 194 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
# 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 =
ARCH = x86_64
URL =
DESC = Base system directories and files
ARCHIVE :=
SRCDIR := $(PWD)/SRC/snap-base
PATCHDIR := $(PWD)/SRC/patches
VERSION := 0.0alpha1-0
include /usr/share/snap/Makefile.snaplinux
$(ROOT): $(SRCDIR)/Makefile
@if [ -d $(ROOT) ]; then \
touch $(ROOT); \
else \
mkdir -v $(ROOT); \
fi
@cd $(SRCDIR) && make install 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
+43
View File
@@ -0,0 +1,43 @@
#!/bin/bash
set -e
case $1 in
preinst)
exit 0
;;
postinst)
if [[ ${TARGET} ]]; then
if [ ! -f ${TARGET}/etc/bashrc ]; then
install -m 0644 ${TARGET}/usr/share/snap-base/bashrc \
${TARGET}/etc/bashrc
fi
if [ ! -f ${TARGET}/etc/group ]; then
install -m 0644 ${TARGET}/usr/share/snap-base/group \
${TARGET}/etc/group
fi
if [ ! -f ${TARGET}/etc/passwd ]; then
install -m 0644 ${TARGET}/usr/share/snap-base/passwd \
${TARGET}/etc/passwd
fi
if [ ! -f ${TARGET}/etc/profile ]; then
install -m 0644 ${TARGET}/usr/share/snap-base/profile \
${TARGET}/etc/profile
fi
if [ ! -f ${TARGET}/etc/snap.conf ]; then
install -m 0644 ${TARGET}/usr/share/snap-base/snap.conf \
${TARGET}/etc/snap.conf
fi
if [ ! -f ${TARGET}/etc/snap_version ]; then
install -m 0644 ${TARGET}/usr/share/snap-base/snap_version \
${TARGET}/etc/snap_version
fi
fi
;;
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.
+37
View File
@@ -0,0 +1,37 @@
install: base usr var lib snap
base:
@install -v -d -m 0755 -o root -g root \
$(DESTDIR)/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc} && \
install -v -d -m 0755 -o root -g root \
$(DESTDIR)/{run,sbin,srv,usr,var} && \
install -v -d -m 0750 -o root -g root \
$(DESTDIR)/root && \
install -v -d -m 1777 $(DESTDIR)/tmp $(DESTDIR)/var/tmp
usr: base
@install -v -d -m 0755 -o root -g root \
$(DESTDIR)/usr/{,local/}{bin,include,lib,sbin,src} && \
install -v -d -m 0755 -o root -g root \
$(DESTDIR)/usr/{,local/}share/{color,dict,doc,info,locale} && \
install -v -d -m 0755 -o root -g root \
$(DESTDIR)/usr/{,local/}share/{man,misc,terminfo,zoneinfo} && \
install -v -d -m 0755 -o root -g root \
$(DESTDIR)/usr/{libexec,{,local/}share/man/man{1..8}}
var: base
@install -v -d -m 0755 -o root -g root \
$(DESTDIR)/var/{log,mail,spool} && \
install -v -d -m 0755 -o root -g root \
$(DESTDIR)/var/{opt,cache,lib/{color,misc,locate},local} && \
ln -sv /run $(DESTDIR)/var/run && \
ln -sv /run/lock $(DESTDIR)/var/lock
lib: usr
@ln -sv lib $(DESTDIR)/lib64 && \
ln -sv lib $(DESTDIR)/usr/lib64
snap: usr
install -v -d -m 0755 $(DESTDIR)/usr/share/snap-base && \
install -v -m 0644 usr/share/snap-base/* $(DESTDIR)/usr/share/snap-base
+18
View File
@@ -0,0 +1,18 @@
# Setup for /bin/ls and /bin/grep to support color
if [ -f "/etc/dircolors" ] ; then
eval $(dircolors -b /etc/dircolors)
fi
if [ -f "$HOME/.dircolors" ] ; then
eval $(dircolors -b $HOME/.dircolors)
fi
# Prompt
if [ "`id -u`" -eq 0 ]; then
export PS1='\u@\h:\w# '
else
export PS1='\u@\h:\w$ '
fi
alias ls='ls --color=auto'
alias grep='grep --color=auto'
+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:100:
+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
+25
View File
@@ -0,0 +1,25 @@
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
alias reset='echo -e "\033c"'
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin"
fi
export PATH
if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
@@ -0,0 +1,2 @@
[sources]
default = http://packages.snaplinux.org/ core dev util
@@ -0,0 +1 @@
0.0alpha1