Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
141 lines (129 sloc) 4.64 KB
#
# common RPM macro definitions used by YaST
#
%yast_dir %{_datadir}/YaST2
%yast_ydatadir %{yast_dir}/data
%yast_imagedir %{yast_dir}/images
%yast_icondir %{_datadir}/icons
%yast_themedir %{yast_dir}/theme
%yast_localedir %{yast_dir}/locale
%yast_clientdir %{yast_dir}/clients
%yast_moduledir %{yast_dir}/modules
%yast_yncludedir %{yast_dir}/include
%yast_libdir %{yast_dir}/lib
%yast_controldir %{yast_dir}/control
%yast_schemadir %{yast_dir}/schema
%yast_scrconfdir %{yast_dir}/scrconf
%yast_desktopdir %{_datadir}/applications/YaST2
%yast_ybindir %{_prefix}/lib/YaST2/bin
%yast_ystartupdir %{_prefix}/lib/YaST2
%yast_plugindir %{_libdir}/YaST2/plugin
%yast_includedir %{_includedir}/YaST2
%yast_docdir %{_docdir}/%{name}
%yast_logdir %{_localstatedir}/log/YaST2
%yast_vardir %{_localstatedir}/lib/YaST2
%yast_fillupdir %{_datadir}/fillup-templates
%yast_execcompdir %{_prefix}/lib/YaST2
%yast_agentdir %{yast_execcompdir}/servers_non_y2
# prepare sources for build
%yast_prep \
%{_bindir}/y2tool y2autoconf \
%{_bindir}/y2tool y2automake \
\
# '-Wall' exposes several possible problems with our Autotools-setup \
%{_bindir}/autoreconf \\\
--force \\\
--install \\\
-Wall
%yast_configure \
\
# '--disable-debug' adds '-DNDEBUG' to C(XX)FLAGS used by %%configure \
# '--disable-silent-rules'-switch overrides 'AM_SILENT_RULES(yes)' \
%configure \\\
--disable-debug \\\
--disable-silent-rules
# build the yast module using autotools/make
%yast_build \
\
# has %%yast_prep been run already? \
if [ ! -x "./configure" ]; then \
%yast_prep \
fi \
\
# has %%yast_configure been run already? \
if [ ! -f "./Makefile" ]; then \
%yast_configure \
fi \
\
%if "x%{?make_build}" != "x" \
%make_build \
%else # "x%%{?make_build}" != "x" \
%{__make} %{?jobs:-j%jobs}%{?!jobs:%{?_smp_mflags:%_smp_mflags}} \
%endif # "x%%{?make_build}" != "x"
# TODO: coveralls support
%yast_ci_check \
if [ -f "Rakefile" ]; then \
LC_ALL=en_US.UTF-8 rake --verbose --trace check:ci \
fi \
# Run the tests, when "--with=yast_run_ci_tests" osc option is set some
# additional tests are executed (rubocop, spell check...).
%yast_check \
%if %{with yast_run_ci_tests} \
if [ -f "configure.in.in" -o -f "configure.ac.in" ]; then \
# TODO: fix the check:ci task to also work with autotools based modules \
%{__make} check %{?jobs:-j%jobs}%{?!jobs:%{?_smp_mflags:%_smp_mflags}} \\\
VERBOSE=1 \\\
Y2DIR="%{buildroot}/%{yast_dir}" \\\
DESTDIR="%{buildroot}" \
fi \
%yast_ci_check \
%else \
if [ ! -f "%{yast_ydatadir}/devtools/NO_MAKE_CHECK" ]; then \
if [ -f "configure.in.in" -o -f "configure.ac.in" ]; then \
%{__make} check %{?jobs:-j%jobs}%{?!jobs:%{?_smp_mflags:%_smp_mflags}} \\\
VERBOSE=1 \\\
Y2DIR="%{buildroot}/%{yast_dir}" \\\
DESTDIR="%{buildroot}" \
elif [ -f "Rakefile" ]; then \
rake test:unit \
else \
echo "Cannot run tests, no configure.{ac|in}.in or Rakefile found" 1>&2 \
exit 1 \
fi \
fi \
%endif
%yast_desktop_files \
\
# on SUSE we use %%suse_update_desktop_file \
# other distris use %%{_bindir}/desktop-file-validate \
%if 0%{?suse_version} \
for f in $(%{_bindir}/find %{buildroot}/%{yast_desktopdir}/ -name '*.desktop') ; do \
d=${f##*/} \
%suse_update_desktop_file -d ycc_${d%.desktop} ${d%.desktop} \
done \
%else # 0%%{?suse_version} \
%{_bindir}/find %{buildroot}/%{yast_desktopdir}/ -print0 \\\
-name '*.desktop' | %{_bindir}/sort -uz | \\\
%{_bindir}/xargs -0 %{_bindir}/desktop-file-validate \
%endif # 0%%{?suse_version}
# install the yast module using autotools/make
%yast_install \
if [ -f "configure.in.in" -o -f "configure.ac.in" ]; then \
%make_install \
# on SUSE run %%yast_check within %%install \
# other distris may choose to run them during %%check \
%if 0%{?suse_version} || 0%{?yast_check_during_install} \
%yast_check \
%if %{with yast_run_ci_tests} \
%yast_ci_check \
%endif \
%endif # 0%%{?suse_version} || 0%%{?yast_check_during_install} \
elif [ -f "Rakefile" ]; then \
rake install DESTDIR="%{buildroot}" \
else \
echo "Cannot install the package, no configure.{ac|in}.in or Rakefile found" 1>&2 \
exit 1 \
fi \
if [ -d "%{buildroot}/%{yast_desktopdir}"]; then \
%yast_desktop_files \
fi \
You can’t perform that action at this time.