Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create debian package from executable jar source without using any tools and scripts

I have created a package based on http://packaging.ubuntu.com/html/packaging-new-software.html sample. In this sample, sources are c++ files. I want to create my new package from executable jar files source. I found maven, ANT and dhBuild tools but I don't want to use this tools. So I need a way to create my package with command line. please give me some hints or samples to know most about that.

like image 994
Shaho Amini Avatar asked Sep 03 '14 12:09

Shaho Amini


1 Answers

The goal is to create a package that simply puts a shell script where I want it.

  1. Create a directory to build your packages in. Some use "deb" and others use "packages". Others create a directory structure for making multiple packages under "deb" (or whatever).

mkdir deb

  1. Create the directory structure in deb that represents where you want the script to be placed1

mkdir -p ./deb/usr/local/bin

3.Copy the script into your new directory

cp /path/to/my/script/myscript.sh ./deb/usr/local/bin/

4.Make a subdirectory called "DEBIAN", this will host the package control file.

mkdir -p ./deb/DEBIAN
Create a control file.
touch ./deb/DEBIAN/control

5.Open the control file and enter the text below.

Package: myPackagename (no spaces or underscores allowed) 
Priority: optional
Section: misc
Maintainer: Maintainer Name <[email protected]> 
Architecture: all 
Version: 1.0       
Depends: package1, package2, .........
Description: short description here 
 long description here (don't remove space at the beginning of 
 line(replace this with an empty line)

Change ownership:

sudo chown -R root:root ./deb

6.Create the debian package.

dpkg -b ./deb /my/output/destination/packagename.deb
like image 52
Shaho Amini Avatar answered Nov 14 '22 18:11

Shaho Amini