Difference between revisions of "Buildiso with AUR packages: Using buildpkg"

proof read and applied command templates, content templates
m (fix paragraph)
(proof read and applied command templates, content templates)
Line 7: Line 7:


The same XFCE ISO profile will be used as example on this Wiki page.
The same XFCE ISO profile will be used as example on this Wiki page.
==Tools to install==
Sync your system with the latest packages and ensure you have the following packages installed.
* git
* manjaro-tools-{base|base-git}
* manjaro-tools-{pkg|pkg-git}
It is important that you match your tools packages - don't mix the default and git packages.


==Create directories==
==Create directories==
Line 12: Line 21:
The first thing you should probably do is create a directory for your online repository. The online repository is called '''online-repo''' throughout this tutorial and it is located in your home-folder. You however are free to choose name location to your liking. This'll help keep things organized. Your repository consist of only this folder:
The first thing you should probably do is create a directory for your online repository. The online repository is called '''online-repo''' throughout this tutorial and it is located in your home-folder. You however are free to choose name location to your liking. This'll help keep things organized. Your repository consist of only this folder:


~ $ mkdir ~/online-repo/x86_64
{{UserCmd|command=mkdir ~/online-repo/x86_64}}


This online repository is created in your home folder, but you can create it anywhere you want.
This online repository is created in your home folder, but you can create it anywhere you want.
Line 20: Line 29:
Create a folder for the packages you want to build. The name is arbitrary decriptor - you can call it anything you think suitable.
Create a folder for the packages you want to build. The name is arbitrary decriptor - you can call it anything you think suitable.


~ $ mkdir ~/pkgbuild
{{UserCmd|command=mkdir ~/pkgbuild}}


Clone the relevant package(s) from AUR or from Github. Later you might create them yourself! You can select any package to build but as example we build the package <code>kickshaw</code>. Kickshaw is modern menu editor for among others openbox. First you add it to your pkgubild repo. Do this using git
Clone the relevant package(s) from AUR or from Github. Later you might create them yourself! You can select any package to build but as example we build the package <code>kickshaw</code>. Kickshaw is modern menu editor for among others openbox. First you add it to your pkgubild repo. Do this using git


~ $ cd ~/pkgbuild
{{UserCmd|command=cd ~/pkgbuild}}
~/pkgbuild $
~/pkgbuild $ git clone https://aur.archlinux.org/kickshaw


Now you have a folder with a <code>PKGBUILD</code> file in your repo
Clone the example package from AUR


