Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Debian package with AA and SELinux options #3414

Merged
merged 1 commit into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ firejail-users.5
firejail.1
firemon.1
firecfg.1
mkdeb.sh
src/firejail/firejail
src/firemon/firemon
src/firecfg/firecfg
Expand Down
6 changes: 3 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ uninstall:
rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg
@echo "If you want to install a different version of firejail, you might also need to run 'rm -fr $(DESTDIR)/$(sysconfdir)/firejail', see #2038."

DISTFILES = "src etc m4 platform contrib configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh mkdeb-apparmor.sh COPYING README RELNOTES"
DISTFILES = "src etc m4 platform contrib configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh.in COPYING README RELNOTES"
DISTFILES_TEST = "test/apps test/apps-x11 test/apps-x11-xorg test/root test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils test/chroot"

dist:
Expand All @@ -202,10 +202,10 @@ dist:
asc:; ./mkasc.sh $(VERSION)

deb: dist
./mkdeb.sh $(NAME) $(VERSION)
./mkdeb.sh

deb-apparmor: dist
./mkdeb-apparmor.sh $(NAME) $(VERSION)
./mkdeb.sh -apparmor

test-compile: dist
cd test/compile; ./compile.sh $(NAME)-$(VERSION)
Expand Down
8 changes: 8 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4186,6 +4186,8 @@ if test "$prefix" = /usr; then
test "$sysconfdir" = '${prefix}/etc' && sysconfdir="/etc"
fi

ac_config_files="$ac_config_files mkdeb.sh"

ac_config_files="$ac_config_files Makefile src/common.mk src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile src/fnetfilter/Makefile src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile src/fsec-print/Makefile src/ftee/Makefile src/faudit/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile src/fsec-optimize/Makefile src/profstats/Makefile"

cat >confcache <<\_ACEOF
Expand Down Expand Up @@ -4895,6 +4897,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"mkdeb.sh") CONFIG_FILES="$CONFIG_FILES mkdeb.sh" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/common.mk") CONFIG_FILES="$CONFIG_FILES src/common.mk" ;;
"src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;;
Expand Down Expand Up @@ -5333,6 +5336,11 @@ which seems to be undefined. Please make sure it is defined" >&2;}

esac


case $ac_file$ac_mode in
"mkdeb.sh":F) chmod +x mkdeb.sh ;;

esac
done # for ac_tag


Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ if test "$prefix" = /usr; then
test "$sysconfdir" = '${prefix}/etc' && sysconfdir="/etc"
fi

AC_CONFIG_FILES([mkdeb.sh], [chmod +x mkdeb.sh])
AC_OUTPUT(Makefile src/common.mk src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile src/fnetfilter/Makefile \
src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile src/fsec-print/Makefile \
src/ftee/Makefile src/faudit/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile src/fsec-optimize/Makefile \
Expand Down
56 changes: 0 additions & 56 deletions mkdeb.sh

This file was deleted.

24 changes: 19 additions & 5 deletions mkdeb-apparmor.sh → mkdeb.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,24 @@
# a code archive should already be available

set -e
NAME=@PACKAGE_NAME@
VERSION=@PACKAGE_VERSION@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
HAVE_APPARMOR=@HAVE_APPARMOR@
HAVE_SELINUX=@HAVE_SELINUX@
EXTRA_VERSION=$1

CONFIG_ARGS="--prefix=/usr"
if [ -n "$HAVE_APPARMOR" ]; then
CONFIG_ARGS="$CONFIG_ARGS --enable-apparmor"
fi
if [ -n "$HAVE_SELINUX" ]; then
CONFIG_ARGS="$CONFIG_ARGS --enable-selinux"
fi

TOP=`pwd`
CODE_ARCHIVE="$1-$2.tar.xz"
CODE_DIR="$1-$2"
CODE_ARCHIVE="$NAME-$VERSION.tar.xz"
CODE_DIR="$NAME-$VERSION"
INSTALL_DIR="${INSTALL_DIR}${CODE_DIR}/debian"
DEBIAN_CTRL_DIR="${DEBIAN_CTRL_DIR}${CODE_DIR}/debian/DEBIAN"

Expand All @@ -24,7 +38,7 @@ echo "*****************************************"
tar -xJvf $CODE_ARCHIVE
#mkdir -p $INSTALL_DIR
cd $CODE_DIR
./configure --prefix=/usr --enable-apparmor
./configure $CONFIG_ARGS
make -j2
mkdir debian
DESTDIR=debian make install-strip
Expand All @@ -40,7 +54,7 @@ gzip -9 -n $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian
rm $INSTALL_DIR/usr/share/doc/firejail/COPYING
install -m644 platform/debian/copyright $INSTALL_DIR/usr/share/doc/firejail/.
mkdir -p $DEBIAN_CTRL_DIR
sed "s/FIREJAILVER/$2/g" platform/debian/control.$(dpkg-architecture -qDEB_HOST_ARCH) > $DEBIAN_CTRL_DIR/control
sed "s/FIREJAILVER/$VERSION/g" platform/debian/control.$(dpkg-architecture -qDEB_HOST_ARCH) > $DEBIAN_CTRL_DIR/control

mkdir -p $INSTALL_DIR/usr/share/lintian/overrides/
install -m644 platform/debian/firejail.lintian-overrides $INSTALL_DIR/usr/share/lintian/overrides/firejail
Expand All @@ -51,6 +65,6 @@ find $INSTALL_DIR -type d | xargs chmod 755
cd $CODE_DIR
fakeroot dpkg-deb --build debian
lintian debian.deb
mv debian.deb ../firejail-apparmor_$2_1_$(dpkg-architecture -qDEB_HOST_ARCH).deb
mv debian.deb ../firejail_${VERSION}${EXTRA_VERSION}_1_$(dpkg-architecture -qDEB_HOST_ARCH).deb
cd ..
rm -fr $CODE_DIR