blob: 8491ef1dd2c6674d50eec9b49082e0ba1eb3b021 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
SPEC File Format
****************
Keywords
========
* **name** - The name of the package
* **repackage** - Change name of package
* **version** - Version of package
* **release** - Release number of package
* **maintainer** - Name and email address of current package maintainer
* **group** - Name of group the package belongs to
* **upstream_url** - URL to package in repository
* **source_url** - URL to original source package
* **description** - Full description of package
* **summary** - Brief description of package
* **classification** - opensolaris package classification format [1]_
* **arch** - Destined architecture of the package
* **license** - License of the package
Directives
==========
.. note::
All commands issued in a directive block are processed by Bourne-Again Shell,
except for *%transforms*
.. note::
Directives must be closed with the **%end** tag
%prep
-----
Set of commands to be executed *before building*;
such as applying patches to source code in the $BUILD directory, changing
pre-configuration data, etc.
Example::
%prep
# Apply various patches
patch -i $SOURCES/$name-$version-some_fixes.patch
# Change execution path of all scripts
find $BUILD -type f -name "*.py" -exec sed -i -e 's|\!#/usr/local|\!#/usr/bin|g' {} \;
%end
%build
------
Set of commands to be executed as part of the build process;
such as running any configuration scripts, and compiling your application(s).
Example::
%build
./configure --prefix=/opt --with-pymalloc
make -j2
%end
%install
--------
Set of commands to executed as part of the installation process;
such as moving data to the build installation directory after being compiled.
Example::
%install
make install DESTDIR=$BUILDPROTO
%end
%transforms
-----------
A syntatical reference is available from `oracle's transforms documentation <http://docs.oracle.com/cd/E26502_01/html/E21383/xformrules.html>`_
Available shell expansion variables
===================================
* **BUILDROOT** - ipsutils/BUILDROOT/[package]
* **BUILDPROTO** - ipsutils/BUILDROOT/[package]/root
* **BUILD** - ipsutils/BUILD/[package]
* **SOURCES** - ipsutils/SOURCES/[package source_url basename]
* **PKGS** - ipsutils/PKGS/[package]
* **SPKGS** - ipsutils/SPKGS/[package]
.. note::
Macro expansion for ipsutils is in its infancy. If you are familiar with macro expansion
in RPM's SPEC implementation; there is nothing even remotely close to it here. This will be
addressed in the future.
SPEC file example
=================
This is a generic example of an IPS spec file
::
name: ipsutils
version: 0.6.0
release: 1
maintainer: "Joseph Hunkeler <jhunk@stsci.edu>"
upstream_url: http://localhost/$name-$version.tar.gz
source_url: http://localhost/$name-$version.tar.gz
description: "Python IPS library"
summary: "A python based IPS library"
group: developer
classification: "org.opensolaris.category.2008:Development/Distribution Tools"
arch: i386
license: GPL
%prep
%end
%build
python setup.py build
%end
%install
python setup.py install --root=$BUILDPROTO --prefix=/opt/ipsutils
%end
%transforms
<transform dir path=opt$ -> edit group bin sys>
%end
Footnotes
=========
.. [1] `IPS package classifications <http://docs.oracle.com/cd/E26502_01/html/E21383/gentextid-3283.html#scrolltoc>`_
|