summaryrefslogtreecommitdiff
path: root/python-reclaimer.spec
blob: 4512068b056f220785f07a57508a8349a17d306a (plain)
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
%global _empty_manifest_terminate_build 0
Name:		python-reclaimer
Version:	2.11.2
Release:	1
Summary:	A libray of SupyrStruct structures and objects for games built with the Blam engine
License:	GPLv3
URL:		https://github.com/Sigmmma/reclaimer
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/bc/4e/78470d2183fc84bb67623ebe5bc55503b28eb0472d94f29158dc8b0b9bc6/reclaimer-2.11.2.tar.gz

Requires:	python3-supyr-struct
Requires:	python3-binilla
Requires:	python3-arbytmap

%description
# Reclaimer
[![](https://img.shields.io/pypi/dm/reclaimer)](https://pypistats.org/packages/reclaimer)
![](https://ci.appveyor.com/api/projects/status/github/Sigmmma/reclaimer?svg=true)
[![PyPI version](https://badge.fury.io/py/reclaimer.svg)](https://pypi.org/project/reclaimer/)
[![GitHub version](https://badge.fury.io/gh/Sigmmma%2Freclaimer.svg)](https://github.com/Sigmmma/reclaimer)

## What is this repository for?

* Reclaimer is a library of [supyr_struct](https://github.com/Sigmmma/supyr_struct) structure descriptors and tag definitions for creating and modifying data files for video games utilizing the Blam engine. These descriptors and definitions are currently limited to Halo 1(xbox, custom edition, and the community made "open sauce" variant) with some support for Stubbs the Zombie. There are plans to branch into Halo 2, though for now the "he2k" sub-module is just a placeholder. Some of the tag definitions have an accompanying object class with methods for manipulating the tag(recalculating inertial matrices in physics tags for example).

## Installing

First install any version of Python 3(The newest version is recommended).

There are two ways to install reclaimer from this point:

*    Open a command prompt and execute ```pip install reclaimer```

or

*    Extract a copy of the repository into a directory titled "reclaimer".
*    Move the file "setup.py" into the directory containing "reclaimer".
*    Open a command prompt, navigate to the directory containing setup.py, and execute:```python setup.py install```
*    During install, python should try to download and install [supyr_struct](https://github.com/Sigmmma/supyr_struct). If it fails to, you must install that as well.

Once the install finishes, reclaimer should be ready to use.

There are currently no test cases, but you should be able to directly import any tag definition from the python interpreter, build it, give it a filepath, and serialize it as shown below:
```
>>> from reclaimer.hek.defs.pphy import pphy_def
>>> asdf = pphy_def.build()
>>> print(asdf)
[ Container, entries:2, pphy
    [ Struct, size:64, entries:6, blam_header
        [ UEnum32, offset:36, size:4, tag_class, 1886414969
             point_physics ]
        [ UInt32, offset:40, size:4, base_address, 1299151482 ]
        [ UInt32, offset:44, size:4, header_size, 64 ]
        [ UInt16, offset:56, size:2, version, 1 ]
        [ UInt16, offset:58, size:2, unknown, 255 ]
        [ UEnum32, offset:60, size:4, engine_id, 1651269997
             halo_1 ]
        ]
    [ Struct, size:64, entries:9, tagdata
        [ Bool32, offset:0, size:4, flags, 0
            ]
        [ FlFloat, offset:4, size:4, wind_coefficient, 0.0 ]
        [ FlFloat, offset:8, size:4, wind_sine_modifier, 0.0 ]
        [ FlFloat, offset:12, size:4, z_translation_rate, 0.0 ]
        [ Float, offset:32, size:4, density, 0.0 ]
        [ Float, offset:36, size:4, air_friction, 0.0 ]
        [ Float, offset:40, size:4, water_friction, 0.0 ]
        [ Float, offset:44, size:4, surface_friction, 0.0 ]
        [ Float, offset:48, size:4, elasticity, 0.0 ]
        ]
    ]
>>> asdf.data.serialize()
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00pphyMozz\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\xffblam
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00')
```




%package -n python3-reclaimer
Summary:	A libray of SupyrStruct structures and objects for games built with the Blam engine
Provides:	python-reclaimer
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
BuildRequires:	python3-cffi
BuildRequires:	gcc
BuildRequires:	gdb
%description -n python3-reclaimer
# Reclaimer
[![](https://img.shields.io/pypi/dm/reclaimer)](https://pypistats.org/packages/reclaimer)
![](https://ci.appveyor.com/api/projects/status/github/Sigmmma/reclaimer?svg=true)
[![PyPI version](https://badge.fury.io/py/reclaimer.svg)](https://pypi.org/project/reclaimer/)
[![GitHub version](https://badge.fury.io/gh/Sigmmma%2Freclaimer.svg)](https://github.com/Sigmmma/reclaimer)

## What is this repository for?

* Reclaimer is a library of [supyr_struct](https://github.com/Sigmmma/supyr_struct) structure descriptors and tag definitions for creating and modifying data files for video games utilizing the Blam engine. These descriptors and definitions are currently limited to Halo 1(xbox, custom edition, and the community made "open sauce" variant) with some support for Stubbs the Zombie. There are plans to branch into Halo 2, though for now the "he2k" sub-module is just a placeholder. Some of the tag definitions have an accompanying object class with methods for manipulating the tag(recalculating inertial matrices in physics tags for example).

## Installing

First install any version of Python 3(The newest version is recommended).

There are two ways to install reclaimer from this point:

*    Open a command prompt and execute ```pip install reclaimer```

or

*    Extract a copy of the repository into a directory titled "reclaimer".
*    Move the file "setup.py" into the directory containing "reclaimer".
*    Open a command prompt, navigate to the directory containing setup.py, and execute:```python setup.py install```
*    During install, python should try to download and install [supyr_struct](https://github.com/Sigmmma/supyr_struct). If it fails to, you must install that as well.

Once the install finishes, reclaimer should be ready to use.

There are currently no test cases, but you should be able to directly import any tag definition from the python interpreter, build it, give it a filepath, and serialize it as shown below:
```
>>> from reclaimer.hek.defs.pphy import pphy_def
>>> asdf = pphy_def.build()
>>> print(asdf)
[ Container, entries:2, pphy
    [ Struct, size:64, entries:6, blam_header
        [ UEnum32, offset:36, size:4, tag_class, 1886414969
             point_physics ]
        [ UInt32, offset:40, size:4, base_address, 1299151482 ]
        [ UInt32, offset:44, size:4, header_size, 64 ]
        [ UInt16, offset:56, size:2, version, 1 ]
        [ UInt16, offset:58, size:2, unknown, 255 ]
        [ UEnum32, offset:60, size:4, engine_id, 1651269997
             halo_1 ]
        ]
    [ Struct, size:64, entries:9, tagdata
        [ Bool32, offset:0, size:4, flags, 0
            ]
        [ FlFloat, offset:4, size:4, wind_coefficient, 0.0 ]
        [ FlFloat, offset:8, size:4, wind_sine_modifier, 0.0 ]
        [ FlFloat, offset:12, size:4, z_translation_rate, 0.0 ]
        [ Float, offset:32, size:4, density, 0.0 ]
        [ Float, offset:36, size:4, air_friction, 0.0 ]
        [ Float, offset:40, size:4, water_friction, 0.0 ]
        [ Float, offset:44, size:4, surface_friction, 0.0 ]
        [ Float, offset:48, size:4, elasticity, 0.0 ]
        ]
    ]
>>> asdf.data.serialize()
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00pphyMozz\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\xffblam
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00')
```




%package help
Summary:	Development documents and examples for reclaimer
Provides:	python3-reclaimer-doc
%description help
# Reclaimer
[![](https://img.shields.io/pypi/dm/reclaimer)](https://pypistats.org/packages/reclaimer)
![](https://ci.appveyor.com/api/projects/status/github/Sigmmma/reclaimer?svg=true)
[![PyPI version](https://badge.fury.io/py/reclaimer.svg)](https://pypi.org/project/reclaimer/)
[![GitHub version](https://badge.fury.io/gh/Sigmmma%2Freclaimer.svg)](https://github.com/Sigmmma/reclaimer)

## What is this repository for?

* Reclaimer is a library of [supyr_struct](https://github.com/Sigmmma/supyr_struct) structure descriptors and tag definitions for creating and modifying data files for video games utilizing the Blam engine. These descriptors and definitions are currently limited to Halo 1(xbox, custom edition, and the community made "open sauce" variant) with some support for Stubbs the Zombie. There are plans to branch into Halo 2, though for now the "he2k" sub-module is just a placeholder. Some of the tag definitions have an accompanying object class with methods for manipulating the tag(recalculating inertial matrices in physics tags for example).

## Installing

First install any version of Python 3(The newest version is recommended).

There are two ways to install reclaimer from this point:

*    Open a command prompt and execute ```pip install reclaimer```

or

*    Extract a copy of the repository into a directory titled "reclaimer".
*    Move the file "setup.py" into the directory containing "reclaimer".
*    Open a command prompt, navigate to the directory containing setup.py, and execute:```python setup.py install```
*    During install, python should try to download and install [supyr_struct](https://github.com/Sigmmma/supyr_struct). If it fails to, you must install that as well.

Once the install finishes, reclaimer should be ready to use.

There are currently no test cases, but you should be able to directly import any tag definition from the python interpreter, build it, give it a filepath, and serialize it as shown below:
```
>>> from reclaimer.hek.defs.pphy import pphy_def
>>> asdf = pphy_def.build()
>>> print(asdf)
[ Container, entries:2, pphy
    [ Struct, size:64, entries:6, blam_header
        [ UEnum32, offset:36, size:4, tag_class, 1886414969
             point_physics ]
        [ UInt32, offset:40, size:4, base_address, 1299151482 ]
        [ UInt32, offset:44, size:4, header_size, 64 ]
        [ UInt16, offset:56, size:2, version, 1 ]
        [ UInt16, offset:58, size:2, unknown, 255 ]
        [ UEnum32, offset:60, size:4, engine_id, 1651269997
             halo_1 ]
        ]
    [ Struct, size:64, entries:9, tagdata
        [ Bool32, offset:0, size:4, flags, 0
            ]
        [ FlFloat, offset:4, size:4, wind_coefficient, 0.0 ]
        [ FlFloat, offset:8, size:4, wind_sine_modifier, 0.0 ]
        [ FlFloat, offset:12, size:4, z_translation_rate, 0.0 ]
        [ Float, offset:32, size:4, density, 0.0 ]
        [ Float, offset:36, size:4, air_friction, 0.0 ]
        [ Float, offset:40, size:4, water_friction, 0.0 ]
        [ Float, offset:44, size:4, surface_friction, 0.0 ]
        [ Float, offset:48, size:4, elasticity, 0.0 ]
        ]
    ]
>>> asdf.data.serialize()
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00pphyMozz\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\xffblam
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00')
```




%prep
%autosetup -n reclaimer-2.11.2

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-reclaimer -f filelist.lst
%dir %{python3_sitearch}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 2.11.2-1
- Package Spec generated