Create deb file python




















Connect and share knowledge within a single location that is structured and easy to search. I want to create a DEB file manually. I would like to just provide a folder which contains data to install, and a script to be executed after installation.

My recommendation is to make a source package. Install build-essential , debhelper , dh-make. Answer the questions. Debhelper will create the basic infrastructure needed to build a package by generating files in a subdirectory called debian , both some mandatory files and templates for optional files. You may need to modify some of these files:. Run dpkg-buildpackage -rfakeroot -us -uc to build the.

If you decide to make a binary package directly without building it from a source package, which is not really easier because there aren't as many tools to facilitate the process, you'll need some basic familiarity with the format of deb packages.

It is described in the Debian Policy Manual , in particular ch. You don't need these if you're only going to use the package in-house, but it's better to have them.

If you have the Debian tools available, use dpkg-deb to construct the package. In the directory containing the data to install, add a directory called DEBIAN at the top level, containing the control files and maintainer scripts. If you don't have the Debian tools, build an archive of the files you want to package called data. You need at least a control file with the fields Package , Maintainer , Priority , Architecture , Installed-Size , Version , and any necessary dependency declaration.

The script to be executed after installation is called postinst. Be sure to make it executable. It goes alongside control. If you already have a binary package from another distribution, you can use alien to convert it. First off you need to create a build folder and an archive of your files: tar czvf data.

Then you can add independently preinst, postint, prerm and postrm shell scripts to control pre and post install and pre and post remove behaviour of the. Then you need a debian-binary file: echo 2. In your build folder you should have now these files: debian-binary control. Finally you need ar package to create the.

In the long description it should not exceed 80characters per line. The rules file:! Also not that you use tab before dh, not spaces The other files can be left empty. Finally lets create a deb package. Goto mymood top level direcotry and build package. Use ubuntu softare center. Previous post Next post.

About Micropyramid. Need any Help in your Project? Improve this answer. Anil Kumar Anil Kumar 1 1 silver badge 5 5 bronze badges. For me this just made a tar. To make an installable deb package this worked for me: sudo python3 setup.

Urban48 Urban48 1, 12 12 silver badges 26 26 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Note: I have completely breezed over the notion of local Python development best practices. I highly recommend that locally you develop in a virtual environment and maintain your dependencies in a requirements. More on this in PyPA docs for requirements files.

At this point we now have something that we should be able to pip install. This allows us to push our deb source packages to Launchpad and have the platform build the software for distribution. One way to think of a PPA is as a hosted package repository.

Another nice feature of using a PPA to host your packages is that they are first-class citizens with much of the Ubuntu tooling. In order to use your own PPA on Launchpad, there are a few things that you need to do to get this up and running:. The last two items are done in your Launchpad account page.

There are other things you could do here as well. For instance, to work with git repositories hosted on Launchpad this is where you would upload your public SSH key s. Ubuntu has a great guide on the specifics of setting up your environment, I highly recommend you read it for specifics. Start by creating a debian dir in the root of the repo.



0コメント

  • 1000 / 1000