Difference between revisions of "Ubuntu create .deb-Package Howto"

From Cactus Howto
Jump to navigationJump to search
(Die Seite wurde neu angelegt: „== create package builder environment == Source: http://wiki.ubuntuusers.de/pBuilder * install neccessary packages sudo apt-get install pbuilder debootstrap d…“)
 
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
== create package builder environment ==
== create package builder environment ==
Documentation:
Source: http://wiki.ubuntuusers.de/pBuilder
* http://wiki.ubuntuusers.de/pBuilder
* https://wiki.ubuntu.com/PbuilderHowto

Setup Environment

* install neccessary packages
* install neccessary packages
sudo apt-get install pbuilder debootstrap devscripts
sudo apt-get install pbuilder debootstrap devscripts ccache gdebi-core debhelper
* create environment (creates tar archive /var/cache/pbuilder/base.tgz)
* create environment (creates tar archive /var/cache/pbuilder/base.tgz)
sudo pbuilder create --debootstrapopts --variant=buildd
sudo pbuilder create --debootstrapopts --variant=buildd
Line 8: Line 13:
sudo pbuilder update
sudo pbuilder update
* Use gdebi for dependencies:
* Use gdebi for dependencies:
cat ~/.pbuilderrc
echo PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-gdebi" >> ~/.pbuilderrc
#export http_proxy=http://proxy.int.cactus.de:8080/
echo COMPONENTS="main restricted universe multiverse" >> ~/.pbuilderrc
PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-gdebi"
COMPONENTS="main restricted universe multiverse"
* update pbuilder environment:
* update pbuilder environment:
sudo pbuilder update --override-config
sudo pbuilder update --override-config
* multiple pBuilder: Falls man sowohl Backports als auch Pakete für die Entwicklungsversion erstellt möchte man parallel mehrere pBuilder-Umgebungen haben. Es ist auch möglich Pakete für Debian {en} zu bauen.
* multiple pBuilder: Falls man sowohl Backports als auch Pakete für die Entwicklungsversion erstellt möchte man parallel mehrere pBuilder-Umgebungen haben. Es ist auch möglich Pakete für Debian {en} zu bauen.
sudo DIST=squeeze pbuilder create
sudo DIST=wheezy pbuilder create
* If you want to build Debian packages on Ubuntu, you need to install Debian archive keys and add Debian distribution name, Debian mirror and key location to pbuilder command line like this:
sudo apt-get install debian-archive-keyring
#sudo pbuilder create --distribution squeeze --mirror ftp://ftp.us.debian.org/debian/ --debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg"
sudo pbuilder create --override-config --distribution wheezy --mirror http://ftp.de.debian.org/debian/ --debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg"

== config ==

Die Config-Daten liegen im debian-Verzeichnis:


ls -la debian

lstree

cat debin/preinstall


cat debian/postinstall

<pre>
#!/bin/sh

set -e

ISO_DIR=/usr/share/itsecorg
ISO_USER=itsecorg
HOME_DIR=/usr/share/$ISO_USER

case "$1" in
configure)

# install databse
cd $ISODIR/install/bin
sudo su - postgres db-init0-user.sh
sudo su - postgres db-init1-structure.sh
sudo su - postgres db-init2-functions-with-output.sh
sudo su - postgres db-init3-fillWrite failed: Broken pipe

# ensure home_dir has appropriate permissions
chown -R $ISO_USER:$ISO_USER $HOME_DIR

;;
esac

exit 0
</pre>


Importer-control-File

<pre>

Source: itsecorg-importer
Section: doc
Priority: extra
Maintainer: Tim Purschke <tmp@cactus.de>
Build-Depends: debhelper (>= 5)

Package: itsecorg-importer
Architecture: all
Depends: ssh, openssl, ntp, ntpdate, libdbi-perl, libdbd-pg-perl, libdate-calc-perl, psmisc, libnet-cidr-perl, libsys-syslog-perl, libexpect-perl, postgresql
Conflicts:
Replaces:
Provides: itsecorg-importer
Description: IT Security Organizer Import Process
helps to report on all your firewall rulesets
helps to document any changes done and link them to a ticket / request number

