Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37524721
en ru br
Репозитории ALT
S:0.1.3-alt2
5.1: 0.1.1-alt1
4.1: 0.1-alt2
www.altlinux.org/Changes

Группа :: Разработка/Прочее
Пакет: installer-sdk

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

installer-sdk-0.1.1/000075500000000000000000000000001105025443300142605ustar00rootroot00000000000000installer-sdk-0.1.1/init-installer-feature000075500000000000000000000040601105025443300205750ustar00rootroot00000000000000#!/bin/bash
# installer feature kickstarter from a template:
# will take $TEMPLATE and turn it into new module skeleton
# to start working on without the need to manually do all
# the needed substitutions (or create from scratch)

# 2008, Michael Shigorin <mike@altlinux.org>
# use freely

# initial setup
error() { echo -e "$0: $*" >&2; exit 1; }
usage() { error "Usage:\n$0 feature-name [feature description]"; }

STUB="@name@"
DESC="@description@"
TEMPLATE="@TEMPLATE@"

# otmazki
[ -d "$TEMPLATE" ] || error "need $TEMPLATE"

[ "$#" = 0 -o "$1" = "-h" -o "$1" = "--help" ] && usage

echo "Setting feature name to \"$1\""

FEATURE="$1"; shift
NAME="installer-feature-$FEATURE"
DESCRIPTION="installer feature: $FEATURE"

[ -d "$NAME" ] && error "$NAME directory already exists"

# well, we're busy
[ "$#" = 0 ] && {
echo "No description given, leaving default:"
} || {
echo "Setting package description to:"
DESCRIPTION="$*"
}
echo " $DESCRIPTION"
echo

# now let's make it happen
cp -a "$TEMPLATE" "$NAME"

find "$NAME" \
-depth \
-name "*$STUB*" \
-execdir sh -c "orig={}; mv \$orig \${orig/$STUB/$FEATURE}" \;

find "$NAME" \
-type f \
-execdir sed -i "s/$STUB/$FEATURE/g; s|$DESC|$DESCRIPTION|g" "{}" \;

# final touch
PACKAGER="`rpm --eval %packager`"
SPEC="$NAME/$NAME.spec"
[ "$PACKAGER" = "%packager" ] && {
echo "You'll probably need to set the Packager tag properly"
echo "before using add_changelog"
} || {
sed -i "s/^Packager:.*$/Packager: $PACKAGER/; /^%changelog/ q" "$SPEC" &&
add_changelog -e '- init with @TOOLNAME@' "$SPEC"
}

# ...and look what happened
cd "$NAME"
[ -x /usr/bin/git-init-db ] && git-init-db && echo
[ -x /usr/bin/tree ] && tree "$NAME" || { pwd; ls -l --color=auto . "$NAME"; }

# farewell!
echo
echo "Welcome to your brand new installer feature!"
echo "You might want to just remove unneeded *install.d/ parts"
echo
echo "See also:"
echo "* http://wiki.sisyphus.ru/devel/installer/features"
echo "* https://lists.altlinux.org/mailman/listinfo/devel-conf"
echo "* http://sisyphus.ru/find.shtml?request=installer-feature"
echo "Good luck!"
echo
installer-sdk-0.1.1/template/000075500000000000000000000000001105025443300160735ustar00rootroot00000000000000installer-sdk-0.1.1/template/.gear-rules000064400000000000000000000000361105025443300201410ustar00rootroot00000000000000tar: installer-feature-@name@
installer-sdk-0.1.1/template/installer-feature-@name@.spec000064400000000000000000000016771105025443300235260ustar00rootroot00000000000000Name: installer-feature-@name@
Version: 0.1
Release: alt1

Summary: @description@
License: GPL
Group: System/Configuration/Other

Url: http://www.altlinux.org/Installer/beans
Source: %name-%version.tar
Packager: Your Name <login@altlinux.org>
BuildArch: noarch

%description
%summary

%package stage2
Summary: @description@
License: GPL
Group: System/Configuration/Other
Requires: installer-stage2
#Conflicts: installer-hpc-stage2
#Conflicts: installer-ltsp-school-stage2 < @compatible_version@
#Conflicts: installer-junior-school-stage2
#Conflicts: installer-junior-stage2

%description stage2
%summary

%prep
%setup -q

%install
%makeinstall

%files stage2
%_datadir/install2/initinstall.d/*
%_datadir/install2/preinstall.d/*
%_datadir/install2/postinstall.d/*

%changelog
# set Packager: above and use add_changelog from rpm-utils to add records
* Tue Jan 01 1997 Your Name <login@altlinux.org> 0.1-alt1
- initial release (based on alterator-sdk 0.1-alt1)
installer-sdk-0.1.1/template/installer-feature-@name@/000075500000000000000000000000001105025443300226375ustar00rootroot00000000000000installer-sdk-0.1.1/template/installer-feature-@name@/50-sample000075500000000000000000000020071105025443300242670ustar00rootroot00000000000000#!/bin/sh -efu

. install2-init-functions

# if autoinstall.scm was used, AUTOINSTALL gets set;
# might want to skip the script then
#[ -z "$AUTOINSTALL" ] || exit 0

# other variable values to expect:
# $destdir -- root of the new system
# $METHOD -- installation method, e.g. "cdrom"
# $CDROMDEV -- mountable device, e.g. "/dev/cdrom"
# $PATH -- _without_ /sbin:/usr/sbin

# exec_chroot doesn't suppress stdout *and* resets environment,
# setting only PATH, HOME=/root, TMPDIR=/tmp
#exec_chroot echo "hello world"

# run_chroot is the same but stdout is suppressed
# NB: take care that scripts don't bail out if at all possible,
# since one failed script will silently fail the rest after it!
#run_chroot chkconfig something on ||:

# when we need a bit more flexibility...
#sed -ir 's,^Enable=false,Enable=true,' "$destdir/etc/sysconfig/something" ||:
#env PATH="/sbin:/usr/sbin:$PATH" HOME="/root" TMPDIR="/tmp" chroot "$destdir" some-amazing-script 2>&1 \
#| tee $destdir/root/.install-log/some-amazing.log ||:
installer-sdk-0.1.1/template/installer-feature-@name@/Makefile000064400000000000000000000004121105025443300242740ustar00rootroot00000000000000install2_dir=$(datadir)/install2

install:
install -d $(install2_dir)
[ -d initinstall.d ] && cp -a initinstall.d $(install2_dir) ||:
[ -d preinstall.d ] && cp -a preinstall.d $(install2_dir) ||:
[ -d postinstall.d ] && cp -a postinstall.d $(install2_dir) ||:
installer-sdk-0.1.1/template/installer-feature-@name@/initinstall.d/000075500000000000000000000000001105025443300254135ustar00rootroot00000000000000installer-sdk-0.1.1/template/installer-feature-@name@/initinstall.d/.gitignore000064400000000000000000000000001105025443300273710ustar00rootroot00000000000000installer-sdk-0.1.1/template/installer-feature-@name@/postinstall.d/000075500000000000000000000000001105025443300254355ustar00rootroot00000000000000installer-sdk-0.1.1/template/installer-feature-@name@/postinstall.d/.gitignore000064400000000000000000000000001105025443300274130ustar00rootroot00000000000000installer-sdk-0.1.1/template/installer-feature-@name@/preinstall.d/000075500000000000000000000000001105025443300252365ustar00rootroot00000000000000installer-sdk-0.1.1/template/installer-feature-@name@/preinstall.d/.gitignore000064400000000000000000000000001105025443300272140ustar00rootroot00000000000000
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin