packages CHANGE major update
diff --git a/packages/CMakeLists.txt b/packages/CMakeLists.txt
new file mode 100644
index 0000000..44a8bad
--- /dev/null
+++ b/packages/CMakeLists.txt
@@ -0,0 +1,52 @@
+set(PACKAGE "libnetconf2")
+set(PACKAGE_BRIEF "libnetconf2 library")
+set(PACKAGE_DESC ${LIBNETCONF2_DESC})
+set(PACKAGE_DBG_DESC "libnetconf2 library debug symbols.")
+set(PACKAGE_DEV_BRIEF "Headers of libnetconf2 library")
+set(PACKAGE_DEV_DESC "libnetconf2 library headers for C.")
+
+set(GITHUB_URL "https://github.com/cesnet/libnetconf2")
+
+find_program(DEB_BUILDER NAMES debuild)
+find_program(RPM_BUILDER NAMES rpmbuild)
+
+# setup package build
+configure_file(${PROJECT_SOURCE_DIR}/packages/${PACKAGE}.spec.in ${PROJECT_BINARY_DIR}/build-packages/${PACKAGE}.spec)
+configure_file(${PROJECT_SOURCE_DIR}/packages/${PACKAGE}.dsc.in ${PROJECT_BINARY_DIR}/build-packages/${PACKAGE}.dsc)
+configure_file(${PROJECT_SOURCE_DIR}/packages/debian.control.in ${PROJECT_BINARY_DIR}/build-packages/debian.control @ONLY)
+configure_file(${PROJECT_SOURCE_DIR}/packages/debian.rules.in ${PROJECT_BINARY_DIR}/build-packages/debian.rules)
+configure_file(${PROJECT_SOURCE_DIR}/packages/debian.compat
+               ${PROJECT_BINARY_DIR}/build-packages/debian.compat COPYONLY)
+configure_file(${PROJECT_SOURCE_DIR}/packages/debian.copyright
+               ${PROJECT_BINARY_DIR}/build-packages/debian.copyright COPYONLY)
+configure_file(${PROJECT_SOURCE_DIR}/packages/${PACKAGE}.rpmlintrc
+               ${PROJECT_BINARY_DIR}/build-packages/${PACKAGE}.rpmlintrc COPYONLY)
+configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${PACKAGE}.install
+               ${PROJECT_BINARY_DIR}/build-packages/debian.${PACKAGE}.install COPYONLY)
+configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${PACKAGE}-dev.install
+               ${PROJECT_BINARY_DIR}/build-packages/debian.${PACKAGE}-dev.install COPYONLY)
+
+if(NOT DEB_BUILDER)
+    message(STATUS "Missing tools (devscripts, debhelper package) for building DEB package.")
+else()
+    # target for local build deb package
+    message(STATUS "To build local DEB package, use \"build-deb\" target.")
+    add_custom_target(build-deb
+                      WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+                      COMMAND build-packages/local-deb.sh
+    )
+    configure_file(${PROJECT_SOURCE_DIR}/packages/local-deb.sh.in ${PROJECT_BINARY_DIR}/build-packages/local-deb.sh @ONLY)
+endif()
+
+if(NOT RPM_BUILDER)
+    message(STATUS "Missing tools (rpm package) for building RPM package.")
+else()
+    # target for local build rpm package
+    message(STATUS "To build local RPM package, use \"build-rpm\" target.")
+    string(REPLACE ${PROJECT_SOURCE_DIR} "." EXCLUDE_BUILD_DIR ${PROJECT_BINARY_DIR})
+    add_custom_target(build-rpm
+                      WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+                      COMMAND build-packages/local-rpm.sh
+    )
+    configure_file(${PROJECT_SOURCE_DIR}/packages/local-rpm.sh.in ${PROJECT_BINARY_DIR}/build-packages/local-rpm.sh @ONLY)
+endif()
diff --git a/packages/create-package.sh b/packages/create-package.sh
index f1787d4..a8adf4b 100755
--- a/packages/create-package.sh
+++ b/packages/create-package.sh
@@ -1,8 +1,15 @@
 #!/usr/bin/env bash
 
