Name:        pterodactyl-panel
Version:     1.12.1
Release:     alt1
Summary:     Pterodactyl game server management panel
License:     MIT
Group:       System/Servers
URL:         https://github.com/pterodactyl/panel
VCS:         https://github.com/pterodactyl/panel

Source: %name-%version.tar

BuildArch: noarch

Requires: php8.2-cli
Requires: php8.2-common
Requires: php8.2-curl
Requires: php8.2-gd
Requires: php8.2-mbstring
Requires: php8.2-opcache
Requires: php8.2-pdo
Requires: php8.2-bcmath
Requires: php8.2-intl
Requires: php8.2-xml
Requires: php8.2-zip
Requires: php8.2-tokenizer
Requires: php8.2-fileinfo
Requires: php8.2-session

# DB/web stack are intentionally not hard-required here:
# php8.2-mysqlnd or php8.2-pgsql
# php8.2-fpm
# nginx or apache2

%description
Pterodactyl Panel is a Laravel-based web panel for managing game servers.

This package installs the application into:
  %_datadir/%name

Configuration is placed in:
  %_sysconfdir/%name

Mutable runtime state is placed in:
  %_sharedstatedir/%name

The web server document root should point to:
  %_datadir/%name/public

%prep
%setup -q

#%build
# it's php bruh

%install
install -d %{buildroot}%{_datadir}/%name
cp -a . %{buildroot}%{_datadir}/%name/

# Keep config out of app tree.
install -d %{buildroot}%{_sysconfdir}/%name
install .env.example %{buildroot}%{_sysconfdir}/%name/.env
install .env.example %{buildroot}%{_sysconfdir}/%name/.env.example

#rm -f %{buildroot}%{_datadir}/%name/.env
#rm -f %{buildroot}%{_datadir}/%name/.env.example
ln -s %{_sysconfdir}/%name/.env %{buildroot}%{_datadir}/%name/.env

# Move writable Laravel state out of /usr.
install -d %{buildroot}%{_sharedstatedir}/%name
install -d %{buildroot}%{_sharedstatedir}/%name/storage
install -d %{buildroot}%{_sharedstatedir}/%name/storage/app
install -d %{buildroot}%{_sharedstatedir}/%name/storage/framework
install -d %{buildroot}%{_sharedstatedir}/%name/storage/framework/cache
install -d %{buildroot}%{_sharedstatedir}/%name/storage/framework/sessions
install -d %{buildroot}%{_sharedstatedir}/%name/storage/framework/views
install -d %{buildroot}%{_sharedstatedir}/%name/storage/logs
install -d %{buildroot}%{_sharedstatedir}/%name/bootstrap-cache

rm -rf %{buildroot}%{_datadir}/%name/storage
ln -s %_sharedstatedir/%name/storage %{buildroot}%{_datadir}/%name/storage

install -d %{buildroot}%{_datadir}/%name/bootstrap
rm -rf %{buildroot}%{_datadir}/%name/bootstrap/cache
ln -s %{_sharedstatedir}/%name/bootstrap-cache %{buildroot}%{_datadir}/%name/bootstrap/cache
install -d %{buildroot}%{_docdir}/%name
install README.md %{buildroot}%{_docdir}/%name/README.md
install LICENSE.md %{buildroot}%{_docdir}/%name/LICENSE.md

%files
%doc %_docdir/%name/README.md
%doc %_docdir/%name/LICENSE.md

%dir %_sysconfdir/%name
%config(noreplace) %_sysconfdir/%name/.env
%config %_sysconfdir/%name/.env.example

%dir %_sharedstatedir/%name
%dir %_sharedstatedir/%name/storage
%dir %_sharedstatedir/%name/storage/app
%dir %_sharedstatedir/%name/storage/framework
%dir %_sharedstatedir/%name/storage/framework/cache
%dir %_sharedstatedir/%name/storage/framework/sessions
%dir %_sharedstatedir/%name/storage/framework/views
%dir %_sharedstatedir/%name/storage/logs
%dir %_sharedstatedir/%name/bootstrap-cache

%_datadir/%name

%changelog
* Sat Mar 07 2026 Arseniy Romenskiy <romenskiy2012@altlinux.org> 1.12.1-alt1
- Initial package