</pre>

GUI-control-File
<pre>
Source: itsecorg-gui
Section: doc
Priority: extra
Maintainer: Tim Purschke <tmp@cactus.de>
Build-Depends: debhelper (>= 5)

Package: itsecorg-gui
Architecture: all
Depends: ssh, openssl, ntp, ntpdate, apache2, libapache2-mod-php5, php5-pgsql, php-pear
Conflicts:
Replaces:
Provides: itsecorg-gui
Description: IT Security Organizer GUI Server
helps to report on all your firewall rulesets
helps to document any changes done and link them to a ticket / request number
</pre>

Database-control-File

<pre>
Source: itsecorg-database
Section: doc
Priority: extra
Maintainer: Tim Purschke <tmp@cactus.de>
Build-Depends: debhelper (>= 5)

Package: itsecorg-database
Architecture: all
Depends: ssh, openssl, ntp, ntpdate, postgresql (>=8.0)
Conflicts:
Replaces:
Provides: itsecorg-datbase
Description: IT Security Organizer Database (backend)
helps to report on all your firewall rulesets
helps to document any changes done and link them to a ticket / request number
</pre>

Complete-control-file

<pre>
Source: itsecorg
Section: doc
Priority: extra
Maintainer: Tim Purschke <tmp@cactus.de>
Build-Depends: debhelper (>= 5)

Package: itsecorg
Architecture: all
Depends: ssh, openssl, ntp, ntpdate, libdbi-perl, libdbd-pg-perl, libdate-calc-perl, psmisc, libnet-cidr-perl, libsys-syslog-perl, libexpect-perl, postgresql, apache2, libapache2-mod-php5, php5-pgsql, php-pear, postgresql (>=8.0)
Conflicts:
Replaces:
Provides: itsecorg
Description: IT Security Organizer complete (single machine) install
helps to report on all your firewall rulesets
helps to document any changes done and link them to a ticket / request number
</pre>


Resultat:
<pre>
tim@isotest-db:~$ dpkg --status itsecorg-database
Package: itsecorg-database
Status: install ok installed
Priority: extra
Section: doc
Installed-Size: 515
Maintainer: Cactus ITSecOrg <itsecorg@cactus.de>
Architecture: all
Version: 4.3.1.0
Provides: itsecorg-database
Depends: ssh, openssl, ntp, ntpdate, postgresql (>= 8.0)
Description: IT Security Organizer Database
helps to report on all your firewall rulesets
helps to document any changes done and link them to a ticket / request number
</pre>

Latest revision as of 15:51, 6 March 2015

create package builder environment

Documentation:

Setup Environment

  • install neccessary packages
sudo apt-get install pbuilder debootstrap devscripts ccache gdebi-core debhelper
  • create environment (creates tar archive /var/cache/pbuilder/base.tgz)
sudo pbuilder create --debootstrapopts --variant=buildd 
  • Update every time before building packages (or on a daily basis)
sudo pbuilder update
  • Use gdebi for dependencies:
cat ~/.pbuilderrc 
#export http_proxy=http://proxy.int.cactus.de:8080/
PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-gdebi"
COMPONENTS="main restricted universe multiverse"
  • update pbuilder environment:
sudo pbuilder update --override-config 
  • multiple pBuilder: Falls man sowohl Backports als auch Pakete für die Entwicklungsversion erstellt möchte man parallel mehrere pBuilder-Umgebungen haben. Es ist auch möglich Pakete für Debian {en} zu bauen.
sudo DIST=wheezy pbuilder create
  • If you want to build Debian packages on Ubuntu, you need to install Debian archive keys and add Debian distribution name, Debian mirror and key location to pbuilder command line like this:
sudo apt-get install debian-archive-keyring
#sudo pbuilder create --distribution squeeze --mirror ftp://ftp.us.debian.org/debian/ --debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg"
sudo pbuilder create --override-config --distribution wheezy --mirror http://ftp.de.debian.org/debian/ --debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg"

config

Die Config-Daten liegen im debian-Verzeichnis:


ls -la debian

lstree

cat debin/preinstall


cat debian/postinstall

#!/bin/sh

set -e

ISO_DIR=/usr/share/itsecorg
ISO_USER=itsecorg
HOME_DIR=/usr/share/$ISO_USER

case "$1" in
    configure)

# install databse
    cd $ISODIR/install/bin
    sudo su - postgres db-init0-user.sh
    sudo su - postgres db-init1-structure.sh
    sudo su - postgres db-init2-functions-with-output.sh
    sudo su - postgres db-init3-fillWrite failed: Broken pipe

# ensure home_dir has appropriate permissions
    chown -R $ISO_USER:$ISO_USER $HOME_DIR

    ;;
esac

exit 0


Importer-control-File


Source: itsecorg-importer
Section: doc
Priority: extra
Maintainer: Tim Purschke <tmp@cactus.de>
Build-Depends: debhelper (>= 5)

Package: itsecorg-importer
Architecture: all
Depends: ssh, openssl, ntp, ntpdate, libdbi-perl, libdbd-pg-perl, libdate-calc-perl, psmisc, libnet-cidr-perl, libsys-syslog-perl, libexpect-perl, postgresql
Conflicts:
Replaces:
Provides: itsecorg-importer
Description: IT Security Organizer Import Process
 helps to report on all your firewall rulesets
 helps to document any changes done and link them to a ticket / request number

GUI-control-File

Source: itsecorg-gui
Section: doc
Priority: extra
Maintainer: Tim Purschke <tmp@cactus.de>
Build-Depends: debhelper (>= 5)

Package: itsecorg-gui
Architecture: all
Depends: ssh, openssl, ntp, ntpdate, apache2, libapache2-mod-php5, php5-pgsql, php-pear
Conflicts:
Replaces:
Provides: itsecorg-gui
Description: IT Security Organizer GUI Server
 helps to report on all your firewall rulesets
 helps to document any changes done and link them to a ticket / request number

Database-control-File

Source: itsecorg-database
Section: doc
Priority: extra
Maintainer: Tim Purschke <tmp@cactus.de>
Build-Depends: debhelper (>= 5)

Package: itsecorg-database
Architecture: all
Depends: ssh, openssl, ntp, ntpdate, postgresql (>=8.0)
Conflicts:
Replaces:
Provides: itsecorg-datbase
Description: IT Security Organizer Database (backend)
 helps to report on all your firewall rulesets
 helps to document any changes done and link them to a ticket / request number

Complete-control-file

Source: itsecorg
Section: doc
Priority: extra
Maintainer: Tim Purschke <tmp@cactus.de>
Build-Depends: debhelper (>= 5)

Package: itsecorg
Architecture: all
Depends: ssh, openssl, ntp, ntpdate, libdbi-perl, libdbd-pg-perl, libdate-calc-perl, psmisc, libnet-cidr-perl, libsys-syslog-perl, libexpect-perl, postgresql, apache2, libapache2-mod-php5, php5-pgsql, php-pear, postgresql (>=8.0)
Conflicts:
Replaces:
Provides: itsecorg
Description: IT Security Organizer complete (single machine) install
 helps to report on all your firewall rulesets
 helps to document any changes done and link them to a ticket / request number


Resultat:

tim@isotest-db:~$ dpkg --status itsecorg-database
Package: itsecorg-database
Status: install ok installed
Priority: extra
Section: doc
Installed-Size: 515
Maintainer: Cactus ITSecOrg <itsecorg@cactus.de>
Architecture: all
Version: 4.3.1.0
Provides: itsecorg-database
Depends: ssh, openssl, ntp, ntpdate, postgresql (>= 8.0)
Description: IT Security Organizer Database
 helps to report on all your firewall rulesets
 helps to document any changes done and link them to a ticket / request number