Packaging+GitLab CI: Move debian to the packaging directory.

We keep our various packaging assets in the "packaging" directory. Move
the Debian assets there. dpkg-buildpackage doesn't seem appear to have a
"debian directory path" option, but symlinking worked in my test
container.
This commit is contained in:
Gerald Combs 2022-02-10 11:17:23 -08:00
parent 4e3b2ec007
commit 79da670bd1
85 changed files with 37 additions and 29 deletions

3
.gitignore vendored
View File

@ -151,6 +151,9 @@ compile_commands.json
# Qt Creator
CMakeLists.txt.user*
# Debian packaging
debian/
# Misc #
########
.vagrant

View File

@ -221,6 +221,7 @@ Debian Stable APT Package:
rules: !reference [.if-merged]
image: registry.gitlab.com/wireshark/wireshark-containers/debian-stable-dev
script:
- ln --symbolic --no-dereference --force packaging/debian
- perl tools/make-version.pl --set-release
# Shared GitLab runners limit the log size to 4M, so reduce verbosity. See
# https://gitlab.com/gitlab-com/support-forum/issues/2790
@ -303,6 +304,7 @@ Ubuntu APT Package:
script:
# build-ubuntu puts us in `build`.
- cd ..
- ln --symbolic --no-dereference --force packaging/debian
- CC=/usr/lib/ccache/gcc CXX=/usr/lib/ccache/g++ MAKE=ninja dpkg-buildpackage -us -uc -rfakeroot -jauto -Zgzip -zfast
- mkdir ubuntu-packages
- mv ../*.deb ubuntu-packages/

View File

@ -1,3 +0,0 @@
usr/share/wireshark/*
etc/wireshark/init.lua
debian/maxmind_db_paths /usr/share/wireshark

View File

@ -331,7 +331,7 @@ Apt should take care of all of the dependency issues for you.
====
By installing Wireshark packages non-root, users wont gain rights automatically
to capture packets. To allow non-root users to capture packets follow the
procedure described in {wireshark-code-file-url}debian/README.Debian
procedure described in {wireshark-code-file-url}packaging/debian/README.Debian
(file:///usr/share/doc/wireshark-common/README.Debian.gz[/usr/share/doc/wireshark-common/README.Debian.gz])
====

View File

@ -9,6 +9,7 @@ Comment: Wireshark and the "fin" logo are trademarks of Gerald Combs.
License: GPL-2+
Files: debian/*
packaging/debian/*
Copyright: 1998-2008 Frederic Peters <fpeters@debian.org>
2005-2009 Joost Yervante Damad <andete@debian.org>
2009-2017 Balint Reczey <balint@balintreczey.hu>

View File

@ -0,0 +1,3 @@
usr/share/wireshark/*
etc/wireshark/init.lua
packaging/debian/maxmind_db_paths /usr/share/wireshark

View File

@ -42,21 +42,21 @@ def create_files(version, deb, email, asn, name, iso, rfc):
"""Create all files for the .deb build process."""
base = asn.lower()[:-5]
if not os.path.isdir("debian"):
os.mkdir("debian")
if not os.path.isdir("packaging/debian"):
os.mkdir("packaging/debian")
create_file("debian/rules", """#!/usr/bin/make -f
create_file("packaging/debian/rules", """#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
PREFIX=`pwd`/debian/wireshark-asn1-%s
PREFIX=`pwd`/packaging/debian/wireshark-asn1-%s
binary-post-install/wireshark-asn1-%s::
rm -f $(PREFIX)/usr/lib/wireshark/plugins/%s/*.a
""" % (base, base, version), 0o755)
create_file("debian/control", """Source: wireshark-asn1-%s
create_file("packaging/debian/control", """Source: wireshark-asn1-%s
Section: net
Priority: optional
Maintainer: %s <%s>
@ -72,7 +72,7 @@ Description: ASN.1/BER dissector for %s
Notation 1) file '%s.asn1'.
""" % (base, name, email, base, deb, base, base))
create_file("debian/changelog",
create_file("packaging/debian/changelog",
"""wireshark-asn1-%s (0.0.1-1) unstable; urgency=low
* Automatically created package.
@ -80,7 +80,7 @@ Description: ASN.1/BER dissector for %s
-- %s <%s> %s
""" % (base, name, email, rfc + "\n (" + iso + ")"))
create_file("debian/copyright",
create_file("packaging/debian/copyright",
"""This package has been created automatically be asn2deb on
%s for Debian GNU/Linux.

View File

@ -17,7 +17,8 @@ fi
DIST=$1
VERSION=$(git describe --tags | sed 's/v//;s/-/~/g;s/rc/~rc/')
rm debian/changelog || true
ln --symbolic --no-dereference --force packaging/debian ./debian
rm packaging/debian/changelog || true
EDITOR=touch dch -p --package wireshark --create --force-distribution -v${VERSION}~${DIST}1 -D $DIST
sed -i 's/\* Initial release.*/* Nightly build for '${DIST^}'/' debian/changelog
sed -i 's/\* Initial release.*/* Nightly build for '${DIST^}'/' packaging/debian/changelog
dpkg-buildpackage -S -d

