debian: Add script for updating shared library package names

It should be run prior to major release after the new shared library
versions are set for cmake.

Change-Id: I5cf2a3a9121672c8be14e57a318c9eaf5105e622
Signed-off-by: Balint Reczey <balint.reczey@canonical.com>
Reviewed-on: https://code.wireshark.org/review/22967
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Petri-Dish: Balint Reczey <balint@balintreczey.hu>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Balint Reczey 2017-08-05 12:32:37 +02:00 committed by Michael Mann
parent c6a23a4b72
commit 5580b3beb7
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
#!/bin/sh
#
# Compare ABIs of two Wireshark working copies
#
# Copyright 2017 Balint Reczey <balint.reczey@canonical.com>
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Set shared library package names and library versions in Debian packaging
# matching the new major release's so versions
set -e
for i in wireshark wiretap wscodecs wsutil; do
NEW_VERSION=$(grep SOVERSION $(grep -l lib${i} */CMakeLists.txt) | sed 's/.*SOVERSION \([0-9]*\).*/\1/')
rename "s/0\./${NEW_VERSION}./" debian/lib${i}0.*
grep -l -R "lib${i}0" debian/ | xargs sed -i "s/lib${i}0/lib${i}${NEW_VERSION}/"
grep -l -R "lib${i}\.so\.0" debian/ | xargs sed -i "s/lib${i}\.so\.0/lib${i}.so.${NEW_VERSION}/"
done