Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Octave.txt 5.8 KB

You have to be logged in to leave a comment. Sign In
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
  1. = Octave Packaging Guidelines
  2. == What is Octave?
  3. The definition from https://www.octave.org/[website] says:
  4. _"GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language."_
  5. If you are interested in packaging Octave packages, you should check here for upstream sources:
  6. * https://octave.sourceforge.io/[The Octave Forge website]
  7. == RPM macros
  8. The following macros are defined in /etc/rpm/macros.octave in the octave 3.4.0 (Fedora 15+) package for help in packaging:
  9. ....
  10. # Octave binary API provided
  11. %octave_api %(octave-config -p API_VERSION || echo 0)}
  12. # Octave Package Directories
  13. %octshareprefix %{_datadir}/octave
  14. %octprefix %{octshareprefix}/packages
  15. %octarchprefix %{_libdir}/octave/packages
  16. %octpkgdir %{octshareprefix}/%{octpkg}-%{version}
  17. %octpkglibdir %{octarchprefix}/%{octpkg}-%{version}
  18. # Run an octave command - quietly with no startup files
  19. %octave_cmd()
  20. # Build Source into a package tar file in a temporary location
  21. %octave_pkg_build
  22. # Install a package. We use the octave pkg install command to install the
  23. # built package into the buildroot. We also put a note to prevent the root
  24. # user from removing the package with the octave pkg uninstall command
  25. %octave_pkg_install
  26. # preun script - we need to remove our uninstall protection and perhaps
  27. # run the package's own uninstall script.
  28. %octave_pkg_preun
  29. ....
  30. == Octave packaging tips
  31. === Naming of Octave packages
  32. Packages of Octave packages have their own naming scheme. They should take into account the upstream name of the package. This makes a package name format of `+octave-$NAME+`. When in doubt, use the name of the module that you type to import it in octave.
  33. '''Examples: '''
  34. ....
  35. octave-java (Octave package named java)
  36. octave-gsl (Octave package named gsl)
  37. ....
  38. Limitations in the pkg function of octave (pkg.m) means that versioning of octave packages requires that the package version must have a MAJOR.MINOR.MICRO format. Failing to use this format results in octave not recognising binary package components in %prefix/libexec.
  39. === Updating the octave package database
  40. Octave maintains a list of installed packages in /usr/share/octave/octave_packages that needs to be updated on package install and removal. This file is in an octave plain-text format.
  41. The contents of the /usr/share/octave/packages/ directory are scanned for the following files when performing a pkg('rebuild') from within octave.
  42. * /usr/share/octave/packages/_NAMEOFPACKAGE_/packinfo/COPYING
  43. * /usr/share/octave/packages/_NAMEOFPACKAGE_/packinfo/DESCRIPTION
  44. If these files are not present in any given _NAMEOFPACKAGE_ directory, then octave will silently skip the folder and fail to index it correctly.
  45. Octave will use the contents of octave_packages to modify its path at startup, allowing octave to find plugins.
  46. === Documentation files
  47. All package files are installed into the octave directories.
  48. == Spec Templates for Octave packages
  49. There are two types of Octave packages: arch-specific and noarch.
  50. === Arch specific Octave spec template
  51. ....
  52. %global octpkg image
  53. # Exclude .oct files from provides
  54. %global __provides_exclude_from ^%{octpkglibdir}/.*\\.oct$
  55. Name: octave-%{octpkg}
  56. Version: 1.0.13
  57. Release: 1%{?dist}
  58. Summary: Image processing for Octave
  59. Group: Applications/Engineering
  60. License: GPLv2+
  61. URL: https://octave.sourceforge.io/image/
  62. Source: https://downloads.sourceforge.net/octave/%{octpkg}-%{version}.tar.gz
  63. BuildRequires: octave-devel
  64. Requires: octave(api) = %{octave_api}
  65. Requires(post): octave
  66. Requires(postun): octave
  67. %description
  68. The Octave-forge Image package provides functions for processing images. The
  69. package also provides functions for feature extraction, image statistics,
  70. spatial and geometric transformations, morphological operations, linear
  71. filtering, and much more.
  72. %prep
  73. %setup -q -n %{octpkg}-%{version}
  74. %build
  75. %octave_pkg_build
  76. %install
  77. %octave_pkg_install
  78. %post
  79. %octave_cmd pkg rebuild
  80. %preun
  81. %octave_pkg_preun
  82. %postun
  83. %octave_cmd pkg rebuild
  84. %files
  85. %{octpkglibdir}
  86. %dir %{octpkgdir}
  87. %{octpkgdir}/*.m
  88. %doc %{octpkgdir}/doc-cache
  89. %{octpkgdir}/packinfo
  90. %changelog
  91. * Sat Feb 12 2011 Orion Poplawski <orion@cora.nwra.com> 1.0.13-1
  92. - Initial Fedora package
  93. ....
  94. === Noarch Octave spec template
  95. ....
  96. %global octpkg actuarial
  97. Name: octave-%{octpkg}
  98. Version: 1.1.0
  99. Release: 1%{?dist}
  100. Summary: Actuarial functions for Octave
  101. Group: Applications/Engineering
  102. License: GPLv2+
  103. URL: https://octave.sourceforge.io
  104. Source: https://downloads.sourceforge.net/octave/%{octpkg}-%{version}.tar.gz
  105. BuildArch: noarch
  106. BuildRequires: octave-devel
  107. Requires: octave
  108. Requires(post): octave
  109. Requires(postun): octave
  110. %description
  111. Actuarial functions for Casualty and Property lines.
  112. %prep
  113. %setup -q -n %{octpkg}-%{version}
  114. %build
  115. %octave_pkg_build
  116. %install
  117. %octave_pkg_install
  118. %post
  119. %octave_cmd pkg rebuild
  120. %preun
  121. %octave_pkg_preun
  122. %postun
  123. %octave_cmd pkg rebuild
  124. %files
  125. %dir %{octpkgdir}
  126. %{octpkgdir}/*.m
  127. %doc %{octpkgdir}/doc-cache
  128. %{octpkgdir}/packinfo
  129. %changelog
  130. * Sat Feb 12 2011 Orion Poplawski <orion@cora.nwra.com> 1.1.0-1
  131. - Initial Fedora package
  132. ....
  133. === Summary of differences between arch-specific and noarch octave packages
  134. * Noarch packages set `+BuildArch: noarch+`
  135. * Don't require a specific API version
  136. * Noarch packages don't install anything into %\{octpkglibdir}
  137. === Obsoletes notes
  138. Packages that used to be in the octave-forge package need to have the Obsoletes line above. Packages that were not do not.
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...