+package="libnetconf2"
+url="https://github.com/cesnet/libnetconf2"
+
 if [ "$TRAVIS_PULL_REQUEST" == "true" -o "$TRAVIS_EVENT_TYPE" != "cron" ] ; then
     exit 0
 fi
+
+#install OSC
+sudo apt-get install -y osc
+
 # check osb_user and osb_pass
 if [ -z "${osb_user}" -o -z "${osb_pass}" ]; then
     exit 0
@@ -11,21 +18,15 @@
 # fill username and password for opensuse build and downlaod last package information
 echo -e "[general]\napiurl = https://api.opensuse.org\n\n[https://api.opensuse.org]\nuser = ${osb_user}\npass = ${osb_pass}" >~/.oscrc
 cd ./build
-if [ $TRAVIS_BRANCH == "devel" ]; then
-	package="home:liberouter/libnetconf2-experimental"
-	name="libnetconf2-experimental"
-else
-	package="home:liberouter/libnetconf2"
-	name="libnetconf2"
-fi
+
 osc checkout home:liberouter
-cp $package/libnetconf2.spec $package/debian.changelog home:liberouter
-cp build-packages/* $package
-cd $package
+cp home:liberouter/$package/$package.spec home:liberouter/$package/debian.changelog home:liberouter
+cp build-packages/debian* build-packages/$package* home:liberouter/$package
+cd home:liberouter/$package
 
 # check versions
-VERSION=$(cat libnetconf2.spec | grep "Version: " | awk '{print $NF}')
-OLDVERSION=$(cat ../libnetconf2.spec | grep "Version: " | awk '{print $NF}')
+VERSION=$(cat $package.spec | grep "Version: " | awk '{print $NF}')
+OLDVERSION=$(cat ../$package.spec | grep "Version: " | awk '{print $NF}')
 if [ -z "$FORCEVERSION" -a "$VERSION" == "$OLDVERSION" ]; then
     exit 0
 fi
@@ -33,7 +34,7 @@
 # create new changelog and paste old changelog
 if [ "$VERSION" != "$OLDVERSION" ]; then
     logtime=$(git log -i --grep="VERSION .* $OLDVERSION" | grep "Date: " | sed 's/Date:[ ]*//')
-    echo -e "$name ($VERSION) stable; urgency=low\n" >debian.changelog
+    echo -e "$package ($VERSION) stable; urgency=low\n" >debian.changelog
     git log --since="$logtime" --pretty=format:"  * %s (%aN)%n" | grep "BUGFIX\|CHANGE\|FEATURE" >>debian.changelog
     git log -1  --pretty=format:"%n -- %aN <%aE>  %aD%n" >>debian.changelog
     echo -e "\n" >>debian.changelog
@@ -41,13 +42,13 @@
 fi
 
 if [ "$VERSION" != "$OLDVERSION" ]; then
-    git log -1 --date=format:'%a %b %d %Y' --pretty=format:"* %ad  %aN <%aE>" | tr -d "\n" >>libnetconf2.spec
-    echo " $VERSION" >>libnetconf2.spec
-    git log --since="$logtime" --pretty=format:"- %s (%aN)"  | grep "BUGFIX\|CHANGE\|FEATURE" >>libnetconf2.spec
-    echo -e "\n" >>libnetconf2.spec
+    git log -1 --date=format:'%a %b %d %Y' --pretty=format:"* %ad  %aN <%aE>" | tr -d "\n" >>$package.spec
+    echo " $VERSION" >>$package.spec
+    git log --since="$logtime" --pretty=format:"- %s (%aN)"  | grep "BUGFIX\|CHANGE\|FEATURE" >>$package.spec
+    echo -e "\n" >>$package.spec
 fi
-cat ../libnetconf2.spec | sed -e '1,/%changelog/d' >>libnetconf2.spec
+cat ../$package.spec | sed -e '1,/%changelog/d' >>$package.spec
 
 # download source and update to opensuse build
-wget "https://github.com/CESNET/libnetconf2/archive/$TRAVIS_BRANCH.tar.gz" -O $TRAVIS_BRANCH.tar.gz
+wget "${url}/archive/master.tar.gz" -O master.tar.gz
 osc commit -m travis-update
