Commit f9b61bf9 authored by Julien Muchembled's avatar Julien Muchembled

Rewrite of re6st-node packaging

- With a Makefile instead of a shell script to make build files,
  it's easier to only redo the necessary parts.
- Do not bootstrap buildout in advance. This caused build failures on old
  dists when this was done with Python 2.7 (parts/buildout/site.py imported
  a module that does not exist on Python 2.6). Now everything can be prepared
  on a recent dist.
- Minimize list of build-deps. We don't need setuptools anymore.
  We also don't rely on system chrpath anymore because SLE_12 does not have it.
- Refactoring with upstream packaging.
- Debian: fix upgrade path from 're6stnet' package.
- Package re6st manpages and logrotate configuration.
- systemd integration on RPM-based dists.
- Fix shebang of OpenVPN/NetworkManager hooks.
- Do never ship *.py[co] files in packages. Remove them on uninstallation
  (not done yet for Arch).
- chrpath: Suse dists use RUNPATH instead of PATH
- Stop stripping ELF files.
- Greatly reduce size of packages by removing eggs/parts that were only useful
  during the build, like Perl.

TODO: integrate with osc working copy ?

For the record, here is an example to strip ELF files:

strip:
	cd $(DESTDIR)/$(TARGET) \
	&& s() { chmod u+w $$x && strip -v -R .comment -R .note "$$@" $$x; } \
	&& x=`find -type f -executable ! -name '*.so*' |xargs -r file | \
		sed -n 's/:.*ELF.*\(executable\|shared\).*//p'` && s \
	&& x=`find -type f -name '*.so*' |xargs -r file | \
		sed -n 's/:.*ELF.*shared.*//p'` && s --strip-unneeded
