-
Notifications
You must be signed in to change notification settings - Fork 1
/
craftos-pc.spec
64 lines (52 loc) · 2.74 KB
/
craftos-pc.spec
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
Name: craftos-pc
Version: 2.8.3
Release: 1%{?dist}
Summary: Advanced ComputerCraft emulator written in C++
License: MIT
URL: https://www.craftos-pc.cc/
Source0: https://github.com/MCJack123/craftos2/archive/v%{version}/craftos2-v%{version}.tar.gz
Source1: https://github.com/MCJack123/craftos2-lua/archive/v%{version}/craftos2-lua-v%{version}.tar.gz
BuildRequires: make, gcc, gcc-c++, SDL2-devel >= 2.0.8, SDL2_mixer-devel, poco-devel, libharu-devel, ncurses-devel, libpng-devel, libwebp-devel, patchelf, unzip
Requires: craftos-pc-data >= 2.5, SDL2 >= 2.0.8, SDL2_mixer, libharu, libpng, ncurses, libwebp
%description
%prep
%setup -n craftos2-%{version} -q
%setup -T -D -a 1 -n craftos2-%{version} -q
cp -R craftos2-lua-%{version}/* craftos2-lua/
mkdir icons
unzip resources/linux-icons.zip -d icons
%build
make -C craftos2-lua -j$(nproc) linux
%configure
make -j$(nproc)
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p "%{buildroot}%{_bindir}"
DESTDIR="%{buildroot}%{_bindir}" make install
install -D -m 0755 craftos2-lua/src/liblua.so "%{buildroot}%{_libdir}/libcraftos2-lua.so"
patchelf --replace-needed craftos2-lua/src/liblua.so libcraftos2-lua.so "%{buildroot}%{_bindir}/craftos"
install -D -m 0644 icons/CraftOS-PC.desktop "%{buildroot}%{_datadir}/applications/CraftOS-PC.desktop"
install -D -m 0644 icons/16.png "%{buildroot}%{_datadir}/icons/hicolor/16x16/apps/craftos.png"
install -D -m 0644 icons/24.png "%{buildroot}%{_datadir}/icons/hicolor/24x24/apps/craftos.png"
install -D -m 0644 icons/32.png "%{buildroot}%{_datadir}/icons/hicolor/32x32/apps/craftos.png"
install -D -m 0644 icons/48.png "%{buildroot}%{_datadir}/icons/hicolor/48x48/apps/craftos.png"
install -D -m 0644 icons/64.png "%{buildroot}%{_datadir}/icons/hicolor/64x64/apps/craftos.png"
install -D -m 0644 icons/96.png "%{buildroot}%{_datadir}/icons/hicolor/96x96/apps/craftos.png"
install -D -m 0644 icons/128.png "%{buildroot}%{_datadir}/icons/hicolor/128x128/apps/craftos.png"
install -D -m 0644 icons/256.png "%{buildroot}%{_datadir}/icons/hicolor/256x256/apps/craftos.png"
install -D -m 0644 icons/1024.png "%{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/craftos.png"
%files
%license LICENSE
%{_libdir}/libcraftos2-lua.so
%{_bindir}/craftos
%{_datadir}/applications/CraftOS-PC.desktop
%{_datadir}/icons/hicolor/16x16/apps/craftos.png
%{_datadir}/icons/hicolor/24x24/apps/craftos.png
%{_datadir}/icons/hicolor/32x32/apps/craftos.png
%{_datadir}/icons/hicolor/48x48/apps/craftos.png
%{_datadir}/icons/hicolor/64x64/apps/craftos.png
%{_datadir}/icons/hicolor/96x96/apps/craftos.png
%{_datadir}/icons/hicolor/128x128/apps/craftos.png
%{_datadir}/icons/hicolor/256x256/apps/craftos.png
%{_datadir}/icons/hicolor/1024x1024/apps/craftos.png
%changelog