Recent

Author Topic: Making a .DEB?  (Read 4575 times)

KarenT

  • Full Member
  • ***
  • Posts: 120
Making a .DEB?
« on: June 23, 2017, 07:12:49 pm »
I tried searching here but Search finds "debug" everywhere. I found a laz plug-in that was 5-years old and the contributor mentions that it will not work with Lazarus 1.

So, good people, my program is complete (for now) so how do I create a .deb file so I can put it on our two other Ubuntu PCs? It is not for general distribution as it manages Pop's greenhouse heating, cooling and venting.

I have dutifully used all the "correct" folders for the working copy, ".config/myApp" and ".config/myApp/Database" so how do I create a .deb file?

Searching online I found the Debian Wiki on building .debs and would need to be a rocket scientist to follow. And, that, I am not.

Probably naive of me, but I have tho believe there must be a packager out there somewhere. I might even be able to spare a few dollars for one. If not too expensive with pocket money negotiations being what they are.

Waiting for enlightenment from the knowledgeable folk here.

AnthonyTekatch

  • Jr. Member
  • **
  • Posts: 78
Re: Making a .DEB?
« Reply #1 on: June 23, 2017, 08:06:56 pm »
I use checkinstall which you can get from the debian repository, it works very well to make .DEB files.

Here is a Makefile that I use, put your own install code in then type make deb to run:
Code: Pascal  [Select][+][-]
  1. NAME=MyProgramName
  2.  
  3. #DESTDIR can be defined when calling make ie. make install DESTDIR=$RPM_BUILD_ROOT
  4. DESTDIR =
  5.  
  6. prefix  = /usr
  7. bindir  = $(prefix)/local/bin
  8. datadir = $(prefix)/share
  9.  
  10. #Not normally used directly, called by make deb:                                                                                                              
  11. install:                                                                                                                                                      
  12.         ... stuff to install the program, like ...
  13.         install -D -m0755 $(Name) $(DESTDIR)$(bindir)/$(NAME)  
  14.  
  15.  
  16. deb:
  17.         checkinstall -D --pkgname=MyProgramName --maintainer='MyName \<me@mydomain.com\>' --provides='' --nodoc make install
  18.  


After you run this, checkinstall may ask some questions.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Making a .DEB?
« Reply #2 on: June 23, 2017, 09:06:40 pm »
Waiting for enlightenment from the knowledgeable folk here.

For future reference, if you create your project with this package, not only do you get a truer cross-platform app, but you also get installers for all 3 platforms automatically:

https://macpgmr.github.io/MacXPlatform/LazXProj.html

For now, just look at the makedeb.sh script in the scripts subfolder.

Also, since Lazarus is distributed as a .deb, presumably it has a script somewhere that builds the .deb - you could take a peek at that too.

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Making a .DEB?
« Reply #3 on: June 23, 2017, 09:11:30 pm »
It's really easy to make a deb, check this
https://github.com/bgrabitmap/lazpaint/tree/master/lazpaint/deb

You need a folder structure, then simply call:

dpkg-deb --build foldername

KarenT

  • Full Member
  • ***
  • Posts: 120
Re: Making a .DEB?
« Reply #4 on: June 24, 2017, 12:52:28 am »
Thank you for all the replies. I will try this one (lainz) first as it looks the least daunting for a newbie with both Lazarus and Linux.


FangQ

  • Full Member
  • ***
  • Posts: 134
Re: Making a .DEB?
« Reply #6 on: July 06, 2017, 04:47:00 am »
So, good people, my program is complete (for now) so how do I create a .deb file so I can put it on our two other Ubuntu PCs? It is not for general distribution as it manages Pop's greenhouse heating, cooling and venting.

yesterday, I just added the first draft of the deb packing script (based on some older deb packages I made over 10 years ago). Here is the Makefile segment

https://github.com/fangq/mcx/blob/master/Makefile#L19-L22

it needs two shell scripts (one creating all needed folder, one copy all needed files to this structure), once you define a control file, dpkg will take care of the rest.

if you want to try, you may download my sample code by

Code: Pascal  [Select][+][-]
  1. git clone https://github.com/fangq/mcx.git
  2. cd mcx
  3. mkdir bin
  4. touch bin/mcx
  5. make deb

the above mkdir/touch command creates a dummy binary so you don't have to recompile the code (which requires CUDA).


mdalacu

  • Full Member
  • ***
  • Posts: 233
    • dmSimpleApps
Re: Making a .DEB?
« Reply #7 on: July 06, 2017, 08:22:09 am »
It also be useful to learn how to build snap packages. By now snaps are working on the majority of linux distributions.

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Making a .DEB?
« Reply #8 on: July 06, 2017, 02:07:35 pm »
It also be useful to learn how to build snap packages. By now snaps are working on the majority of linux distributions.

That's it.

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: Making a .DEB?
« Reply #9 on: July 06, 2017, 02:11:56 pm »
But not on Raspbian.
Specialize a type, not a var.

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: Making a .DEB?
« Reply #10 on: July 07, 2017, 01:56:40 am »
Also it may be useful to have daily build for your application on Launchpad so you can install and update your application with your PPA channel.
http://wiki.freepascal.org/Publish_project_on_Launchpad


Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: Making a .DEB?
« Reply #12 on: July 07, 2017, 09:17:00 am »
Yes I know there is an unofficial port (that works) but I am awaiting an official port.
Since it is installer software, it just complicates matters for average users, so I will stick to .deb until snapd is in the repository.
The point about snap is to simplify software installations, not make it more complex.....by needing an install from an outside source...

In the future, of course I will provide snaps for my software, but creating .debs is not rocket science.
« Last Edit: July 07, 2017, 09:18:38 am by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018