| 1 |
Last changed: 09 July 2016 |
| 2 |
|
| 3 |
Building packages for Alpine |
| 4 |
|
| 5 |
Files in this directory: |
| 6 |
alpine.spec - spec file for building RPMs on RedHat, Fedora and OpenSuse. |
| 7 |
debian/* - files containing instructions for building .deb files |
| 8 |
for use with dpkg |
| 9 |
windows/* - files used to build the Windows Alpine installer. Upon |
| 10 |
release, we set up directory dist.wnt.d with all of the |
| 11 |
files to be installed, and we then run the command |
| 12 |
binstaller wnt 0.98 (or whatever the current version is). |
| 13 |
These scripts are used with Inno Setup 5. |
| 14 |
README - this file. |
| 15 |
|
| 16 |
|
| 17 |
Most Linux distributions include a package management system to |
| 18 |
simplify the installing and uninstalling of programs. There are two |
| 19 |
types of these systems commonly used; RPM is the system used by |
| 20 |
default on RedHat, Fedora, Ubuntu, Mandrake, and SuSE, and dpkg |
| 21 |
is a system used by default on Debian and Mac OS X's fink. |
| 22 |
|
| 23 |
|
| 24 |
Why build your own packages? |
| 25 |
|
| 26 |
An RPM and a .deb file are already provided on the Alpine Information |
| 27 |
Center (http://www.washington.edu/alpine). Additionally, many |
| 28 |
distributions roll their own alpine packages. The files provided here |
| 29 |
will allow people to build their own versions of the same package in |
| 30 |
the event that the provided packages fail to install due to |
| 31 |
compatibility issues, or in the case where one would want to have a |
| 32 |
modified alpine package. Unlike the alpine packages provided by the |
| 33 |
various distributions, the packages built with these scripts are built |
| 34 |
directly from source, and will be released concurrently with every |
| 35 |
alpine release. It may be preferable to use the distributions' alpine |
| 36 |
packages, as they do tend to add value which is intended to enhance |
| 37 |
their users' experience. |
| 38 |
|
| 39 |
|
| 40 |
Building RPMs: |
| 41 |
|
| 42 |
For building RPMs, first find the directory where RPMs are built on |
| 43 |
your system. On Redhat 9, this directory is /usr/src/redhat. You can |
| 44 |
change this directory by editing your .rpmmacros file. Also, you need |
| 45 |
not be root to build an rpm. To build the RPM, place the |
| 46 |
alpine-{version}.tar.gz file in the SOURCES directory, and place the |
| 47 |
alpine.spec file contained here in the SPECS directory. Then, you need |
| 48 |
only issue the command: |
| 49 |
|
| 50 |
rpmbuild -ba alpine.spec |
| 51 |
|
| 52 |
The RPM file will be placed in the RPMS directory, and a source RPM |
| 53 |
will be placed in the SRPMS directory. Installing an RPM is done with |
| 54 |
the command: |
| 55 |
|
| 56 |
rpm -ivh alpine-{version}-1.x86_64.rpm |
| 57 |
|
| 58 |
|
| 59 |
Building .deb files: |
| 60 |
|
| 61 |
For building .deb files, dpkg, the program that builds them, looks in |
| 62 |
the "debian" directory for various control files and build scripts. This |
| 63 |
directory should reside in the top level of the alpine directory, in the |
| 64 |
same directory as the "build" file. This requires copying the |
| 65 |
debian directory contained here to the next level up, which can be |
| 66 |
done via the command: |
| 67 |
|
| 68 |
cp -pr debian ../ |
| 69 |
|
| 70 |
Then, from alpine's root directory, you would issue the command: |
| 71 |
|
| 72 |
dpkg-buildpackage |
| 73 |
|
| 74 |
Note that you must be root in order to build .deb packages. After |
| 75 |
running the above command, the .deb will have been built in the |
| 76 |
directory above the alpine root directory, and it would be of the form |
| 77 |
alpine_{version}_i386.deb. You can then install this package by |
| 78 |
running the command: |
| 79 |
|
| 80 |
dpkg -i alpine_{version}_i386.deb |