gyp/gyp.spec
2020-08-28 14:41:56 +08:00

58 lines
1.7 KiB
RPMSpec

%global revision fcd686f1
%{expand: %%global archivename gyp-%{version}%{?revision:-git%{revision}}}
Name: gyp
Version: 0.1
Release: 1
Summary: Generate Your Projects
License: BSD
URL: http://code.google.com/p/gyp
# No released tarball available. so the tarball was generated
# from svn as following:
#
# 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.tar -a --exclude-vcs -cf /tmp/gyp-$version-git$revision.tar.bz2 *
Source0: %{archivename}.tar.xz
Patch0: gyp-rpmoptflags.patch
Patch1: gyp-ninja-build.patch
Patch2: gyp-python3.patch
Patch3: gyp-python38.patch
Patch4: gyp-fix-cmake.patch
BuildRequires: python3-devel python3-setuptools
Requires: python3-setuptools
BuildRequires: gcc gcc-c++ ninja-build
BuildArch: noarch
%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
%autosetup -p1 -c -n %{archivename}
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
%{__python3} setup.py build
%install
%{__python3} setup.py install --root $RPM_BUILD_ROOT --skip-build
%check
%{__python3} gyptest.py test/hello/gyptest-all.py
%files
%license LICENSE
%doc AUTHORS
%{_bindir}/gyp
%{python3_sitelib}/*
%changelog
* Fri Aug 21 2020 Ge Wang <wangge20@huawei.com> - 0.1-1
- Package init