# limitations under the License.
#
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:2-u18.04-nng
+FROM ubuntu:18.04
-# Install build tools and SDL dependencies:
+# Install building tools and SDL dependencies:
RUN apt-get update && \
- apt-get install -y libhiredis-dev && \
+ apt-get install -y \
+ build-essential \
+ automake \
+ libtool \
+ pkg-config \
+ libgtest-dev \
+ rpm \
+ devscripts \
+ gawk \
+ debhelper \
+ autoconf-archive \
+ libboost-all-dev \
+ libhiredis-dev && \
apt-get clean
# Copy sourcefiles:
RUN mkdir -p /tmp/build
COPY . /tmp/build
+WORKDIR /tmp/build
# Compile and run unit tests:
-WORKDIR /tmp/build
RUN ./autogen.sh && \
./configure && \
make all && \
make test
+
+# Build packages:
+RUN make clean && \
+ make distclean && \
+ ./package.sh --skip-test debian rpm
+
+RUN cp /tmp/build/ci/publish.sh /bin
+ENTRYPOINT ["/bin/publish.sh"]
--- /dev/null
+#!/bin/bash
+echo "$0: start copying packages"
+
+TARGET=/export
+if [ $# -eq 1 ]
+then
+ TARGET=$1
+fi
+
+if [ ! -d "$TARGET" ]
+then
+ echo "$0: Error: target dir $TARGET does not exist"
+ exit 1
+fi
+
+cp -v /tmp/*.rpm /tmp/*.deb "$TARGET"
m4_define([SDL_MAJOR], [1])
m4_define([SDL_MINOR], [0])
-m4_define([SDL_MICRO], [3])
+m4_define([SDL_MICRO], [4])
# SDL ABI version with libtool
#
# Change the numbers just before release.
m4_define([SDL_CURRENT], [1])
-m4_define([SDL_REVISION], [3])
+m4_define([SDL_REVISION], [4])
m4_define([SDL_AGE], [0])
AC_INIT([shareddatalayer], [SDL_MAJOR.SDL_MINOR.SDL_MICRO], [], [], [https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/sdl])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Doxyfile])
+AC_CONFIG_FILES([rpm/sdl.spec])
+AC_CONFIG_FILES([debian/changelog])
AC_CONFIG_FILES([run-tests.sh], [chmod +x run-tests.sh])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([subdir-objects foreign 1.13 tar-pax -Wall -Werror])
--- /dev/null
+sdl (@PACKAGE_VERSION@-1) unstable; urgency=medium
+
+ * Initial release
+
+ -- Rolf Badorek <rolf.badorek@nokia.com> Tue, 12 Nov 2019 15:35:00 +0300
--- /dev/null
+Source: sdl
+Priority: optional
+Maintainer: Rolf Badorek <rolf.badorek@nokia.com>
+Build-Depends: debhelper (>= 10), pkg-config, libtool, automake, gawk, autoconf, automake, autoconf-archive, make, gcc, libboost-all-dev, libhiredis-dev
+Standards-Version: 4.1.2
+Section: libs
+
+Package: sdl-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: sdl (= ${binary:Version}), ${misc:Depends}
+Description: Development files for sdl
+ The sdl-dev package contains public headers, library and pkg-config file for developing applications that use sdl
+
+Package: sdl
+Architecture: any
+Multi-Arch: same
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: C++ API library for Shared Data Layer clients
--- /dev/null
+#
+# Copyright (c) 2018-2019 Nokia.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
\ No newline at end of file
--- /dev/null
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#export DH_VERBOSE = 1
+
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+
+%:
+ dh $@
+
+
+# dh_make generated override targets
+# This is example for Cmake (See https://bugs.debian.org/641051 )
+#override_dh_auto_configure:
+# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
+
--- /dev/null
+usr/lib
+usr/include
--- /dev/null
+usr/include/*
+usr/lib/*/lib*.so
+usr/lib/*/pkgconfig/*
--- /dev/null
+usr/lib
+usr/bin
--- /dev/null
+usr/lib/*/lib*.so.*
+usr/bin/sdltool
--- /dev/null
+3.0 (quilt)
Version history
---------------
+[1.0.4] - 2019-11-13
+
+* Add PackageCloud.io publishing to CI scripts.
+
[1.0.3] - 2019-11-08
* Add CI Dockerfile to compile SDL library and run unit tests.
--- /dev/null
+#!/bin/bash
+#
+# Copyright (c) 2019 AT&T Intellectual Property.
+# Copyright (c) 2018-2019 Nokia.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e
+
+if [ $# -eq 0 ]
+then
+ echo "Generate a binary package"
+ echo "Usage: $0 [--target-dir <dir>] [--skip-config] target..."
+ echo "Where possible targets are debian and rpm"
+ exit 1
+fi
+
+SKIP_CONF=0
+BUILD_RPM=0
+BUILD_DEB=0
+SKIP_TEST=0
+TARGET_DIR=/tmp
+
+for i in "$@"
+do
+ case "$i" in
+ --target-dir)
+ shift
+ TARGET_DIR=$i
+ ;;
+ --skip-config)
+ SKIP_CONF=1
+ ;;
+ --skip-test)
+ SKIP_TEST=1
+ ;;
+ rpm)
+ BUILD_RPM=1
+ shift
+ ;;
+ debian)
+ BUILD_DEB=1
+ ;;
+ *)
+ echo "Unknown argument $1"
+ exit 1
+ ;;
+ esac
+done
+
+if [ $SKIP_CONF -eq 0 ]
+then
+ ./autogen.sh && ./configure
+fi
+
+if [ $BUILD_RPM -ne 0 ]
+then
+ if [ $SKIP_TEST ]
+ then
+ TESTOPT=--nocheck
+ fi
+ rpmbuild --nodeps $TESTOPT -bb rpm/sdl.spec --define="_sourcedir $PWD" --define="_builddir $PWD" --define="_rpmdir .."
+ cp ../x86_64/*.rpm "$TARGET_DIR"
+fi
+
+if [ $BUILD_DEB -ne 0 ]
+then
+ if [ $SKIP_TEST -eq 1 ]
+ then
+ export DEB_BUILD_OPTIONS="nocheck noddebs"
+ fi
+ debuild -b -us -uc
+fi
--- /dev/null
+Name: sdl
+Version: @PACKAGE_VERSION@
+Release: 1%{?dist}
+Summary: C++ API library for Shared Data Layer clients
+
+License: Apache-2
+URL: https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/sdl
+
+BuildRequires: pkgconfig
+BuildRequires: gcc
+BuildRequires: autoconf
+BuildRequires: autoconf-archive
+BuildRequires: automake
+BuildRequires: make
+BuildRequires: gawk
+BuildRequires: libtool
+BuildRequires: boost-devel
+BuildRequires: pkgconfig(hiredis)
+
+%description
+%{name} provices a C++ API library for Shared Data Layer clients
+
+%package devel
+Summary: Development files for %{name}
+Requires: %{name}%{?isa} = %{version}-%{release}
+
+%description devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+%build
+./autogen.sh
+%configure
+%make_build
+
+%install
+%make_install
+rm -f %{buildroot}%{_libdir}/lib*.*a
+
+%post -p /sbin/ldconfig
+
+%files
+%{_libdir}/*.so.*
+%{_bindir}/sdltool
+
+%files devel
+%{_libdir}/pkgconfig/libsdl.pc
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*.pc
+%{_includedir}/sdl
+
+%changelog
+* Tue Nov 12 2019 Rolf Badorek <rolf.badorek@nokia.com> - @PACKAGE_VERSION@-1
+- first version