View File

@ -34,21 +34,21 @@ def create_files(version, deb, email, idl, name, preserve, iso, rfc):
"""Create all files for the .deb build process."""
base = os.path.basename(idl.lower().split(".idl")[0])
if not os.path.isdir("debian"):
os.mkdir("debian")
if not os.path.isdir("packaging/debian"):
os.mkdir("packaging/debian")
create_file(preserve, "debian/rules", """#!/usr/bin/make -f
create_file(preserve, "packaging/debian/rules", """#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
PREFIX=`pwd`/debian/wireshark-giop-%s
PREFIX=`pwd`/packaging/debian/wireshark-giop-%s
binary-post-install/wireshark-giop-%s::
rm -f $(PREFIX)/usr/lib/wireshark/plugins/%s/*.a
""" % (base, base, version), 0o755)
create_file(preserve, "debian/control", """Source: wireshark-giop-%s
create_file(preserve, "packaging/debian/control", """Source: wireshark-giop-%s
Section: net
Priority: optional
Maintainer: %s <%s>
@ -65,7 +65,7 @@ Description: GIOP dissector for CORBA interface %s
in the IDL (Interface Definition Language) file '%s.idl'.
""" % (base, name, email, base, deb, base, base))
create_file(preserve, "debian/changelog",
create_file(preserve, "packaging/debian/changelog",
"""wireshark-giop-%s (0.0.1-1) unstable; urgency=low
* Automatically created package.
@ -73,7 +73,7 @@ Description: GIOP dissector for CORBA interface %s
-- %s <%s> %s
""" % (base, name, email, rfc))
create_file(preserve, "debian/copyright",
create_file(preserve, "packaging/debian/copyright",
"""This package has been created automatically by idl2deb on
%s for Debian GNU/Linux.

View File

@ -506,13 +506,13 @@ sub update_docinfo_asciidoc
}
}
# Read debian/changelog, then write back out an updated version.
# Read packaging/debian/changelog, then write back out an updated version.
sub update_debian_changelog
{
my $line;
my $contents = "";
my $version = "";
my $filepath = "$src_dir/debian/changelog";
my $filepath = "$src_dir/packaging/debian/changelog";
open(CHANGELOG, "< $filepath") || die "Can't read $filepath!";
while ($line = <CHANGELOG>) {
@ -782,7 +782,7 @@ Print the vcs version to standard output
Set the major, minor, and micro versions in the top-level
CMakeLists.txt, configure.ac, docbook/attributes.adoc,
debian/changelog, and the CMakeLists.txt for all libraries
packaging/debian/changelog, and the CMakeLists.txt for all libraries
to the provided version number.
=item --set-release, -r

View File

@ -9,18 +9,19 @@
# The pathname wildcards allowed are: '*', '?', character set '[abc]' or
# negated with '[!abc]'.
cli_main.c
doc/packet-PROTOABBREV.c
epan/dissectors/asn1/*/packet-*-template.c
epan/dissectors/asn1/*/*asn
epan/dissectors/asn1/*/packet-*-template.c
epan/dissectors/packet-http.c
epan/nghttp2/*
epan/wmem/wmem_strbuf.c
epan/wmem/wmem_strutil.c
epan/wslua/init_wslua.c
extcap/*
image/stock_icons/*
cli_main.c
mmdbresolve.c
packaging/*
tools/lemon/*
wsutil/file_util.h
wsutil/strptime.c
epan/dissectors/packet-http.c

View File

@ -17,7 +17,7 @@ set -e
for i in codecs wireshark wiretap 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}/"
rename "s/0\\./${NEW_VERSION}./" packaging/debian/lib${i}0.*
grep -l -R "lib${i}0" packaging/debian/ | xargs sed -i "s/lib${i}0/lib${i}${NEW_VERSION}/"
grep -l -R "lib${i}\\.so\\.0" packaging/debian/ | xargs sed -i "s/lib${i}\\.so\\.0/lib${i}.so.${NEW_VERSION}/"
done