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

[Draft] Apt debian packages #2541

Closed

Conversation

AndrewQuijano
Copy link
Contributor

@AndrewQuijano AndrewQuijano commented Nov 10, 2024

Your checklist for this pull request

  • I've documented or updated the documentation of every API function and struct this PR changes.
  • I've added tests that prove my fix is effective or that my feature works (if possible)

Detailed description

Based on the original PR #2521, I created a Debian package that created everything needed to run capstone. However, it would be nice to be able to update the Debian package repositories too. So I will be working on the steps to create the updated libcapstone5, libcapstone6, and libcapstone-dev packages to be relatively identical to the current outdated versions in Ubuntu.
...

Test plan

Based on a prior PR, I am essentially using these same tests to confirm the packages that would be sent to Debian/Ubuntu work as intended.

...

Closing issues

closes #2537
...

@AndrewQuijano AndrewQuijano marked this pull request as draft November 10, 2024 04:04
@AndrewQuijano
Copy link
Contributor Author

At the moment, I get /usr/local/lib/libcapstone.so.6.0. My question is, where is the .so.6.0 being populated? Should a fix be made to have the files only be in a format like libcapstone.so.5, libcapstone.so.6, etc?

With that said, I will have to assume the version based as an argument is correct in populating the control file

@AndrewQuijano
Copy link
Contributor Author

I suspect I also need to update capstone.pc to point from /usr/local to /usr? Once again, the main question is how would the plan be to update these new packages to Ubuntu/Debian.

@Rot127 Rot127 added this to the v6 - Beta milestone Nov 10, 2024
@Rot127
Copy link
Collaborator

Rot127 commented Nov 10, 2024

Should a fix be made to have the files only be in a format like libcapstone.so.5, libcapstone.so.6, etc?

You can check the Debian package naming conventions for details. The revision version must be part of the name apparently (docs, dpkg-name and more details).

I suspect I also need to update capstone.pc to point from /usr/local to /usr?

As I see it, it should install directly into /usr/lib (see: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html). So the current implementation (installing into /usr/local) is wrong. Can you please open another PR to fix it?

Copy link
Collaborator

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move all packaging related files into packages/deb/

@Rot127
Copy link
Collaborator

Rot127 commented Nov 10, 2024

@AndrewQuijano I looked into your questions in detail and found actually more than one problem. I am sorry that I did not review more thoroughly before. I also never worked with deb packages until now, was in a rush due to other things and oversaw quite some problems.
Thank you for asking about these problems, otherwise I would have missed them.

The issues I found are the following:

  • We didn't added all mandatory fields to the control file.
  • Architecture in the control file was incorrectly set to all.
  • As you already said, the package should be installed into /usr/.
  • The generated package misses the dependency information.
  • The package name was not according to the Debian standard.
  • Hash sums missing

I tried fixing some of them, but quickly recognized that it gets out of hand quickly. And for Capstone we need a more complete approach.

As it looks like, the original script, you used as a basis, was never meant to generate a deb package for the official Debian/Ubuntu repositories. This would also explain why it was lacking so many things.

Unfortunately, we cannot provide a package which is this much incomplete for the release. In #2543 I removed it from the release CI, but kept your work in packages/deb/. Also you can trigger the package build by dispatching the new Build Debian Package workflow.

Because your initial idea was to ease the install in PANDA, I would see two solutions for this:

  1. Fork the Capstone repository for PANDA and redo the package generation there. You can easily do a release in this fork and download the package for PANDA from it.
  2. If you want to have a deb package in the official Ubuntu/Debian repositories, I would ask you to do the implementation from scratch. This time though by using CPack. And with CPack we can also generate packages for other distros. Also we have a certain guarantee that the built packages are correct.
    If you do so, please first submit the package to the Debian packages and wait for approval. Then we can merge it here.

I am sorry again I didn't properly reviewed the first PR, due to my lag of knowledge about Debian packages.

@Rot127 Rot127 closed this Nov 10, 2024
@AndrewQuijano AndrewQuijano deleted the apt-debian-packages branch November 14, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate Debian Package generation for Ubuntu apt repos
2 participants