Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37559248
en ru br
Репозитории ALT

Группа :: Разработка/Прочее
Пакет: autorepo-altnode-admin-scripts

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

pax_global_header00006660000000000000000000000064123374732700014522gustar00rootroot0000000000000052 comment=d6c8d1c397dc85f68e192e975c341aa6fc109ae2
autorepo-altnode-admin-scripts-0.04/000075500000000000000000000000001233747327000175005ustar00rootroot00000000000000autorepo-altnode-admin-scripts-0.04/.gear/000075500000000000000000000000001233747327000204745ustar00rootroot00000000000000autorepo-altnode-admin-scripts-0.04/.gear/rules000064400000000000000000000000071233747327000215460ustar00rootroot00000000000000tar: .
autorepo-altnode-admin-scripts-0.04/autorepo-altnode-admin-create-build-node000075500000000000000000000006071233747327000272620ustar00rootroot00000000000000#!/bin/sh -e

node=$1
if [ -z "$node" ]; then
echo "node name is mandatory argument."
exit 1;
fi
autorepo-altnode-admin-create-node $node
mkdir -p /var/ftp/pub/ALTLinux
chmod 775 /var/ftp/pub/ALTLinux
chgrp cronbuild /var/ftp/pub/ALTLinux
mkdir -p /var/ftp/pub/ALTLinux/$node
chown -R $node /var/ftp/pub/ALTLinux/$node
#[ -x setup_build_node.sh ] && su - $node < setup_build_node.sh
autorepo-altnode-admin-scripts-0.04/autorepo-altnode-admin-create-node000075500000000000000000000014751233747327000261710ustar00rootroot00000000000000#!/bin/sh -xe

node=$1
if [ -z "$node" ]; then
echo "node name is mandatory argument."
exit 1;
fi
if grep '^$node:x:' /etc/passwd >/dev/null; then
echo "node $node already exists."
exit 1;
fi
groupadd -f cronbuild
groupadd -f repocop
groupadd -f $node
useradd $node -g $node -G cronbuild,repocop
mkdir -p /var/ftp/altnode/$node
chown $node /var/ftp/altnode/$node
if ! [ -e /etc/hasher-priv/user.d/$node ]; then
hasher-useradd $node
fi
if [ -e /etc/hasher-priv/user.d/$node ] && ! grep wlimit_time_elapsed /etc/hasher-priv/user.d/$node >/dev/null; then
cat >> /etc/hasher-priv/user.d/$node <<EOF

allowed_mountpoints=/proc,/dev/pts
# This option limits total execution time, in seconds.
wlimit_time_elapsed=12000
wlimit_time_idle=1500
EOF
fi
#[ -x setup_build_node.sh ] && su - $node < setup_build_node.sh
autorepo-altnode-admin-scripts-0.04/autorepo-altnode-admin-create-repocop-node000075500000000000000000000005551233747327000276340ustar00rootroot00000000000000#!/bin/sh -e

node=$1
node_to_test=$2
if [ -z "$node" ]; then
echo "node name is mandatory argument."
exit 1;
fi
autorepo-altnode-admin-create-node $node
mkdir -p /var/ftp/pub/repocop
chgrp repocop /var/ftp/pub/repocop
if [ -n "$node_to_test" ]; then
mkdir -p /var/ftp/pub/repocop/$node_to_test
chown -R $node /var/ftp/pub/ALTLinux/$node_to_test
fi
autorepo-altnode-admin-scripts-0.04/autorepo-altnode-admin-delete-node000075500000000000000000000015101233747327000261560ustar00rootroot00000000000000#!/bin/sh -x

node=$1
if [ -z "$node" ]; then
echo "Node name is mandatory argument."
echo "usage: $0 <node name>."
exit 1;
fi
if ! [ -d /var/ftp/altnode/$node ]; then
echo "node $node does not found."
exit 1
fi

delete_hasher_users()
{
local userfile=$1
if [ -e $userfile ]; then
userdel `grep user1= $userfile |sed -e 's,user1=,,'`
userdel `grep user2= $userfile |sed -e 's,user2=,,'`
rm -f $userfile
fi
}

rm -rf /var/ftp/altnode/$node

# TODO: some repocop support
#rmdir -p /var/ftp/pub/repocop/$node_to_support

userdel -r $node

for hashernum in /etc/hasher-priv/user.d/$node /etc/hasher-priv/user.d/${node}:*; do
delete_hasher_users $hashernum
done

[ -d /var/ftp/pub/ALTLinux/$node ] && rmdir /var/ftp/pub/ALTLinux/$node || echo "/var/ftp/pub/ALTLinux/$node is not empty: delete it manually"
autorepo-altnode-admin-scripts-0.04/autorepo-altnode-admin-scripts.spec000064400000000000000000000017301233747327000264120ustar00rootroot00000000000000Name: autorepo-altnode-admin-scripts
Version: 0.04
Release: alt1
BuildArch: noarch
Packager: Igor Yu. Vlasenko <viy@altlinux.org>

