LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File test_spec.spec of Package TEST_spec (Project home:infi777)

#
# spec file for package X
#


Name:           TEST_spec
Version:        0.1
Release:        0
Summary:        To TEST spec on oBS
License:        GPL-3.0
Group:          Applications
Url:            http://www.energy-x.com/
#
# Sources only as a testing article
Source:         http://dl.unvanquished.net/sources/osavul/osavul-1.1.2.tar.gz
Source1:        http://dl.unvanquished.net/deps/linux32-2.tar.bz2
Source2:        http://dl.unvanquished.net/deps/linux64-2.tar.bz2
#
BuildRequires:  xz
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
TESTING openSUSE build service environment

%prep
echo "##===== prep ====="
# if 'Source0' does not create BUILD/%{name}-%{version} in setup macro, 
# need to manually create it, because setup macro will try to 'cd' into it.
mkdir %{name}-%{version}
%setup -D -q

#echo "##============== TESTING env ================="
%dump
#echo "##============== TESTED env ================="

mkdir external_deps
pushd external_deps
%ifarch i586
tar -xjvf %{SOURCE1}
%endif
%ifarch x86_64
tar -xjvf %{SOURCE2}
%endif
popd

%build
echo "##===== build ====="
#echo "##============== TESTING env ================="
#pwd
#ls
#echo "##============== TESTED env ================="

%install
echo "##===== install ====="

# TESTING Copy of files for installs from assest files
#echo "##============== TESTING build env ================="
echo %{_topdir}
#ls %{_topdir}
echo %{SOURCE1}
#cat ~/.rpmmacros
exit 1
#echo "##============== TESTED build env ================="


cat >> COPYING.txt <<EOF
Testin This
EOF

echo "##============== TESTING build env ================="
cat COPYING.txt
ls
echo "##============== TESTED build env ================="

# Desktop
#install -d %{buildroot}%{_datadir}/applications/

# Don't use a suse-macro to support other distributions
cat >> %{name}.desktop <<EOF
[Desktop Entry]
Categories=Applications;
Name=TEST
GenericName=Testing This
Type=Application
Exec=%{name}
Icon=%{name}
EOF

install -Dm 644 %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop

mkdir -p %{buildroot}%{_libdir}/%{name}/

# Helpers
# files as included within Unvanquished universal zip package 
%ifarch i586
install -m 755 external_deps/linux32-2/sel_ldr %{buildroot}%{_libdir}/%{name}/
%endif
%ifarch x86_64
install -m 755 external_deps/linux64-2/sel_ldr %{buildroot}%{_libdir}/%{name}/
%endif


%post


%postun


%files
%defattr(-,root,root,-)
%doc COPYING.txt
%{_bindir}/*
%{_libdir}/%{name}/
%{_datadir}/applications/%{name}.desktop

%changelog