%define	githash	d6c5dd5

Summary:        Generate Your Projects
Name:           gyp
Version:        0.1
Release:        5.git%{githash}%{?_dist_release}
Group:          programming
Vendor:         Project Vine
Distribution:   Vine Linux
Packager:       iwaim

License:        BSD
URL:            https://gyp.gsrc.io
# 1. git clone https://chromium.googlesource.com/external/gyp
# 2. cd gyp
# 3. version=$(grep version= setup.py|cut -d\' -f2)
# 4. revision=$(git log --oneline|head -1|cut -d' ' -f1)
# 5. cd ..
# 6. tar -a --exclude-vcs -cf gyp-$version-git$revision.tar.xz gyp
Source0:        %{name}-%{version}-git%{githash}.tar.gz
Patch0:         gyp-rpmoptflags.patch
Patch1:         gyp-ninja-build.patch
Patch2:         gyp-python3.patch
Patch3:         gyp-python38.patch
Patch4:         gyp-fix-cmake.patch
Patch5:         gyp-python39.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch:      noarch
BuildRequires:  python3-devel
BuildRequires:  python3-rpm-macros
BuildRequires:  python3-setuptools
BuildRequires:  ninja
Requires:       python3
Requires:       python3-setuptools

%description
GYP is a tool to generates native Visual Studio, Xcode and SCons
and/or make build files from a platform-independent input format.

Its syntax is a universal cross-platform build representation
that still allows sufficient per-platform flexibility to accommodate
irreconcilable differences.


%prep
%setup -q -c -n %{name}
%autopatch -p1
for i in $(find pylib -name '*.py'); do
  sed -e '\,#![ \t]*/.*python,{d}' $i > $i.new && touch -r $i $i.new && mv $i.new $i
done


%build
%py3_build


%install
%{__rm} -rf %{buildroot}
%py3_install


%check
%{__python3} gyptest.py test/hello/gyptest-all.py


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-,root,root,-)
%license LICENSE
%doc AUTHORS
%{_bindir}/gyp
%{python3_sitelib}/*

%changelog
* Thu Sep 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.1-5.d6c5dd5
- updated to git HEAD.

* Tue May 05 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.1-4.gite87d37d6
- updated to git HEAD.
- import Patch1-5 from rawhide.
- switch to python3.

* Fri Mar 22 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0.46-1
- update to svn r1569

* Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.1-2.svn827
- rebuild with python-2.7.2

* Fri Jun  4 2010 IWAI, Masaharu <iwai@alib.jp> 0.1-1.svn827
- Initial build.

