[[makefile-sh-gui]]
=== Makefile (shell, GUI)

Here is an example of creating a simple Debian package from a POSIX shell GUI program using the *Makefile* as its build system.

This upstream is based on <<makefile-sh>> with enhanced GUI support.

Let's assume its upstream tarball to be *debhello-1.2.tar.gz*.

Let's get the source and make the Debian package.

.Download *debhello-1.2.tar.gz*
----
include::../examples/debhello-1.2_build-1/step000.slog[]
----

Here, the *hello* has been re-written to use the *zenity* command to make this a GTK+ GUI program.

.*hello* (v=1.2)
----
include::../examples/debhello-1.2_build-1/step101.slog[]
----

Here, the desktop file is updated to be *Terminal=false* as a GUI program.

.*hello.desktop* (v=1.2)
----
include::../examples/debhello-1.2_build-1/step102.slog[]
----

All other files are the same as in <<makefile-sh>>.

Let's package this with the *debmake* command.  Here, the *-b\':sh'* option is used to specify that the generated binary package is a shell script.

----
sys::[head -n3 ../examples/debhello-1.2_build-1/step200.slog]
 ...
sys::[grep -A12  '^I: sanity check of parameters' ../examples/debhello-1.2_build-1/step200.slog]
 ...
----

Let's inspect the notable template files generated.

// .The source tree after the basic *debmake* execution. (v=1.2)
// ----
// include::../examples/debhello-1.2_build-1/step201.slog[]
// ----

.*debian/control* (template file, v=1.2):
----
include::../examples/debhello-1.2_build-1/step202.slog[]
----

Let's make this Debian package better as the maintainer.

.*debian/control* (maintainer version, v=1.2):
----
include::../examples/debhello-1.2_build-1/step302.slog[]
----

Please note the manually added *zenity* dependency.

The *debian/rules* file is exactly the same as the one in <<makefile-sh>>.

There are several other template files under the *debian/* directory.  These also need to be updated.

.Template files under *debian/*. (v=1.2):
----
include::../examples/debhello-1.2_build-1/step400.slog[]
----

The rest of the packaging activities are practically the same as in <<makefile-sh>>.

Here is the generated dependency list of *debhello_1.2-1_all.deb*.

.The generated dependency list of *debhello_1.2-1_all.deb*:
----
include::../examples/debhello-1.2_build-1/step702.slog[]
----

