From 242e3c4add3cc31333a00d9106106b7d60a72bfe Mon Sep 17 00:00:00 2001 From: nginn Date: Sun, 27 Dec 2015 18:20:19 +0300 Subject: [PATCH] new rpm rules --- installers/rpm_package_build/bench.spec.i686 | 69 +++++++++++++++++++ .../{bench.spec => bench.spec.x86_64} | 15 ++-- 2 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 installers/rpm_package_build/bench.spec.i686 rename installers/rpm_package_build/{bench.spec => bench.spec.x86_64} (88%) diff --git a/installers/rpm_package_build/bench.spec.i686 b/installers/rpm_package_build/bench.spec.i686 new file mode 100644 index 00000000..aa8c828c --- /dev/null +++ b/installers/rpm_package_build/bench.spec.i686 @@ -0,0 +1,69 @@ +%define name bench +%define version 0.92 +%define unmangled_version 0.92 +%define unmangled_version 0.92 +%define release 1 +%define _buildshell /bin/bash + +Summary: Metadata driven, full-stack web framework +Name: %{name} +Version: %{version} +Release: %{release} +Source0: %{name}-%{unmangled_version}.tar.gz +License: GPL +Group: Development/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +Prefix: %{_prefix} +BuildArch: i686 +Vendor: Frappe Technologies +Url: https://github.com/frappe/bench + +# for building/installing the package +BuildRequires: python + +# centos 6 dependencies +%if 0%{rhel} == 6 +Requires: git, MariaDB-server, MariaDB-client, MariaDB-compat, python-setuptools, nginx +Requires: zlib-devel, bzip2-devel, openssl-devel, postfix, python27-devel, python27 +Requires: libxml2, libxml2-devel, libxslt, libxslt-devel, redis, MariaDB-devel, libXrender, libXext +Requires: python27-setuptools, cronie, sudo, which, xorg-x11-fonts-Type1, xorg-x11-fonts-75dpi, nodejs, npm +Requires: libtiff-devel, libjpeg-devel, libzip-devel, freetype-devel, lcms2-devel, libwebp-devel, tcl-devel, tk-devel +%endif + +# centos 7 dependencies +%if 0%{rhel} == 7 +Requires: git, mariadb-server, mariadb-devel, python-setuptools, nginx +Requires: zlib-devel, bzip2-devel, openssl-devel, postfix, python-devel +Requires: libxml2, libxml2-devel, libxslt, libxslt-devel, redis, libXrender, libXext +Requires: supervisor, cronie, sudo, which, xorg-x11-fonts-75dpi, xorg-x11-fonts-Type1, nodejs, npm +Requires: libtiff-devel, libjpeg-devel, libzip-devel, freetype-devel, lcms2-devel, libwebp-devel, tcl-devel, tk-devel +%endif + +%description +UNKNOWN + +%prep +%setup -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version} +python2.7 setup.py bdist_wheel + +%install +# directory for bench installation +mkdir -p build +# the following is to install bench locally +export ppath=`pwd`/build +export PYTHONPATH=$ppath +export whl_file=`find . -type f -name *.whl` +pip install --root=$ppath $whl_file --ignore-installed +# pip installed bench, now moving it to appropriate location in %{buildroot} +mkdir -p %{buildroot}/usr/lib/python2.7/site-packages/ +cp -r build/usr/* %{buildroot}/usr/ +cp -r bench/ %{buildroot}/usr/lib/python2.7/site-packages/ + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%doc MANIFEST.in LICENSE.md README.md +/usr/bin/* +/usr/lib/* diff --git a/installers/rpm_package_build/bench.spec b/installers/rpm_package_build/bench.spec.x86_64 similarity index 88% rename from installers/rpm_package_build/bench.spec rename to installers/rpm_package_build/bench.spec.x86_64 index 1f90ab0c..d5a15b05 100644 --- a/installers/rpm_package_build/bench.spec +++ b/installers/rpm_package_build/bench.spec.x86_64 @@ -14,12 +14,12 @@ License: GPL Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} -BuildArch: noarch +BuildArch: x86_64 Vendor: Frappe Technologies Url: https://github.com/frappe/bench # for building/installing the package -BuildRequires: python, python-wheel +BuildRequires: python # centos 6 dependencies %if 0%{rhel} == 6 @@ -53,10 +53,11 @@ mkdir -p build export ppath=`pwd`/build export PYTHONPATH=$ppath export whl_file=`find . -type f -name *.whl` -pip install --root=$ppath $whl_file +pip install --root=$ppath $whl_file --ignore-installed # pip installed bench, now moving it to appropriate location in %{buildroot} -mkdir -p %{buildroot}/usr/bin -cp build/usr/bin/bench %{buildroot}/usr/bin/ +mkdir -p %{buildroot}/usr/lib/python2.7/site-packages/ +cp -r build/usr/* %{buildroot}/usr/ +cp -r bench/ %{buildroot}/usr/lib/python2.7/site-packages/ %clean @@ -65,4 +66,6 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc MANIFEST.in LICENSE.md README.md -/usr/bin/bench +/usr/bin/* +/usr/lib/* +/usr/lib64/*