Skip to content

Commit

Permalink
Much more compliant with Debian standards for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Dec 6, 2024
1 parent 02d933a commit 65cc54a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
23 changes: 18 additions & 5 deletions panda/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,29 @@ COPY --from=panda /tmp/base_dep.txt /tmp
COPY --from=panda /tmp/build_dep.txt /tmp

# Set up /package-root with files from panda we'll package
COPY --from=panda /usr/local/bin/panda* /usr/local/bin/libpanda* /usr/local/bin/qemu-img /package-root/usr/local/bin/
COPY --from=panda /usr/local/etc/panda /package-root/usr/local/etc/panda
COPY --from=panda /usr/local/lib/panda /package-root/usr/local/lib/panda
COPY --from=panda /usr/local/share/panda /package-root/usr/local/share/panda
RUN mkdir -p /package-root/etc/panda
RUN mkdir -p /package-root/usr/lib/x86_64-linux-gnu/panda
RUN mkdir -p /package-root/usr/share/doc/panda
COPY --from=panda /usr/local/bin/panda* /usr/bin/libpanda* /usr/bin/qemu-img /package-root/usr/bin/
COPY --from=panda /usr/local/etc/panda /package-root/etc/panda
COPY --from=panda /usr/local/lib/panda /package-root/usr/lib/x86_64-linux-gnu/panda
COPY --from=panda /usr/local/share/panda /package-root/usr/share/panda

# Copy documentation over, we should have a better Changelog if we go for official release?
COPY ./LICENSE /package-root/usr/share/doc/panda
COPY ./README.md /package-root/usr/share/doc/panda

# Create DEBIAN directory and control file
COPY control /package-root/DEBIAN/control

# Update control file with the correct version
# Generate MD5 checksums for all files and save to DEBIAN/md5sums
RUN cd /package-root && \
find . -type f ! -path './DEBIAN/*' -exec md5sum {} + | sed 's| \./| |' > /package-root/DEBIAN/md5sums

# Update control file with the correct version, and place installed size
ARG PACKAGE_VERSION
RUN INSTALLED_SIZE=$(du -sk /package-root | cut -f1) && \
sed -i "s/^Installed-Size:.*/Installed-Size: ${INSTALLED_SIZE}/" /package-root/DEBIAN/control
RUN sed -i "s/^Version:.*/Version: ${PACKAGE_VERSION}/" /package-root/DEBIAN/control

# Update control file with dependencies
Expand Down
12 changes: 9 additions & 3 deletions panda/debian/control
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
Package: pandare
Package: panda
Source: MITLL
Version: <version-placeholder>
Architecture: all
Architecture: amd64
BUILD_DEPENDS_LIST
DEPENDS_LIST
Maintainer: Andrew Fasano <fasano@mit.edu>
Maintainer: Luke Craig <luke.craig@ll.mit.edu>
Installed-Size: <size-in-kb>
Section: devel
Priority: optional
Multi-Arch: same
Homepage: https://panda.re/
Description: dynamic analysis platform
Platform for Architecture Neutral Dynamic Analysis (PANDA) is a processor
emulator designed to support analyses of guest code. PANDA supports record-
Expand Down

0 comments on commit 65cc54a

Please sign in to comment.