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.

Zanna
  • 70,465
NoSixties
  • 111
  • Follow the linked duplicate. That's what I personally use for all my scripts. – Sergiy Kolodyazhnyy Dec 30 '16 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 '16 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. – Sergiy Kolodyazhnyy Dec 30 '16 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 '16 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 06 '17 at 12:30
  • I think you can add this location to the install script ( I don't use it , so not 100% sure), although there's other ways,too: http://askubuntu.com/q/439780/295286 – Sergiy Kolodyazhnyy Jan 06 '17 at 12:48
  • @Serg great thank you that's exactly what I needed – NoSixties Jan 06 '17 at 13:04
  • @Serg one last question. I have successfully created the .deb package now. However I was wondering how would I make sure people can install it by just running apt-get install <mypackage> ? – NoSixties Jan 06 '17 at 22:46
  • you will need to create a Personal Package Archive(PPA) on launchpad for that (https://launchpad.net/). Once you have that, people can add your PPA to their list, run apt-get update and then apt-get install. There's also other ways, but if you want apt-get way, you need to have PPA created – Sergiy Kolodyazhnyy Jan 06 '17 at 22:50
  • @Serg alread have a PPA will look into it more thanks! – NoSixties Jan 07 '17 at 12:43
  • @Serg I have another question. I wanted to fix a bug (still set to UNRELEASED) but when I regenerate the package and install it again it doesn't install it correctly. Is there something special I need to do before generating/installing it again? – NoSixties Jan 26 '17 at 10:16
  • Well, I would recommend you ask another question on the site, and provide the exact error you're getting. – Sergiy Kolodyazhnyy Jan 26 '17 at 19:43

1 Answers1

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