📜 ⬆️ ⬇️

Simplifying is difficult - to complicate is easy. GUI program for creating deb-packages

Perhaps the wrath of aesthetes linux, vim, mc will fall upon me. But I will say right away, we used it - we know. Collect the deb-package, so for a beginner, so we will not complicate his life by learning vim and mc, but simply give further click with the mouse. Who is interested in the question of simplifying the creation of binary deb-packages and is not afraid to compile using qtcreator itself, welcome under the cat

How did it start


Inspired by the article about creating deb-packages, I sat down to collect packages ... After the 10th package, admit 4 open MCs made me think that you still need a gui tool. Of course, the giftwrap was immediately installed, the first pages of the customizer were quickly filled, and then it was discovered that the scripts should be dragged again inside the DEBIAN folder.

I came in a little bewilderment. Why it was impossible to simply make the ability to select a file from anywhere? Well, never mind, copy it. So, you need to register folders in DEBIAN / dirs. Stop, but where to write? Well, neither of which, I also have vim and mc. Again vim + mc for changelog ...

Enough GiftWrap upset me. Then I decided to spend the evening and write a simple and realizing greater opportunities than GiftWrap utility. (Of course, laziness to do it in the old-fashioned hands did not affect such a decision).
')

Preparation for epic music


As the development environment, it was decided to use QtCreator, my favorite environment, and as a framework for QtSdk 5.7. For version control was called up git selected.

Obviously, after reading the article , that difficulties in writing code should not arise, however, I immediately identified the main steps for myself:

  1. Create widgets to edit files.
  2. We collect widgets to a heap in the master of creation of packages
  3. We assemble the package by checking the availability of programs

Everything is trivial and simple, but there is still 1 question left, the answer to which I wanted to hear from you, dear Khabrovchane and Khabrovchanka. How more convenient to make a collector:

  1. Assembly wizard, based on windows installer (hereinafter, hereinafter, ready)
  2. Assembly wizard with tabs (top, bottom, left, right)

But at the time of creating the program, I didn’t bother myself (the main window can always be redone) and chose the first path.

The program is currently used only on several machines, used by a small number of people. The need to collect source packages was absent, therefore, and was not implemented. It is located in the source for here .

What happened in the end


After starting the program, we can enjoy see the starting window asking us to enter the path to the sysroot of our package. The assembly of the sysroot itself was stupid to include (IMHO) in the program, since the midnight commander or the same thunar would handle it perfectly well.



Also, if you go to the “General” menu and select “Settings”, we will be able to:

  1. Set path for saving packages
  2. Number of pop-up lines "Previous directories"
  3. Set for all packages the name of the package collector and e-mail

Finished settings, chose a folder - clicked continue - went to the present miracles settings.

The package name, version, etc. We all know this well from the Article , but the moment that the program will write the changes made here to the file immediately by clicking the Next button is worth noting now. Although it is possible to go back, the file after clicking “Next” will already be changed!

I will not describe the parameters in detail, they are described in many places, I will note only a few convenient moments in the program: in the changelog window, after the example, there is a line where the name, mail of the package creator and the time of creation are recorded. It’s convenient to copy and paste at the end of your changelog entry.

In the scripts window, the default names of the scripts are: preinst, postinst, prerm, postrm .
If they are already in the sysroot / DEBIAN directory, then nothing will be done, if you want to drag them outside, the selected files will be copied and renamed, depending on the field selection.

The end of the program


At the end, after successfully assembling the package, the user is prompted to use lintian for verification.

Frankly, rarely when it was useful, or the package was not intended at all, or if lintian wrote any errors, there were simply no problems with its installation ...

But still, having decided to check the package, nothing bad will happen. The current window will show lintian output when checking the created deb package.



This label is selectable, so copy the warning or error and look in the search engine to find out how to fix this problem.

Afterword


I do not pretend that debCreator is the only good gui packet scribe. Also, I'm not saying that there are no glitches and problems in it. However, me and the people who are already working with him, he saved a lot of time, and yet he was still writing and writing ...

I look forward to reading the implementation tips, and suggestions for modernization, in the comments or issues .

TODO List


This will be amended, which will soon be implemented:

  1. auto complete confiles

Source: https://habr.com/ru/post/318594/


All Articles