Implement support for release numbers

parent e016fcdc
#!/bin/bash -e
VERSION=0.33
RECIPE_VERSION=0.135
RECIPE_VERSION=0.135.1
RELEASE=1
VERSION_REGEX="s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g;s/\%RELEASE\%/$RELEASE/g"
CURRENT_DIRECTORY="$(pwd)"
TEMPLATES_DIRECTORY=$CURRENT_DIRECTORY/templates
SLAPOS_ORGINAL_DIRECTORY=slapos-node
SLAPOS_DIRECTORY=slapos-node_$VERSION+$RECIPE_VERSION+0
SLAPOS_DIRECTORY=slapos-node_$VERSION+$RECIPE_VERSION+$RELEASE
OBS_DIRECTORY=$CURRENT_DIRECTORY/home:VIFIBnexedi:branches:home:VIFIBnexedi/SlapOS-Node
......@@ -16,8 +18,8 @@ if [ ! -d "$CURRENT_DIRECTORY/$SLAPOS_DIRECTORY" ]; then
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
sed $VERSION_REGEX $TEMPLATES_DIRECTORY/Makefile.in > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/Makefile
sed $VERSION_REGEX $TEMPLATES_DIRECTORY/offline.sh.in > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/offline.sh
# Prepare Download Cache for SlapOS
cd $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/
......@@ -44,13 +46,13 @@ 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
sed $VERSION_REGEX $TEMPLATES_DIRECTORY/slapos.spec.in > slapos.spec
osc add slapos.spec
##################### Prepare configuration file for .deb ############
# Add entry to changelog
cd $TEMPLATES_DIRECTORY/debian
dch -pm -v $VERSION+$RECIPE_VERSION+0 --check-dirname-level=0 "New version of slapos ($VERSION+$RECIPE_VERSION)"
dch -pm -v $VERSION+$RECIPE_VERSION+$RELEASE --check-dirname-level=0 "New version of slapos ($VERSION+$RECIPE_VERSION+$RELEASE)"
# Add cronfile
cp $CURRENT_DIRECTORY/$SLAPOS_ORGINAL_DIRECTORY/template/slapos-node.cron.d $TEMPLATES_DIRECTORY/debian/cron.d
cd $TEMPLATES_DIRECTORY
......@@ -59,11 +61,11 @@ 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
sed $VERSION_REGEX $TEMPLATES_DIRECTORY/slapos.dsc.in > $SLAPOS_DIRECTORY.dsc
osc add $SLAPOS_DIRECTORY.dsc
## Upload new Package
osc commit -m " New SlapOS Recipe $RECIPE_VERSION"
osc commit -m "New SlapOS Recipe $RECIPE_VERSION"
# Save current version
echo "$RECIPE_VERSION" > $CURRENT_DIRECTORY/slapos-recipe-version
......
......@@ -2,11 +2,11 @@ Format: 1.0
Source: slapos-node
Binary: slapos-node
Architecture: any
Version: %VERSION%+%RECIPE_VERSION%+0-1
Version: %VERSION%+%RECIPE_VERSION%+%RELEASE%-1
Maintainer: Arnaud Fontaine <arnaud.fontaine@nexedi.com>
Homepage: http://www.slapos.org
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 4.1.16), chrpath, po-debconf, wget, python, python-setuptools
Files:
1c2803e4693c74042985d753c9c3ba53 73736102 slapos-node_%VERSION%+%RECIPE_VERSION%+0.orig.tar.gz
1c2803e4693c74042985d753c9c3ba53 6102 slapos-node_%VERSION%+%RECIPE_VERSION%+0-1.diff.tar.gz
\ No newline at end of file
1c2803e4693c74042985d753c9c3ba53 73736102 slapos-node_%VERSION%+%RECIPE_VERSION%+%RELEASE%.orig.tar.gz
1c2803e4693c74042985d753c9c3ba53 6102 slapos-node_%VERSION%+%RECIPE_VERSION%+%RELEASE%-1.diff.tar.gz
\ No newline at end of file
......@@ -28,19 +28,19 @@
%define version %VERSION%
%define unmangled_version %VERSION%
%define unmangled_version %VERSION%
%define release 1
%define release_number %RELEASE%
Summary:Client-side to deploy applications with SlapOS
Name: slapos.node
Version:%{slapversion}
Release:1
Release:%{release_number}
License:GPL
Group: Application/Network
Source0: slapos-node_%{unmangled_version}+%{slapversion}+0.tar.gz
Source0: slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}.tar.gz
URL: http://www.slapos.org/
Vendor: Vifib
Packager: Arnaud Fontaine <arnaud.fontaine@nexedi.com>, Cédric Le Ninivin <cedric.leninivin@tiolive.com>
Packager: Arnaud Fontaine <arnaud.fontaine@nexedi.com>, Cédric Le Ninivin <cedric.leninivin@tiolive.com>, Cédric de Saint Martin <cedric.dsm@nexedi.com>
%if 0%{?suse_version} == 1210
......@@ -73,21 +73,21 @@ AutoReqProv: no
%prep
rm -rf $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+0
zcat $RPM_SOURCE_DIR/slapos-node_%{unmangled_version}+%{slapversion}+0.tar.gz | tar -xvf -
rm -rf $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}
zcat $RPM_SOURCE_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}.tar.gz | tar -xvf -
%build
cd $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+0
cd $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}
make
%install
cd $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+0/
cd $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT/etc/cron.d/
cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+0/template/slapos-node.cron.d $RPM_BUILD_ROOT/etc/cron.d/slapos-node
cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.cron.d $RPM_BUILD_ROOT/etc/cron.d/slapos-node
mkdir -p $RPM_BUILD_ROOT/etc/systemd/system/
cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+0/template/slapos-node.service %{buildroot}/etc/systemd/system/
cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.service %{buildroot}/etc/systemd/system/
%files
/
......
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