Commit cb01986f by Cédric Le Ninivin

Initial commit with environment for obs packaging

0 parents
Showing 53 changed files with 2862 additions and 0 deletions
prepare slapos build for obs
============================
This environment is made to prepare a SlapOS tarball and packaging configurations
to be used with openSUSE Build Service (OBS).
Requirements
------------
- A computer
- Internet connection
- gcc, g++, make, patch, wget, python, chrpath, osc, devscripts
- An account on OBS
Documentation
-------------
- http://en.opensuse.org/openSUSE:Build_Service_Tutorial
- http://en.opensuse.org/Portal:Packaging
- http://wiki.debian.org/IntroDebianPackaging
Directory Organisation
----------------------
- prepare_slapos_build.sh : This is the script you have to run to prepare the packet.
You can choose the version you want to build in it.
- ./home:VIFIBnexedi/SlapOS-Node : This is the directory for OBS. It is the one used to generate package so far.
If you have/want to use another directory, update its path in prepare_slapos_build.sh
- slapos-*version : Used to register current version of packet.
Avoid to rebuild network-cache if you just change packaging configuration files.
- templates/ : Contain templates to build the package.
- debian/ : contain configuration files for .deb packaging
- Makefile.in : Makefile to build slapos
- offline.sh.in : Prepare network-cache build building once slapos
- slapos.dsc.in : File needed by obs to build .deb package
- slapos.spec.in : configuration file for rpm packaging
- slapos-node/ : Template to build package
- Makefile : Makefile to build slapos and add files for package
- slapos-start : shell script that will be run on startup (called by slapos-node daemon)
- template : template files for package (cron.d, service)
- slapos : to build slapos. Contain buildout.cfg.in
preparing the package
---------------------
First make sure all files are ready and you have all necessary packages installed.
SlapOS is build using buildout and need an internet connection to fetch all elements.
On obs package are build on virtual machines without internet acces.
prepare_slapos_build.sh will compile slapos on your computer and build a network-cache thanks to offline.sh script.
At the end it remove slapos installation and only keep cache.
It makes a tarball out of it to be used by obs.
It then fetch packaging configuration from templates directory. Everything is then commit to obs thanks to osc.
\ No newline at end of file
#!/bin/bash -e
VERSION=0.28.2
RECIPE_VERSION=0.101
CURRENT_RECIPE_VERSION=$(cat ./slapos-recipe-version)
CURRENT_VERSION=$(cat ./slapos-version)
CURRENT_DIRECTORY="$(pwd)"
TEMPLATES_DIRECTORY=$CURRENT_DIRECTORY/templates
SLAPOS_ORGINAL_DIRECTORY=slapos-node
SLAPOS_DIRECTORY=slapos-node_$VERSION+$RECIPE_VERSION+0
OBS_DIRECTORY=$CURRENT_DIRECTORY/home:VIFIBnexedi/SlapOS-Node
# Prepare directory for new version if needed
if [ ! -d "$CURRENT_DIRECTORY/$SLAPOS_DIRECTORY" ]; then
cp -r $CURRENT_DIRECTORY/$SLAPOS_ORGINAL_DIRECTORY $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY
fi
# Prepare Makefile and offline script
sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/Makefile.in > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/Makefile
sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/offline.sh.in > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/offline.sh
# Prepare Download Cache for SlapOS
cd $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/
#rm -rf build/
bash offline.sh
# Prepare tarball
cd $CURRENT_DIRECTORY
tar -czf $SLAPOS_DIRECTORY.tar.gz $SLAPOS_DIRECTORY
################# Prepare obs ###################################
cd $CURRENT_DIRECTORY/home:VIFIBnexedi/SlapOS-Node
# Remove former configuration
osc rm -f $SLAPOS_ORGINAL_DIRECTORY*.tar.gz
osc rm -f slapos.spec
# Prepare new tarball
cp $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY.tar.gz .
osc add $SLAPOS_DIRECTORY.tar.gz
# Prepare new specfile
sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/slapos.spec.in > slapos.spec
osc add slapos.spec
##################### Prepare configuration file for .deb ############
# Add entry to changelog
if [ $RECIPE_VERSION != $CURRENT_RECIPE_VERSION ]
then
cd $TEMPLATES_DIRECTORY/debian
dch -pm -v $VERSION+$RECIPE_VERSION+0 --check-dirname-level=0 "New version of slapos ($VERSION+$RECIPE_VERSION)"
fi
cd $TEMPLATES_DIRECTORY
tar -czf debian.tar.gz debian
cd $OBS_DIRECTORY
cp $TEMPLATES_DIRECTORY/debian.tar.gz .
#prepare new .dsc file
osc rm -f slapos*.dsc
sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/slapos.dsc.in > $SLAPOS_DIRECTORY.dsc
osc add $SLAPOS_DIRECTORY.dsc
## Upload new Package
osc commit -m " New SlapOS Recipe $RECIPE_VERSION"
# Save current version
echo "$RECIPE_VERSION" > $CURRENT_DIRECTORY/slapos-recipe-version
echo "$VERSION" > $CURRENT_DIRECTORY/slapos-version
\ No newline at end of file
#!/usr/bin/make -f
# -*- makefile -*-
build:
cd slapos; make build
all: build
install: all
cd slapos; make install
mkdir -p $(DESTDIR)/usr/sbin/
cp slapos-start $(DESTDIR)/usr/sbin/
cp $(DESTDIR)/opt/slapos/bin/slapos $(DESTDIR)/usr/sbin/
clean:
# cd slapos; make clean
# Début 23:39
\ No newline at end of file
#!/bin/sh
IPV6CHECK=ipv6.google.com
IPV4CHECK=google.com
IPV6WAITTIME=5
# Execute slapformat
SLAPOS_CONFIGURATION=/etc/opt/slapos
echo "Starting slap script"
# Check ipv4
ping -c 2 $IPV4CHECK
while [ $? != 0 ]; do
sleep $(($i*5))
if [[ $i < 40 ]]; then
let i++
fi
ping -c 2 $IPV4CHECK
done
# Wait for ipv6 connection to be ready
i=0
ping6 -c 2 $IPV6CHECK
while [ $? != 0 ];
do
sleep $(($i*10))
if [[ $i < 40 ]]; then
let i++
fi
ping6 -c 2 $IPV6CHECK
done
# Run slapformat
i=1
echo -n "Running slapformat..."
/opt/slapos/bin/slapformat --now --console --verbose $SLAPOS_CONFIGURATION/slapos.cfg
while [[ $? != 0 ]]; do
sleep $(($i*60))
if [[ $i < 20 ]]; then
let i++
fi
echo "Retrying slapformat"
/opt/slapos/bin/slapformat --now --console --verbose $SLAPOS_CONFIGURATION/slapos.cfg
done
# Run bang
i=1
echo -n "Banging..."
/opt/slapos/bin/bang -m "Rebooted" $SLAPOS_CONFIGURATION/slapos.cfg
while [[ $? != 0 ]]; do
sleep $(($i*60))
if [[ $i < 20 ]]; then
let i++
fi
echo "Retrying Bang"
/opt/slapos/bin/bang -m "Rebooted" $SLAPOS_CONFIGURATION/slapos.cfg
done
echo "done."
# Run slapgrid on all computer partitions
/opt/slapos/bin/slapgrid-cp --verbose --develop --now --logfile=/opt/slapos/slapgrid-cp.log --pidfile=/opt/slapos/slapgrid-cp.pid $SLAPOS_CONFIGURATION/slapos.cfg >> /opt/slapos/slapgrid-cp.log 2>&1
\ No newline at end of file
[buildout]
extends =
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-%RECIPE_VERSION%:/component/slapos/buildout.cfg
extends-cache= extends-cache
download-cache= download-cache
# Uguu, upstream buildout.cfg must be patched as it works the other way
# around from a packager point of view at least, thus at the end static
# path, such as Python HOME directory, are wrong...
#
# Currently:
# ./configure --prefix=BUILD_DIRECTORY && make install
# Instead of:
# ./configure --prefix=INSTALL_DIRECTORY && make install DESTDIR=BUILD_DIRECTORY
[python2.7]
configure-options +=
--prefix=%TARGET_DIRECTORY%/parts/${:_buildout_section_name_}
make-options +=
DESTDIR=%BUILD_ROOT_DIRECTORY%
[openssl]
configure-options +=
--prefix=%TARGET_DIRECTORY%/parts/${:_buildout_section_name_}
--openssldir=%TARGET_DIRECTORY%/parts/${:_buildout_section_name_}/etc/ssl
make-options +=
INSTALL_PREFIX=%BUILD_ROOT_DIRECTORY%
[gettext]
configure-options +=
--prefix=%TARGET_DIRECTORY%/parts/${:_buildout_section_name_}
make-options +=
DESTDIR=%BUILD_ROOT_DIRECTORY%
# Add gettext library path to RPATH as its binaries are used to build
# glib for example
environment =
CPPFLAGS=-I${libxml2:location}/include -I${zlib:location}/include -I${ncurses:location}/include
LDFLAGS=-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -Wl,-rpath=%BUILD_DIRECTORY%/parts/${:_buildout_section_name_}/lib
[bison]
configure-options +=
--prefix=%TARGET_DIRECTORY%/parts/${:_buildout_section_name_}
make-options +=
DESTDIR=%BUILD_ROOT_DIRECTORY%
[slapos]
software_root = /opt/slapgrid
instance_root = /srv/slapgrid
master_url = http://127.0.0.1:5000
computer_id = abeautifulbutuniquename
pidfile = /var/opt/slapos/run/slapgrid.pid
logfile = /var/opt/slapos/log/slapgrid.log
supervisord-socket = /var/opt/slapos/run/slapgrid-supervisord.sock
#key_file = /etc/opt/slapos/ssl/computer.key
#cert_file = /etc/opt/slapos/ssl/computer.crt
#certificate_repository_path = /var/opt/slapos/lib/certificates
[slapformat]
computer_xml = /var/opt/slapos/lib/computer.xml
log_file = /var/opt/slapos/log/slapformat.log
partition_amount = 10
ipv4_local_network = 10.0.0.0/16
bridge_name = slapbr0
tap_base_name = slaptap
partition_base_name = slappart
user_base_name = slapuser
[slapproxy]
host = 127.0.0.1
port = 5000
database_uri = /var/opt/slapos/lib/proxy.db
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin
MAILTO=root
*/5 * * * * root /opt/slapos/bin/slapgrid-cp /etc/opt/slapos.cfg
*/15 * * * * root /opt/slapos/bin/slapgrid-sr /etc/opt/slapos.cfg
0 0 * * * root /opt/slapos/bin/slapgrid-ur /etc/opt/slapos.cfg
0 0 * * * root /opt/slapos/bin/slapformat /etc/opt/slapos.cfg
[Unit]
Description=SlapOS node script
Requires=basic.target
Wants=network.target remote-fs.target
After=basic.target network.target remote-fs.target
[Service]
Type=simple
ExecStart=/usr/sbin/slapos-start
StandardOutput=tty
TTYPath=/dev/console
[Install]
WantedBy=multi-user.target
recursive-include slapprepare/template *.in
include slapprepare/script/slapos
include slapprepare/script/slapos_firstboot
include slapprepare/script/slapos.service
include slapprepare/script/run_slapformat
include slapprepare/connect.sh
\ No newline at end of file
slapos.toolbox
==============
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
from setuptools import setup, find_packages
import glob
import os
version = '0.23'
name = 'slapprepare'
setup(name=name,
version=version,
description="SlapOS SetUP kit.",
classifiers=[
"Programming Language :: Python",
],
keywords='slapos Setup Kit',
license='GPLv3',
packages=['slapprepare'],
include_package_data=True,
zip_safe=False, # proxy depends on Flask, which has issues with
# accessing templates
entry_points={
'console_scripts': [
'slapprepare = slapprepare:slapprepare',
]
},
)
#!/bin/sh
sleep 15
SLAPOS_CONFIGURATION='%(slapos_configuration)s'
i=0
false
while [[ $? != 0 ]]; do
sleep $(($i*60))
if [[ $i < 20 ]]; then
let i++
fi
echo "Retrying slapformat"
/opt/slapos/bin/slapformat --verbose --console $SLAPOS_CONFIGURATION/slapos.cfg
done
\ No newline at end of file
#!/bin/sh
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
systemctl stop slapos-node.service
systemctl disable slapos-node.service
# clean the system
for service in rpcbind network-remotefs postfix ; do
chkconfig --del $service
/etc/init.d/$service stop
done
IPV6CHECK=ipv6.google.com
IPV4CHECK=google.com
IPV6WAITTIME=5
SLAPVPN="ipv6_interface = tapVPN"
SLAPOS_CONFIGURATION='%(slapos_configuration)s'
# Test ipv4/ipv6 connectivity and if not working use openvpn
# and wait for it to be ready
/etc/init.d/openvpn stop
ping -c 2 $IPV4CHECK
while [ $? != 0 ]; do
sleep 5
ping -c 2 $IPV4CHECK
done
echo """Ipv4 connection ok"""
# Wait for native ipv6 connection to be ready
i=0
ping6 -c 2 $IPV6CHECK
while [[ $? != 0 ]] && [[ $i < $IPV6WAITTIME ]]
do
let i++
sleep 1
ping6 -c 2 $IPV6CHECK
done
if [ $? != 0 ] || [ -f $SLAPOS_CONFIGURATION/openvpn-needed ]; then
echo """ Starting openVPN """
/etc/init.d/openvpn start
sleep 10
ping6 -I tapVPN -c 2 $IPV6CHECK
while [[ $? != 0 ]]; do
ping6 -I tapVPN -c 2 $IPV6CHECK
done
# Ask slapos to use openvpn as ipv6 provider
sed -i "/${SLAPVPN}/ s/# *//" $SLAPOS_CONFIGURATION/slapos.cfg
# Use tapVPN as default interface for ipv6 traffic
/sbin/ip -6 route del default dev br0
sleep 2
else
# OpenVPN not needed, comment line about he_ipv6 (if not ailready done)
sed -i "/${SLAPVPN}/ s/^\([^#]\)/#\1/g" $SLAPOS_CONFIGURATION/slapos.cfg
fi
# set random root password
pwgen -sync 512 1 | passwd --stdin root
SLAP_INSTALL_LOG=/opt/slapos/slapos-install.log
while :; do
if [ -f /opt/slapos/bin/slapformat ] && [ -f /opt/slapos/bin/bang ]; then
# slapos tools available, nothing to do
break
fi
# software not detected, force forever installation
echo -n "Installing SlapOS, log availble at ${SLAP_INSTALL_LOG}..."
mkdir -p /opt/slapos
#(python -S -c \
# 'import urllib2;print urllib2.urlopen("http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py").read()' \
# | python -S - -c $SLAPOS_CONFIGURATION/software.cfg buildout:directory=/opt/slapos \
# >> ${SLAP_INSTALL_LOG} 2>&1 && /opt/slapos/bin/buildout -c \
# $SLAPOS_CONFIGURATION/software.cfg buildout:directory=/opt/slapos >> \
# ${SLAP_INSTALL_LOG} 2>&1 ) && (echo "done.") || (echo \
# "failed, retrying, the last error was:." ; tail -n 20 ${SLAP_INSTALL_LOG} ; rm -f /opt/slapos/bin/slapformat)
rpm --install --force $SLAPOS_CONFIGURATION/slapos*.rpm
done
# Create PKI repository
repo=`egrep ^certificate_repository_path $SLAPOS_CONFIGURATION/slapos.cfg | sed 's/^certificate_repository_path.*= *//'`
mkdir -v -p -m 0755 $repo
# software detected, ready to run
# Set up cron
echo """# BEWARE: This file will be automatically regenerated on each boot
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
MAILTO=root
0 0 * * * root /opt/slapos/bin/slapformat --verbose --log_file=/opt/slapos/slapformat.log $SLAPOS_CONFIGURATION/slapos.cfg >> /opt/slapos/slapformat.log 2>&1
*/5 * * * * root /opt/slapos/bin/slapgrid-cp --verbose --logfile=/opt/slapos/slapgrid-cp.log --pidfile=/opt/slapos/slapgrid-cp.pid $SLAPOS_CONFIGURATION/slapos.cfg >> /opt/slapos/slapgrid-cp.log 2>&1
*/15 * * * * root /opt/slapos/bin/slapgrid-sr --verbose --logfile=/opt/slapos/slapgrid-sr.log --pidfile=/opt/slapos/slapgrid-sr.pid $SLAPOS_CONFIGURATION/slapos.cfg >> /opt/slapos/slapgrid-sr.log 2>&1
0 0 * * * root /opt/slapos/bin/slapgrid-ur --verbose --logfile=/opt/slapos/slapgrid-ur.log --pidfile=/opt/slapos/slapgrid-ur.pid $SLAPOS_CONFIGURATION/slapos.cfg >> /opt/slapos/slapgrid-ur.log 2>&1
""" > /etc/cron.d/slapos
# Setup more server like network parameters in order to avoid
# "Neighbour table overflow."
# Those machines are itself has a lot of interfaces and are in
# heavily networked environment, so limit of ARP cache for IPv4
# and IPv6 is 4x higher then default
# More tuning can be applied from: http://www.enigma.id.au/linux_tuning.txt
sysctl -w \
net.ipv4.neigh.default.gc_thresh1=512 \
net.ipv4.neigh.default.gc_thresh2=1024 \
net.ipv4.neigh.default.gc_thresh3=2048 \
net.ipv6.neigh.default.gc_thresh1=512 \
net.ipv6.neigh.default.gc_thresh2=1024 \
net.ipv6.neigh.default.gc_thresh3=2048
# Increase default aio-max-nr for sql servers
sysctl -w fs.aio-max-nr=262144
# Enable noop scheduler for disk which have SLAPOS labeled partition
disk=`blkid -L SLAPOS | sed -r -e 's/(\/dev\/|[0-9]*$)//g'`
echo noop > /sys/block/$disk/queue/scheduler
# Set kvm up
modprobe kvm_intel
sleep 1
chmod 666 /dev/kvm
# Set power saving
modprobe acpi_cpufreq
# Set hardware monitoring tools (for Shuttle xh61 machines)
modprobe coretemp
modprobe f71882fg
# Activate KSM (shared memory for KVM)
echo 1 > /sys/kernel/mm/ksm/run
systemctl enable slapos-node.service
systemctl start slapos-node.service
[Unit]
Description=SlapOs Boot script
Requires=basic.target
Wants=network.target remote-fs.target
After=basic.target network.target remote-fs.target
Before=slapos-node.service
[Service]
Type=simple
ExecStart=/usr/sbin/slapos-boot-dedicated
StandardOutput=tty
TTYPath=/dev/console
[Install]
WantedBy=multi-user.target
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 %(computer_id)s localhost
# special IPv6 addresses
::1 %(computer_id)s localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
BOOTPROTO='dhcp'
BRIDGE='yes'
BRIDGE_FORWARDDELAY='0'
BRIDGE_PORTS='eth0'
BRIDGE_STP='off'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME=''
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'
PermitRootLogin yes
AllowUsers root
AddressFamily any
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
PasswordAuthentication no
X11Forwarding yes
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
Subsystem sftp /usr/lib64/ssh/sftp-server
UsePAM yes
#!/usr/bin/make -f
# -*- makefile -*-
VERSION = %VERSION%
RECIPE_VERSION = %RECIPE_VERSION%
INSTALL_DIRECTORY = $(DESTDIR)/opt/slapos
TARGET_DIRECTORY = /opt/slapos
BUILD_ROOT_DIRECTORY := $(shell pwd)/build
BUILD_DIRECTORY := $(BUILD_ROOT_DIRECTORY)$(TARGET_DIRECTORY)
PATCHES_DIRECTORY := $(shell pwd)/patches
#Use to get path of buildout correct
ORIGINAL_DIRECTORY := $(shell cat ./original_directory)
BOOTSTRAP_URL := 'http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py?rev=127518'
build: build-stamp
build-stamp:
@echo "Fixing buildout path to $(BUILD_ROOT_DIRECTORY) rather than $(ORIGINAL_DIRECTORY) for buildout"
grep -rIl '$(ORIGINAL_DIRECTORY)' $(BUILD_ROOT_DIRECTORY) 2> /dev/null | \
xargs sed -i 's#$(ORIGINAL_DIRECTORY)#$(BUILD_ROOT_DIRECTORY)#g' || \
echo "No path to fix."
@echo 'Preparing source tarball (recipe version: $(RECIPE_VERSION))'
cd $(BUILD_DIRECTORY) && \
./bin/buildout -v
@touch build-stamp
cleanup-build: cleanup-build-stamp
cleanup-build-stamp: build
@echo "Deleting unecessary files to reduce source tarball size"
# TODO: Figure out why there is no write permission even for
# the owner
chmod -R u+w $(BUILD_DIRECTORY)
# Buildout files
rm -rfv $(BUILD_DIRECTORY)/downloads
rm -fv $(BUILD_DIRECTORY)/bootstrap.py $(BUILD_DIRECTORY)/buildout.cfg \
$(BUILD_DIRECTORY)/bin/buildout $(BUILD_DIRECTORY)/.installed.cfg \
$(BUILD_DIRECTORY)/environment.*
rm -rfv $(BUILD_DIRECTORY)/parts/*-patch-download/ \
$(BUILD_DIRECTORY)/parts/*-hooks-download/
rm -rfv $(BUILD_DIRECTORY)/extends-cache/ \
$(BUILD_DIRECTORY)/download-cache/
# Removing locales, terminfo and base_completion.d directories
find $(BUILD_DIRECTORY) -type d \
\( -name locale -o -name terminfo -o -name bash_completion.d \) \
-prune -exec rm -rfv '{}' ';'
rm -rf $(BUILD_DIRECTORY)/parts/glib/share/glib-2.0/gdb/ \
$(BUILD_DIRECTORY)/parts/glib/share/gdb
rm -rf $(BUILD_DIRECTORY)/parts/ncurses/lib/terminfo
# Removing gettext archive tarball containing all versions
rm -fv $(BUILD_DIRECTORY)/parts/gettext/share/gettext/archive.dir.tar.gz
# Removing documentations
find $(BUILD_DIRECTORY)/parts -regextype posix-extended -type d \
-iregex '.*/(gtk-)?(doc[s]?|man|info|test[s]?)$$' \
-prune -exec rm -rfv '{}' ';'
find $(BUILD_DIRECTORY) -regextype posix-extended -type f \
-iregex '.*(COPYING|LICENSE).*' -exec rm -f '{}' ';'
# Removing include directories
find $(BUILD_DIRECTORY) -type d \( -name include -o -name pkgconfig \) | \
grep -v python | xargs rm -rfv
find $(BUILD_DIRECTORY) -type f -executable -name '*-config' | \
grep -v python | xargs rm -fv
# Removing Python byte-compiled files (as it will be done upon
# package installation) and static libraries
find $(BUILD_DIRECTORY) -regextype posix-extended -type f \
-iregex '.*/*\.(py[co]|[l]?a|exe|bat)$$' -exec rm -fv '{}' ';'
# Removing empty directories
find $(BUILD_DIRECTORY) -type d -empty -prune -exec rmdir '{}' ';'
@touch cleanup-build-stamp
strip-binaries: strip-binaries-stamp
strip-binaries-stamp: build
set -e; \
for f in `find $(BUILD_DIRECTORY) -type f -executable ! -name '*.so*'`; do \
if file $$f | grep -Eq '.*ELF.*(executable|shared).*'; then \
echo "Stripping executable $$f"; \
strip --remove-section=.comment --remove-section=.note $$f; \
fi; \
done
set -e; \
for f in `find $(BUILD_DIRECTORY) -type f -name '*.so*'`; do \
if file $$f | grep -Eq '.*ELF.*shared.*'; then \
echo "Stripping shared library $$f"; \
strip --remove-section=.comment --strip-unneeded \
--remove-section=.note $$f; \
fi; \
done
@touch strip-binaries-stamp
all: all-stamp
all-stamp: build cleanup-build strip-binaries
@touch all-stamp
install: all
mkdir -p $(INSTALL_DIRECTORY)
cp -r $(BUILD_DIRECTORY)/* $(INSTALL_DIRECTORY)
set -e; \
for l in `find $(INSTALL_DIRECTORY) -type l -lname '$(BUILD_DIRECTORY)/*'`; do \
echo "Fixing symlink $$l"; \
base_directory=`echo $$l|sed 's#^$(INSTALL_DIRECTORY)/\(.*/\).*#\1#'|sed -r 's#[^/]+#..#g'`; \
cd `dirname $$l` && \
ln -sf `readlink $$l | sed "s#$(BUILD_DIRECTORY)#$$base_directory#"` \
`basename $$l`; \
done
@echo "Removing shebang from Python files not in bin/"
for f in `grep --exclude-dir='bin' --include='*.py' -rIl '^#!' $(INSTALL_DIRECTORY) 2> /dev/null`; do \
chmod -x $$f && sed -i '1d' $$f; \
done
@echo "Fixing path to $(TARGET_DIRECTORY) rather than $(BUILD_DIRECTORY)"
grep -rIl '$(BUILD_DIRECTORY)' $(INSTALL_DIRECTORY) 2> /dev/null | \
xargs sed -i 's#$(BUILD_DIRECTORY)#$(TARGET_DIRECTORY)#g' || \
echo "No path to fix."
set -e; \
for f in `find $(INSTALL_DIRECTORY) \( -type f -o -type l \) \( -executable -o -name "*.so" \)`; do \
if file -L $$f | grep -Eq '.*ELF.*(executable|shared).*'; then \
OLD_RPATH="`chrpath $$f|awk -F'RPATH=' '{print $$2}'|sed 's#$(BUILD_DIRECTORY)#$(TARGET_DIRECTORY)#g' 2> /dev/null`"; \
if [ -n "$$OLD_RPATH" ]; then \
chrpath -r "$$OLD_RPATH" $$f; \
fi; \
fi; \
done
clean:
rm -rf $(BUILD_ROOT_DIRECTORY)
rm -f *-stamp
.PHONY: build cleanup-build strip-binaries all install clean
Bridge configuration
====================
Before using slapformat commands, you must set up a bridge network interface
named ``slapbr0''. On that bridge, you must set up at least an IPv6 global
address, even if it is only a localhost one.
On Debian systems, this is commonly done in ``/etc/network/interfaces'' file.
Note that if you declare any interface as part of the bridge (when you want
your instances to be available not only on localhost), you should remove them
from the configuration file.
Here is an example of the bridge on eth0 device with static IPv4 address and
private IPv6 address:
auto slapbr0
iface slapbr0 inet static
address ADDRESS
netmask NETMASK
gateway GATEWAY
bridge_ports eth0
iface slapbr0 inet6 static
address fd00::1
netmask 64
You can have a look at bridge-utils-interfaces(5) and interfaces(5) manpages
for further details.
-- Arnaud Fontaine <arnaud.fontaine@nexedi.com>, Fri, 16 Nov 2011 10:24:51 +0900
slapos-node (0.27+0.97+0) unstable; urgency=low
* Removed slapprepare from package
-- Cedric Le Ninivin <cedric.leninivin@tiolive.com> Thu, 16 Aug 2012 15:13:52 +0200
slapos-node (0.25+0.88+0) unstable; urgency=low
* New Version of SlapOS (0.88)
* New Makefile for slapprepare
-- Cedric Le Ninivin <cedric.leninivin@tiolive.com> Tue, 22 May 2012 16:02:45 +0200
slapos-node (0.20+0.61+0) unstable; urgency=low
* New upstream release.
* debian/config:
+ Use Vifib master URL by default.
+ Remove now useless software root as it will always be /opt/slapgrid.
* Rename Computer SSL filenames from slapos to computer prefix.
+ Update debian/templates.
+ debian/postinst: automatically rename slapos.{crt,key} files.
* Move ./debian/conf/slapos.cfg to ./slapos.cfg.
* Add slapconsole missing configuration:
+ slapos.cfg: add section.
+ debian/templates: add account key and certificate.
* Makefile:
+ Improve errors handling of shell loops.
+ Clean up empty directories as well.
* debian/prerm: delete /opt/slapos/ before upgrade.
* buildout.cfg.in: update netifaces URL as it was unavailable.
* Handle update of /etc/opt/slapos/slapos.cfg with ucf:
+ debian/postinst: register and check file on update.
+ debian/postrm: remove the configuration from the hash file on purge.
-- Arnaud Fontaine <arnaud.fontaine@nexedi.com> Thu, 02 Dec 2011 10:48:33 +0900
slapos-node (0.14+0.56+0) unstable; urgency=low
* Initial release.
-- Arnaud Fontaine <arnaud.fontaine@nexedi.com> Wed, 16 Nov 2011 11:32:17 +0900
#!/bin/sh
set -e
#DEBHELPER#
. /usr/share/debconf/confmodule
CONFIG_FILE=/etc/opt/slapos/slapos.cfg
MASTER_URL=
COMPUTER_ID=
SOFTWARE_ROOT=
PARTITION_AMOUNT=
IPV4_LOCAL_NETWORK=
if [ -f "$CONFIG_FILE" ]; then
MASTER_URL="`sed -ne 's#^\s*master_url[^=]*=\s*\(.*\)$#\1#p' \"$CONFIG_FILE\"`"
COMPUTER_ID="`sed -ne 's#^\s*computer_id[^=]*=\s*\(.*\)$#\1#p' \"$CONFIG_FILE\"`"
PARTITION_AMOUNT="`sed -ne 's#^\s*partition_amount[^=]*=\s*\(.*\)$#\1#p' \"$CONFIG_FILE\"`"
IPV4_LOCAL_NETWORK="`sed -ne 's#^\s*ipv4_local_network[^=]*=\s*\(.*\)$#\1#p' \"$CONFIG_FILE\"`"
fi
if [ -n "$MASTER_URL" ]; then
db_set slapos-node/master_url "$MASTER_URL"
db_input medium slapos-node/master_url || true
else
db_set slapos-node/master_url "https://slap.vifib.com"
db_input high slapos-node/master_url || true
fi
db_go || true
db_get slapos-node/master_url
( echo "$RET" | grep -q "^https://" ) && db_input high slapos-node/master_url_with_ssl_note || true
if [ -n "$COMPUTER_ID" ]; then
db_set slapos-node/computer_id "$COMPUTER_ID"
db_input medium slapos-node/computer_id || true
else
db_input high slapos-node/computer_id || true
fi
if [ -n "$PARTITION_AMOUNT" ]; then
db_set slapos-node/partition_amount "$PARTITION_AMOUNT"
db_input medium slapos-node/partition_amount || true
else
db_input high slapos-node/partition_amount || true
fi
if [ -n "$IPV4_LOCAL_NETWORK" ]; then
db_set slapos-node/ipv4_local_network "$IPV4_LOCAL_NETWORK"
db_input medium slapos-node/ipv4_local_network || true
else
db_input high slapos-node/ipv4_local_network || true
fi
db_go || true