aboutsummaryrefslogtreecommitdiffstats
path: root/mkdeb.sh.in
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-05-10 15:47:44 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-06-30 05:30:14 -0300
commit011d84b462a78703b9b939cb5e48b4cc75ebe015 (patch)
treefe2ad82e289323a7749191a6e8f719b011e2b937 /mkdeb.sh.in
parentTransmission fixes: drop private-lib (#5213) (diff)
downloadfirejail-011d84b462a78703b9b939cb5e48b4cc75ebe015.tar.gz
firejail-011d84b462a78703b9b939cb5e48b4cc75ebe015.tar.zst
firejail-011d84b462a78703b9b939cb5e48b4cc75ebe015.zip
build: reduce autoconf input files from 32 to 2
Configure summary: autoconf essentially only parses configure.ac and generates the configure script (that is, the "./configure" shell script). The latter is what actually checks what is available on the system and internally sets the value of the output variables. It then, for every filename foo in AC_CONFIG_FILES (and for every output variable name BAR in AC_SUBST), reads foo.in, replaces every occurrence of `@BAR@` with the value of the shell variable `$BAR` and generates the file foo from the result. After this, configure is finished and `make` could be executed to start the build. Now that (as of #5140) all output variables are only defined on config.mk.in and on config.sh.in, there is no need to generate any makefile nor any other mkfile or shell script at configure time. So rename every "Makefile.in" to "Makefile", mkdeb.sh.in to mkdeb.sh, src/common.mk.in to src/common.mk and leave just config.mk and config.sh as the files to be generated at configure time. This allows editing and committing all makefiles directly, without potentially having to run ./configure in between. Commands used to rename the makefiles: $ git ls-files -z -- '*Makefile.in' | xargs -0 -I '{}' sh -c \ "git mv '{}' \"\$(dirname '{}')/Makefile\"" Additionally, from my (rudimentary) testing, this commit reduces the time it takes to run ./configure by about 20~25% compared to commit 72ece92ea ("Transmission fixes: drop private-lib (#5213)", 2022-06-22). Environment: dash 0.5.11.5-1, gcc 12.1.0-2, Artix Linux, ext4 on an HDD. Commands used for benchmarking each commit: $ : >time_configure && ./configure && make distclean && for i in $(seq 1 10); do { time -p ./configure; } 2>>time_configure; done $ grep real time_configure | awk '{ total += $2 } END { print total/NR }'
Diffstat (limited to 'mkdeb.sh.in')
-rwxr-xr-xmkdeb.sh.in61
1 files changed, 0 insertions, 61 deletions
diff --git a/mkdeb.sh.in b/mkdeb.sh.in
deleted file mode 100755
index a98261ba6..000000000
--- a/mkdeb.sh.in
+++ /dev/null
@@ -1,61 +0,0 @@
1#!/bin/sh
2# This file is part of Firejail project
3# Copyright (C) 2014-2022 Firejail Authors
4# License GPL v2
5
6# based on http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/
7# a code archive should already be available
8
9set -e
10
11. "$(dirname "$0")/config.sh"
12
13EXTRA_VERSION=$1
14
15test "$#" -gt 0 && shift
16
17CODE_ARCHIVE="$NAME-$VERSION.tar.xz"
18CODE_DIR="$NAME-$VERSION"
19INSTALL_DIR="${INSTALL_DIR}${CODE_DIR}/debian"
20DEBIAN_CTRL_DIR="${DEBIAN_CTRL_DIR}${CODE_DIR}/debian/DEBIAN"
21
22echo "*****************************************"
23echo "code archive: $CODE_ARCHIVE"
24echo "code directory: $CODE_DIR"
25echo "install directory: $INSTALL_DIR"
26echo "debian control directory: $DEBIAN_CTRL_DIR"
27echo "*****************************************"
28
29tar -xJvf "$CODE_ARCHIVE"
30#mkdir -p "$INSTALL_DIR"
31cd "$CODE_DIR"
32./configure --prefix=/usr "$@"
33make -j2
34mkdir debian
35DESTDIR=debian make install-strip
36
37cd ..
38echo "*****************************************"
39SIZE="$(du -s "$INSTALL_DIR")"
40echo "install size $SIZE"
41echo "*****************************************"
42
43mv "$INSTALL_DIR/usr/share/doc/firejail/RELNOTES" "$INSTALL_DIR/usr/share/doc/firejail/changelog.Debian"
44gzip -9 -n "$INSTALL_DIR/usr/share/doc/firejail/changelog.Debian"
45rm "$INSTALL_DIR/usr/share/doc/firejail/COPYING"
46install -m644 "$CODE_DIR/platform/debian/copyright" "$INSTALL_DIR/usr/share/doc/firejail/."
47mkdir -p "$DEBIAN_CTRL_DIR"
48sed "s/FIREJAILVER/$VERSION/g" "$CODE_DIR/platform/debian/control.$(dpkg-architecture -qDEB_HOST_ARCH)" > "$DEBIAN_CTRL_DIR/control"
49
50mkdir -p "$INSTALL_DIR/usr/share/lintian/overrides/"
51install -m644 "$CODE_DIR/platform/debian/firejail.lintian-overrides" "$INSTALL_DIR/usr/share/lintian/overrides/firejail"
52
53find "$INSTALL_DIR/etc" -type f | sed "s,^$INSTALL_DIR,," | LC_ALL=C sort > "$DEBIAN_CTRL_DIR/conffiles"
54chmod 644 "$DEBIAN_CTRL_DIR/conffiles"
55find "$INSTALL_DIR" -type d -exec chmod 755 '{}' +
56cd "$CODE_DIR"
57fakeroot dpkg-deb --build debian
58lintian --no-tag-display-limit debian.deb
59mv debian.deb "../firejail_${VERSION}${EXTRA_VERSION}_1_$(dpkg-architecture -qDEB_HOST_ARCH).deb"
60cd ..
61rm -fr "$CODE_DIR"