diff --git a/packages/debian.compat b/packages/debian.compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/packages/debian.compat
@@ -0,0 +1 @@
+9
diff --git a/packages/debian.control.in b/packages/debian.control.in
index 9033066..144b4b8 100644
--- a/packages/debian.control.in
+++ b/packages/debian.control.in
@@ -1,37 +1,24 @@
-Source: @PACKAGE_NAME@
-Maintainer: CESNET <rkrejci@cesnet.cz>
+Source: @PACKAGE@
+Maintainer: CESNET <mvasko@cesnet.cz>
 Priority: extra
 Standards-Version: 3.8.2
 Build-Depends: debhelper (>= 9), gcc
-Homepage: https://github.com/CESNET/libnetconf2
+Homepage: @GITHUB_URL@
 
-Package: @PACKAGE_NAME@
-Depends: libyang@PACKAGE_PART_NAME@, libssh-4 (>= 0.7.1), ${shlibs:Depends}
-Conflicts: @CONFLICT_PACKAGE_NAME@
+Package: @PACKAGE@
+Depends: libyang, libssh-4 (>= 0.7.1), libssh-4 (<< 0.9.3) | libssh-4 (>> 0.9.4), ${shlibs:Depends}
 Section: libs
 Architecture: any
-Description: Libnetconf2 is a NETCONF library in C intended for building NETCONF clients and servers.
+Description: @PACKAGE_DESC@
 
-Package: @PACKAGE_NAME@-dev
-Depends: libyang@PACKAGE_PART_NAME@-dev
+Package: @PACKAGE@-dev
+Depends: libyang-dev, @PACKAGE@ (=@LIBNETCONF2_VERSION@)
 Section: libdevel
 Architecture: any
-Description: Headers for libnetconf2 library.
+Description: @PACKAGE_DEV_DESC@
 
-Package: @PACKAGE_NAME@-dbg
-Depends: @PACKAGE_NAME@ (= @LIBNETCONF2_VERSION@)
+Package: @PACKAGE@-dbg
+Depends: @PACKAGE@ (=@LIBNETCONF2_VERSION@)
 Section: debug
 Architecture: any
