File read-edid.spec of Package read-edid

%define realname read-edid
%define realver  3.0.2
%define srcext   tar.gz

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       wiz%{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         Hardware/Other
URL:           http://polypux.org/projects/read-edid/
Summary:       Tool to read the monitor details directly from the monitor

# Build-time parameters
BuildRequires: cmake >= 2.6 gcc-c++
BuildRequires: libx86-devel
BuildRoot:     %{_tmppath}/%{name}-root
Source:        http://polypux.org/projects/read-edid/%{realname}-%{realver}%{?extraver}.%{srcext}
Patch:         read-edid-code-cleanup.patch

%description
read-edid is a pair of tools (originally by John Fremlin) for reading the EDID
from a monitor. It should work with most monitors made since 1996 (except for
newer ones with 256-byte EDID's - WiP), assuming the video card supports the
standard read commands (most do).read-edid is a set of two tools - get-edid,
which gets the raw edid information from the monitor, and parse-edid, which
turns the raw binary information into an XF86Config-compatible monitor section.

%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%patch -p1
head -n -2 CMakeLists.txt > c && %{__mv} -f c CMakeLists.txt

%build
mkdir build
cd build
cmake .. \
 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 -DCMAKE_C_FLAGS="%{optflags}" \
 -DCMAKE_CXX_FLAGS="%{optflags}" \
 -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--strip-all"
%{__make} clean
%{__make} %{?_smp_mflags}

%install
%{__make} -C build install DESTDIR=%{buildroot}

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc AUTHORS LICENSE README
%{_bindir}/*
%doc %{_mandir}/man1/*

%changelog
openSUSE Build Service is sponsored by