parent ea302488
......@@ -2,8 +2,7 @@ obs/*/home:VIFIBnexedi*
obs/slapos/slapos-node_*
obs/slapos/slapos-recipe-version
obs/slapos/slapos-version
obs/re6st/re6st-node_*
obs/*/templates/debian.tar.gz
debian.tar.gz
obs/slapos/templates/debian/cron.d
obs/slapos/templates/debian/slapos-node.logrotate
debian-preseed/*.iso
......@@ -13,6 +12,6 @@ slapprepare/dist
slapprepare/slapprepare.egg-info
*.egg-info
.*.swp
build
build/
dist
playbook/install
/re6stnet/
/slapos/
/upstream.mk
/re6st-node_*.tar.gz
/re6st-node_*.dsc
/debian/control
/debian/changelog
/re6stnet.spec
/PKGBUILD
# This file doesn't force specific versions of re6stnet or slapos.
# It automatically clones missing repositories but doesn't automatically pull.
# You have to choose by using git manually.
# Run with SLAPOS_EPOCH=<N> (where <N> is an integer > 1)
# if rebuilding for new SlapOS version but same re6stnet.
# Non-obvious dependencies:
# - Debian: python-debian, python-docutils | python3-docutils
# We could avoid them by doing like for setuptools, but I'd rather go the
# opposite way: simplify the upload part by using the system setuptools and
# recent features from Make 4.
# This Makefile tries to be smart by only rebuilding the necessary parts after
# some change. But as always, it does not handle all cases, so once everything
# works, you should clean up everything before the final prepare+upload.
# TODO:
# - Arch probably needs clean up of *.py[co] files on uninstallation.
# This is done already for DEB/RPM.
# - RPM: automatic deps to system libraries.
# - Each built package should have its own dist version (something like
# -<dist-name><dist-version> suffix), at least to know which one is installed
# after a dist upgrade.
# On the other side, Debian should normally suggest to reinstall because
# package metadata usually differ (e.g. installed size or dependencies), even
# if there's nothing like checksum comparisons. Maybe other dists do as well.
# - Split tarball in several parts (for Debian, this is doable with
# "debtransform" tag):
# - 1 file for each one in download-cache
# - 1 tarball with everything else
# For faster release after re6st development, an intermediate split could be:
# - re6stnet sdist
# - a tarball of remaining download-cache
# - 1 tarball with everything else
# - Make tarballs "reproducible". If the contents does not change, and we don't
# really care about modification times, the result should always be the same.
# It's really annoying that we can't rely on 'osc status' to know whether
# there are real changes or not. 2 ways:
# - This is doable with a very recent of tar (not even in Jessie), in order
# to sort files by name (--sort option). Then there are timestamps:
# see -n option of gzip, and --mtime option of tar.
# - But the best one is probably to use Python instead of tar+gzip.
# And in fact, such Python script should not be limited to that, since many
# intermediate files like re6stnet.spec are so quick to generate that they
# should be produced in RAM.
#
# Note that package don't contain *.py[co] files and they're not generated
# at installation. For this package, it's better like this because it minimizes
# disk usage without slowness (executables are either daemons or run as root).
# If this way of packaging is reused for other software, postinst scripts
# should be implemented.
BOOTSTRAP_URL = http://downloads.buildout.org/1/bootstrap.py
RE6STNET_URL = http://git.erp5.org/repos/re6stnet.git
SLAPOS_URL = http://git.erp5.org/repos/slapos.git
PACKAGE = re6st-node
BIN = re6st-conf re6st-registry re6stnet
NOPART = chrpath flex glib lunzip m4 patch perl popt site_perl xz-utils
TARGET = opt/re6st
ROOT = build
BUILD = $(ROOT)/$(TARGET)
BUILD_KEEP = buildout.cfg extends-cache download-cache
all: tarball debian.tar.gz re6stnet.spec PKGBUILD re6stnet.install
re6stnet:
git clone $(RE6STNET_URL) $@
slapos:
git clone $(SLAPOS_URL) $@
$(BUILD)/buildout.cfg: buildout.cfg.in
mkdir -p $(@D)
python2 -c 'import os; cfg = open("$<").read() % dict( \
SLAPOS="$(CURDIR)/slapos", ROOT="$${buildout:directory}/" \
+ os.path.relpath("$(ROOT)", "$(BUILD)"), \
TARGET="/$(TARGET)"); open("$@", "w").write(cfg)'
$(BUILD)/bin/python: $(BUILD)/buildout.cfg slapos
if [ -e $@ ]; then touch $@; else cd $(BUILD) \
&& rm -rf extends-cache && mkdir -p download-cache extends-cache \
&& wget -qO - $(BOOTSTRAP_URL) | python2 -S \
&& bin/buildout buildout:parts=$(@F); fi
re6stnet/re6stnet.egg-info: $(BUILD)/bin/python re6stnet
rm -f $(BUILD)/download-cache/dist/re6stnet-*
cd re6stnet && ../$< setup.py sdist -d ../$(BUILD)/download-cache/dist
# Touch target because the current directory is used as temporary
# storage, and it is cleaned up after that setup.py runs egg_info.
touch $@
$(BUILD)/.installed.cfg: re6stnet/re6stnet.egg-info
cd $(BUILD) && bin/buildout
# Touch target in case that buildout had nothing to do.
touch $@
$(ROOT)/Makefile: Makefile.in Makefile
($(foreach x,BIN NOPART BUILD_KEEP TARGET, \
echo $(x) = $($(x)) &&) cat $<) > $@
prepare: $(BUILD)/.installed.cfg $(ROOT)/Makefile
$(eval VERSION = $(shell cd $(BUILD)/download-cache/dist \
&& set re6stnet-* && set $${1#*-} \
&& echo -n $${1%.tar.*}+slapos$(SLAPOS_EPOCH).g \
&& cd $(CURDIR)/slapos && git rev-parse --short HEAD))
make -C re6stnet
upstream.mk: re6stnet Makefile
(echo 'override PYTHON = /$(TARGET)/parts/python2.7/bin/python' \
&& cat $</Makefile) > $@
tarball: upstream.mk prepare
tar -caf $(PACKAGE)_$(VERSION).tar.gz \
--xform s,^re6stnet/,, \
--xform s,^,$(PACKAGE)-$(VERSION)/, \
cleanup install-eggs rebootstrap $< \
re6stnet/daemon re6stnet/docs/*.1 re6stnet/docs/*.8 \
-C $(ROOT) Makefile $(patsubst %,$(TARGET)/%,$(BUILD_KEEP))
debian/changelog: prepare
cd re6stnet && sed s,$@,../$@, debian/common.mk | \
make -f - PACKAGE=$(PACKAGE) VERSION=$(VERSION) ../$@
debian/control: debian/source/format prepare Makefile
$(eval DSC = $(PACKAGE)_$(VERSION).dsc)
python2 -c 'from debian.deb822 import Deb822; d = Deb822(); \
b = open("re6stnet/$@"); s = Deb822(b); b = Deb822(b); \
d["Format"] = open("$<").read().strip(); \
d["Source"] = s["Source"] = b["Package"] = "$(PACKAGE)"; \
d["Version"] = "$(VERSION)"; \
d["Architecture"] = b["Architecture"] = "any"; \
d["Build-Depends"] = s["Build-Depends"] = \
"python (>= 2.6), debhelper (>= 8)"; \
b["Depends"] = "$${shlibs:Depends}, iproute2 | iproute"; \
b["Conflicts"] = b["Provides"] = b["Replaces"] = "re6stnet"; \
open("$@", "w").write("%s\n%s" % (s, b)); \
open("$(DSC)", "w").write(str(d))'
debian.tar.gz: $(patsubst %,debian/%,changelog control prerm postinst rules source/*)
# Unfortunately, OBS does not support symlinks.
set -e; cd re6stnet; [ ! -e debian/postinst ]; \
x=`find debian ! -type d $(patsubst %,! -path %,$^))`; \
tar -chaf ../$@ $$x -C .. $^
define SED_SPEC
# https://fedoraproject.org/wiki/Packaging:Python_Appendix#Manual_byte_compilation
1i%global __os_install_post %(echo '%{__os_install_post}' |grep -v brp-python-bytecompile)
/^%define (_builddir|ver)/d
s/^(Name:\s*).*/\1$(PACKAGE)/
s/^(Version:\s*).*/\1$(VERSION)/
s/^(Release:\s*).*/\11/
/^BuildArch:/cAutoReqProv: no\nBuildRequires: gcc-c++, make, python\n#!BuildIgnore: rpmlint-Factory\nSource: %{name}_%{version}.tar.gz
/^Requires:/{/iproute/!d}
/^Recommends:/d
s/^(Conflicts:\s*).*/\1re6stnet/
/^%description$$/a%prep\n%setup -q
/^%preun$$/,/^$$/{/^$$/ifind /$(TARGET) -type f -name '*.py[co]' -delete
}
endef
re6stnet.spec: prepare
$(eval export SED_SPEC)
sed -r "$$SED_SPEC" re6stnet/$@ > $@
PKGBUILD: PKGBUILD.in prepare
sed 's/%VERSION%/$(VERSION)/' $< > $@
clean:
rm -rf "$(ROOT)" *.dsc *.tar.gz re6stnet.spec \
upstream.mk debian/control debian/changelog
# Note that this file and related scripts (rebootstrap, install-eggs) don't
# contain anything specific to re6stnet. They could be reused as is for SlapOS.
# We don't strip ELF files because all dists automatically do it.
# For those that produce debug packages, these packages are anyway quite small
# (debug information also compresses quite well).
BUILD = $(TARGET)
PATH := $(patsubst %,$(CURDIR)/$(BUILD)/parts/%/bin:,chrpath file perl)$(PATH)
PYTHON2 = $(firstword $(wildcard /usr/bin/python2 /usr/bin/python))
all: $(BUILD)/.installed.cfg
ifneq ($(wildcard upstream.mk),)
make -f upstream.mk
%: _%
make -f upstream.mk $@
_install%: _install;
Makefile:;
else
install: _install
endif
$(BUILD)/bin/buildout:
cd $(BUILD) && $(PYTHON2) -S $(CURDIR)/rebootstrap
$(BUILD)/.installed.cfg: $(BUILD)/bin/buildout $(BUILD)/buildout.cfg
cd $(BUILD) && bin/buildout
touch $@
PROGS = $(patsubst %,$(DESTDIR)/usr/bin/%,$(BIN))
_install: $(DESTDIR)/$(TARGET) $(PROGS);
$(PROGS): $(BUILD)/.installed.cfg
mkdir -p $(@D)
sed s,$(CURDIR)/$(BUILD),/$(TARGET),g $(BUILD)/bin/$(@F) > $@
chmod +x $@
$(DESTDIR)/$(TARGET): $(BUILD)/.installed.cfg
rm -rf $@ && mkdir -p $@/parts
cd $(BUILD) && $(PYTHON2) $(CURDIR)/install-eggs $@ $(BIN)
for x in $(filter-out $(NOPART),$(shell cd $(BUILD)/parts && echo *)); \
do cp --preserve=links -r $(BUILD)/parts/$$x $@/parts; done
cd $@ && $(CURDIR)/cleanup && chmod -R u+w .
# Fix paths in files, first ELF, then non-binary
set -e $(CURDIR)/$(BUILD) /$(TARGET); set $$* "s:\\Q$$1\\E:$$2:g"; \
x=`find $@ -type f \( -executable -o -name '*.so*' \) | \
xargs -r file |sed -n 's/:.*ELF.*\(executable\|shared\).*//p' | \
xargs -r chrpath -k |perl -ne "$$3"'; \
s/(.*): R(UN)?PATH=(.*)/chrpath -r $$3 $$1/ and print'`; \
eval "$$x"; \
if x=`grep -rIlF $$1 $@`; then \
echo "Fixing path to $$2 rather than $$1:" $$x; \
perl -pi -e "$$3" $$x; fi
# Fix symlinks at the end because they'll become broken inside DESTDIR.
# Maybe we should generate relative symlinks, or let dists do it.
set -e $(CURDIR)/$(BUILD)/; \
find $@ -type l -lname "$$1*" -printf '%l %p\n' |cut -c"$${#1}"- | \
while read s d; do echo "Fixing symlink $$d"; \
rm $$d; ln -s /$(TARGET)$$s $$d; \
done
clean:
find $(BUILD) -mindepth 1 -maxdepth 1 \
$(patsubst %,! -name %,$(BUILD_KEEP)) |xargs rm -rf
# Maintainer: Rafael Monnerat <rafael@nexedi.com>
pkgname=re6st-node
pkgver=%VERSION%+%RECIPE_VERSION%+%RELEASE%
pkgdesc="re6stnet"
pkgver=%VERSION%
pkgdesc="resilient, scalable, IPv6 network application"
pkgrel=1
arch=('x86_64' 'i686')
url="http://www.re6st.net"
license=('GPL')
depends=('gcc' 'make' 'patch' 'wget' 'python2' 'python2-distribute' 'bridge-utils')
makedepends=('gcc' 'make' 'patch' 'wget' 'python2' 'python2-distribute' 'chrpath' 'inetutils')
depends=('iproute2')
makedepends=('gcc' 'make' 'python2')
install='re6stnet.install'
source=(${pkgname}_${pkgver}.tar.gz)
md5sums=(%SOURCEMD5)
SKIPCHECKSUMS=1
build() {
cd "${srcdir}/${pkgname}_${pkgver}"
make PYTHON=python2
cd "${srcdir}/${pkgname}-${pkgver}"
make
}
package() {
cd "${srcdir}/${pkgname}_${pkgver}"
make DESTDIR="$pkgdir/" install
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="$pkgdir" PREFIX=/usr install
}
[buildout]
extends =
%BUILDOUT_URL%
# Don't load extensions
extensions =
file://%(SLAPOS)s/stack/slapos.cfg
file://%(SLAPOS)s/component/chrpath/buildout.cfg
file://%(SLAPOS)s/component/re6stnet/buildout.cfg
extends-cache = extends-cache
download-cache = download-cache
develop =
extensions =
newest = false
parts += chrpath python
parts =
babeld
re6stnet
[python]
recipe = zc.recipe.egg
interpreter = ${:_buildout_section_name_}
eggs = setuptools
python = buildout
scripts =
# 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
......@@ -24,30 +30,6 @@ parts =
# ./configure --prefix=INSTALL_DIRECTORY && make install DESTDIR=BUILD_DIRECTORY
[python2.7]
configure-options +=
--prefix=%TARGET_DIRECTORY%/parts/${:_buildout_section_name_}
--prefix=%(TARGET)s/parts/${:_buildout_section_name_}
environment +=
DESTDIR=%BUILD_ROOT_DIRECTORY%
[gettext]
# Add gettext library path to RPATH as its binaries are used to build
# glib for example
environment =
PATH=${perl:location}/bin:${lunzip:location}/bin:%(PATH)s
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%
[python-cryptography-prep]
recipe = zc.recipe.egg
eggs =
${python-cffi:egg}
enum34
pycparser
six
pyasn1
DESTDIR=%(ROOT)s
#!/bin/sh -e
(cd parts
# Buildout files
rm -r *-patch-download *-hooks-download || :
# Removing gdb, locales, terminfo and base_completion.d directories
find -type d \
\( -name gdb -name locale -o -name terminfo -o -name bash_completion.d \) \
-print0 -prune |xargs -0 rm -rf
rm ncurses/lib/terminfo || :
# Removing gettext archive tarball containing all versions
rm gettext/share/gettext/archive.dir.tar.* || :
# Removing include/pkgconfig files
find -name 'python*' -prune -o \
\( -type d \( -name include -o -name pkgconfig \) \
-o -type f -executable -name '*-config' \
\) -print0 -prune |xargs -0 rm -rf
)
# Removing documentations
find -regextype posix-extended -type d \
-iregex '.*/(gtk-)?(doc[s]?|man|info|test[s]?)$' \
-print0 -prune |xargs -0 rm -rf
find -regextype posix-extended -type f \
-iregex '.*(COPYING|LICENSE).*' -delete
# Removing Python byte-compiled files (as it will be done upon
# package installation) and static libraries
find -regextype posix-extended -type f \
-iregex '.*/*\.(py[co]|[l]?a|exe|bat)$' -delete
# Removing empty directories
find -type d -empty -delete
#!/bin/sh
set -e
# https://lists.debian.org/debian-mentors/2015/12/msg00367.html
x=/var/lib/dpkg/info/re6stnet.postrm
if [ "$1" = "configure" ] && grep -q DPKG_MAINTSCRIPT_PACKAGE $x 2>/dev/null
then sed -ri '1s,^(#!/bin/)sh,\1true\n\0,' $x
fi
#DEBHELPER#
#!/bin/sh
set -e
# BBB: service renamed from 're6st-node' to 're6stnet'
dpkg-maintscript-helper rm_conffile /etc/init.d/re6st-node -- "$@"
#DEBHELPER#
#!/bin/sh
set -e
pyclean() {
local x IFS='
'
x=`dpkg -L $1`
rm -f `for x in $x; do
case $x in *.py) echo $x[co];; esac
done`
}
pyclean $DPKG_MAINTSCRIPT_PACKAGE
#DEBHELPER#
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1
include debian/common.mk
override_dh_auto_install:
override_dh_link:
override_dh_makeshlibs:
dh_makeshlibs -n
override_dh_shlibdeps:
dh_shlibdeps -- -x$(PACKAGE)
rm $(TMP)/DEBIAN/shlibs
%:
dh $@
#!/usr/bin/python2
import errno, os, shutil, sys
path = set()
class Stop(Exception):
pass
class SysPath(tuple):
def __setitem__(self, i, v):
path.update(v)
raise Stop
sys_path = sys.path
try:
sys.path = SysPath(sys_path)
for x in sys.argv[2:]:
try:
execfile(os.path.join("bin", x))
except Stop:
pass
finally:
sys.path = sys_path
dest = sys.argv[1]
for x in path:
x = os.path.relpath(x)
d = os.path.join(dest, x)
try:
os.mkdir(os.path.basename(x))
except OSError as e:
if e.errno != errno.EEXIST:
raise
shutil.copytree(x, d, True)
#!/bin/sh -e
# Edit for release
VERSION=0.435
# Edit for release
RECIPE_VERSION=1.0.18
# Edit for release
RELEASE=1
GITHASH=ded003246fc9a65d6030a8f77a770c33bf9d254b
CURRENT_DIRECTORY="$(pwd)"
# Define URL to compile
BUILDOUT_URL=http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-$RECIPE_VERSION:/component/re6stnet/buildout.cfg
OBS_DIRECTORY=$CURRENT_DIRECTORY/home:VIFIBnexedi/Re6stnet
# Development Section [Uncomment for use]
OBS_DIRECTORY=$CURRENT_DIRECTORY/home:VIFIBnexedi:branches:home:VIFIBnexedi/Re6stnet
BUILDOUT_URL=http://git.erp5.org/gitweb/slapos.git/blob_plain/$GITHASH:/component/re6stnet/buildout.cfg
VERSION_REGEX="s!\%BUILDOUT_URL\%!$BUILDOUT_URL!g;s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g;s/\%RELEASE\%/$RELEASE/g"
TEMPLATES_DIRECTORY=$CURRENT_DIRECTORY/templates
RE6ST_ORGINAL_DIRECTORY=re6st-node
RE6ST_DIRECTORY=re6st-node_$VERSION+$RECIPE_VERSION+$RELEASE
function prepare_template_files
{
# Prepare directory for new version if needed
mkdir -p $CURRENT_DIRECTORY/$RE6ST_DIRECTORY
cp -rf $CURRENT_DIRECTORY/$RE6ST_ORGINAL_DIRECTORY/* $CURRENT_DIRECTORY/$RE6ST_DIRECTORY
sed $VERSION_REGEX $TEMPLATES_DIRECTORY/Makefile.in > $CURRENT_DIRECTORY/$RE6ST_DIRECTORY/re6stnet/Makefile
sed $VERSION_REGEX $TEMPLATES_DIRECTORY/offline.sh.in > $CURRENT_DIRECTORY/$RE6ST_DIRECTORY/re6stnet/offline.sh
}
function prepare_download_cache
{
cd $CURRENT_DIRECTORY/$RE6ST_DIRECTORY/re6stnet/
rm -rf build/
bash offline.sh || (echo "Impossible to build Re6stnet, exiting." && exit 1)
# Go back to starting point
cd $CURRENT_DIRECTORY
}
function prepare_tarball
{
tar -czf $RE6ST_DIRECTORY.tar.gz $RE6ST_DIRECTORY
}
function prepare_deb_packaging
{
# Add entry to changelog
cd $TEMPLATES_DIRECTORY/debian
#dch -pm -v $VERSION+$RECIPE_VERSION+$RELEASE --check-dirname-level=0 "New version of re6st ($VERSION+$RECIPE_VERSION+$RELEASE)"
# Add cron and logrotate files
cd $TEMPLATES_DIRECTORY
tar -czf debian.tar.gz debian
cd $OBS_DIRECTORY
cp $TEMPLATES_DIRECTORY/debian.tar.gz .
}
function obs_upload
{
cd $OBS_DIRECTORY
# Update directory
osc up
# Remove former configuration
osc rm -f $RE6ST_ORGINAL_DIRECTORY*.tar.gz
osc rm -f re6stnet.spec
# Prepare new tarball
cp $CURRENT_DIRECTORY/$RE6ST_DIRECTORY.tar.gz .
osc add $RE6ST_DIRECTORY.tar.gz
# Prepare new specfile
sed $VERSION_REGEX $TEMPLATES_DIRECTORY/re6stnet.spec.in > re6stnet.spec
osc add re6stnet.spec
# Prepare new .dsc file
osc rm -f re6st*.dsc
sed $VERSION_REGEX $TEMPLATES_DIRECTORY/re6stnet.dsc.in > $RE6ST_DIRECTORY.dsc
osc add $RE6ST_DIRECTORY.dsc
osc rm -f PKGBUILD
SOURCEMD5=`md5sum $RE6ST_DIRECTORY.tar.gz | cut -d\ -f1`
sed "$VERSION_REGEX;s/\%SOURCEMD5\%/$SOURCEMD5/g" $TEMPLATES_DIRECTORY/PKGBUILD.in > PKGBUILD
cp $TEMPLATES_DIRECTORY/re6stnet.install .
osc add PKGBUILD re6stnet.install
## Upload new Package
osc commit -m "New Re6stnet Recipe $RECIPE_VERSION"
}
prepare_template_files
prepare_download_cache
prepare_tarball
prepare_deb_packaging
obs_upload
#!/usr/bin/make -f
# -*- makefile -*-
build:
cd re6stnet; make build
all: build
install: all
cd re6stnet; make install
mkdir -p $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/usr/sbin/
cp $(DESTDIR)/opt/re6st/bin/re6st* $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/var/lib/re6stnet
mkdir -p $(DESTDIR)/var/log/re6stnet
mkdir -p $(DESTDIR)/etc/re6stnet
install -Dpm 0644 daemon/README.conf $(DESTDIR)/etc/re6stnet/README
install -Dp daemon/network-manager $(DESTDIR)/etc/NetworkManager/dispatcher.d/50re6stnet
clean:
# cd slapos; make clean
re6stnet configuration files
re6stnet is started automatically if /etc/re6stnet contains a 're6stnet.conf'
file with all parameters to pass to the daemon.
Same for the registry: all parameters must be specified in 're6st-registry.conf'
So for a normal node, you should have the following files:
re6stnet.conf ca.crt cert.crt cert.key dh2048.pem
And if you also host the registry:
re6st-registry.conf ca.key
/var/log/re6stnet/babeld.log {
compress
delaycompress
missingok
notifempty
postrotate
[ -r /var/run/re6st-babeld.pid ] && kill -USR2 $(cat /var/run/re6st-babeld.pid)
endscript
}
#!/usr/bin/python -S
import errno, glob, os, signal, socket, subprocess, sys, time
DAEMON = "re6stnet"
CONFDIR = "/etc/re6stnet"
os.environ["PATH"] = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
iface = sys.argv[1]
action = sys.argv[2]
lock_name = DAEMON + ':' + iface
if action in ("up", "vpn-up"):
os.chdir(CONFDIR)
if os.path.exists("re6stnet.conf") and not subprocess.call(
(DAEMON, "@re6stnet.conf", "--test", "main_interface != %r" % iface)):
s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
try:
s.bind('\0' + lock_name)
except socket.error, e:
if e[0] != errno.EADDRINUSE:
raise
sys.stderr.write("daemon already started\n")
sys.exit()
if not os.fork():
os.setsid()
os.execlp(DAEMON, DAEMON, "@re6stnet.conf")
elif action in ("down", "vpn-down"):
pattern = " @%s\n" % lock_name
with open("/proc/net/unix") as f:
for line in f:
if line.endswith(pattern):
sock_path = "socket:[%s]" % line.split()[-2]
break
else:
sys.exit()
pattern = "(%s)" % DAEMON
for path in glob.glob("/proc/*/stat"):
try:
pid = int(path[6:-5])
with open(path) as f:
stat = f.read().split()
if stat[1] == pattern and sock_path in (os.readlink(path)
for path in glob.glob(path[:-4] + "fd/*")):
break
except (EnvironmentError, ValueError):
pass
else:
sys.exit()
try:
os.kill(pid, signal.SIGTERM)
sleep = .1
while sleep < 5:
time.sleep(sleep)
os.kill(pid, 0)
sleep *= 1.5
# we waited for about 11 seconds
os.kill(-int(stat[4]), signal.SIGKILL)
except OSError, e:
if e.errno != errno.ESRCH:
raise
[Unit]
Description=Server application for re6snet
ConditionPathExists=/etc/re6stnet/re6st-registry.conf
[Service]
WorkingDirectory=/etc/re6stnet
ExecStart=/usr/bin/env re6st-registry @re6st-registry.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target
[Unit]
Description=Resilient, Scalable, IPv6 Network application
ConditionPathExists=/etc/re6stnet/re6stnet.conf
[Service]
WorkingDirectory=/etc/re6stnet
# systemd plans to "introduce ExecCondition= in services" (cf its TODO file)
ExecStart=/bin/sh -c 'set re6stnet @re6stnet.conf; "$@" --test main_interface==\"lo\" || exec "$@"'
Restart=on-failure
StandardOutput=null
[Install]
WantedBy=multi-user.target
#!/usr/bin/python2 -S
import glob, os, sys, zipfile
d = "download-cache/dist"
p = "setuptools-*"
x, = glob.glob(d + "/" + p)
zipfile.ZipFile(x).extractall()
sys.path[:0] = p = glob.glob(p)
from setuptools.command.easy_install import main
for x in "bin", "eggs":
try:
os.mkdir(x)
except OSError, e:
pass
main(["-f", d, "-mxd", x, "zc.buildout"])
p.append(*glob.glob("eggs/zc.buildout-*"))
os.write(os.open("bin/buildout", os.O_CREAT|os.O_WRONLY|os.O_TRUNC, 0777), """\
#!%s -S
import os, sys
d = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
d = os.path.dirname(d) + os.sep
sys.path[:0] = (%s)
from zc.buildout.buildout import main
sys.exit(main())
""" % (sys.executable, ", ".join("d + %r" % p for p in p)))
#!/usr/bin/make -f
# -*- makefile -*-
VERSION = %VERSION%
RECIPE_VERSION = %RECIPE_VERSION%
PY = $(PYTHON)
INSTALL_DIRECTORY = $(DESTDIR)/opt/re6st
TARGET_DIRECTORY = /opt/re6st
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) && \
$(PY) ./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
re6st-node (0.399+0.260+0) unstable; urgency=low
* Initial release.
-- Rafael Monnerat <rafael@nexedi.com> Thu, 9 Apr 2015 11:32:17 +0300
Source: re6st-node
Maintainer: Julien Muchembled <jm@nexedi.com>
Section: net
Priority: optional
Build-Depends: python-setuptools, python, debhelper (>= 7.4.3)
Standards-Version: 3.9.1
Package: re6st-node
Architecture: any
Depends: ${misc:Depends}, python, python-argparse, iproute2 | iproute, openssl
Recommends: ${python:Recommends}, logrotate
Suggests: ndisc6
Description: resilient, scalable, IPv6 network application
Format: http://dep.debian.net/deps/dep5
Files: *
Copyright: 2012 Nexedi SA and Contributors
License: GPL-2+
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 2 of the License, or
(at your option) any later version.
.
This package 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, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
#!/bin/sh -e
[ "$DPKG_MAINTSCRIPT_PACKAGE" ]
[ "$1" = purge ] && for d in lib log; do
d=/var/$d/$DPKG_MAINTSCRIPT_PACKAGE
[ ! -d "$d" ] || rm -r "$d" || :
done
#DEBHELPER#
#!/bin/sh
### BEGIN INIT INFO
# Provides: re6stnet
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/re6st/bin
NAME=re6stnet
DESC="Resilient, Scalable, IPv6 Network application"
DAEMON=/opt/re6st/bin/re6stnet
CONFDIR=/etc/re6stnet
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/re6st-node
# Exit if the package is not installed or not configured
[ -x $DAEMON -a -r $CONFDIR/re6stnet.conf ] || exit 0
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
set start-stop-daemon --quiet --pidfile $PIDFILE
"$@" --stop --test --name $NAME && return 1
"$@" --start --make-pidfile --background --chdir $CONFDIR --exec $DAEMON -- @re6stnet.conf || return 2
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
set start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5
"$@" --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
rm -f $PIDFILE
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
"$@" --oknodo --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
return "$RETVAL"
}
cd $CONFDIR; $DAEMON @re6stnet.conf --test "main_interface != 'lo'" ||
case "$1" in start) exit 0;; restart|force-reload) set stop;; esac
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# This is the debhelper compatibility version to use.
export DH_COMPAT=4
CFLAGS = -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
build: build-stamp
build-stamp:
dh_testdir
# Add here commands to compile the package.
make
# --- end custom part for compiling
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process
# --- end custom part for cleaning up
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package
# The DESTDIR Has To Be Exactly /usr/src/packages/BUILD/debian/<nameOfPackage>
dh_auto_install --TARGET_DIRECTORY=/opt/re6st
# --- end custom part for installing
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
dh_installinit
dh_installcron
dh_installlogrotate
dh_installman
dh_installinfo
# dh_undocumented
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs -n
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb -- -Zlzma -z9
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
#!/bin/bash
VERSION=%VERSION%
RECIPE_VERSION=%RECIPE_VERSION%
BUILDOUT_URL=%BUILDOUT_URL%
TARGET_DIRECTORY=/opt/re6st
BUILD_ROOT_DIRECTORY="$(pwd)/build"
BUILD_DIRECTORY=$BUILD_ROOT_DIRECTORY$TARGET_DIRECTORY
BOOTSTRAP_URL='https://raw.githubusercontent.com/buildout/buildout/1/bootstrap/bootstrap.py'
echo "Preparing source tarball (recipe version: $RECIPE_VERSION)"
echo " Build Directory: $BUILD_DIRECTORY "
echo " Buildroot Directory: $BUILD_ROOT_DIRECTORY "
mkdir -p $BUILD_DIRECTORY
mkdir $BUILD_DIRECTORY/extends-cache
mkdir $BUILD_DIRECTORY/download-cache
set -e
echo "$BUILD_ROOT_DIRECTORY" > ./original_directory
sed "s!\%BUILDOUT_URL\%!$BUILDOUT_URL!g;s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s|\%PATCHES_DIRECTORY\%|$PATCHES_DIRECTORY|g;s|\%TARGET_DIRECTORY\%|$TARGET_DIRECTORY|g;s|\%BUILD_ROOT_DIRECTORY\%|$BUILD_ROOT_DIRECTORY|g;s|\%BUILD_DIRECTORY\%|$BUILD_DIRECTORY|g" buildout.cfg.in > $BUILD_DIRECTORY/buildout.cfg
# Build first time to get download-cache and extends-cache ready
cd $BUILD_DIRECTORY
wget $BOOTSTRAP_URL --no-check-certificate -O bootstrap.py
(python -S bootstrap.py && \
./bin/buildout) || (echo "Failed to run buildout, exiting." && exit 1)
cd $BUILD_ROOT_DIRECTORY/..
# remove all files from build keeping only caches
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/.installed.cfg \
$BUILD_DIRECTORY/environment.*
rm -rfv $BUILD_DIRECTORY/parts/
rm -rfv $BUILD_DIRECTORY/eggs/
rm -rfv $BUILD_DIRECTORY/develop-eggs/
rm -rfv $BUILD_DIRECTORY/bin
# Removing empty directories
find $BUILD_DIRECTORY -type d -empty -prune -exec rmdir '{}' ';'
# Prepare buildout
sed "s!\%BUILDOUT_URL\%!$BUILDOUT_URL!g;s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s|\%PATCHES_DIRECTORY\%|$PATCHES_DIRECTORY|g;s|\%TARGET_DIRECTORY\%|$TARGET_DIRECTORY|g;s|\%BUILD_ROOT_DIRECTORY\%|$BUILD_ROOT_DIRECTORY|g;s|\%BUILD_DIRECTORY\%|$BUILD_DIRECTORY|g" $BUILD_ROOT_DIRECTORY/../buildout.cfg.in > $BUILD_DIRECTORY/buildout.cfg
cd $BUILD_DIRECTORY && \
wget $BOOTSTRAP_URL --no-check-certificate -O bootstrap.py && \
python -S bootstrap.py
# 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 '{}' ';'
Format: 1.0
Source: re6st-node
Binary: re6st-node
Architecture: any
Version: %VERSION%+%RECIPE_VERSION%+%RELEASE%-1
Maintainer: Rafael Monnerat <rafael@nexedi.com>
Homepage: http://www.slapos.org
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 4.1.16), chrpath, po-debconf, wget, python, python-dev, python-setuptools
Files:
1c2803e4693c74042985d753c9c3ba53 73736102 re6st-node_%VERSION%+%RECIPE_VERSION%+%RELEASE%.orig.tar.gz
1c2803e4693c74042985d753c9c3ba53 6102 re6st-node_%VERSION%+%RECIPE_VERSION%+%RELEASE%-1.diff.tar.gz
%define slapversion %RECIPE_VERSION%
%define version %VERSION%
%define unmangled_version %VERSION%
%define release_number %RELEASE%
Summary: resilient, scalable, IPv6 network application
Name: re6st-node
Version: %{slapversion}
Release: %{release_number}
Source: re6st-node_%{unmangled_version}+%{slapversion}+%{release_number}.tar.gz
License: GPLv2+
Group: Applications/Internet
BuildRequires: gcc-c++, make, patch, wget, python, python-devel, chrpath, python-setuptools, openssl-devel
Requires: python
AutoReqProv: no
%description
%prep
rm -rf $RPM_BUILD_DIR/re6st-node_%{unmangled_version}+%{slapversion}+%{release_number}
zcat $RPM_SOURCE_DIR/re6st-node_%{unmangled_version}+%{slapversion}+%{release_number}.tar.gz | tar -xvf -
%build
cd $RPM_BUILD_DIR/re6st-node_%{unmangled_version}+%{slapversion}+%{release_number}
make
%install
cd $RPM_BUILD_DIR/re6st-node_%{unmangled_version}+%{slapversion}+%{release_number}/
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT/etc/systemd/
install -Dpm 0644 daemon/re6stnet.service $RPM_BUILD_ROOT/etc/systemd/re6stnet.service
%files
/etc/systemd
/etc/systemd/re6stnet.service
/etc/NetworkManager
/etc/NetworkManager/dispatcher.d
/etc/NetworkManager/dispatcher.d/50re6stnet
/etc/re6stnet
/usr/bin/re6st-conf
/usr/bin/re6st-registry
/usr/bin/re6stnet
/var/lib/re6stnet
/var/log/re6stnet
/opt/re6st
%defattr(-,root,root)
%post
%preun
%postun
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment