Devtools

From Manjaro Linux
Jump to: navigation, search


Warning: As of March 2015, the "devtools" described in this Wiki tutorial is superseded by "buildpkg" (part of Manjaro-tools) but still maintained and working correctly.


The package devtools includes scripts and tools for Manjaro Linux package maintainers. Official packages get built in clean chroots to avoid dependency conflicts with our branches.

Prerequisite software

First ensure that the necessary tools are installed. The package group base-devel and devtools should be sufficient; it includes make and additional tools needed for compiling from source.

# pacman -S base-devel devtools

Building packages for unstable branch

First we have to get some PKGBUILDs:

core

git clone https://github.com/manjaro/packages-core.git

extra

git clone https://github.com/manjaro/packages-extra.git

community

git clone https://github.com/manjaro/packages-community.git

Now we can change into the prefered directory which contains our PKGBUILD:

[phil@manjaro repositories]$ cd extra/pamac
[phil@manjaro pamac]$ dir
pamac-install  PKGBUILD

To build packages we provide followed scripts for each architecture:

unstable-i686-build
unstable-x86_64-build

You can build 32bit packages also on your 64bit host. So we want to create a new pamac package for our unstable branch. Therefore we start the script unstable-i686-build to create a 32bit package of pamac. To create a 64bit package start unstable-x86_64-build instead.

We start the script with:

[phil@manjaro pamac]$ sudo unstable-i686-build

A new chroot will be created. When you have already a chroot for this branch and architecture created, it will be automatically updated like a normal Manjaro system. If you want to create a new chroot add the -c switch to your cmd.

==> Creating chroot for [unstable] (i686)...
  -> Deleting chroot copy 'root'...
==> Creating install root at /var/lib/manjarobuild/unstable-i686/root
==> Installing packages to /var/lib/manjarobuild/unstable-i686/root
:: Synchronizing package databases...
 core                     118.2 KiB  1104K/s 00:00 [######################] 100%
 extra                   1529.3 KiB  2.47M/s 00:01 [######################] 100%
 community                  2.0 MiB  2.29M/s 00:01 [######################] 100%
:: There are 25 members in group base-devel:
:: Repository core
   1) autoconf  2) automake  3) binutils  4) bison  5) fakeroot  6) file
   7) findutils  8) flex  9) gawk  10) gcc  11) gettext  12) grep  13) groff
   14) gzip  15) libtool  16) m4  17) make  18) pacman  19) patch
   20) pkg-config  21) sed  22) sudo  23) texinfo  24) util-linux  25) which

Enter a selection (default=all): 
resolving dependencies...
warning: dependency cycle detected:
warning: openssl will be installed before its perl dependency
looking for inter-conflicts...

Packages (89): acl-2.2.52-2  archlinux-keyring-20131027-1  attr-2.4.47-1
               bash-4.2.045-5  bzip2-1.0.6-5  ca-certificates-20130906-1
               cloog-0.18.1-2  coreutils-8.22-2  cracklib-2.9.0-2
               curl-7.34.0-2  db-5.3.28-1  diffutils-3.3-1  dirmngr-1.1.1-1
               e2fsprogs-1.42.8-2  expat-2.1.0-3  filesystem-2013.06-1
               gc-7.2.d-2  gcc-libs-4.8.2-7  gdbm-1.10-3  glib2-2.38.2-1
               glibc-2.18-11  gmp-5.1.3-2  gnupg-2.0.22-1  gpgme-1.4.3-1
               guile-2.0.9-1  iana-etc-2.30-4  isl-0.12.1-2  less-458-1
               libarchive-3.1.2-4  libassuan-2.1.1-1  libcap-2.23-2
               libffi-3.0.13-4  libgcrypt-1.5.3-1  libgpg-error-1.12-1
               libgssglue-0.4-2  libksba-1.3.0-1  libldap-2.4.38-1
               libltdl-2.4.2-12  libmpc-1.0.1-2  libsasl-2.1.26-6
               libssh2-1.4.3-2  libtirpc-0.2.3-2  libunistring-0.9.3-6
               linux-api-headers-3.12.4-1  lzo2-2.06-3
               manjaro-keyring-20120504-1  mpfr-3.1.2.p5-1  ncurses-5.9-6
               openssl-1.0.1.e-5  pacman-mirrorlist-20131230-1  pam-1.1.8-2
               pambase-20130928-1  pcre-8.34-1  perl-5.18.1-1  pinentry-0.8.3-1
               pth-2.0.7-4  python-3.3.3-1  readline-6.2.004-2  run-parts-4.4-1
               shadow-4.1.5.1-7  tar-1.27.1-1  tzdata-2013i-1  xz-5.0.5-2
               zlib-1.2.8-3  autoconf-2.69-1  automake-1.14.1-1
               binutils-2.24-1  bison-3.0.2-1  fakeroot-1.20-1  file-5.16-1
               findutils-4.4.2-5  flex-2.5.37-1  gawk-4.1.0-2  gcc-4.8.2-7
               gettext-0.18.3.1-2  grep-2.16-1  groff-1.22.2-5  gzip-1.6-1
               libtool-2.4.2-12  m4-1.4.17-1  make-4.0-2  pacman-4.1.2-5
               patch-2.7.1-2  pkg-config-0.28-1  sed-4.2.2-3  sudo-1.8.8-1
               texinfo-5.2-2  util-linux-2.24-2  which-2.20-6

Total Installed Size:   409.89 MiB

:: Proceed with installation? [Y/n] 
(89/89) checking keys in keyring                   [######################] 100%
(89/89) checking package integrity                 [######################] 100%
(89/89) loading package files                      [######################] 100%
(89/89) checking for file conflicts                [######################] 100%
( 1/89) installing linux-api-headers               [######################] 100%
..
(82/89) installing pacman-mirrorlist               [######################] 100%
/usr/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
...
(89/89) installing which                           [######################] 100%
/usr/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/etc/localtime is not a symlink, not updating container timezone.
Generating locales...
  en_US.UTF-8
  de_DE.UTF-8
Generation complete.

Now we can start to create the package. Your chroot will be cleaned before every package build:

==> Building in chroot for [unstable] (i686)...
==> Creating clean working copy [phil]...done
/etc/localtime is not a symlink, not updating container timezone.

Next step is to install all needed dependencies for pamac:

==> Making package: pamac 0.9.5-1 (Sun Jan  5 10:16:40 UTC 2014)
==> Checking runtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
:: There are 6 providers available for linux>=3.4:
:: Repository core
   1) linux310  2) linux311  3) linux312  4) linux313  5) linux34  6) linux38

Enter a number (default=1): 
looking for inter-conflicts...

Packages (120): at-spi2-atk-2.10.2-1  at-spi2-core-2.10.2-1  atk-2.10.0-1
                avahi-0.6.31-11  cairo-1.12.16-1  colord-1.0.4-1
                compositeproto-0.4.2-2  damageproto-1.2.1-2  dbus-1.6.18-3
                dconf-0.18.0-1  elfutils-0.157-1  fixesproto-5.0-2
                fontconfig-2.11.0-1  freetype2-2.5.2-1  gdk-pixbuf2-2.30.2-1
                gnutls-3.2.8-1  gobject-introspection-1.38.0-1
                graphite-1:1.2.4-1  gtk-update-icon-cache-2.24.22-1
                harfbuzz-0.9.24-1  hicolor-icon-theme-0.12-2
                hwids-20130915.1-1  hwinfo-21.0-1  inputproto-2.3-1
                jasper-1.900.1-10  js-17.0.0-1  kbd-2.0.1-1  kbproto-1.0.6-1
                keyboardctl-0.1.5-2  keyutils-1.5.8-1  kmod-16-1  krb5-1.11.4-1
                lcms2-2.5-2  libcups-1.7.0-2  libdaemon-0.14-2
                libdatrie-0.2.6-1  libdbus-1.6.18-3  libdrm-2.4.50-1
                libgusb-0.1.6-1  libjpeg-turbo-1.3.0-4  libpciaccess-0.13.2-2
                libpng-1.6.7-1  libtasn1-3.4-1  libthai-0.1.19-1
                libtiff-4.0.3-4  libusbx-1.0.17-1  libvdpau-0.7-1
                libx11-1.6.2-1  libx86emu-1.1-29  libxau-1.0.8-2  libxcb-1.10-1
                libxcomposite-0.4.4-1  libxcursor-1.1.14-1  libxdamage-1.1.4-1
                libxdmcp-1.1.1-1  libxext-1.3.2-1  libxfixes-5.0.1-1
                libxft-2.3.1-2  libxi-1.7.2-1  libxinerama-1.1.3-2
                libxkbcommon-0.3.2-1  libxml2-2.9.1-5  libxrandr-1.4.2-2
                libxrender-0.9.8-1  libxtst-1.2.2-1  libxxf86vm-1.1.3-1
                licenses-20130203-1  linux-firmware-20131013.7d0c7a8-1
                linux310-3.10.25-1  llvm-libs-3.3-1  manjaro-system-20131229-1
                mesa-10.0.1-1  mesa-libgl-10.0.1-1  mhwd-0.3.1-1
                mhwd-catalyst-13.12-1  mhwd-catalyst-13.4-12.104-1
                mhwd-catalyst-legacy-13.1-4  mhwd-db-0.3.1-2
                mhwd-nvidia-331.20-1  mhwd-nvidia-legacy-304.117-1
                mkinitcpio-16-2  mkinitcpio-busybox-1.21.1-2  nettle-2.7.1-1
                nspr-4.10.2-1  p11-kit-0.20.1-1  pango-1.36.1-1
                pcmciautils-018-7  pixman-0.32.4-1  polkit-0.112-1
                pygobject-devel-3.10.2-1  python-cairo-1.10.0-3
                python-dbus-common-1.2.0-1  python-pyelftools-0.21-1
                python2-2.7.6-1  python2-beaker-1.6.4-1  python2-mako-0.9.0-1
                python2-markupsafe-0.18-2  randrproto-1.4.0-1
                recordproto-1.14.2-1  renderproto-0.11.1-2
                shared-color-profiles-0.1.5-1  shared-mime-info-1.2-1
                sqlite-3.8.2-1  systemd-208-3  v86d-0.1.10-5  wayland-1.3.0-1
                xcb-proto-1.10-1  xextproto-7.2.1-1  xf86vidmodeproto-2.3.1-2
                xineramaproto-1.2.1-2  xkeyboard-config-2.10.1-1
                xproto-7.0.25-1  dbus-glib-0.100.2-1  gtk3-3.10.6-1
                libnotify-0.7.6-1  namcap-3.2.5-1  pyalpm-0.6.2.2-1
                python-dbus-1.2.0-1  python-gobject-3.10.2-1
                python-requests-2.1.0-1

Total Installed Size:   448.06 MiB

:: Proceed with installation? [Y/n] 
(120/120) checking keys in keyring                 [######################] 100%
(120/120) checking package integrity               [######################] 100%
(120/120) loading package files                    [######################] 100%
(120/120) checking for file conflicts              [######################] 100%
(  1/120) installing pyalpm                        [######################] 100%
..
(120/120) installing namcap                        [######################] 100%

Then buildtime dependencies will get installed:

==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for inter-conflicts...

Packages (3): perl-error-0.17021-1  git-1.8.5.2-1  itstool-2.0.0-1

Total Installed Size:   20.98 MiB

:: Proceed with installation? [Y/n] 
(3/3) checking keys in keyring                     [######################] 100%
(3/3) checking package integrity                   [######################] 100%
(3/3) loading package files                        [######################] 100%
(3/3) checking for file conflicts                  [######################] 100%
(1/3) installing itstool                           [######################] 100%
(2/3) installing perl-error                        [######################] 100%
(3/3) installing git                               [######################] 100%
Optional dependencies for git
    tk: gitk and git gui
    perl-libwww: git svn
    perl-term-readkey: git svn
    perl-mime-tools: git send-email
    perl-net-smtp-ssl: git send-email TLS support
    perl-authen-sasl: git send-email TLS support
    python2: various helper scripts [installed]
    subversion: git svn
    cvsps: git cvsimport
    gnome-keyring: GNOME keyring credential helper

Then we download all needed sources to build the package:

==> Retrieving sources...
  -> Downloading pamac-0.9.5.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  133k    0  133k    0     0   279k      0 --:--:-- --:--:-- --:--:--  279k
==> Validating source files with sha256sums...
    pamac-0.9.5.tar.gz ... Passed
==> Extracting sources...
  -> Extracting pamac-0.9.5.tar.gz with bsdtar

Now we change into the fakeroot environment and build the package:

==> Entering fakeroot environment...
==> Starting package()...
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/pamac
copying pamac/config.py -> build/lib/pamac
copying pamac/__init__.py -> build/lib/pamac
copying pamac/common.py -> build/lib/pamac
copying pamac/aur.py -> build/lib/pamac
copying pamac/transaction.py -> build/lib/pamac
running install_lib
creating /build/pkg/pamac/usr
creating /build/pkg/pamac/usr/lib
creating /build/pkg/pamac/usr/lib/python3.3
creating /build/pkg/pamac/usr/lib/python3.3/site-packages
creating /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac
copying build/lib/pamac/config.py -> /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac
copying build/lib/pamac/__init__.py -> /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac
copying build/lib/pamac/common.py -> /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac
copying build/lib/pamac/aur.py -> /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac
copying build/lib/pamac/transaction.py -> /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac
byte-compiling /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac/config.py to config.cpython-33.pyc
byte-compiling /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac/__init__.py to __init__.cpython-33.pyc
byte-compiling /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac/common.py to common.cpython-33.pyc
byte-compiling /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac/aur.py to aur.cpython-33.pyc
byte-compiling /build/pkg/pamac/usr/lib/python3.3/site-packages/pamac/transaction.py to transaction.cpython-33.pyc
writing byte-compilation script '/tmp/tmpb1jkmr.py'
/usr/bin/python -O /tmp/tmpb1jkmr.py
removing /tmp/tmpb1jkmr.py
running install_egg_info
Writing /build/pkg/pamac/usr/lib/python3.3/site-packages/Pamac-0.9-py3.3.egg-info
==> Tidying install...
  -> Purging unwanted files...
  -> Removing empty directories...
  -> Compressing man and info pages...
  -> Stripping unneeded symbols from binaries and libraries...
==> Creating package "pamac"...
  -> Generating .PKGINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: pamac 0.9.5-1 (Sun Jan  5 10:18:29 UTC 2014)

Last step is to install the package inside our chroot and verfiy it with namcap:

==> Installing package pamac with pacman -U...
loading packages...
resolving dependencies...
looking for inter-conflicts...

Packages (1): pamac-0.9.5-1

Total Installed Size:   1.03 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) installing pamac                             [######################] 100%
/tmp/alpm_2bhPPr/.INSTALL: line 2: update-desktop-database: command not found
==> The polkit-gnome agent is no longer autostarted by default
    except in GNOME Flashback.
    For Xfce, LXDE etc., lxpolkit is the suggested lightweight alternative.
    See https://wiki.archlinux.org/index.php/Polkit#Authentication_agents
    for more details.
Optional dependencies for pamac
    polkit-gnome: needed for authentification in Cinnamon, Gnome
    lxpolkit: needed for authentification in Xfce, LXDE etc.
warning: namcap-3.2.5-1 is up to date -- skipping
 there is nothing to do
Checking PKGBUILD
Checking pamac-0.9.5-1-any.pkg.tar.xz
pamac E: Dependency desktop-file-utils detected and not included (needed for update-desktop-database)
pamac W: Dependency python included but already satisfied
pamac W: Dependency python included but already satisfied
pamac W: Dependency included and not needed ('pacman')
pamac W: Dependency included and not needed ('pyalpm')
pamac W: Dependency included and not needed ('gtk3')
pamac W: Dependency included and not needed ('python-requests')
pamac W: Dependency included and not needed ('python-gobject')
pamac W: Dependency included and not needed ('python-dbus')
pamac W: Dependency included and not needed ('dbus-glib')
pamac W: Dependency included and not needed ('libnotify')
pamac W: Dependency included and not needed ('namcap')

You will find now followed files in your directory:

[phil@manjaro pamac]$ dir
pamac-0.9.5-1-any.pkg.tar.xz		 pamac-install
pamac-0.9.5-1-any.pkg.tar.xz-namcap.log  PKGBUILD
pamac-0.9.5-1-i686-package.log		 PKGBUILD-namcap.log
pamac-0.9.5.tar.gz

Building packages for unstable multilib repository

First we have to get some PKGBUILDs:

multilib

git clone https://github.com/manjaro/packages-multilib

Now we can change into the prefered directory which contains our PKGBUILD:

[phil@manjaro repositories]$ cd multilib/*nvidia*
[phil@manjaro lib32-nvidia-304xx-utils]$ dir
lib32-nvidia-304xx-utils.install  PKGBUILD

We start our script to build multilib packages:

unstable-multilib-build

A new chroot will be created. When you have already a chroot for this branch and architecture created, it will be automatically updated like a normal Manjaro system. If you want to create a new chroot add the -c switch to your cmd.

[phil@manjaro lib32-nvidia-304xx-utils]$ sudo unstable-multilib-build
==> Creating chroot for [unstable-multilib] (x86_64)...
==> Creating install root at /var/lib/manjarobuild/unstable-multilib-x86_64/root
==> Installing packages to /var/lib/manjarobuild/unstable-multilib-x86_64/root
:: Synchronizing package databases...
 core                     118.1 KiB  1458K/s 00:00 [######################] 100%
 extra                   1525.8 KiB  1982K/s 00:01 [######################] 100%
 community                  2.0 MiB  2.33M/s 00:01 [######################] 100%
 multilib                 109.7 KiB  1247K/s 00:00 [######################] 100%
:: There are 25 members in group base-devel:
:: Repository core
   1) autoconf  2) automake  3) binutils  4) bison  5) fakeroot  6) file
   7) findutils  8) flex  9) gawk  10) gcc  11) gettext  12) grep  13) groff
   14) gzip  15) libtool  16) m4  17) make  18) pacman  19) patch
   20) pkg-config  21) sed  22) sudo  23) texinfo  24) util-linux  25) which

Enter a selection (default=all): 
:: There are 4 members in group multilib-devel:
:: Repository multilib
   1) binutils-multilib  2) gcc-multilib  3) lib32-fakeroot
   4) libtool-multilib

Enter a selection (default=all): 
resolving dependencies...
warning: dependency cycle detected:
warning: openssl will be installed before its perl dependency
looking for inter-conflicts...
warning: removing 'gcc-libs' from target list because it conflicts with 'gcc-libs-multilib'
warning: removing 'binutils' from target list because it conflicts with 'binutils-multilib'
warning: removing 'gcc' from target list because it conflicts with 'gcc-multilib'
warning: removing 'libtool' from target list because it conflicts with 'libtool-multilib'

Packages (93): acl-2.2.52-2  archlinux-keyring-20131027-1  attr-2.4.47-1
               bash-4.2.045-5  bzip2-1.0.6-5  ca-certificates-20130906-1
               cloog-0.18.1-2  coreutils-8.22-2  cracklib-2.9.0-2
               curl-7.34.0-2  db-5.3.28-1  diffutils-3.3-1  dirmngr-1.1.1-1
               e2fsprogs-1.42.8-2  expat-2.1.0-3  filesystem-2013.06-1
               gc-7.2.d-2  gcc-libs-multilib-4.8.2-7  gdbm-1.10-3
               glib2-2.38.2-1  glibc-2.18-11  gmp-5.1.3-2  gnupg-2.0.22-1
               gpgme-1.4.3-1  guile-2.0.9-1  iana-etc-2.30-4  isl-0.12.1-2
               less-458-1  lib32-gcc-libs-4.8.2-7  lib32-glibc-2.18-11
               lib32-libltdl-2.4.2-12  libarchive-3.1.2-4  libassuan-2.1.1-1
               libcap-2.23-2  libffi-3.0.13-4  libgcrypt-1.5.3-1
               libgpg-error-1.12-1  libgssglue-0.4-2  libksba-1.3.0-1
               libldap-2.4.38-1  libltdl-2.4.2-12  libmpc-1.0.1-2
               libsasl-2.1.26-6  libssh2-1.4.3-2  libtirpc-0.2.3-2
               libunistring-0.9.3-6  linux-api-headers-3.12.4-1  lzo2-2.06-3
               manjaro-keyring-20120504-1  mpfr-3.1.2.p5-1  ncurses-5.9-6
               openssl-1.0.1.e-5  pacman-mirrorlist-20131230-1  pam-1.1.8-2
               pambase-20130928-1  pcre-8.34-1  perl-5.18.1-1  pinentry-0.8.3-1
               pth-2.0.7-4  python-3.3.3-1  readline-6.2.004-2  run-parts-4.4-1
               shadow-4.1.5.1-7  tar-1.27.1-1  tzdata-2013i-1  xz-5.0.5-2
               zlib-1.2.8-3  autoconf-2.69-1  automake-1.14.1-1
               binutils-multilib-2.24-1  bison-3.0.2-1  fakeroot-1.20-1
               file-5.16-1  findutils-4.4.2-5  flex-2.5.37-1  gawk-4.1.0-2
               gcc-multilib-4.8.2-7  gettext-0.18.3.1-2  grep-2.16-1
               groff-1.22.2-5  gzip-1.6-1  lib32-fakeroot-1.20-1
               libtool-multilib-2.4.2-12  m4-1.4.17-1  make-4.0-2
               pacman-4.1.2-5  patch-2.7.1-2  pkg-config-0.28-1  sed-4.2.2-3
               sudo-1.8.8-1  texinfo-5.2-2  util-linux-2.24-2  which-2.20-6

Total Download Size:    0.28 MiB
Total Installed Size:   451.60 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages ...
 lib32-fakeroot-1.20...    13.8 KiB  6.75M/s 00:00 [######################] 100%
 libtool-multilib-2....   270.4 KiB  1401K/s 00:00 [######################] 100%
(93/93) checking keys in keyring                   [######################] 100%
(93/93) checking package integrity                 [######################] 100%
(93/93) loading package files                      [######################] 100%
(93/93) checking for file conflicts                [######################] 100%
( 1/93) installing linux-api-headers               [######################] 100%
( 2/93) installing tzdata                          [######################] 100%
...
(83/93) installing pacman-mirrorlist               [######################] 100%

/usr/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

...
(93/93) installing libtool-multilib                [######################] 100%
/usr/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/etc/localtime is not a symlink, not updating container timezone.
Generating locales...
  en_US.UTF-8
  de_DE.UTF-8
Generation complete.

Now we can start to create the package. Your chroot will be cleaned before every package build:

==> Building in chroot for [unstable-multilib] (x86_64)...
==> Creating clean working copy [phil]...done
/etc/localtime is not a symlink, not updating container timezone.

Next step is to install all needed dependencies for pamac:

==> Making package: lib32-nvidia-304xx-utils 304.117-1 (Sun Jan  5 10:40:32 UTC 2014)
==> Checking runtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
:: There are 6 providers available for linux>=3.4:
:: Repository core
   1) linux310  2) linux311  3) linux312  4) linux313  5) linux34  6) linux38

Enter a number (default=1): 
looking for inter-conflicts...

Packages (69): dbus-1.6.18-3  fontconfig-2.11.0-1  fontsproto-2.1.2-1
               freetype2-2.5.2-1  hwids-20130915.1-1  hwinfo-21.0-1
               kbd-2.0.1-1  kbproto-1.0.6-1  keyboardctl-0.1.5-2  kmod-16-1
               lib32-libx11-1.6.2-1  lib32-libxau-1.0.8-1  lib32-libxcb-1.10-1
               lib32-libxdmcp-1.1.1-1  lib32-libxext-1.3.2-1
               lib32-libxv-1.0.10-1  libdbus-1.6.18-3  libdrm-2.4.50-1
               libfontenc-1.1.2-1  libpciaccess-0.13.2-2  libpng-1.6.7-1
               libx11-1.6.2-1  libx86emu-1.1-29  libxau-1.0.8-2  libxcb-1.10-1
               libxdmcp-1.1.1-1  libxext-1.3.2-1  libxfont-1.4.6-1
               libxkbfile-1.0.8-1  libxv-1.0.10-1  libxvmc-1.0.8-1
               linux-firmware-20131013.7d0c7a8-1  linux310-3.10.25-1
               manjaro-system-20131229-1  mhwd-catalyst-13.12-1
               mhwd-catalyst-13.4-12.104-1  mhwd-catalyst-legacy-13.1-4
               mhwd-db-0.3.1-2  mhwd-nvidia-331.20-1
               mhwd-nvidia-legacy-304.117-1  mkinitcpio-16-2
               mkinitcpio-busybox-1.21.1-2  mtdev-1.1.4-1  pcmciautils-018-7
               pixman-0.32.4-1  systemd-208-3  v86d-0.1.10-5
               videoproto-2.3.2-1  xcb-proto-1.10-1  xextproto-7.2.1-1
               xf86-input-evdev-2.8.2-1  xkeyboard-config-2.10.1-1
               xorg-bdftopcf-1.0.4-1  xorg-font-util-1.3.0-1
               xorg-font-utils-7.6-3  xorg-fonts-alias-1.0.3-1
               xorg-fonts-encodings-1.0.4-3  xorg-fonts-misc-1.0.1-2
               xorg-mkfontdir-1.0.7-1  xorg-mkfontscale-1.1.1-1
               xorg-server-1.14.5-1  xorg-server-common-1.14.5-1
               xorg-setxkbmap-1.3.0-1  xorg-xkbcomp-1.2.4-1  xproto-7.0.25-1
               lib32-libxvmc-1.0.8-1  lib32-zlib-1.2.8-1  mhwd-0.3.1-1
               nvidia-304xx-utils-304.117-1

Total Download Size:    13.20 MiB
Total Installed Size:   260.91 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages ...
 nvidia-304xx-utils-...    13.2 MiB  3.56M/s 00:04 [######################] 100%
 lib32-libxvmc-1.0.8...    10.3 KiB  5.55K/s 00:02 [######################] 100%
(69/69) checking keys in keyring                   [######################] 100%
(69/69) checking package integrity                 [######################] 100%
(69/69) loading package files                      [######################] 100%
(69/69) checking for file conflicts                [######################] 100%
( 1/69) installing xproto                          [######################] 100%
...
(69/69) installing nvidia-304xx-utils              [######################] 100%
libGl and libglx symlinks are invalid!
Falling back to default...
warning: could not find '/usr/lib/libGL.so.mesa'!
libglx: '/usr/lib/xorg/modules/extensions/libglx.xorg'
==> use mhwd-gpu to set nvidia as default: 'mhwd-gpu --setgl nvidia'
Optional dependencies for nvidia-304xx-utils
    gtk2: nvidia-settings
    pkg-config: nvidia-xconfig [installed]
    opencl-nvidia-304xx: OpenCL support

Then buildtime dependencies will get installed:

==> Checking buildtime dependencies...

Then we download all needed sources to build the package:

==> Retrieving sources...
  -> Downloading NVIDIA-Linux-x86-304.117.run...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 38.2M  100 38.2M    0     0  1208k      0  0:00:32  0:00:32 --:--:-- 1296k
==> Validating source files with sha256sums...
    NVIDIA-Linux-x86-304.117.run ... Passed
==> Extracting sources...
==> Starting build()...
Creating directory NVIDIA-Linux-x86-304.117
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86  304.117.................................................................................................................................................

Now we change into the fakeroot environment and build the package:

==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Purging unwanted files...
  -> Compressing man and info pages...
==> Creating package "lib32-nvidia-304xx-utils"...
  -> Generating .PKGINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: lib32-nvidia-304xx-utils 304.117-1 (Sun Jan  5 10:52:04 UTC 2014)

Last step is to install the package inside our chroot and verfiy it with namcap:

==> Installing package lib32-nvidia-304xx-utils with pacman -U...
loading packages...
resolving dependencies...
looking for inter-conflicts...

Packages (1): lib32-nvidia-304xx-utils-304.117-1

Total Installed Size:   70.80 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) installing lib32-nvidia-304xx-utils          [######################] 100%
libGl and libglx symlinks are invalid!
Falling back to default... 
warning: could not find '/usr/lib/libGL.so.mesa'!
libglx: '/usr/lib/xorg/modules/extensions/libglx.xorg'
==> use mhwd-gpu to set nvidia as default: 'mhwd-gpu --setgl nvidia'

resolving dependencies...
looking for inter-conflicts... 

Packages (5): elfutils-0.157-1  licenses-20130203-1  pyalpm-0.6.2.2-1
              python-pyelftools-0.21-1  namcap-3.2.5-1

Total Installed Size:   4.29 MiB

:: Proceed with installation? [Y/n] 
(5/5) checking keys in keyring                     [######################] 100%
(5/5) checking package integrity                   [######################] 100%
(5/5) loading package files                        [######################] 100%
(5/5) checking for file conflicts                  [######################] 100%
(1/5) installing pyalpm                            [######################] 100%
(2/5) installing licenses                          [######################] 100%
(3/5) installing elfutils                          [######################] 100%
(4/5) installing python-pyelftools                 [######################] 100%
(5/5) installing namcap                            [######################] 100%
Checking PKGBUILD
Checking lib32-nvidia-304xx-utils-304.117-1-x86_64.pkg.tar.xz
lib32-nvidia-304xx-utils E: Symlink (usr/share/licenses/lib32-nvidia-304xx-utils) points to non-existing nvidia-304xx-utils
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libXvMCNVIDIA.so.304.117') has text relocations.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libnvcuvid.so.304.117') has text relocations.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libnvidia-cfg.so.304.117') has text relocations.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libcuda.so.304.117') has text relocations.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libnvidia-glcore.so.304.117') has text relocations.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libnvidia-tls.so.304.117') has text relocations.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libnvidia-compiler.so.304.117') has text relocations.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/vdpau/libvdpau_nvidia.so.304.117') has text relocations.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/nvidia/libGL.so') has text relocations.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libOpenCL.so.1.0.0') has executable stack.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libcuda.so.304.117') has executable stack.
lib32-nvidia-304xx-utils W: ELF file ('usr/lib32/libnvidia-compiler.so.304.117') has executable stack.
lib32-nvidia-304xx-utils E: Missing custom license directory (usr/share/licenses/lib32-nvidia-304xx-utils)
lib32-nvidia-304xx-utils W: Dependency mhwd included but already satisfied

You will find now followed files in your directory:

[phil@manjaro lib32-nvidia-304xx-utils]$ dir
lib32-nvidia-304xx-utils-304.117-1-x86_64-build.log
lib32-nvidia-304xx-utils-304.117-1-x86_64-package.log
lib32-nvidia-304xx-utils-304.117-1-x86_64.pkg.tar.xz
lib32-nvidia-304xx-utils-304.117-1-x86_64.pkg.tar.xz-namcap.log
lib32-nvidia-304xx-utils.install
NVIDIA-Linux-x86-304.117.run
PKGBUILD
PKGBUILD-namcap.log

Signing packages

When you're a packager for official Manjaro repositories you have to sign your package:

[phil@manjaro pamac]$ signpkgs
==> Signing package './pamac-0.9.5-1-any.pkg.tar.xz' with key philm...

You need a passphrase to unlock the secret key for
user: "Philip Müller (Called Little) <philm@manjaro.org>"
2048-bit RSA key, ID 11C7F07E, created 2012-05-05

You will find an additional sig-file in your directory:

[phil@manjaro pamac]$ dir
pamac-0.9.5-1-any.pkg.tar.xz		 pamac-0.9.5.tar.gz
pamac-0.9.5-1-any.pkg.tar.xz-namcap.log  pamac-install
pamac-0.9.5-1-any.pkg.tar.xz.sig	 PKGBUILD
pamac-0.9.5-1-i686-package.log		 PKGBUILD-namcap.log

Your package and signature file can be uploaded with boxit later on.