Summary: imake source code configuration and build system
Name: imake
Version: 1.0.9
Release: 1
License: MIT
URL: http://www.x.org

Source0: https://www.x.org/pub/individual/util/imake-1.0.9.tar.gz
Source1: https://www.x.org/pub/individual/util/makedepend-1.0.8.tar.gz
Source2: https://www.x.org/pub/individual/util/gccmakedep-1.0.3.tar.bz2
Source3: https://www.x.org/pub/individual/util/xorg-cf-files-1.0.8.tar.gz
Source4: https://www.x.org/pub/individual/util/lndir-1.0.4.tar.gz
# Adapt ar invocation to binutils 2.36, bug #1943274, in upstream after 1.0.6,
# <https://gitlab.freedesktop.org/xorg/util/cf/-/merge_requests/2>
Patch1: 0001-xorg-cf-files-1.0.6-for-Invoke-ar-cq-with-binutils.patch
Patch2: 0001-imake-1.0.2-for-abort.patch

BuildRequires: pkgconfig gcc gcc-c++ xorg-x11-util-macros xorg-x11-proto-devel

Requires:      gcc

Provides: ccmakedep cleanlinks gccmakedep lndir makedepend
Provides: makeg mergelib mkdirhier mkhtmlindex revpath xmkmf

%description
imake is a build automation system written for the X Window System.
It was used by X from X11R1 (1987) to X11R6.9 (2005), and continued
to be used in XFree86 (last commit 2009). It is implemented on top
of the C preprocessor and make. The first version was written by Todd
Brunhoff at Tektronix.

%package_help

%prep
%setup -q -c %{name}-%{version} -a1 -a2 -a3 -a4

pushd xorg-cf-files-1.0.8
%patch1 -p1 -b .ar
popd

pushd %{name}-%{version}
%patch2 -p1 -b .abort
popd

%build
{
   for i in %{name} makedepend gccmakedep lndir xorg-cf-files ; do
      pushd $i-*
      case $i in
         %{name}|xorg-cf-files)
            %configure --with-config-dir=%{_datadir}/X11/config
            ;;
         *)
            %configure
            ;;
      esac
      %{__make}
      popd
   done
}

%install
{
   for i in %{name} makedepend gccmakedep lndir xorg-cf-files ; do
      pushd $i-*
      %make_install
      popd
   done
}

%files
%{_bindir}/*
%dir %{_datadir}/X11/config
%{_datadir}/X11/config/*

%files help
%{_mandir}/man1/*

%changelog
* Fri Jul 21 2023 houlifei <houlifei@uniontech.com> - 1.0.9-1
- Upgrade to version 1.0.9

* Tue Jun 21 2022 SimpleUpdate Robot <tc@openeuler.org> - 1.0.8-1
- Upgrade to version 1.0.8

* Fri Apr 3 2020 huanghaitao<huanghaitao8@huawei.com> - 1.0.7-17
- Delete patch

* Tue Dec 3 2019 caomeng<caomeng5@huawei.com> - 1.0.7-16
- Package init