-Description: Debug symbols for libnetconf2 library.
-
-Package: python3-netconf2@PACKAGE_PART_NAME@
-Depends: @PACKAGE_NAME@ (= @LIBNETCONF2_VERSION@)
-Section: libs
-Architecture: any
-Description: Bindings of libyang library to python3 language.
-
-Package: python3-netconf2@PACKAGE_PART_NAME@-dbg
-Depends: python3-netconf2@PACKAGE_PART_NAME@ (= @LIBNETCONF2_VERSION@)
-Section: debug
-Architecture: any
-Description: Debug symbols of python3 bidings of libnetconf2 library.
+Description: @PACKAGE_DBG_DESC@
diff --git a/packages/debian.copyright b/packages/debian.copyright
new file mode 100644
index 0000000..0d90f79
--- /dev/null
+++ b/packages/debian.copyright
@@ -0,0 +1,27 @@
+Copyright (c) 2015-2020, CESNET
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name of libnetconf2 nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/packages/debian.python3-netconf2.install b/packages/debian.python3-netconf2.install
deleted file mode 100644
index c9a0b54..0000000
--- a/packages/debian.python3-netconf2.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib*/python*/*-packages/*
diff --git a/packages/debian.rules.in b/packages/debian.rules.in
index 3063dd6..646fa5c 100644
--- a/packages/debian.rules.in
+++ b/packages/debian.rules.in
@@ -7,11 +7,10 @@
 	dh $@
 
 override_dh_strip:
-	dh_strip -p@PACKAGE_NAME@ --dbg-package=@PACKAGE_NAME@-dbg
-	dh_strip -ppython3-netconf2@PACKAGE_PART_NAME@ --dbg-package=python3-netconf2@PACKAGE_PART_NAME@-dbg
+	dh_strip -p@PACKAGE@  --dbg-package=@PACKAGE@-dbg
 
 override_dh_auto_configure:
-	cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_PYTHON=ON -DCMAKE_BUILD_TYPE="@BUILD_TYPE@" .
+	cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE="Package" .
 
 override_dh_auto_test:
 	ctest --output-on-failure
diff --git a/packages/libnetconf2.dsc.in b/packages/libnetconf2.dsc.in
index 703ef05..8fbe62d 100644
--- a/packages/libnetconf2.dsc.in
+++ b/packages/libnetconf2.dsc.in
@@ -1,10 +1,10 @@
 Format: 3.0 (quilt)
-Source: @PACKAGE_NAME@
-Binary: @PACKAGE_NAME@, @PACKAGE_NAME@-dbg, @PACKAGE_NAME@-dev, python3-netconf2@PACKAGE_PART_NAME@, python3-netconf2@PACKAGE_PART_NAME@-dbg
-Maintainer: CESNET <rkrejci@cesnet.cz>
+Source: @PACKAGE@
+Binary: @PACKAGE@, @PACKAGE@-dbg, @PACKAGE@-dev
+Maintainer: CESNET <mvasko@cesnet.cz>
 Version: @LIBNETCONF2_VERSION@
 Architecture: any
 Standards-Version: 3.8.2
-Homepage: https://github.com/CESNET/libnetconf2
-Vcs-Git: https://github.com/CESNET/libnetconf2
-Build-Depends: debhelper (>= 9), make, gcc, cmake, pkg-config, libcmocka-dev, libyang@PACKAGE_PART_NAME@-dev, libssh-dev (>= 0.7.1), openssl, python3-dev (>= 3.4)
+Homepage: @GITHUB_URL@
+Vcs-Git: @GITHUB_URL@
+Build-Depends: debhelper (>= 9), make, gcc, cmake, pkg-config, libyang-dev, libcmocka-dev, libssh-dev (>= 0.7.1), openssl
diff --git a/packages/libnetconf2.rpmlintrc b/packages/libnetconf2.rpmlintrc
new file mode 100644
index 0000000..14ec53b
--- /dev/null
+++ b/packages/libnetconf2.rpmlintrc
@@ -0,0 +1 @@
+addFilter("E: shlib-policy-name-error")
diff --git a/packages/libnetconf2.spec.in b/packages/libnetconf2.spec.in
index 16136d5..acce10e 100644
--- a/packages/libnetconf2.spec.in
+++ b/packages/libnetconf2.spec.in
@@ -1,59 +1,68 @@
-Name: @PACKAGE_NAME@
+Name: @PACKAGE@
 Version: @LIBNETCONF2_VERSION@
 Release: 0
-Summary: Libnetconf2 library
-Url: https://github.com/CESNET/libnetconf2
-Source: %{url}/archive/@BRANCH@.tar.gz
+Summary: @PACKAGE_BRIEF@
+Url: @GITHUB_URL@
+Source: @GITHUB_URL@/archive/master.tar.gz
+Source1: @PACKAGE@.rpmlintrc
 License: BSD-3-Clause
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
 
-Requires:  libyang@PACKAGE_PART_NAME@
-BuildRequires:  libyang@PACKAGE_PART_NAME@-devel
+%if 0%{?centos_version} || 0%{?centos_ver} || 0%{?scientificlinux_version}
+Requires:  libssh >= 0.7.1
+%else
+%if 0%{?suse_version}
+Requires:  libssh4 >= 0.7.1
+Requires:  (libssh4 < 0.9.3 or libssh4 > 0.9.4)
+%else
+Requires:  libssh >= 0.7.1
+Requires:  (libssh < 0.9.3 or libssh > 0.9.4)
+%endif
+%endif
+
+Requires:  libyang
+Requires:  openssl
+
+BuildRequires:  cmake
+BuildRequires:  doxygen
+BuildRequires:  libyang-devel
+BuildRequires:  gcc
+BuildRequires:  libcmocka-devel
 BuildRequires:  libssh-devel >= 0.7.1
 BuildRequires:  openssl-devel
-BuildRequires:  cmake
-BuildRequires:  libcmocka-devel
-BuildRequires:  gcc
+
 %if 0%{?suse_version}
 BuildRequires:  timezone
 %endif
 
-%if 0%{?suse_version} + 0%{?fedora} > 0
-BuildRequires:  python3-devel
-%else
-BuildRequires:  python36-devel
-%endif
-Conflicts: @CONFLICT_PACKAGE_NAME@
-
 %package devel
-Summary:    Headers of libnetconf2 library
+Summary:    @PACKAGE_DEV_BRIEF@
 Requires:   %{name} = %{version}-%{release}
 Requires:   libssh-devel
 
-%package -n python3-netconf2@PACKAGE_PART_NAME@
-Summary:    Bindings to python3
-Requires:   %{name} = %{version}-%{release}
-
 %description devel
-Headers of libnetconf2 library.
-
-%description -n python3-netconf2@PACKAGE_PART_NAME@
-Bindings of libnetconf2 library to python3 language.
+@PACKAGE_DEV_DESC@
 
 %description
-Libnetconf2 is a NETCONF library in C intended for building NETCONF clients and servers.
+@PACKAGE_DESC@
 
 %prep
-%setup -n libnetconf2-@BRANCH@
+%setup -n @PACKAGE@-master
+mkdir build
 
 %build
-cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE="@BUILD_TYPE@" -DENABLE_PYTHON=ON -DENABLE_VALGRIND_TESTS=OFF .
+cd build
+cmake -DCMAKE_INSTALL_PREFIX=/usr \
+   -DCMAKE_BUILD_TYPE="Package" \
+   -DENABLE_VALGRIND_TESTS=OFF ..
 make
 
 %check
+cd build
 ctest --output-on-failure
 
 %install
+cd build
 make DESTDIR=%{buildroot} install
 
 %post -p /sbin/ldconfig
@@ -75,8 +84,4 @@
 %{_includedir}/nc_server.h
 %dir %{_includedir}/libnetconf2/
 
-%files -n python3-netconf2@PACKAGE_PART_NAME@
-%defattr(-,root,root)
-/usr/lib*/python*/*-packages/*
-
 %changelog
diff --git a/packages/local-deb.sh.in b/packages/local-deb.sh.in
index afd7302..326a0a9 100755
--- a/packages/local-deb.sh.in
+++ b/packages/local-deb.sh.in
@@ -7,12 +7,12 @@
 cp build-packages/debian.rules debian/rules
 cp build-packages/debian.control debian/control
 echo '9' >debian/compat
-echo '3.0 (quilt)' >debian/source/format 
+echo '3.0 (quilt)' >debian/source/format
 cp "@PROJECT_SOURCE_DIR@/LICENSE" debian/copyright
-cp "@PROJECT_SOURCE_DIR@/packages/debian.libnetconf2-experimental.install" debian/@PACKAGE_NAME@.install
-cp "@PROJECT_SOURCE_DIR@/packages/debian.libnetconf2-experimental-dev.install" debian/@PACKAGE_NAME@-dev.install
-cp "@PROJECT_SOURCE_DIR@/packages/debian.python3-netconf2-experimental.install" debian/python3-netconf2@COMPAT_PACKAGES@.install
-echo -e "@PACKAGE_NAME@ (@LIBNETCONF2_VERSION@) stable; urgency=low\n" >debian/changelog
+cp "@PROJECT_SOURCE_DIR@/packages/debian.@PACKAGE@.install" debian/@PACKAGE@.install
+cp "@PROJECT_SOURCE_DIR@/packages/debian.@PACKAGE@-dev.install" debian/@PACKAGE@-dev.install
+cp "@PROJECT_SOURCE_DIR@/packages/debian.@PYTHON_PACKAGE@.install" debian/@PYTHON_PACKAGE@.install
+echo -e "@PACKAGE@ (@LIBNETCONF2_VERSION@) stable; urgency=low\n" >debian/changelog
 git log -10 --pretty=format:'  * %s (%aN)%n' 2>/dev/null >>debian/changelog || echo -e "  * unknown changes \n" >>debian/changelog
 git log -1 --pretty=format:'%n -- %aN <%aE>  %aD%n' >>debian/changelog 2>/dev/null || echo " -- ${USER} <${USER}@`hostname`>  `date -R`" >>debian/changelog
 debuild --no-lintian -i -b -us -uc
diff --git a/packages/local-rpm.sh.in b/packages/local-rpm.sh.in
index 7aedca0..23cec4a 100755
--- a/packages/local-rpm.sh.in
+++ b/packages/local-rpm.sh.in
@@ -2,13 +2,13 @@
 
 LOCAL_LC_TIME=$LC_TIME
 export LC_TIME="en_US.UTF-8"
-cd "@PROJECT_SOURCE_DIR@" && tar --exclude="@EXCLUDE_BUILD_DIR@" --exclude=./.git* -zcvf "@PROJECT_BINARY_DIR@/@GIT_BRANCH@.tar.gz" . --transform 's/./libnetconf2-@GIT_BRANCH@/'
+cd "@PROJECT_SOURCE_DIR@" && tar --exclude="@EXCLUDE_BUILD_DIR@" --exclude=./.git* -zcvf "@PROJECT_BINARY_DIR@/master.tar.gz" . --transform 's/./@PACKAGE@-master/'
 cd @PROJECT_BINARY_DIR@
 mkdir -p rpms/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}
-mv @GIT_BRANCH@.tar.gz rpms/SOURCES
-cp build-packages/libnetconf2.spec rpms/SPECS
-git log -1 --date=format:'%a %b %d %Y' --pretty=format:"* %ad  %aN <%aE>" 2>/dev/null >>rpms/SPECS/libnetconf2.spec || printf "* `date +"%a %b %d %Y"`  ${USER} <${USER}@`hostname`>" >>rpms/SPECS/libnetconf2.spec
-echo " @LIBNETCONF2_VERSION@" >>rpms/SPECS/libnetconf2.spec
-git log -10 --pretty=format:"- %s (%aN)" >>rpms/SPECS/libnetconf2.spec 2>/dev/null || echo "- unknown changes" >>rpms/SPECS/libnetconf2.spec
-rpmbuild --ba rpms/SPECS/libnetconf2.spec --define "%_topdir @PROJECT_BINARY_DIR@/rpms"
+mv master.tar.gz rpms/SOURCES
+sed -e '7d' build-packages/@PACKAGE@.spec > rpms/SPECS/@PACKAGE@.spec
+git log -1 --date=format:'%a %b %d %Y' --pretty=format:"* %ad  %aN <%aE>" 2>/dev/null >>rpms/SPECS/@PACKAGE@.spec || printf "* `date +"%a %b %d %Y"`  ${USER} <${USER}@`hostname`>" >>rpms/SPECS/@PACKAGE@.spec
+echo " @LIBNETCONF2_VERSION@" >>rpms/SPECS/@PACKAGE@.spec
+git log -10 --pretty=format:"- %s (%aN)" >>rpms/SPECS/@PACKAGE@.spec 2>/dev/null || echo "- unknown changes" >>rpms/SPECS/@PACKAGE@.spec
+rpmbuild --ba rpms/SPECS/@PACKAGE@.spec --define "%_topdir @PROJECT_BINARY_DIR@/rpms"
 export LC_TIME=$LOCAL_LC_TIME
diff --git a/packages/upload-package.sh b/packages/upload-package.sh
index 8344eaf..86ba1a4 100755
--- a/packages/upload-package.sh
+++ b/packages/upload-package.sh
@@ -6,8 +6,8 @@
     exit
 fi
 
-if [ $# -ne 2 ]; then
-    echo "Usage $0 <osb-user> <osb-pass>"
+if [ $# -ne 1 ]; then
+    echo "Usage $0 <osb-user>"
     exit
 fi
 
@@ -17,12 +17,14 @@
 FORCEVERSION=1
 # needed so that the package is even created
 TRAVIS_EVENT_TYPE=cron
-# what package to upload (devel = libnetconf2-experimental, master = libnetconf2)
-TRAVIS_BRANCH=`git branch --show-current`
 
 # OSB login
 osb_user=$1
-osb_pass=$2
+
+# OSB password
+echo -n Password:
+read -s osb_pass
+echo
 
 # create and upload the package
 . ./packages/create-package.sh