Summary: admin scripts for an automated packaging node
Group: Development/Other
License: GPL2+
#Url:
Source: %name-%version.tar

%description
%summary

%prep
%setup

%build

%install

mkdir -p $RPM_BUILD_ROOT%_bindir
install -m 755 autorepo-altnode-admin-setup-build-node $RPM_BUILD_ROOT%_bindir
mkdir -p $RPM_BUILD_ROOT%_sbindir
install -m 755 autorepo-altnode-admin-create-*node $RPM_BUILD_ROOT%_sbindir
install -m 755 autorepo-altnode-admin-delete-*node $RPM_BUILD_ROOT%_sbindir

%files
#%doc
%_bindir/*
%_sbindir/*

%changelog
* Fri May 23 2014 Igor Vlasenko <viy@altlinux.ru> 0.04-alt1
- adjusted limits

* Tue Oct 29 2013 Igor Vlasenko <viy@altlinux.ru> 0.03-alt1
- bugfix release

* Sun Oct 20 2013 Igor Vlasenko <viy@altlinux.ru> 0.02-alt1
- support for common /space

* Fri Sep 06 2013 Igor Vlasenko <viy@altlinux.ru> 0.01-alt1
- First build
autorepo-altnode-admin-scripts-0.04/autorepo-altnode-admin-setup-build-node000075500000000000000000000041721233747327000271600ustar00rootroot00000000000000#!/bin/sh

mkdir -p hasher.i586 hasher.x86_64 OUT Mail tmp
mkdir -p .autorepo/apt .hasher
cat > ~/.rpmmacros <<'EOF'
#%_topdir %homedir/RPM
#%_tmppath %homedir/tmp

#%_topdir %homedir/src/RPM
#%_sourcedir %{_topsrcdir}/SOURCES/
#%_sourcedir %{_topsrcdir}/SOURCES/%name
#%_specdir %{_topsrcdir}/SOURCES/%name-%version
#%tmpdir %homedir/tmp
#%tmppath %homedir/tmp
#%_unpackaged_files_terminate_build 1
%_gpg_name cronbuild@altlinux.org
%packager Cronbuild Service <cronbuild@altlinux.org>
EOF
[ -e ~/.hasher/config ] || cat > ~/.hasher/config <<'EOF'
workdir=~/hasher
packager="`rpm --eval %packager`"
known_mountpoints=/proc
EOF
pushd .autorepo/apt
for arch in i586 x86_64; do
[ -e build.conf.$arch ] || ln -s apt.conf.$arch build.conf.$arch
[ -e apt.conf.$arch ] || cat > apt.conf.$arch <<EOF
/*
* This is the main configuration file for the APT suite of tools,
* see apt.conf(5) for details.
*/

Dir::Etc::main "/dev/null";
Dir::Etc::parts "/var/empty";
Dir::Etc::SourceParts "/var/empty";

Dir::Etc::sourcelist "`pwd`/sources.list.$arch";

Debug::PkgProblemResolver "true";

APT::Cache-Limit 200000000;
EOF
node=`whoami`
autoimportsdir=/var/ftp/pub/ALTLinux/autoimports
[ -d /var/ftp/pub/mirrors/ALTLinux/autoimports ] && autoimportsdir=/var/ftp/pub/mirrors/ALTLinux/autoimports
[ -d /space/autoimports/ALTLinux/autoimports ] && autoimportsdir=/space/autoimports/ALTLinux/autoimports
branch=Sisyphus
[ -e sources.list.$arch ] || cat > sources.list.$arch <<EOF
rpm file:/ALT/$branch $arch classic debuginfo
rpm file:/ALT/$branch noarch classic
rpm file:$autoimportsdir/$branch $arch autoimports
rpm file:$autoimportsdir/$branch noarch autoimports
rpm file:/var/ftp/pub/ALTLinux/$node/$branch $arch $node
rpm file:/var/ftp/pub/ALTLinux/$node/$branch noarch $node
EOF
#if [ -d /space/autoextra/ALTLinux/build-addon-repo/$branch ]; then
#[ -e sources.list.$arch ] || cat >> sources.list.$arch <<EOF
#rpm file:/space/autoextra/ALTLinux/build-addon-repo/$branch $arch build-addon-repo
#rpm file:/space/autoextra/ALTLinux/build-addon-repo/$branch noarch build-addon-repo
#EOF
#fi
done
popd

echo "fix ~/.autorepo/.apt !"
echo TODO mk .autorepo/config
echo TODO scp .gnupg
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin