1

Please keep in mind this is the first time I've ever written a bash script, worked on Linux just the first time really that I'm trying to achieve something like this.

I've written a script that I now want to make available to other people, I will be posting it on Github and what not. I've read and followed this up until step 6. But I can't seem to figure out how to apply it for my own needs.

What I have is three scripts. One script makes use of the two others. They are right now just sitting in a directory. What I want to do is make it installable by making a .deb package of it.

When you install the package I want the scripts to be placed in a corresponding directory in /etc and I want to be able to create the man page and alias etc in the install process so everything will work after installing the program.

Could someone help me out on how to do this, or point me to a good tutorial that will help me to figure this out.

12
  • Follow the linked duplicate. That's what I personally use for all my scripts. Dec 30, 2016 at 12:24
  • This is for bash but looking at it it looks like a lot of stuff is the same for python as for bash. Since I already created files like control
    – NoSixties
    Dec 30, 2016 at 12:46
  • Python or bash, the idea is the same - you will need to tell the install where to throw each of your scripts. Dec 30, 2016 at 12:52
  • I'm going throug it right now I'll let you know if i'm able to do what I'm aiming for
    – NoSixties
    Dec 30, 2016 at 12:55
  • @Serg can you tell the install file to create directories as well? For instance I want to place some stuff in /etc/myscriptname/ would I just add this location in the install script or would I need to add mkdir /etc/myscriptname/ first?
    – NoSixties
    Jan 6, 2017 at 12:30

1 Answer 1

0

Github - fpm - Effing Package Management
I think this is what you need.
For another tool for easy packaging:
Debreate
For a guide involving a few tools:
create a .deb Package from scripts or binaries
All the answers here are relevant for both Python and Bash:
How do I create a deb package for a single python script?
Especially the first answer in the above link is very useful.
If you wish to learn all of it without missing anything consider this:
Ubuntu Packaging

6
  • I was aware of the fpm project indeed. However I need to do things on install and I don't see any documentation on how to achieve this with fpm
    – NoSixties
    Dec 30, 2016 at 12:15
  • I don't think it's supported. Maybe you really need to start from the basics. I could also suggest that you try snapcraft. But I guess that might not help in your case.
    – Nightglare
    Dec 30, 2016 at 12:29
  • BTW, is this bash or python?
    – Nightglare
    Dec 30, 2016 at 12:30
  • this is for bash
    – NoSixties
    Dec 30, 2016 at 12:45
  • Should still be the same. The answers remain relevant, at least most of them.
    – Nightglare
    Dec 30, 2016 at 12:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.