Creating a debian package for a shell script

What: I have a shell script that I would like to distribute in my LUG. I believe the debian package will be the easiest way to distribute it. I want to create a .deb file for a script in this repository

Where: I want it to be placed in some directory, for example / usr / local / bin, so that it is easy to execute and possibly create some symbolic links

Problem: How to write a make file for it and / or other files and folders needed for this. I researched a lot when I tried to do this a couple of months ago, but no luck. Here are the files from my previous attempt Now I'm trying to compile this for a tutorial on the shell script in my LUG and before a similar situation again.

I will be very happy if someone can be patient enough to guide me through this.

Any kind of resources or details will be appreciated.

PS: I also intend to port the script to perl soon.

+4
source share
4 answers

mirabilos, , Lucas Nussbaum, Debian. Debian:

# apt-get install packaging-tutorial

PDF, /usr/share/doc/packaging-tutorial/packaging-tutorial.pdf. , Debian.

. mv script . upstreamname- * version *.

rul@helicon:/tmp/a$ mkdir script-0.1
rul@helicon:/tmp/a$ mv script.sh script-0.1

cd , script dh_make --createorig. single binary. debian/ . . , , *.ex . .

​​ . script /usr/local/bin. , , . . dh_install. . , install debian/.

rul@helicon:/tmp/a/script-0.1$ echo "script.sh usr/local/bin/" > debian/install

.

! , , . cd dpkg-buildpackage. , .deb ../.

+6
+1

( ) , Debian .

equivs. equivs, equivs-control, .

( , ..).

script Files: , :

Package: my-awesome-script
Version: 4.2
Files: my-awesome-script.sh /usr/local/bin
Section: misc
Priority: optional
Standards-Version: 3.9.2
Maintainer: Me <me@gmail.com>
Description: An awesome script doing stuff
 Lorem ipsum etc. pp.

script .

equivs-build, Debian.

, - ; ndash; , , , .

+1

checkinstall fpm , !:

sudo checkinstall --fstrans=yes --install=no -D --pkgname=script \
    --maintainer='Name <name@domain.tld>' --pkgarch=all --pkgversion=0.1 \
    --nodoc cp script.sh /usr/local/bin

fpm -s dir -t deb --prefix /usr/local/bin -n script -v 0.1 -a all ./script.sh

: checkinstall dpkg/dpkg-deb ( Debian/Ubuntu), fpm , .

-1

All Articles