[[snappkg]]
=== Snapshot (*simple*)

Let's consider an upstream source in the VCS and make a snapshot package from it.

Let's inspect files.

.VCS source tree
----
include::../hello-c-1.0_t/ref/step101.log[]
----

The source is the same one as <<singlepkg>> but the parent directory lacks the version part.  This is typical for the source in the VCS. 

You create a non-native Debian package source tree from the above upstream example using the *debmake*(1) command.

.*git* and *debmake*
----
sys::[head -n25  ../hello-c-1.0_t/ref/step200.log]
 ...
sys::[grep '^I: debmake -x' ../hello-c-1.0_t/ref/step200.log]
 ...
sys::[tail -n5  ../hello-c-1.0_t/ref/step200.log]
----

Let’s inspect files.

----
include::../hello-c-1.0_t/ref/step400.log[]
----


include::../hello-c-1.0_t/ref/snapshotversion.log[]

There are many files:

* the snapshot upstream tarball: *hello-{snapshotversion}.tar.gz* (*hello-c_{snapshotversion}.orig.tar.gz*)
* the snapshot upstream source tree with template files generated by the *debmake* command: *hello-c-{snapshotversion}/**
* the cleaned VCS directory: *hello-c-{snapshotversion}/**

For the proper packaging, you are required to make further modification using these auto-generated template files in the *hello-c-{snapshotversion}/debian* directory. For learning purpose, let's leave such details and move on. You can create a non-native Debian package using the *debuild* command (or its equivalent) in this source tree.

----
sys::[head -n3  ../hello-c-1.0_t/ref/step500.log]
 ...
sys::[grep -A 1 -e '^ fakeroot debian\/rules clean' ../hello-c-1.0_t/ref/step500.log]
 ...
sys::[grep -A 1 -e '^ debian\/rules build' ../hello-c-1.0_t/ref/step500.log]
 ...
sys::[grep -A 1 -e '^ fakeroot debian\/rules binary' ../hello-c-1.0_t/ref/step500.log]
 ...
sys::[tail -n1  ../hello-c-1.0_t/ref/step500.log]
----

Let’s inspect the result.

----
include::../hello-c-1.0_t/ref/step600.log[]
----

----
include::../hello-c-1.0_t/ref/step700.log[]
----

----
include::../hello-c-1.0_t/ref/step701.log[]
----

Your development branch holding the working upstream source tree and the **debian/*** files is the *devel* branch.

The following will import generated Debian packages to *master*, *upstream*, and *pristine-tar* branches. (These are the 3 typical branches used by the *gbp* command.)

----
include::../hello-c-1.0_t/ref/step800.log[]
----

The *gitk* command shows the VCS history nicely.