~/pkgbuild $ ls -R  
{{UserCmd|command=git clone <nowiki>https://aur.archlinux.org/kickshaw</nowiki>}}
~/pkgbuild $ cat kickshaw/PKGBUILD
 
Now you have a folder with a <code>PKGBUILD</code> file in your pkgbuild repository.
 
{{UserCmd|command=ls -R ~/pkgbuild}}
 
It is best practice to always familarize yourself with the content of the package to ensure everything is as expected.


==Building with buildpkg==
==Building with buildpkg==
Line 37: Line 49:
The '''buildpkg''' has some options you need to familiarize yourself with.
The '''buildpkg''' has some options you need to familiarize yourself with.


~/pkgbuild $ buildpkg -h
{{File|file=buildpkg -h|content=<pre>
 
Usage: buildpkg [options]
Usage: buildpkg [options]
  -p <pkg>          Build list or pkg [default: default]
    -p <pkg>          Build list or pkg [default: default]
  -a <arch>          Arch [default: x86_64]
    -a <arch>          Arch [default: x86_64]
  -b <branch>        Branch [default: unstable]
    -b <branch>        Branch [default: unstable]
  -r <dir>          Chroots directory
    -r <dir>          Chroots directory
                      [default: /var/cache/manjaro-tools]
                        [default: /var/cache/manjaro-tools]
  -i <pkgs>          Install packages into the working copy of the chroot
    -i <pkgs>          Install packages into the working copy of the chroot
  -c                Recreate chroot
    -c                Recreate chroot
  -w                Clean up cache and sources
    -w                Clean up cache and sources
  -n                Install and run namcap check
    -n                Install and run namcap check
  -s                Sign packages
    -s                Sign packages
  -u                Udev base-devel group (no systemd)
    -u                Udev base-devel group (no systemd)
  -q                Query settings and pretend build
    -q                Query settings and pretend build
  -h                This help
    -h                This help
</pre>}}


Next thing to do is build the package. Please note that you must be located one level above your actual PKGBUILD. Understand this as the <code>-p</code> argument is '''the name of the folder''' holding the PKGBUILD instructionset.  
Next thing to do is build the package. Please note that you must be located one level above your actual PKGBUILD. Understand this as the <code>-p</code> argument is '''the name of the folder''' holding the PKGBUILD instructionset.  


~/pkgbuild $ buildpkg -p kickchaw
{{UserCmd|command=buildpkg -p kickchaw}}


For more examples how to use '''buildpkg''', look [https://wiki.manjaro.org/index.php?title=Manjaro-tools#buildpkg here].
For more examples how to use '''buildpkg''', look [https://wiki.manjaro.org/index.php?title=Manjaro-tools#buildpkg here].
Line 64: Line 76:
==Copy package files to online repository==
==Copy package files to online repository==


The resulting package is created in this directory on your system:
The resulting package is saved in the location defined in your manjaro-tools.conf on your system (default is the cache folder)
 
/var/cache/manjaro-tools/pkg/<code>$branch</code>/<code>$arch</code>


On a 64-Bit system using the stable branch the exact path is
{{UserCmd|command=ls /var/cache/manjaro-tools/pkg/stable/x86_64}}
 
/var/cache/manjaro-tools/pkg/stable/x86_64


You should see compressed package files. The file name should end with <code>.pkg.tar.zst</code>.
You should see compressed package files. The file name should end with <code>.pkg.tar.zst</code>.
Line 76: Line 84:
Copy or move your package files to your online repository:
Copy or move your package files to your online repository:


~/pkgbuild $ cp -r /var/cache/manjaro-tools/pkg/stable ~/online-repo
{{UserCmd|command=mv /var/cache/manjaro-tools/pkg/stable/x86_64 ~/online-repo}}


==Build a .db file==
==Build a .db file==
Line 82: Line 90:
To keep track of available packages the ''pacman'' package manager uses database files which is downloaded and kept on your computer. You need to create such a database file for your repo. It is crucial that your database filename is the same as your repo name. If your repo is named '''online-repo''' then your database name must be '''online-repo.db.tar.gz'''.
To keep track of available packages the ''pacman'' package manager uses database files which is downloaded and kept on your computer. You need to create such a database file for your repo. It is crucial that your database filename is the same as your repo name. If your repo is named '''online-repo''' then your database name must be '''online-repo.db.tar.gz'''.


Use the command <code>repo-add</code> to build a database file
Use the command <code>repo-add</code> to build a database file inside your designated repo folder


~/pkgbuild $ cd ~/online-repo/x86_64
{{UserCmd|command=cd ~/online-repo/x86_64}}
~/online-repo/x86_64 $ repo-add online-repo.db.tar.gz *.pkg.tar.*
{{UserCmd|command=repo-add online-repo.db.tar.gz *.pkg.tar.*}}
~/online-repo/x86_64 $ ls
{{File|file=~/online-repo/x86_64|content=<pre>
kickshaw-0.5-2-x86_64.pkg.tar.zst online-repo.db online-repo.db.tar.gz online-repo.files online-repo.files.tar.gz
kickshaw-0.5-2-x86_64.pkg.tar.zst
online-repo.db
online-repo.db.tar.gz
online-repo.files
online-repo.files.tar.gz
</pre>}}


Every time you change the content of your online repository, the database must be rebuild! Otherwise, ''buildiso'' will complain later about missing packages in your online repository.
Every time you change the content of your online repository, the database must be rebuild! Otherwise, ''buildiso'' will complain later about missing packages in your online repository.
Line 97: Line 110:
Now you need to upload online-repo to your Host Server. Upload everything from online-repo to your Host Server. Your web address as to match the name of the directory folder you created. This is what your web address should look like after upload online-repo to your Host Server.
Now you need to upload online-repo to your Host Server. Upload everything from online-repo to your Host Server. Your web address as to match the name of the directory folder you created. This is what your web address should look like after upload online-repo to your Host Server.


64-Bit Repository
  <nowiki>http://www.myserver.com/repository/online-repo/x86_64/</nowiki>
 
  http://www.myserver.com/repository/online-repo/x86_64/


==Add online-repo to your iso-profile==
==Add online-repo to your iso-profile==


Create a file
Create a file
{{File|file=${profile_dir}/user-repos.conf|content=<pre>
[online-repo]
SigLevel = Never
Server = <nowiki>http://www.myserver.com/repository/online-repo/$repo/$arch</nowiki></pre>}}


${profile_dir}/user-repos.conf
Custom online repositories will be added to the resulting '''pacman.conf'''. This means AUR packages cannot be installed unless you are using webserver to provide <code>[online-repo]</code> as shown this article).
 
Add these lines
 
[online-repo]
SigLevel = Never
Server = http://www.myserver.com/repository/online-repo/$repo/$arch
 
Custom online repositories will be added to the resulting pacman.conf. This means AUR packages are best installed from a custom online repository (as demonstrated by <code>[online-repo]</code> in this tutorial).


==Add package names to ISO profile==
==Add package names to ISO profile==


Using the example mentioned in [https://wiki.manjaro.org/index.php?title=Build_Manjaro_ISOs_with_buildiso#Packages-Xfce here], you can now add the AUR package names to your <code>Packages-Xfce</code> file.
Now you add <code>kickshaw</code> to your package list for your ISO profile. This means your '''Packages-Desktop''' file should look something like this:
 
Attention: You need to add all dependency names '''before''' the package name (only for dependencies from the AUR).


Now you add <code>kickshaw</code> to your package list for your ISO profile. This means your <code>/usr/share/manjaro-tools/iso-profiles/official/xfce/Packages-Xfce</code> file should look something like this:
{{File|file=~/iso-profiles/manjaro/xfce/Packages-Desktop|content=<pre>
ffmpegthumbnailer
gconf # fix qt-theme
gnome-keyring # fix wlan segfault
gufw # firewall
accountsservice
lightdm-gtk-greeter
lightdm-gtk-greeter-settings
light-locker
manjaro-settings-manager
menulibre


## XFCE Main Packages
## AUR packages
ffmpegthumbnailer
kickshaw</pre>}}
gconf # fix qt-theme
gnome-keyring # fix wlan segfault
gufw # firewall
accountsservice
lightdm-gtk-greeter
lightdm-gtk-greeter-settings
light-locker
manjaro-settings-manager
menulibre
...
## AUR packages
'''kickshaw'''


==Cleaning build environment==
==Cleaning build environment==
Line 142: Line 145:
For removing your build environment from your hard drive, execute:
For removing your build environment from your hard drive, execute:


~ $ sudo rm -r /var/lib/manjaro-tools/buildpkg
{{UserCmd|command=sudo rm -r /var/lib/manjaro-tools/buildpkg}}
 


==More==
==NOTE==


Now, you can continue to [https://wiki.manjaro.org/index.php?title=Build_Manjaro_ISOs_with_buildiso#manjaro-tools.conf adjust your manjaro-tools.conf] or [https://wiki.manjaro.org/index.php?title=Build_Manjaro_ISOs_with_buildiso#Build_your_ISO build your ISO].
Now, you can continue to [https://wiki.manjaro.org/index.php?title=Build_Manjaro_ISOs_with_buildiso#manjaro-tools.conf adjust your manjaro-tools.conf] or [https://wiki.manjaro.org/index.php?title=Build_Manjaro_ISOs_with_buildiso#Build_your_ISO build your ISO].


 
Creating an online repo requires you to keep the repo up-to-date when changes are made upstream.
Please remember to include <code>pamac</code> or another AUR helper as only such apps can update packages from the AUR.
 


[[Category:Contents Page]]
[[Category:Contents Page]]
Moderators, translator
455

edits