Accepting request 659779 from home:TheBlackCat:branches:science:HPC

- Add hpc_docdir macro.
- Add cmake directories macros.
- Use upstream-recommended %{_rpmconfigdir}/macros.d directory
  for rpm macros.
- Add meson macro.
- Future-proof cmake macro.

OBS-URL: https://build.opensuse.org/request/show/659779
OBS-URL: https://build.opensuse.org/package/show/science:HPC/suse-hpc?expand=0&rev=39
This commit is contained in:
Dirk Stoecker 2018-12-19 08:20:49 +00:00 committed by Git OBS Bridge
parent 413dd18fa9
commit 1531c9aa43
3 changed files with 78 additions and 18 deletions

View File

@ -32,9 +32,12 @@
%hpc_libexecdir %{hpc_prefix}/lib %hpc_libexecdir %{hpc_prefix}/lib
%hpc_localstatedir %{_localstatedir} %hpc_localstatedir %{_localstatedir}
%hpc_sharedstatedir %{_sharedstatedir} %hpc_sharedstatedir %{_sharedstatedir}
%hpc_mandir %{hpc_prefix}/share/man %hpc_mandir %{hpc_datadir}/man
%hpc_infodir %{hpc_prefix}/share/info %hpc_docdir %{hpc_datadir}/doc/packages
%hpc_infodir %{hpc_datadir}/info
%hpc_pkgconfigdir %{hpc_libdir}/pkgconfig %hpc_pkgconfigdir %{hpc_libdir}/pkgconfig
%hpc_cmake_dir %{hpc_datadir}/cmake
%hpc_cmake_moddir %{hpc_cmake_dir}/Modules
# pkgconfig # pkgconfig
# %hpc_write_pkgconfig [-l <libname>][-n <pkgfile_name>] # %hpc_write_pkgconfig [-l <libname>][-n <pkgfile_name>]
@ -294,7 +297,7 @@ cat << EOF > %{buildroot}%{hpc_module_dep_base}%{version}
--exec-prefix=%{hpc_exec_prefix} \\\ --exec-prefix=%{hpc_exec_prefix} \\\
--bindir=%{hpc_bindir} \\\ --bindir=%{hpc_bindir} \\\
--sbindir=%{hpc_sbindir} \\\ --sbindir=%{hpc_sbindir} \\\
--sysconfdir=%{_sysconfdir} \\\ --sysconfdir=%{hpc_sysconfdir} \\\
--datadir=%{hpc_datadir} \\\ --datadir=%{hpc_datadir} \\\
--includedir=%{hpc_includedir} \\\ --includedir=%{hpc_includedir} \\\
--libdir=%{hpc_libdir} \\\ --libdir=%{hpc_libdir} \\\
@ -637,7 +640,7 @@ sys.exit(0)" %{1}
%hpc_compress_man() \ %hpc_compress_man() \
[ -n "%{*}" ] || { echo "no man page list!" >&2 ; exit 1; } \ [ -n "%{*}" ] || { echo "no man page list!" >&2 ; exit 1; } \
for j in %{*}; do \ for j in %{*}; do \
for i in $(ls %{buildroot}%hpc_mandir/man${j}/*.${j}* | grep -v ".*\.gz$"); \ for i in $(ls %{buildroot}%{hpc_mandir}/man${j}/*.${j}* | grep -v ".*\.gz$"); \
do \ do \
test -L $i && continue \ test -L $i && continue \
gzip $i \ gzip $i \
@ -646,17 +649,66 @@ sys.exit(0)" %{1}
# wraps macro from macros.cmake - paths replaced by HPC paths. # wraps macro from macros.cmake - paths replaced by HPC paths.
%hpc_cmake \ %hpc_cmake \
%{!?cmake:%{error: please include macros.cmake}} \ %{!?cmake:%{error: please include macros.cmake}} \
%{?cmake: \ %{?cmake: \
%global __cmake %{_bindir}/cmake \ %global __cmake %{_bindir}/cmake \
%define _prefix %{hpc_prefix} \ %define _bindir %{hpc_bindir} \
%define _includedir %{hpc_includedir} \
%define _libdir %{hpc_libdir} \
%define _datadir %{hpc_datadir} \ %define _datadir %{hpc_datadir} \
%define _includedir %{hpc_includedir} \
%define _infodir %{hpc_infodir} \
%define _libdir %{hpc_libdir} \
%define _libexecdir %{hpc_libexecdir} \
%define _localstatedir %{hpc_localstatedir} \
%define _mandir %{hpc_mandir} \
%define _prefix %{hpc_prefix} \
%define _sbindir %{hpc_sbindir} \
%define _sharedstatedir %{hpc_sharedstatedir} \
%define _sysconfdir %{hpc_sysconfdir} \
%cmake \\\ %cmake \\\
%undefine __cmake \\\ %undefine __cmake \\\
%undefine _prefix \\\ %undefine _bindir \\\
%undefine _includedir \\\
%undefine _libdir \\\
%undefine _datadir \\\ %undefine _datadir \\\
%undefine _includedir \\\
%undefine _infodir \\\
%undefine _libdir \\\
%undefine _libexecdir \\\
%undefine _localstatedir \\\
%undefine _mandir \\\
%undefine _prefix \\\
%undefine _sbindir \\\
%undefine _sharedstatedir \\\
%undefine _sysconfdir \\\
}
# wraps macro from macros.meson - paths replaced by HPC paths.
%hpc_meson \
%{!?meson:%{error: please include macros.meson}} \
%{?meson: \
%global __meson %{_bindir}/meson \
%define _bindir %{hpc_bindir} \
%define _datadir %{hpc_datadir} \
%define _includedir %{hpc_includedir} \
%define _infodir %{hpc_infodir} \
%define _libdir %{hpc_libdir} \
%define _libexecdir %{hpc_libexecdir} \
%define _localstatedir %{hpc_localstatedir} \
%define _mandir %{hpc_mandir} \
%define _prefix %{hpc_prefix} \
%define _sbindir %{hpc_sbindir} \
%define _sharedstatedir %{hpc_sharedstatedir} \
%define _sysconfdir %{hpc_sysconfdir} \
%meson \\\
%undefine __meson \\\
%undefine _bindir \\\
%undefine _datadir \\\
%undefine _includedir \\\
%undefine _infodir \\\
%undefine _libdir \\\
%undefine _libexecdir \\\
%undefine _localstatedir \\\
%undefine _mandir \\\
%undefine _prefix \\\
%undefine _sbindir \\\
%undefine _sharedstatedir \\\
%undefine _sysconfdir \\\
} }

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri Dec 14 19:20:06 UTC 2018 - Todd R <toddrme2178@gmail.com>
- Add hpc_docdir macro.
- Add cmake directories macros.
- Use upstream-recommended %{_rpmconfigdir}/macros.d directory
for rpm macros.
- Add meson macro.
- Future-proof cmake macro.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Nov 19 01:19:05 UTC 2018 - eich@suse.com Mon Nov 19 01:19:05 UTC 2018 - eich@suse.com

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via https://bugs.opensuse.org/
# #
@ -29,7 +29,6 @@ Source3: hpc_elf.attr
Source4: hpc_elflib.attr Source4: hpc_elflib.attr
Source5: LICENSE Source5: LICENSE
Url: http://www.suse.com/hpc Url: http://www.suse.com/hpc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
Provide rpm macros for building and installing SUSE HPC Provide rpm macros for building and installing SUSE HPC
@ -42,8 +41,8 @@ cp %{S:1} .
gcc -o dlinfo dlinfo.c -ldl gcc -o dlinfo dlinfo.c -ldl
%install %install
mkdir -p %{buildroot}%{_sysconfdir}/rpm mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d
install -m 644 %{S:0} %{buildroot}%{_sysconfdir}/rpm install -m 644 %{S:0} %{buildroot}%{_rpmconfigdir}/macros.d
mkdir -p %{buildroot}%{_rpmconfigdir}/fileattrs mkdir -p %{buildroot}%{_rpmconfigdir}/fileattrs
install -m 755 %{S:2} dlinfo %{buildroot}%{_rpmconfigdir} install -m 755 %{S:2} dlinfo %{buildroot}%{_rpmconfigdir}
install -m 644 %{S:3} %{S:4} %{buildroot}%{_rpmconfigdir}/fileattrs install -m 644 %{S:3} %{S:4} %{buildroot}%{_rpmconfigdir}/fileattrs
@ -56,9 +55,8 @@ cp %{S:5} .
%endif %endif
%files %files
%defattr(-,root,root,-)
%mylicense LICENSE %mylicense LICENSE
%config %{_sysconfdir}/rpm/macros.hpc %{_rpmconfigdir}/macros.d/macros.hpc
%{_rpmconfigdir}/dlinfo %{_rpmconfigdir}/dlinfo
%{_rpmconfigdir}/hpc_elf.pl %{_rpmconfigdir}/hpc_elf.pl
%{_rpmconfigdir}/fileattrs/* %{_rpmconfigdir}/fileattrs/*