|
|
@@ -29,8 +29,26 @@
|
|
|
# the OpenPKG release identification (for the current package or as a fallback for the bootstrap package)
|
|
|
%l_openpkg_release(F:) %(echo "%{?release}%{!?release:%(@l_prefix@/bin/rpm -q --qf '%{release}' openpkg)}" | sed -e 's;^;X;' -e 's;^X\\([0-9][0-9]*\\.[0-9][0-9]*\\).*$;\\1;' -e 's;^X\\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\\)$;CURRENT;' -e 's;^X.*$;UNKNOWN;' | awk '{ printf(%{?-F:%{-F*}}%{!?-F:"OpenPKG-%s"}, $0); }')
|
|
|
|
|
|
-# the OpenPKG instance location
|
|
|
-%l_location @LOC@
|
|
|
+# the OpenPKG OIDs (root is officially registered at IANA)
|
|
|
+%l_openpkg_oid 1.3.6.1.4.1.18749
|
|
|
+%l_openpkg_oid_bootstrap %{l_openpkg_oid}.4.1
|
|
|
+%l_openpkg_oid_instance %{l_openpkg_oid_bootstrap}.1
|
|
|
+%l_openpkg_oid_platform %{l_openpkg_oid_bootstrap}.2
|
|
|
+%l_openpkg_oid_tagfmtopt %{l_openpkg_oid_bootstrap}.3
|
|
|
+
|
|
|
+# the OpenPKG package tagging
|
|
|
+%l_tag_fmt @TAG@
|
|
|
+%l_tag_fmt_loc %(echo "%{l_prefix}" | sed -e 's;^/\\([^/]\\)[^/]*/\\([^/]\\)[^/]*/\\([^/]\\).*;\\1\\2\\3;' -e 's;^/\\([^/]\\)[^/]*/\\([^/][^/]\\).*;\\1\\2;' -e 's;^/\\([^/][^/]\\)[^/]*/\\([^/]\\).*;\\1\\2;' -e 's;^/\\([^/]\\)[^/]*/\\([^/]\\).*;\\1\\2;' -e 's;^/\\([^/][^/][^/]\\).*;\\1;' -e 's;^/\\([^/][^/]\\).*;\\1;' -e 's;^/\\([^/]\\).*;\\1;')
|
|
|
+%l_tag_fmt_opt %(uuid_ns="`%{l_uuid} -v3 ns:OID %{l_openpkg_oid_tagfmtopt}`"; %{l_uuid} -v3 $uuid_ns '%{?_options}')
|
|
|
+%l_tag_fmt_uuid %(%{l_uuid} -v1)
|
|
|
+%l_tag_fmt_time %(date '+%%Y%%m%%d%%H%%M%%S')
|
|
|
+%l_tag_fmt_user %(%{l_shtool} echo -e '%u')
|
|
|
+%l_tag_fmt_host %(%{l_shtool} echo -e '%h%d')
|
|
|
+%l_tag_gen %{expand:%(echo '%{l_tag_fmt}' | sed -e 's/<\\([a-zA-Z][_a-zA-Z0-9]*\\)>/%%{l_tag_fmt_\\1}/g')}
|
|
|
+%l_tag %(echo "%{l_tag_gen}" | sed -e 's;-;;g')
|
|
|
+
|
|
|
+# the OpenPKG instance location (backward compatibility only)
|
|
|
+%l_location %{l_tag}
|
|
|
|
|
|
# standard RPM host platform identification
|
|
|
# (defaults via "shtool platform" and uname(3); used internally)
|
|
|
@@ -217,6 +235,7 @@
|
|
|
%l_shtool %{l_prefix}/lib/openpkg/shtool
|
|
|
%l_curl %{l_prefix}/lib/openpkg/curl
|
|
|
%l_bash %{l_prefix}/lib/openpkg/bash
|
|
|
+%l_uuid %{l_prefix}/lib/openpkg/uuid
|
|
|
|
|
|
# provide smart paths to tools
|
|
|
%l_tool_locate() %(if [ ".%{expand:%%{?use_%1}}" != . ]; then tool="%{expand:%%{use_%1}}"; elif [ -f "%{l_bindir}/%2" ]; then tool="%{l_bindir}/%2"; elif [ -f "%{l_prefix}/lib/openpkg/%2" ]; then tool="%{l_prefix}/lib/openpkg/%2"; else tool="%2"; fi; echo $tool)
|
|
|
@@ -269,10 +288,10 @@
|
|
|
%_install_script_path @l_prefix@/bin:@l_prefix@/sbin:/bin:/sbin:/usr/bin:/usr/sbin
|
|
|
|
|
|
# override the name scheme for RPM files
|
|
|
-%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-@LOC@.rpm
|
|
|
-%_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-@LOC@.rpm
|
|
|
-%_repackage_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-@LOC@.rpm
|
|
|
-%_solve_name_fmt %{_solve_pkgsdir}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-@LOC@.rpm
|
|
|
+%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-%{l_tag}.rpm
|
|
|
+%_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-%{l_tag}.rpm
|
|
|
+%_repackage_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-%{l_tag}.rpm
|
|
|
+%_solve_name_fmt %{_solve_pkgsdir}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-%{l_tag}.rpm
|
|
|
|
|
|
# override the payload compression for the CPIO parts of an RPM
|
|
|
# (we use the equivalent of "bzip2 -9")
|
|
|
@@ -289,7 +308,7 @@
|
|
|
%ifndef() %if %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
|
|
|
|
|
|
# macro for package option configuration
|
|
|
-%option() %{expand:%%{!?%{1}:%%global %*}} \
|
|
|
+%option() %{expand:%%{!?%{1}:%%global %*}} %{expand:%%global _options %{?_options:%{_options}:}%{1}=%%%{1}} \
|
|
|
Provides: %{name}::%{1} = %(echo '%{expand:%%{%{1}}}' | sed -e 's;%%;%%%%;g' -e 's; ;%%20;g' -e 's; ;%%09;g')
|
|
|
|
|
|
# macros for NoSource/NoPatch (distribution restriction) integrity handling
|