%global tarball xf86-video-amdgpu
%global moduledir %(pkg-config xorg-server --variable=moduledir )
%global driverdir %{moduledir}/drivers

# Xorg cannot load hardened build
%undefine _hardened_build

Name:           xorg-x11-drv-amdgpu
Summary:        AMD GPU video driver
Summary(ja):    xorg X11 amdgpu ビデオドライバ
Version:        19.1.0
Release:        1%{?_dist_release}
Group:          User Interface/X Hardware Support
Vendor:         Project Vine
Distribution:   Vine Linux

License:        MIT
URL:            http://www.x.org
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
Source0:        https://www.x.org/archive/individual/driver/%{tarball}-%{version}.tar.bz2

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

BuildRequires:  python
BuildRequires:  xorg-x11-server-sdk >= 1.6
BuildRequires:  mesa-libGL-devel
BuildRequires:  mesa-libgbm-devel
BuildRequires:  libdrm-devel >= 2.4.72
BuildRequires:  kernel-headers
BuildRequires:  automake autoconf libtool pkgconfig
BuildRequires:  xorg-x11-util-macros
BuildRequires:  eudev-libudev-devel

Requires:  hwdata
Requires:  xorg-x11-server-Xorg
Requires:  libdrm >= 2.4.72

%description
X.Org X11 AMDGPU driver

%prep
%autosetup -n %{tarball}-%{version}

%build
#autoreconf -fiv
%configure --disable-static --enable-glamor
%make_build

%install
%make_install
find %{buildroot} -name '*.la' -exec rm -f {} ';'

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%{driverdir}/amdgpu_drv.so
%{_datadir}/X11/xorg.conf.d/10-amdgpu.conf
%{_mandir}/man4/amdgpu.4*

%changelog
* Sat May 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 19.1.0-1
- new upstream release.
- built with xserver-1.20.8.

* Fri Feb 16 2018 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.4.0-3
- rebuild with xserver-1.19.6

* Wed Feb 14 2018 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.4.0-2
- add Distri/Vendor tags

* Wed Feb 14 2018 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.4.0-1
- Initial build for VineLinux (Vine7)
- This package is based on xorg-x11-drv-amdgpu-1.4.0-1.fc28
  Thanks to fc team.
