User Tools

Site Tools


linux:debian:creating_virtual_debian_package

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux:debian:creating_virtual_debian_package [2015/09/05 09:20] (current)
ozan created
Line 1: Line 1:
 +===== Creating Virtual Packages for Debian =====
  
 +Virtual packages (a.k.a meta packages) are not real packages but they are highly used. By installing a virtual package you can force debian based systems to install all dependent packages and you get rid of installing/​removing packages you want or dont want. Additionally,​ you can group some independent packages so you can install them by easily. ​
 +
 +Beriefly, use cases are alot for virtual packages. Apt mechanism in debian systems depends on control files of packages. You can get information from this [[https://​www.debian.org/​doc/​manuals/​maint-guide/​dreq.en.html#​control|link]] about control files. After you learn every field and its function in control file, you can use virtual packages for many things.
 +
 +You can create virtual packages by learning how to create debian packages but there is a tool called **equivs** which makes life easier.
 +
 +Firstly you install equivs if you dont have
 +<code bash>
 +apt-get install equivs
 +</​code>​
 +
 +Find a name for your new package and run this command, i.e. ozanh-dev-env
 +<code bash>
 +equivs-control ozanh-dev-env
 +</​code>​
 +The above command creates a control file in the directory you are in
 +
 +The content of the control file is below
 +<​code>​
 +### Commented entries have reasonable defaults.
 +### Uncomment to edit them.
 +# Source: <source package name; defaults to package name>
 +Section: misc
 +Priority: optional
 +# Homepage: <enter URL here; no default>
 +Standards-Version:​ 3.9.2
 +
 +Package: <package name; defaults to equivs-dummy>​
 +# Version: <enter version here; defaults to 1.0>
 +# Maintainer: Your Name <​yourname@example.com>​
 +# Pre-Depends:​ <​comma-separated list of packages>​
 +# Depends: <​comma-separated list of packages>​
 +# Recommends: <​comma-separated list of packages>​
 +# Suggests: <​comma-separated list of packages>​
 +# Provides: <​comma-separated list of packages>​
 +# Replaces: <​comma-separated list of packages>​
 +# Architecture:​ all
 +# Copyright: <​copyright file; defaults to GPL2>
 +# Changelog: <​changelog file; defaults to a generic changelog>​
 +# Readme: <​README.Debian file; defaults to a generic one>
 +# Extra-Files:​ <​comma-separated list of additional files for the doc directory>​
 +# Files: <pair of space-separated paths; First is file to include, second is destination>​
 +#  <more pairs, if there'​s more than one file to include. Notice the starting space>
 +Description:​ <short description;​ defaults to some wise words> ​
 + long description and info
 + .
 + ​second paragraph
 +</​code>​
 +
 +I edited the control file for my needs and became like this
 +<file bash ozanh-dev-env>​
 +### Commented entries have reasonable defaults.
 +### Uncomment to edit them.
 +# Source: <source package name; defaults to package name>
 +Section: misc
 +Priority: optional
 +Homepage: http://​www.ozanh.com
 +Standards-Version:​ 3.9.2
 +
 +Package: ozanh-dev-env
 +Version: 1.0-1
 +Maintainer: Ozan H. <​ozan_haci@yahoo.com>​
 +# Pre-Depends:​ <​comma-separated list of packages>​
 +Depends: python-dev, cython, python-numpy,​ python-stdeb,​ python-setuptools,​ build-essential,​ simple-cdd, approx, lintian
 +# Recommends: <​comma-separated list of packages>​
 +# Suggests: <​comma-separated list of packages>​
 +# Provides: <​comma-separated list of packages>​
 +# Replaces: <​comma-separated list of packages>​
 +Architecture:​ all
 +# Copyright: <​copyright file; defaults to GPL2>
 +# Changelog: <​changelog file; defaults to a generic changelog>​
 +# Readme: <​README.Debian file; defaults to a generic one>
 +# Extra-Files:​ <​comma-separated list of additional files for the doc directory>​
 +# Files: <pair of space-separated paths; First is file to include, second is destination>​
 +#  <more pairs, if there'​s more than one file to include. Notice the starting space>
 +Description:​ <short description;​ defaults to some wise words> ​
 + long description and info
 + .
 + ​second paragraph
 +</​file>​
 +
 +Then you run the following command
 +<code bash>
 +equivs-build ozanh-dev-env
 +</​code>​
 +Your new deb package is ready in the same directory and you can install it with
 +<code bash>
 +dpkg -i ozanh-dev-env_1.0-1_all.deb
 +apt-get install -f
 +</​code>​
 +
 +You can check the quality of the deb package by
 +<code bash>
 +lintian ozanh-dev-env_1.0-1_all.deb
 +</​code>​
 +
 +Have fun... :-)
 +
 +{{tag>​meta_package virtual_package debian linux packaging equivs control_file apt}}
 +~~DISCUSSION~~
linux/debian/creating_virtual_debian_package.txt ยท Last modified: 2015/09/05 09:20 by ozan