]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
- split macros into language/feature specific files
authorJan Rękorajski <baggins@pld-linux.org>
Fri, 3 Jan 2020 12:50:18 +0000 (21:50 +0900)
committerJan Rękorajski <baggins@pld-linux.org>
Fri, 3 Jan 2020 12:50:18 +0000 (21:50 +0900)
18 files changed:
attr.kernel [new file with mode: 0644]
macros.browser-plugins [new file with mode: 0644]
macros.cacti [new file with mode: 0644]
macros.emacs [new file with mode: 0644]
macros.ghc [new file with mode: 0644]
macros.kernel
macros.nagios [new file with mode: 0644]
macros.openldap [new file with mode: 0644]
macros.perl [new file with mode: 0644]
macros.pld
macros.python [new file with mode: 0644]
macros.systemd [new file with mode: 0644]
macros.tcl [new file with mode: 0644]
macros.upstart [new file with mode: 0644]
macros.webapp [new file with mode: 0644]
macros.xmms [new file with mode: 0644]
macros.xorg [new file with mode: 0644]
rpm-build-macros.spec

diff --git a/attr.kernel b/attr.kernel
new file mode 100644 (file)
index 0000000..38a1637
--- /dev/null
@@ -0,0 +1,2 @@
+%__kernel_provides     %{_rpmconfigdir}/kmod-deps.sh --provides --modinfo %__modinfo
+#__kernel_requires     %{_rpmconfigdir}/kmod-deps.sh --requires --modinfo %__modinfo
diff --git a/macros.browser-plugins b/macros.browser-plugins
new file mode 100644 (file)
index 0000000..b059f58
--- /dev/null
@@ -0,0 +1,26 @@
+# browser plugins v2
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# Usage:
+#      %browser_plugins_add_browser <name> -p <plugindir>
+#
+#  <name> (required) -- name of the browser. usually %{name}.
+#  -p <plugindir> (required) -- in what directory browser searches for its plugins.
+#  -b -- default blacklists
+#  -a <arch> override arch
+#
+# Example:
+#   %browser_plugins_add_browser %{name} -p %{_firefoxdir}/plugins
+
+%_browserpluginsconfdir                /etc/browser-plugins
+%_browserpluginsdir            %{_libdir}/browser-plugins
+%update_browser_plugins                /usr/sbin/update-browser-plugins || :
+
+%browser_plugins_add_browser(p:b:a:) \
+       browser=%1.%{!-a:%{_target_base_arch}}%{-a*} \
+       install -d $RPM_BUILD_ROOT%{_browserpluginsconfdir}/{blacklist,browsers}.d \
+       ln -s %{-p*} $RPM_BUILD_ROOT%{_browserpluginsconfdir}/browsers.d/$browser \
+       blacklist_file=$RPM_BUILD_ROOT%{_browserpluginsconfdir}/blacklist.d/$browser.blacklist \
+       echo '# This file format is shell globs at base dir of plugindir' > $blacklist_file \
+       %{-b:cat >> $blacklist_file %{-b*}} \
+%{nil}
diff --git a/macros.cacti b/macros.cacti
new file mode 100644 (file)
index 0000000..d0592c6
--- /dev/null
@@ -0,0 +1,23 @@
+# Import or update Cacti template.
+#
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# Usage:
+# %cacti_import_template XMLFILE
+#  XMLFILE -- XML template to import
+#
+# Sample:
+# %post
+# %cacti_import_template %{resourcedir}/cacti_host_template_varnish.xml
+#
+# Requires:            cacti >= 0.8.7e-8
+# BuildRequires:       rpmbuild(macros) >= 1.630
+# Note: 1.1 (cacti-0.8.7h) adds requirement for --with-template-rras or --with-user-rras option
+
+%cacti_import_template() {\
+v=$(%{__sed} -rne 's/.+Add Graphs Script ([0-9\.]+).+/\1/p' /usr/share/cacti/cli/import_template.php); \
+if [ "$v" != "1.0" ]; then \
+       rra="--with-template-rras"; \
+fi; \
+/usr/share/cacti/cli/import_template.php --filename=%1 $rra || :; \
+}%{nil}
diff --git a/macros.emacs b/macros.emacs
new file mode 100644 (file)
index 0000000..bfd2f63
--- /dev/null
@@ -0,0 +1,4 @@
+# (X)emacs support
+%___emacs_lispdir_helper -batch -q -eval '(while load-path (princ (concat (car load-path) "\\n")) (setq load-path (cdr load-path)))' 2> /dev/null|sed -n '/\\(.*\\/x\\?emacs\\/site-lisp\\)\\/\\?$/{s,,\\1,p;q;}'
+%_emacs_lispdir %{expand:%%global _emacs_lispdir %(Z=$(emacs %___emacs_lispdir_helper); echo ${Z:-ERROR})}%_emacs_lispdir
+%_xemacs_lispdir %{expand:%%global _xemacs_lispdir %(Z=$(xemacs %___emacs_lispdir_helper); echo ${Z:-ERROR})}%_xemacs_lispdir
diff --git a/macros.ghc b/macros.ghc
new file mode 100644 (file)
index 0000000..5842cf8
--- /dev/null
@@ -0,0 +1,13 @@
+# Haskell Macros
+# BuildRequires:       rpmbuild(macros) >= 1.608
+%ghcdir                ghc-%(/usr/bin/ghc --numeric-version 2>/dev/null || echo ERROR)
+
+# update /usr/lib*/ghc-*/package.conf.d/package.cache
+# Requires: ghc
+# BuildRequires:       rpmbuild(macros) >= 1.607
+#
+%ghc_pkg_recache() {{ \
+       umask 022; \
+       [ ! -x /usr/bin/ghc-pkg ] || /usr/bin/ghc-pkg recache; \
+};} \
+%{nil}
index 4c7998ee2af7eceb7d6506a5ee9133b543522239..84d96b0b6518e976638a162b933ad83bc70d693b 100644 (file)
@@ -5,13 +5,6 @@
 
 %__modinfo             /sbin/modinfo
 
-# Path to scripts to autogenerate gstreamer package dependencies,
-#
-# Note: Used iff _use_internal_dependency_generator is non-zero. The
-# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
-%__kernel_provides     %{_rpmhome}/kmod-deps.sh --provides --modinfo %__modinfo
-#__kernel_requires     %{_rpmhome}/kmod-deps.sh --requires --modinfo %__modinfo
-
 # Alternative kernel type/version
 %_alt_kernel   %{nil}%{?alt_kernel:-%{?alt_kernel}}
 %_build_kernels        %{nil}%{?build_kernels:%{?build_kernels}}%{!?build_kernels:%{?alt_kernel}}
diff --git a/macros.nagios b/macros.nagios
new file mode 100644 (file)
index 0000000..24e312d
--- /dev/null
@@ -0,0 +1,41 @@
+# Hook to register nagios object based plugins in Nagios NRPE daemon config.
+#
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# Usage:
+#  -a NAME  -- add command named NAME
+#  -d NAME  -- remove command named NAME
+#  -f FILE  -- specify plugin configuration FILE to extract command definition from
+#
+# Sample:
+# %triggerin -- nagios-nrpe
+# %nagios_nrpe -a %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
+#
+# %triggerun -- nagios-nrpe
+# %nagios_nrpe -d %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
+#
+# Requirements:
+# Requires:                    grep
+# Requires:                    sed >= 4.0
+# BuildRequires:       rpmbuild(macros) >= 1.685
+%nagios_nrpe(a:d:c:f:) {\
+       if %{__grep} -q '^include_dir=/etc/nagios/nrpe.d' /etc/nagios/nrpe.cfg && [ -d /etc/nagios/nrpe.d ]; then \
+               file=/etc/nagios/nrpe.d/%{-a*}%{-d*}.cfg; \
+       else \
+               file=/etc/nagios/nrpe.cfg; \
+       fi; \
+       m=$(test -f $file && md5sum < $file); \
+       %{-a:# on -a and config exists \
+       if [ -f /etc/nagios/nrpe.cfg ]; then \
+               if [ ! -f $file ] || ! %{__grep} -q '^command\[%{-a*}\]' $file; then \
+                       %{__sed} -ne 's/^[ \t]*command_line[ \t]\+\(.\+\)/command[%{-a*}]=\1/p' %{-f*} >> $file; \
+               fi; \
+       fi;} \
+       %{-d:# on package remove, -d and config exists \
+       if [ "$1" = "0" -a -f $file ]; then \
+               %{__sed} -i -e '/^[ \t]*command\[%{-d*}\]/d' $file; \
+       fi;} \
+       if [ "$m" != "$(md5sum < $file)" ]; then \
+               %service -q nrpe restart; \
+       fi; \
+}%{nil}
diff --git a/macros.openldap b/macros.openldap
new file mode 100644 (file)
index 0000000..44207de
--- /dev/null
@@ -0,0 +1,44 @@
+# Register OpenLDAP schema.
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# Usage:
+#   %%openldap_schema_register [-d core,nis] %{schemadir}/horde.schema
+#
+#  -d specify dependant schemas, separated by comma
+#
+%openldap_schema_register(d:) \
+for schema in %*; do \
+       if ! grep -q "$schema" /etc/openldap/slapd.conf; then \
+               %{__sed} -i -e " \
+                       /^include.*local.schema/{ \
+                               iinclude\\t     $schema\
+                       } \
+               " /etc/openldap/slapd.conf \
+       fi \
+done \
+# enable dependant schemas \
+if [ "%{-d*}" ]; then \
+       %{__sed} -i -e ' \
+       /^#include.*\\(%(echo '%{-d*}' | %{__sed} -e 's/,/\\\\|/g')\\)\\.schema/{ \
+               s/^#// \
+       }' /etc/openldap/slapd.conf \
+fi \
+%{nil}
+
+# Unregister OpenLDAP schema.
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# Usage:
+#   %%openldap_schema_unregister %{schemadir}/horde.schema
+#
+%openldap_schema_unregister() \
+for schema in %*; do \
+       if grep -q "$schema" /etc/openldap/slapd.conf; then \
+               %{__sed} -i -e " \
+               /^include.*$(echo "$schema" | %{__sed} -e 's,/,\\\\/,g')/d \
+               # for symmetry it would be nice if we disable enabled schemas in post, \
+               # but we really can not do that, it would break something else. \
+               " /etc/openldap/slapd.conf \
+       fi \
+done \
+%{nil}
diff --git a/macros.perl b/macros.perl
new file mode 100644 (file)
index 0000000..dc61310
--- /dev/null
@@ -0,0 +1,10 @@
+# Perl specific macro definitions.
+
+%__perl                        /usr/bin/perl
+
+%perl_privlib          %{expand:%%global perl_privlib %(eval $(%{__perl} -V:installprivlib 2>/dev/null); echo ${installprivlib:-ERROR})}%perl_privlib
+%perl_archlib          %{expand:%%global perl_archlib %(eval $(%{__perl} -V:installarchlib 2>/dev/null); echo ${installarchlib:-ERROR})}%perl_archlib
+%perl_vendorlib                %{expand:%%global perl_vendorlib %(eval $(%{__perl} -V:installvendorlib 2>/dev/null); echo ${installvendorlib:-ERROR})}%perl_vendorlib
+%perl_vendorarch       %{expand:%%global perl_vendorarch %(eval $(%{__perl} -V:installvendorarch 2>/dev/null); echo ${installvendorarch:-ERROR})}%perl_vendorarch
+%perl_sitelib          %{expand:%%global perl_sitelib %(eval $(%{__perl} -V:installsitelib 2>/dev/null); echo ${installsitelib:-ERROR})}%perl_sitelib
+%perl_sitearch         %{expand:%%global perl_sitearch %(eval $(%{__perl} -V:installsitearch 2>/dev/null); echo ${installsitearch:-ERROR})}%perl_sitearch
index 9ac562c19d5e28834837c3feab052d4a8dddc5cd..ffc1494f8f8700950c10b67cc1b45e2bd5e67426 100644 (file)
@@ -1003,170 +1003,6 @@ fi; \
 #
 %_missing_doc_files_terminate_build    1%{nil}
 %_unpackaged_files_terminate_build     %{nil}
-# (X)emacs support
-%___emacs_lispdir_helper -batch -q -eval '(while load-path (princ (concat (car load-path) "\\n")) (setq load-path (cdr load-path)))' 2> /dev/null|sed -n '/\\(.*\\/x\\?emacs\\/site-lisp\\)\\/\\?$/{s,,\\1,p;q;}'
-%_emacs_lispdir %{expand:%%global _emacs_lispdir %(Z=$(emacs %___emacs_lispdir_helper); echo ${Z:-ERROR})}%_emacs_lispdir
-%_xemacs_lispdir %{expand:%%global _xemacs_lispdir %(Z=$(xemacs %___emacs_lispdir_helper); echo ${Z:-ERROR})}%_xemacs_lispdir
-
-%__perl_provides %{nil}
-%__perl_requires %{nil}
-%__mono_provides %{nil}
-%__mono_requires %{nil}
-
-# Perl specific macro definitions.
-%perl_privlib          %{expand:%%global perl_privlib %(eval $(%{__perl} -V:installprivlib 2>/dev/null); echo ${installprivlib:-ERROR})}%perl_privlib
-%perl_archlib          %{expand:%%global perl_archlib %(eval $(%{__perl} -V:installarchlib 2>/dev/null); echo ${installarchlib:-ERROR})}%perl_archlib
-%perl_vendorlib                %{expand:%%global perl_vendorlib %(eval $(%{__perl} -V:installvendorlib 2>/dev/null); echo ${installvendorlib:-ERROR})}%perl_vendorlib
-%perl_vendorarch       %{expand:%%global perl_vendorarch %(eval $(%{__perl} -V:installvendorarch 2>/dev/null); echo ${installvendorarch:-ERROR})}%perl_vendorarch
-%perl_sitelib          %{expand:%%global perl_sitelib %(eval $(%{__perl} -V:installsitelib 2>/dev/null); echo ${installsitelib:-ERROR})}%perl_sitelib
-%perl_sitearch         %{expand:%%global perl_sitearch %(eval $(%{__perl} -V:installsitearch 2>/dev/null); echo ${installsitearch:-ERROR})}%perl_sitearch
-
-# X.org helper macros
-%__xorg_abi_requires_ge() Requires: xorg-xserver-server(%{expand:%1}-abi) >= %{expand:%{%2}}
-%__xorg_abi_requires_lt() Requires: xorg-xserver-server(%{expand:%1}-abi) < %(awk -vv=%{expand:%{%2}} 'BEGIN{split(v, a, "."); printf("%s.0", a[1] + 1); exit}')
-
-%xorg_xserver_ansic_abi                %{expand:%%global xorg_xserver_ansic_abi %(awk '/#define ABI_ANSIC_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)}%xorg_xserver_ansic_abi
-%xorg_xserver_extension_abi    %{expand:%%global xorg_xserver_extension_abi %(awk '/#define ABI_EXTENSION_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)}%xorg_xserver_extension_abi
-%xorg_xserver_font_abi         %{expand:%%global xorg_xserver_font_abi %(awk '/#define ABI_FONT_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null | echo ERROR)}%xorg_xserver_font_abi
-%xorg_xserver_videodrv_abi     %{expand:%%global xorg_xserver_videodrv_abi %(awk '/#define ABI_VIDEODRV_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)}%xorg_xserver_videodrv_abi
-%xorg_xserver_xinput_abi       %{expand:%%global xorg_xserver_xinput_abi %(awk '/#define ABI_XINPUT_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)}%xorg_xserver_xinput_abi
-# vim: '
-
-%requires_xorg_xserver_extension \
-%{__xorg_abi_requires_ge ansic xorg_xserver_ansic_abi} \
-%{__xorg_abi_requires_lt ansic xorg_xserver_ansic_abi} \
-%{__xorg_abi_requires_ge extension xorg_xserver_extension_abi} \
-%{__xorg_abi_requires_lt extension xorg_xserver_extension_abi} \
-%{nil}
-
-%requires_xorg_xserver_xinput \
-%{__xorg_abi_requires_ge ansic xorg_xserver_ansic_abi} \
-%{__xorg_abi_requires_lt ansic xorg_xserver_ansic_abi} \
-%{__xorg_abi_requires_ge xinput xorg_xserver_xinput_abi} \
-%{__xorg_abi_requires_lt xinput xorg_xserver_xinput_abi} \
-%{nil}
-
-%requires_xorg_xserver_font \
-%{__xorg_abi_requires_ge ansic xorg_xserver_ansic_abi} \
-%{__xorg_abi_requires_lt ansic xorg_xserver_ansic_abi} \
-%{__xorg_abi_requires_ge font xorg_xserver_font_abi} \
-%{__xorg_abi_requires_lt font xorg_xserver_font_abi} \
-%{nil}
-
-%requires_xorg_xserver_videodrv \
-%{__xorg_abi_requires_ge ansic xorg_xserver_ansic_abi} \
-%{__xorg_abi_requires_lt ansic xorg_xserver_ansic_abi} \
-%{__xorg_abi_requires_ge videodrv xorg_xserver_videodrv_abi} \
-%{__xorg_abi_requires_lt videodrv xorg_xserver_videodrv_abi} \
-%{nil}
-
-# TCL specific macro definitions.
-# TODO: when th tcl is fixed use tclsh to get version: %(echo 'puts $tcl_version' | tclsh)
-%tcl_version   %{expand:%%global tcl_version %(v=$(rpm -q --qf %{V} tcl | cut -d. -f1,2); echo ${v:-ERROR})}%tcl_version
-%tcl_sitearch  %{_libdir}/tcl%{tcl_version}
-%tcl_sitelib   %{_datadir}/tcl%{tcl_version}
-
-# Python specific macro definitions.
-# python main version
-%py_ver                        %{expand:%%global py_ver %(%{__python} -c "import sys; print sys.version[:3]" 2>/dev/null || echo ERROR)}%py_ver
-
-# directories
-%py_prefix             %{expand:%%global py_prefix %(%{__python} -c "import sys; print sys.prefix" 2>/dev/null || echo ERROR)}%py_prefix
-%py_libdir             %{py_prefix}/%{_lib}/python%{py_ver}
-%py_scriptdir  %{py_prefix}/share/python%{py_ver}
-%py_incdir             /usr/include/python%{py_ver}
-%py_sitedir            %{py_libdir}/site-packages
-%py_sitescriptdir %{py_scriptdir}/site-packages
-%py_dyndir             %{py_libdir}/lib-dynload
-
-# pure python modules compilation
-%py_comp               python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
-
-%py_ocomp              python -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
-
-# Software written in Python language require Python with main version
-%pyrequires_eq() Requires:     %1
-
-# Python 3.x
-# python main version
-%__python3                     /usr/bin/python3
-%py3_ver                       %{expand:%%global py3_ver %(%{__python3} -c "import sys; print(sys.version[:3])" 2>/dev/null || echo ERROR)}%py3_ver
-
-# directories
-%py3_prefix            %{expand:%%global py3_prefix %(%{__python3} -c "import sys; print(sys.prefix)" 2>/dev/null || echo ERROR)}%py3_prefix
-%py3_incdir            %{expand:%%global py3_incdir %(%{__python3} -c "import sysconfig; print(sysconfig.get_path('include'))" 2>/dev/null || echo ERROR)}%py3_incdir
-%py3_libdir            %{py3_prefix}/%{_lib}/python%{py3_ver}
-%py3_sitedir   %{py3_libdir}/site-packages
-%py3_sitescriptdir %{py3_prefix}/share/python%{py3_ver}/site-packages
-%py3_dyndir            %{py3_libdir}/lib-dynload
-
-# pure python modules compilation
-%py3_comp              %{__python3} -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
-
-%py3_ocomp             %{__python3} -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
-
-%py_build { \
-       LDFLAGS="${LDFLAGS:-%rpmldflags}"; export LDFLAGS; \
-       CFLAGS="${CFLAGS:-%rpmcppflags %rpmcflags}"; export CFLAGS; \
-       CXXFLAGS="${CXXFLAGS:-%rpmcppflags %rpmcxxflags}"; export CXXFLAGS; \
-       %{?__cc:CC="%{__cc}"; export CC;} \
-       %{?__cxx:CXX="%{__cxx}"; export CXX;} \
-       %{__python} setup.py \
-                               build --build-base=build-2 \
-}
-
-# "shrink" filter to keep this macro without newlines,
-# so it could be used as make arguments
-%py_install_opts() %{shrink: \
-       --prefix=%{_prefix} \
-       --install-purelib=%{py_sitescriptdir} \
-       --install-platlib=%{py_sitedir} \
-       --optimize=2 \
-}
-
-%py_install { \
-       LDFLAGS="${LDFLAGS:-%rpmldflags}"; export LDFLAGS; \
-       CFLAGS="${CFLAGS:-%rpmcppflags %rpmcflags}"; export CFLAGS; \
-       CXXFLAGS="${CXXFLAGS:-%rpmcppflags %rpmcxxflags}"; export CXXFLAGS; \
-       %{?__cc:CC="%{__cc}"; export CC;} \
-       %{?__cxx:CXX="%{__cxx}"; export CXX;} \
-       %{__python} setup.py \
-                               build --build-base=build-2 \
-                               install --skip-build \
-                               %{py_install_opts} \
-                               --root=$RPM_BUILD_ROOT \
-}
-
-%py3_build { \
-       LDFLAGS="${LDFLAGS:-%rpmldflags}"; export LDFLAGS; \
-       CFLAGS="${CFLAGS:-%rpmcppflags %rpmcflags}"; export CFLAGS; \
-       CXXFLAGS="${CXXFLAGS:-%rpmcppflags %rpmcxxflags}"; export CXXFLAGS; \
-       %{?__cc:CC="%{__cc}"; export CC;} \
-       %{?__cxx:CXX="%{__cxx}"; export CXX;} \
-       %{__python3} setup.py build --build-base=build-3 \
-}
-
-# "shrink" filter to keep this macro without newlines,
-# so it could be used as make arguments
-%py3_install_opts() %{shrink: \
-       --prefix=%{_prefix} \
-       --install-purelib=%{py3_sitescriptdir} \
-       --install-platlib=%{py3_sitedir} \
-       --optimize=2 \
-}
-
-%py3_install { \
-       LDFLAGS="${LDFLAGS:-%rpmldflags}"; export LDFLAGS; \
-       CFLAGS="${CFLAGS:-%rpmcppflags %rpmcflags}"; export CFLAGS; \
-       CXXFLAGS="${CXXFLAGS:-%rpmcppflags %rpmcxxflags}"; export CXXFLAGS; \
-       %{?__cc:CC="%{__cc}"; export CC;} \
-       %{?__cxx:CXX="%{__cxx}"; export CXX;} \
-       %{__python3} setup.py \
-                               build --build-base=build-3 \
-                               install --skip-build \
-                               %{py3_install_opts} \
-                               --root=$RPM_BUILD_ROOT \
-}
 
 # node.js libdir
 # Requirements:
@@ -1189,44 +1025,6 @@ fi; \
 # BuildRequires:       rpmbuild(macros) >= 1.719
 %zsh_compdir           /usr/share/zsh/site-functions
 
-# Hardlink binary identical .pyc and .pyo files
-%__spec_install_post_py_hardlink {\
-%{!?no_install_post_py_hardlink: __spec_install_post_py_hardlink() { \
-%{!?debug:set +x;} \
-local a b c=0 t=0 pyc=%{tmpdir}/%{name}-%{version}-%{release}__rpm_pyc; \
-if [ -d "$RPM_BUILD_ROOT" ]; then \
-       find "$RPM_BUILD_ROOT" -name '*.pyc' > $pyc; \
-       while read a; do \
-               b="${a%.pyc}.pyo"; \
-               if cmp -s "$a" "$b"; then \
-                       ln -f "$a" "$b"; \
-                       c=$((c + 1)); \
-               fi; \
-               t=$((t + 1)); \
-       done < $pyc; \
-       [ $t -gt 0 ] && printf "Hardlink Python files: %d/%d files hardlinked\n" $c $t; \
-       rm -f $pyc; \
-fi; \
-}; __spec_install_post_py_hardlink } }
-
-# Remove Python 2.x sources,
-# PLD Linux policy is to package only compiled .py[co] for Python 2.x libraries.
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-#
-# Usage:
-# %py_postclean /usr/share/extra -x keepme.py,keeptoo.py
-# Options:
-# -x - comma separated of file basenames to preserve (rpmbuild(macros) >= 1.658)
-# ARGS - extra directories to clean for .py sources
-#
-# BuildRequires:       rpmbuild(macros) >= 1.189
-#
-%py_postclean(x:) \
-for d in %{py_sitescriptdir} %{py_sitedir} %*; do \
-       [ ! -d "$RPM_BUILD_ROOT$d" ] || find "$RPM_BUILD_ROOT$d" -name '*.py' -print0 %{-x:| grep -ZzvE '/(%(echo '%{-x*}' | tr ',' '|'))$'} | xargs -0r -l512 rm;\
-done \
-%{nil}
-
 # depmod macro
 %depmod() { \
 umask 022; \
@@ -1241,18 +1039,6 @@ else \
 fi; \
 }
 
-# XMMS specific macros
-%xmms_prefix                   %{expand:%%global xmms_prefix %(xmms-config --prefix 2>/dev/null || echo ERROR)}%xmms_prefix
-%xmms_exec_prefix              %{expand:%%global xmms_exec_prefix %(xmms-config --exec-prefix 2>/dev/null || echo ERROR)}%xmms_exec_prefix
-%xmms_version                  %{expand:%%global xmms_version %(xmms-config --version 2>/dev/null || echo ERROR)}%xmms_version
-%xmms_datadir                  %{expand:%%global xmms_datadir %(xmms-config --data-dir 2>/dev/null || echo ERROR)}%xmms_datadir
-%xmms_plugindir                        %{expand:%%global xmms_plugindir %(xmms-config --plugin-dir 2>/dev/null || echo ERROR)}%xmms_plugindir
-%xmms_visualization_plugindir  %{expand:%%global xmms_visualization_plugindir %(xmms-config --visualization-plugin-dir 2>/dev/null || echo ERROR)}%xmms_visualization_plugindir
-%xmms_input_plugindir          %{expand:%%global xmms_input_plugindir %(xmms-config --input-plugin-dir 2>/dev/null || echo ERROR)}%xmms_input_plugindir
-%xmms_output_plugindir         %{expand:%%global xmms_output_plugindir %(xmms-config --output-plugin-dir 2>/dev/null || echo ERROR)}%xmms_output_plugindir
-%xmms_effect_plugindir         %{expand:%%global xmms_effect_plugindir %(xmms-config --effect-plugin-dir 2>/dev/null || echo ERROR)}%xmms_effect_plugindir
-%xmms_general_plugindir                %{expand:%%global xmms_general_plugindir %(xmms-config --general-plugin-dir 2>/dev/null || echo ERROR)}%xmms_general_plugindir
-
 # user/group checking macros
 #
 # Usage:
@@ -1382,44 +1168,6 @@ else \
        [ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || : \
 fi;
 
-# webapp macros
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-#
-# The config is installed/removed inside trigger, this means that you can any
-# time install apache1/apache/lighttpd package and the configuration file is
-# updated. if you don't need the config for various reason for specific
-# webserver, just remove the symlink from config directory using webapp
-# program. the trigger will not recreate the symlink on upgrades. In other
-# words the config is linked to webserver config directory on first install of
-# PACKAGE or WEBSERVER.
-#
-# Add package's webserver config to webserver webapps dir.
-# Usage:
-#   %webapp_register [-f] WEBSERVER WEBAPP
-#
-%webapp_register(f) \
-%{?debug:set -x; echo "webapp_register: %{name}-%{version}-%{release} 1:[$1]; 2:[$2]"} \
-if [ -n "%{-f:1}" ] || ([ "$1" = "1" ] && [ "$2" = "1" ]); then\
-       /usr/sbin/webapp register %1 %2\
-fi\
-# reload webserver if the config symlink is there and skip reload if webserver is upgraded\
-if [ -L /etc/%1/webapps.d/%(echo "%2" | tr '/' '-').conf ] && [ "$2" -lt "2" ]; then\
-       %{expand:%service -q %%1 reload}\
-fi\
-%{nil}
-
-# Remove package's config from webserver webapps dir.
-# Usage:
-#   %webapp_register [-f] WEBSERVER WEBAPP
-%webapp_unregister(f) \
-%{?debug:set -x; echo "webapp_unregister: %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"} \
-# remove link if either of the packages are gone \
-if [ -n "%{-f:1}" ] || ([ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/%1/webapps.d/%(echo "%2" | tr '/' '-').conf ]); then \
-       /usr/sbin/webapp unregister %1 %2\
-       %{expand:%service -q %%1 reload}\
-fi \
-%{nil}
-
 # service macro.
 # Author: Elan Ruusamäe <glen@pld-linux.org>
 #
@@ -1443,51 +1191,6 @@ fi \
 # BuildRequires:       rpmbuild(macros) >= 1.450
 %service(qn) {{%(export noop=%{-n:1} quiet=%{-q:1} RPM_BUILD_ROOT=%{buildroot}; /usr/lib/rpm/service_generator.sh %{*}) };}
 
-# Register OpenLDAP schema.
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-#
-# Usage:
-#   %%openldap_schema_register [-d core,nis] %{schemadir}/horde.schema
-#
-#  -d specify dependant schemas, separated by comma
-#
-%openldap_schema_register(d:) \
-for schema in %*; do \
-       if ! grep -q "$schema" /etc/openldap/slapd.conf; then \
-               %{__sed} -i -e " \
-                       /^include.*local.schema/{ \
-                               iinclude\\t     $schema\
-                       } \
-               " /etc/openldap/slapd.conf \
-       fi \
-done \
-# enable dependant schemas \
-if [ "%{-d*}" ]; then \
-       %{__sed} -i -e ' \
-       /^#include.*\\(%(echo '%{-d*}' | %{__sed} -e 's/,/\\\\|/g')\\)\\.schema/{ \
-               s/^#// \
-       }' /etc/openldap/slapd.conf \
-fi \
-%{nil}
-
-# Unregister OpenLDAP schema.
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-#
-# Usage:
-#   %%openldap_schema_unregister %{schemadir}/horde.schema
-#
-%openldap_schema_unregister() \
-for schema in %*; do \
-       if grep -q "$schema" /etc/openldap/slapd.conf; then \
-               %{__sed} -i -e " \
-               /^include.*$(echo "$schema" | %{__sed} -e 's,/,\\\\/,g')/d \
-               # for symmetry it would be nice if we disable enabled schemas in post, \
-               # but we really can not do that, it would break something else. \
-               " /etc/openldap/slapd.conf \
-       fi \
-done \
-%{nil}
-
 %env_update [ ! -x /sbin/env-update ] || /sbin/env-update -u || :
 
 # patchset macros
@@ -1567,33 +1270,6 @@ done \
 # return EXPANDED source url N from current spec
 %sourceurl(n:) %(test "$IN_RPM" = 1 && exit 1; export IN_RPM=1; rpmbuild --nodigest --nosignature --nobuild -D "prep %%dump" %{_specdir}/%{name}.spec 2>&1 | awk '$2 ~ /^SOURCEURL%{-n*}/ {print $3}')
 
-# browser plugins v2
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-#
-# Usage:
-#      %browser_plugins_add_browser <name> -p <plugindir>
-#
-#  <name> (required) -- name of the browser. usually %{name}.
-#  -p <plugindir> (required) -- in what directory browser searches for its plugins.
-#  -b -- default blacklists
-#  -a <arch> override arch
-#
-# Example:
-#   %browser_plugins_add_browser %{name} -p %{_firefoxdir}/plugins
-
-%_browserpluginsconfdir                /etc/browser-plugins
-%_browserpluginsdir                    %{_libdir}/browser-plugins
-%update_browser_plugins                /usr/sbin/update-browser-plugins || :
-
-%browser_plugins_add_browser(p:b:a:) \
-       browser=%1.%{!-a:%{_target_base_arch}}%{-a*} \
-       install -d $RPM_BUILD_ROOT%{_browserpluginsconfdir}/{blacklist,browsers}.d \
-       ln -s %{-p*} $RPM_BUILD_ROOT%{_browserpluginsconfdir}/browsers.d/$browser \
-       blacklist_file=$RPM_BUILD_ROOT%{_browserpluginsconfdir}/blacklist.d/$browser.blacklist \
-       echo '# This file format is shell globs at base dir of plugindir' > $blacklist_file \
-       %{-b:cat >> $blacklist_file %{-b*}} \
-%{nil}
-
 # Helper for LUA.
 # split string separated by space into quoted list
 #
@@ -1682,49 +1358,6 @@ end\
 %{-p:end} \
 %{nil}
 
-# Check syntax for Python files
-#
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-# Author: Arkadiusz Miśkiewicz <arekm@pld-linux.org>
-#
-# Usage:
-#   %py_lint src
-#
-# Requirements:
-# BuildRequires:       python
-# BuildRequires:       rpmbuild(macros) >= 1.602
-
-%py_lint() \
-__py_lint() { \
-%{!?debug:set +x;} \
-find "$@" -type f -name '*.py' | python -c ' \
-import sys \
-import compiler \
-\
-found = err = 0\
-for f in sys.stdin: \
-       fd = open(f.rstrip()) \
-       c = fd.read() \
-       fd.close() \
-       found = found + 1 \
-       try: \
-               compiler.parse(c) \
-       except SyntaxError, e: \
-               print "py_lint: %s: %s" % (f.rstrip(), e) \
-               err = err + 1\
-\
-if not found:\
-       print >> sys.stderr, "\\npy_lint: ERROR: No files processed.\\n" \
-       sys.exit(1) \
-elif err: \
-       print >> sys.stderr, "\\npy_lint: ERROR: Syntax errors in %d files.\\n" % err \
-       sys.exit(1) \
-else: \
-       print >> sys.stderr,  "py_lint: %d files scanned, found no syntax errors." % found \
-' \
-}; __py_lint %* \
-%{nil}
-
 # Undos files
 #
 # Author: Paweł Zuzelski <pawelz@pld-linux.org>
@@ -1755,245 +1388,6 @@ else: \
 %undos(f:i)    %{-f:%{__find} -type f -regextype posix-extended -%{-i:i}regex '^.+\\.(%(echo %{-f*} | tr ',' '|'))$' -print0 | xargs -0} %{__sed} -i -e 's,\\r$,,' %* \
 %{nil}
 
-# Hook to register nagios object based plugins in Nagios NRPE daemon config.
-#
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-#
-# Usage:
-#  -a NAME  -- add command named NAME
-#  -d NAME  -- remove command named NAME
-#  -f FILE  -- specify plugin configuration FILE to extract command definition from
-#
-# Sample:
-# %triggerin -- nagios-nrpe
-# %nagios_nrpe -a %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
-#
-# %triggerun -- nagios-nrpe
-# %nagios_nrpe -d %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
-#
-# Requirements:
-# Requires:                    grep
-# Requires:                    sed >= 4.0
-# BuildRequires:       rpmbuild(macros) >= 1.685
-%nagios_nrpe(a:d:c:f:) {\
-       if %{__grep} -q '^include_dir=/etc/nagios/nrpe.d' /etc/nagios/nrpe.cfg && [ -d /etc/nagios/nrpe.d ]; then \
-               file=/etc/nagios/nrpe.d/%{-a*}%{-d*}.cfg; \
-       else \
-               file=/etc/nagios/nrpe.cfg; \
-       fi; \
-       m=$(test -f $file && md5sum < $file); \
-       %{-a:# on -a and config exists \
-       if [ -f /etc/nagios/nrpe.cfg ]; then \
-               if [ ! -f $file ] || ! %{__grep} -q '^command\[%{-a*}\]' $file; then \
-                       %{__sed} -ne 's/^[ \t]*command_line[ \t]\+\(.\+\)/command[%{-a*}]=\1/p' %{-f*} >> $file; \
-               fi; \
-       fi;} \
-       %{-d:# on package remove, -d and config exists \
-       if [ "$1" = "0" -a -f $file ]; then \
-               %{__sed} -i -e '/^[ \t]*command\[%{-d*}\]/d' $file; \
-       fi;} \
-       if [ "$m" != "$(md5sum < $file)" ]; then \
-               %service -q nrpe restart; \
-       fi; \
-}%{nil}
-
-# Import or update Cacti template.
-#
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-#
-# Usage:
-# %cacti_import_template XMLFILE
-#  XMLFILE -- XML template to import
-#
-# Sample:
-# %post
-# %cacti_import_template %{resourcedir}/cacti_host_template_varnish.xml
-#
-# Requires:    cacti >= 0.8.7e-8
-# BuildRequires:       rpmbuild(macros) >= 1.630
-# Note: 1.1 (cacti-0.8.7h) adds requirement for --with-template-rras or --with-user-rras option
-
-%cacti_import_template() {\
-v=$(%{__sed} -rne 's/.+Add Graphs Script ([0-9\.]+).+/\1/p' /usr/share/cacti/cli/import_template.php); \
-if [ "$v" != "1.0" ]; then \
-       rra="--with-template-rras"; \
-fi; \
-/usr/share/cacti/cli/import_template.php --filename=%1 $rra || :; \
-}%{nil}
-
-# pre/post script for -upstart subpackages
-#
-# Author: Jacek Konieczny <jajcus@jajcus.net>
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-#
-# Usage:
-#      %upstart_post service_name
-#   %upstart_postun service_name
-#
-# Sample:
-# %post upstart
-# %upstart_post %{name}
-#
-# %postun upstart
-# %upstart_postun %{name}
-#
-# Requirements:
-# BuildRequires:       rpmbuild(macros) >= 1.690
-# Requires:                    rc-scripts >= 0.4.3
-
-# migrate from init script to upstart job
-%upstart_post() \
-       if [ -x /sbin/initctl ] && [ -f /var/lock/subsys/%1 ]; then \
-               /sbin/service --no-upstart %1 stop \
-               /sbin/service %1 start \
-       fi \
-%{nil}
-
-# restart the job after upgrade or migrate to init script on removal
-# cannot be stopped with 'service' as /etc/init/$name.conf may be missing
-# at this point
-%upstart_postun() \
-       if [ -x /sbin/initctl ] && /sbin/initctl status %1 2>/dev/null | grep -q 'running' ; then \
-               /sbin/initctl stop %1 >/dev/null 2>&1 \
-               [ -f /etc/rc.d/init.d/%1 -o -f /etc/init/%1.conf ] && { echo -n "Re-"; /sbin/service %1 start; }; \
-       fi \
-%{nil}
-
-# Haskell Macros
-# BuildRequires:       rpmbuild(macros) >= 1.608
-%ghcdir                ghc-%(/usr/bin/ghc --numeric-version 2>/dev/null || echo ERROR)
-
-# update /usr/lib*/ghc-*/package.conf.d/package.cache
-# Requires: ghc
-# BuildRequires:       rpmbuild(macros) >= 1.607
-#
-%ghc_pkg_recache() {{ \
-       umask 022; \
-       [ ! -x /usr/bin/ghc-pkg ] || /usr/bin/ghc-pkg recache; \
-};} \
-%{nil}
-
-
-# pre/post script for packages supporting systemd units
-#
-# Authors:     Bartlomiej Zimon <uzi18@o2.pl>
-#              Jan Rękorajski <baggins@mimuw.edu.pl>
-#
-# Usage:
-# %systemd_reload
-# %systemd_service <unit command> service_name1.service service_name2.service
-# %systemd_service_enable service_name1.service service_name2.service
-# %systemd_service_disable service_name1.service service_name2.service
-# %systemd_service_start service_name1.service service_name2.service
-# %systemd_service_stop service_name1.service service_name2.service
-# %systemd_service_restart service_name1.service service_name2.service
-# %systemd_service_reload service_name1.service service_name2.service
-#
-# %systemd_post service_name1.service service_name2.service
-# %systemd_preun service_name1.service service_name2.service
-# %systemd_trigger service_name1.service service_name2.service
-#
-# Sample:
-# %post
-# %systemd_post %{name}.service
-#
-# %preun
-# %systemd_preun %{name}.service
-#
-# %postun
-# %systemd_reload
-#
-# %triggerpostun -- %{name} < first-version-with-systemd-units
-# %systemd_trigger %{name}.service
-#
-# Requirements:
-# BuildRequires:       rpmbuild(macros) >= 1.671
-# Requires:    systemd-units >= 38
-
-%systemd_reload /bin/systemd_booted && SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog /bin/systemctl daemon-reload || :
-
-%systemd_service_enable() \
-       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-       /bin/systemctl preset --preset-mode=enable-only %{*} || : \
-       /bin/systemd_booted && echo 'Run "/bin/systemctl start %{*}" to start %{*}.' || : \
-%{nil}
-
-%systemd_service_disable() \
-       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-       /bin/systemctl --quiet disable %{*} || : \
-%{nil}
-
-%systemd_service() \
-       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-       /bin/systemd_booted && /bin/systemctl %{*} || : \
-%{nil}
-
-%systemd_service_start() \
-       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-       /bin/systemd_booted && /bin/systemctl start %{*} || : \
-%{nil}
-
-%systemd_service_stop() \
-       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-       /bin/systemd_booted && /bin/systemctl stop %{*} || : \
-%{nil}
-
-# NOTE: doesn't honour RPM_SKIP_AUTO_RESTART, avoid using
-%systemd_service_restart() \
-       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-       /bin/systemd_booted && /bin/systemctl try-restart %{*} || : \
-%{nil}
-
-# NOTE: doesn't honour RPM_SKIP_AUTO_RESTART, avoid using
-%systemd_service_reload() \
-       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-       /bin/systemd_booted && /bin/systemctl reload %{*} || : \
-%{nil}
-
-# NOTE: this trigger disobeys systemd.preset in favour of RPM_ENABLE_SYSTEMD_SERVICE
-%systemd_trigger() \
-want_enable_service() { \
-       [ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm \
-       [ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && return 1 \
-       [ "$(echo /etc/rc.d/rc[0-6].d/S[0-9][0-9]${1%.service})" = "/etc/rc.d/rc[0-6].d/S[0-9][0-9]${1%.service}" ] && return 1 \
-       return 0 \
-}\
-       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-       for s in %{*}; do \
-               if want_enable_service $s; then \
-                       /bin/systemctl enable $s || : \
-               fi \
-       done \
-%{nil}
-
-%systemd_post() \
-       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-       /bin/systemd_booted && /bin/systemctl daemon-reload || : \
-       if [ $1 -eq 1 ]; then \
-               /bin/systemctl preset --preset-mode=enable-only %{*} >/dev/null || : \
-               /bin/systemd_booted && echo 'Run "/bin/systemctl start %{*}" to start %{*}.' || : \
-       elif [ -z "$NORESTART" ]; then \
-               /bin/systemd_booted && /bin/systemctl try-restart %{*} || : \
-       else \
-               /bin/systemd_booted && echo 'Run "/bin/systemctl restart %{*}" to restart %{*}.' || : \
-       fi \
-%{nil}
-
-%systemd_preun() \
-       if [ $1 -eq 0 ]; then \
-               export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
-               /bin/systemd_booted && /bin/systemctl stop %{*} || : \
-               /bin/systemctl --quiet disable %{*} || : \
-       fi \
-%{nil}
-
-%systemdunitdir /lib/systemd/system
-%systemduserunitdir /usr/lib/systemd/user
-%systemdtmpfilesdir /usr/lib/tmpfiles.d
-
-# BuildRequires:       rpmbuild(macros) >= 1.721
-%journal_catalog_update() [ ! -x /bin/journalctl ] || /bin/journalctl --update-catalog >/dev/null 2>&1 || :
-
 #-----------------------------------------------------------------
 # Update hardware database index
 #
diff --git a/macros.python b/macros.python
new file mode 100644 (file)
index 0000000..198ae77
--- /dev/null
@@ -0,0 +1,185 @@
+# Python specific macro definitions.
+
+%__python              /usr/bin/python
+
+# python main version
+%py_ver                        %{expand:%%global py_ver %(%{__python} -c "import sys; print sys.version[:3]" 2>/dev/null || echo ERROR)}%py_ver
+
+# directories
+%py_prefix             %{expand:%%global py_prefix %(%{__python} -c "import sys; print sys.prefix" 2>/dev/null || echo ERROR)}%py_prefix
+%py_libdir             %{py_prefix}/%{_lib}/python%{py_ver}
+%py_scriptdir          %{py_prefix}/share/python%{py_ver}
+%py_incdir             /usr/include/python%{py_ver}
+%py_sitedir            %{py_libdir}/site-packages
+%py_sitescriptdir      %{py_scriptdir}/site-packages
+%py_dyndir             %{py_libdir}/lib-dynload
+
+# pure python modules compilation
+%py_comp               python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
+
+%py_ocomp              python -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
+
+# Software written in Python language require Python with main version
+%pyrequires_eq() Requires:     %1
+
+# Python 3.x
+# python main version
+%__python3             /usr/bin/python3
+%py3_ver               %{expand:%%global py3_ver %(%{__python3} -c "import sys; print(sys.version[:3])" 2>/dev/null || echo ERROR)}%py3_ver
+
+# directories
+%py3_prefix            %{expand:%%global py3_prefix %(%{__python3} -c "import sys; print(sys.prefix)" 2>/dev/null || echo ERROR)}%py3_prefix
+%py3_incdir            %{expand:%%global py3_incdir %(%{__python3} -c "import sysconfig; print(sysconfig.get_path('include'))" 2>/dev/null || echo ERROR)}%py3_incdir
+%py3_libdir            %{py3_prefix}/%{_lib}/python%{py3_ver}
+%py3_sitedir           %{py3_libdir}/site-packages
+%py3_sitescriptdir     %{py3_prefix}/share/python%{py3_ver}/site-packages
+%py3_dyndir            %{py3_libdir}/lib-dynload
+
+# pure python modules compilation
+%py3_comp              %{__python3} -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
+
+%py3_ocomp             %{__python3} -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
+
+%py_build { \
+       LDFLAGS="${LDFLAGS:-%rpmldflags}"; export LDFLAGS; \
+       CFLAGS="${CFLAGS:-%rpmcppflags %rpmcflags}"; export CFLAGS; \
+       CXXFLAGS="${CXXFLAGS:-%rpmcppflags %rpmcxxflags}"; export CXXFLAGS; \
+       %{?__cc:CC="%{__cc}"; export CC;} \
+       %{?__cxx:CXX="%{__cxx}"; export CXX;} \
+       %{__python} setup.py \
+       build --build-base=build-2 \
+}
+
+# "shrink" filter to keep this macro without newlines,
+# so it could be used as make arguments
+%py_install_opts() %{shrink: \
+       --prefix=%{_prefix} \
+       --install-purelib=%{py_sitescriptdir} \
+       --install-platlib=%{py_sitedir} \
+       --optimize=2 \
+}
+
+%py_install { \
+       LDFLAGS="${LDFLAGS:-%rpmldflags}"; export LDFLAGS; \
+       CFLAGS="${CFLAGS:-%rpmcppflags %rpmcflags}"; export CFLAGS; \
+       CXXFLAGS="${CXXFLAGS:-%rpmcppflags %rpmcxxflags}"; export CXXFLAGS; \
+       %{?__cc:CC="%{__cc}"; export CC;} \
+       %{?__cxx:CXX="%{__cxx}"; export CXX;} \
+       %{__python} setup.py \
+       build --build-base=build-2 \
+       install --skip-build \
+       %{py_install_opts} \
+       --root=$RPM_BUILD_ROOT \
+}
+
+%py3_build { \
+       LDFLAGS="${LDFLAGS:-%rpmldflags}"; export LDFLAGS; \
+       CFLAGS="${CFLAGS:-%rpmcppflags %rpmcflags}"; export CFLAGS; \
+       CXXFLAGS="${CXXFLAGS:-%rpmcppflags %rpmcxxflags}"; export CXXFLAGS; \
+       %{?__cc:CC="%{__cc}"; export CC;} \
+       %{?__cxx:CXX="%{__cxx}"; export CXX;} \
+       %{__python3} setup.py build --build-base=build-3 \
+}
+
+# "shrink" filter to keep this macro without newlines,
+# so it could be used as make arguments
+%py3_install_opts() %{shrink: \
+       --prefix=%{_prefix} \
+       --install-purelib=%{py3_sitescriptdir} \
+       --install-platlib=%{py3_sitedir} \
+       --optimize=2 \
+}
+
+%py3_install { \
+       LDFLAGS="${LDFLAGS:-%rpmldflags}"; export LDFLAGS; \
+       CFLAGS="${CFLAGS:-%rpmcppflags %rpmcflags}"; export CFLAGS; \
+       CXXFLAGS="${CXXFLAGS:-%rpmcppflags %rpmcxxflags}"; export CXXFLAGS; \
+       %{?__cc:CC="%{__cc}"; export CC;} \
+       %{?__cxx:CXX="%{__cxx}"; export CXX;} \
+       %{__python3} setup.py \
+       build --build-base=build-3 \
+       install --skip-build \
+       %{py3_install_opts} \
+       --root=$RPM_BUILD_ROOT \
+}
+
+# Hardlink binary identical .pyc and .pyo files
+%__spec_install_post_py_hardlink {\
+%{!?no_install_post_py_hardlink: __spec_install_post_py_hardlink() { \
+%{!?debug:set +x;} \
+local a b c=0 t=0 pyc=%{tmpdir}/%{name}-%{version}-%{release}__rpm_pyc; \
+if [ -d "$RPM_BUILD_ROOT" ]; then \
+       find "$RPM_BUILD_ROOT" -name '*.pyc' > $pyc; \
+       while read a; do \
+               b="${a%.pyc}.pyo"; \
+               if cmp -s "$a" "$b"; then \
+                       ln -f "$a" "$b"; \
+                       c=$((c + 1)); \
+               fi; \
+               t=$((t + 1)); \
+       done < $pyc; \
+       [ $t -gt 0 ] && printf "Hardlink Python files: %d/%d files hardlinked\n" $c $t; \
+       rm -f $pyc; \
+fi; \
+}; __spec_install_post_py_hardlink } }
+
+# Remove Python 2.x sources,
+# PLD Linux policy is to package only compiled .py[co] for Python 2.x libraries.
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# Usage:
+# %py_postclean /usr/share/extra -x keepme.py,keeptoo.py
+# Options:
+# -x - comma separated of file basenames to preserve (rpmbuild(macros) >= 1.658)
+# ARGS - extra directories to clean for .py sources
+#
+# BuildRequires:       rpmbuild(macros) >= 1.189
+#
+%py_postclean(x:) \
+for d in %{py_sitescriptdir} %{py_sitedir} %*; do \
+       [ ! -d "$RPM_BUILD_ROOT$d" ] || find "$RPM_BUILD_ROOT$d" -name '*.py' -print0 %{-x:| grep -ZzvE '/(%(echo '%{-x*}' | tr ',' '|'))$'} | xargs -0r -l512 rm;\
+done \
+%{nil}
+
+# Check syntax for Python files
+#
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+# Author: Arkadiusz Miśkiewicz <arekm@pld-linux.org>
+#
+# Usage:
+#   %py_lint src
+#
+# Requirements:
+# BuildRequires:       python
+# BuildRequires:       rpmbuild(macros) >= 1.602
+
+%py_lint() \
+__py_lint() { \
+%{!?debug:set +x;} \
+find "$@" -type f -name '*.py' | python -c ' \
+import sys \
+import compiler \
+\
+found = err = 0\
+for f in sys.stdin: \
+       fd = open(f.rstrip()) \
+       c = fd.read() \
+       fd.close() \
+       found = found + 1 \
+       try: \
+               compiler.parse(c) \
+       except SyntaxError, e: \
+               print "py_lint: %s: %s" % (f.rstrip(), e) \
+               err = err + 1\
+\
+if not found:\
+       print >> sys.stderr, "\\npy_lint: ERROR: No files processed.\\n" \
+       sys.exit(1) \
+elif err: \
+       print >> sys.stderr, "\\npy_lint: ERROR: Syntax errors in %d files.\\n" % err \
+       sys.exit(1) \
+else: \
+       print >> sys.stderr,  "py_lint: %d files scanned, found no syntax errors." % found \
+' \
+}; __py_lint %* \
+%{nil}
diff --git a/macros.systemd b/macros.systemd
new file mode 100644 (file)
index 0000000..9a1f638
--- /dev/null
@@ -0,0 +1,119 @@
+# pre/post script for packages supporting systemd units
+#
+# Authors:     Bartlomiej Zimon <uzi18@o2.pl>
+#              Jan Rękorajski <baggins@mimuw.edu.pl>
+#
+# Usage:
+# %systemd_reload
+# %systemd_service <unit command> service_name1.service service_name2.service
+# %systemd_service_enable service_name1.service service_name2.service
+# %systemd_service_disable service_name1.service service_name2.service
+# %systemd_service_start service_name1.service service_name2.service
+# %systemd_service_stop service_name1.service service_name2.service
+# %systemd_service_restart service_name1.service service_name2.service
+# %systemd_service_reload service_name1.service service_name2.service
+#
+# %systemd_post service_name1.service service_name2.service
+# %systemd_preun service_name1.service service_name2.service
+# %systemd_trigger service_name1.service service_name2.service
+#
+# Sample:
+# %post
+# %systemd_post %{name}.service
+#
+# %preun
+# %systemd_preun %{name}.service
+#
+# %postun
+# %systemd_reload
+#
+# %triggerpostun -- %{name} < first-version-with-systemd-units
+# %systemd_trigger %{name}.service
+#
+# Requirements:
+# BuildRequires:       rpmbuild(macros) >= 1.671
+# Requires:    systemd-units >= 38
+
+%systemd_reload /bin/systemd_booted && SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog /bin/systemctl daemon-reload || :
+
+%systemd_service_enable() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemctl preset --preset-mode=enable-only %{*} || : \
+       /bin/systemd_booted && echo 'Run "/bin/systemctl start %{*}" to start %{*}.' || : \
+%{nil}
+
+%systemd_service_disable() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemctl --quiet disable %{*} || : \
+%{nil}
+
+%systemd_service() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemd_booted && /bin/systemctl %{*} || : \
+%{nil}
+
+%systemd_service_start() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemd_booted && /bin/systemctl start %{*} || : \
+%{nil}
+
+%systemd_service_stop() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemd_booted && /bin/systemctl stop %{*} || : \
+%{nil}
+
+# NOTE: doesn't honour RPM_SKIP_AUTO_RESTART, avoid using
+%systemd_service_restart() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemd_booted && /bin/systemctl try-restart %{*} || : \
+%{nil}
+
+# NOTE: doesn't honour RPM_SKIP_AUTO_RESTART, avoid using
+%systemd_service_reload() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemd_booted && /bin/systemctl reload %{*} || : \
+%{nil}
+
+# NOTE: this trigger disobeys systemd.preset in favour of RPM_ENABLE_SYSTEMD_SERVICE
+%systemd_trigger() \
+want_enable_service() { \
+       [ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm \
+       [ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && return 1 \
+       [ "$(echo /etc/rc.d/rc[0-6].d/S[0-9][0-9]${1%.service})" = "/etc/rc.d/rc[0-6].d/S[0-9][0-9]${1%.service}" ] && return 1 \
+       return 0 \
+}\
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       for s in %{*}; do \
+               if want_enable_service $s; then \
+                       /bin/systemctl enable $s || : \
+               fi \
+       done \
+%{nil}
+
+%systemd_post() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemd_booted && /bin/systemctl daemon-reload || : \
+       if [ $1 -eq 1 ]; then \
+               /bin/systemctl preset --preset-mode=enable-only %{*} >/dev/null || : \
+               /bin/systemd_booted && echo 'Run "/bin/systemctl start %{*}" to start %{*}.' || : \
+       elif [ -z "$NORESTART" ]; then \
+               /bin/systemd_booted && /bin/systemctl try-restart %{*} || : \
+       else \
+               /bin/systemd_booted && echo 'Run "/bin/systemctl restart %{*}" to restart %{*}.' || : \
+       fi \
+%{nil}
+
+%systemd_preun() \
+       if [ $1 -eq 0 ]; then \
+               export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+               /bin/systemd_booted && /bin/systemctl stop %{*} || : \
+               /bin/systemctl --quiet disable %{*} || : \
+       fi \
+%{nil}
+
+%systemdunitdir /lib/systemd/system
+%systemduserunitdir /usr/lib/systemd/user
+%systemdtmpfilesdir /usr/lib/tmpfiles.d
+
+# BuildRequires:       rpmbuild(macros) >= 1.721
+%journal_catalog_update() [ ! -x /bin/journalctl ] || /bin/journalctl --update-catalog >/dev/null 2>&1 || :
diff --git a/macros.tcl b/macros.tcl
new file mode 100644 (file)
index 0000000..5f784d1
--- /dev/null
@@ -0,0 +1,7 @@
+# TCL specific macro definitions.
+
+%__tclsh       /usr/bin/tclsh
+
+%tcl_version   %{expand:%%global tcl_version %(echo 'puts $tcl_version' | %{__tclsh})}%tcl_version
+%tcl_sitearch  %{_libdir}/tcl%{tcl_version}
+%tcl_sitelib   %{_datadir}/tcl%{tcl_version}
diff --git a/macros.upstart b/macros.upstart
new file mode 100644 (file)
index 0000000..0979386
--- /dev/null
@@ -0,0 +1,37 @@
+# pre/post script for -upstart subpackages
+#
+# Author: Jacek Konieczny <jajcus@jajcus.net>
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# Usage:
+#      %upstart_post service_name
+#      %upstart_postun service_name
+#
+# Sample:
+# %post upstart
+# %upstart_post %{name}
+#
+# %postun upstart
+# %upstart_postun %{name}
+#
+# Requirements:
+# BuildRequires:       rpmbuild(macros) >= 1.690
+# Requires:                    rc-scripts >= 0.4.3
+
+# migrate from init script to upstart job
+%upstart_post() \
+       if [ -x /sbin/initctl ] && [ -f /var/lock/subsys/%1 ]; then \
+               /sbin/service --no-upstart %1 stop \
+               /sbin/service %1 start \
+       fi \
+%{nil}
+
+# restart the job after upgrade or migrate to init script on removal
+# cannot be stopped with 'service' as /etc/init/$name.conf may be missing
+# at this point
+%upstart_postun() \
+       if [ -x /sbin/initctl ] && /sbin/initctl status %1 2>/dev/null | grep -q 'running' ; then \
+               /sbin/initctl stop %1 >/dev/null 2>&1 \
+               [ -f /etc/rc.d/init.d/%1 -o -f /etc/init/%1.conf ] && { echo -n "Re-"; /sbin/service %1 start; }; \
+       fi \
+%{nil}
diff --git a/macros.webapp b/macros.webapp
new file mode 100644 (file)
index 0000000..30f21b2
--- /dev/null
@@ -0,0 +1,37 @@
+# webapp macros
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# The config is installed/removed inside trigger, this means that you can any
+# time install apache1/apache/lighttpd package and the configuration file is
+# updated. if you don't need the config for various reason for specific
+# webserver, just remove the symlink from config directory using webapp
+# program. the trigger will not recreate the symlink on upgrades. In other
+# words the config is linked to webserver config directory on first install of
+# PACKAGE or WEBSERVER.
+#
+# Add package's webserver config to webserver webapps dir.
+# Usage:
+#   %webapp_register [-f] WEBSERVER WEBAPP
+#
+%webapp_register(f) \
+%{?debug:set -x; echo "webapp_register: %{name}-%{version}-%{release} 1:[$1]; 2:[$2]"} \
+if [ -n "%{-f:1}" ] || [ "$1" = "1" ] && [ "$2" = "1" ]; then\
+       /usr/sbin/webapp register %1 %2\
+fi\
+# reload webserver if the config symlink is there and skip reload if webserver is upgraded\
+if [ -L /etc/%1/webapps.d/%(echo "%2" | tr '/' '-').conf ] && [ "$2" -lt "2" ]; then\
+       %{expand:%service -q %%1 reload}\
+fi\
+%{nil}
+
+# Remove package's config from webserver webapps dir.
+# Usage:
+#   %webapp_register [-f] WEBSERVER WEBAPP
+%webapp_unregister(f) \
+%{?debug:set -x; echo "webapp_unregister: %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"} \
+# remove link if either of the packages are gone \
+if [ -n "%{-f:1}" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/%1/webapps.d/%(echo "%2" | tr '/' '-').conf ]; then \
+       /usr/sbin/webapp unregister %1 %2\
+       %{expand:%service -q %%1 reload}\
+fi \
+%{nil}
diff --git a/macros.xmms b/macros.xmms
new file mode 100644 (file)
index 0000000..e5c2066
--- /dev/null
@@ -0,0 +1,11 @@
+# XMMS specific macros
+%xmms_prefix                   %{expand:%%global xmms_prefix %(xmms-config --prefix 2>/dev/null || echo ERROR)}%xmms_prefix
+%xmms_exec_prefix              %{expand:%%global xmms_exec_prefix %(xmms-config --exec-prefix 2>/dev/null || echo ERROR)}%xmms_exec_prefix
+%xmms_version                  %{expand:%%global xmms_version %(xmms-config --version 2>/dev/null || echo ERROR)}%xmms_version
+%xmms_datadir                  %{expand:%%global xmms_datadir %(xmms-config --data-dir 2>/dev/null || echo ERROR)}%xmms_datadir
+%xmms_plugindir                        %{expand:%%global xmms_plugindir %(xmms-config --plugin-dir 2>/dev/null || echo ERROR)}%xmms_plugindir
+%xmms_visualization_plugindir  %{expand:%%global xmms_visualization_plugindir %(xmms-config --visualization-plugin-dir 2>/dev/null || echo ERROR)}%xmms_visualization_plugindir
+%xmms_input_plugindir          %{expand:%%global xmms_input_plugindir %(xmms-config --input-plugin-dir 2>/dev/null || echo ERROR)}%xmms_input_plugindir
+%xmms_output_plugindir         %{expand:%%global xmms_output_plugindir %(xmms-config --output-plugin-dir 2>/dev/null || echo ERROR)}%xmms_output_plugindir
+%xmms_effect_plugindir         %{expand:%%global xmms_effect_plugindir %(xmms-config --effect-plugin-dir 2>/dev/null || echo ERROR)}%xmms_effect_plugindir
+%xmms_general_plugindir                %{expand:%%global xmms_general_plugindir %(xmms-config --general-plugin-dir 2>/dev/null || echo ERROR)}%xmms_general_plugindir
diff --git a/macros.xorg b/macros.xorg
new file mode 100644 (file)
index 0000000..f07d665
--- /dev/null
@@ -0,0 +1,38 @@
+# X.org helper macros
+%__xorg_abi_requires_ge() Requires: xorg-xserver-server(%{expand:%1}-abi) >= %{expand:%{%2}}
+%__xorg_abi_requires_lt() Requires: xorg-xserver-server(%{expand:%1}-abi) < %(awk -vv=%{expand:%{%2}} 'BEGIN{split(v, a, "."); printf("%s.0", a[1] + 1); exit}')
+
+%xorg_xserver_ansic_abi                %{expand:%%global xorg_xserver_ansic_abi %(awk '/#define ABI_ANSIC_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)}%xorg_xserver_ansic_abi
+%xorg_xserver_extension_abi    %{expand:%%global xorg_xserver_extension_abi %(awk '/#define ABI_EXTENSION_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)}%xorg_xserver_extension_abi
+%xorg_xserver_font_abi         %{expand:%%global xorg_xserver_font_abi %(awk '/#define ABI_FONT_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null | echo ERROR)}%xorg_xserver_font_abi
+%xorg_xserver_videodrv_abi     %{expand:%%global xorg_xserver_videodrv_abi %(awk '/#define ABI_VIDEODRV_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)}%xorg_xserver_videodrv_abi
+%xorg_xserver_xinput_abi       %{expand:%%global xorg_xserver_xinput_abi %(awk '/#define ABI_XINPUT_VERSION/ { split($0,A,/[(,)]/); printf("%d.%d",A[2], A[3]); }' /usr/include/xorg/xf86Module.h 2> /dev/null || echo ERROR)}%xorg_xserver_xinput_abi
+# vim: '
+
+%requires_xorg_xserver_extension \
+%{__xorg_abi_requires_ge ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires_lt ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires_ge extension xorg_xserver_extension_abi} \
+%{__xorg_abi_requires_lt extension xorg_xserver_extension_abi} \
+%{nil}
+
+%requires_xorg_xserver_xinput \
+%{__xorg_abi_requires_ge ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires_lt ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires_ge xinput xorg_xserver_xinput_abi} \
+%{__xorg_abi_requires_lt xinput xorg_xserver_xinput_abi} \
+%{nil}
+
+%requires_xorg_xserver_font \
+%{__xorg_abi_requires_ge ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires_lt ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires_ge font xorg_xserver_font_abi} \
+%{__xorg_abi_requires_lt font xorg_xserver_font_abi} \
+%{nil}
+
+%requires_xorg_xserver_videodrv \
+%{__xorg_abi_requires_ge ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires_lt ansic xorg_xserver_ansic_abi} \
+%{__xorg_abi_requires_ge videodrv xorg_xserver_videodrv_abi} \
+%{__xorg_abi_requires_lt videodrv xorg_xserver_videodrv_abi} \
+%{nil}
index 18d03a676e9933ce1b615744f16d907f0e2fb87c..738f3b3ed10ffaa194c5bcbdc1e95f0523501ee5 100644 (file)
@@ -12,6 +12,7 @@ Source1:      service_generator.sh
 Source3:       find-lang.sh
 Source4:       dokuwiki-find-lang.sh
 Source5:       macros.kernel
+Source6:       attr.kernel
 
 Source10:      attr.ruby
 Source11:      macros.ruby
@@ -29,6 +30,21 @@ Source32:    rpm-php-provides
 Source33:      rpm-php-requires
 Source34:      rpm-php-requires.php
 
+Source40:      macros.browser-plugins
+Source41:      macros.cacti
+Source42:      macros.emacs
+Source43:      macros.ghc
+Source44:      macros.nagios
+Source45:      macros.openldap
+Source46:      macros.perl
+Source47:      macros.python
+Source48:      macros.systemd
+Source49:      macros.tcl
+Source50:      macros.upstart
+Source51:      macros.webapp
+Source52:      macros.xmms
+Source53:      macros.xorg
+
 Patch0:                disable-systemd.patch
 #Patchx: %{name}-pydebuginfo.patch
 BuildRequires: rpm >= 4.4.9-56
@@ -127,7 +143,6 @@ pakietach RPM.
 %setup -qcT
 cp -p %{SOURCE0} .
 cp -p %{SOURCE1} .
-cp -p %{SOURCE5} .
 
 %if "%{pld_release}" == "ac"
 %{__sed} -i -e '/libtoolize --copy --force --install/s/ --install//' macros.pld
@@ -153,7 +168,8 @@ rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d
 
 cp -p macros.pld $RPM_BUILD_ROOT%{_usrlibrpm}/macros.build
-cp -p macros.kernel $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/kernel
+
+cat %{SOURCE5} %{SOURCE6} >$RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/kernel
 
 install -p service_generator.sh $RPM_BUILD_ROOT%{_usrlibrpm}
 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_usrlibrpm}/find-lang.sh
@@ -172,16 +188,45 @@ cp -p %{SOURCE32} $RPM_BUILD_ROOT%{_usrlibrpm}/php.prov
 cp -p %{SOURCE33} $RPM_BUILD_ROOT%{_usrlibrpm}/php.req
 cp -p %{SOURCE34} $RPM_BUILD_ROOT%{_usrlibrpm}/php.req.php
 
+cp -p %{SOURCE40} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/browser-plugins
+cp -p %{SOURCE41} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/cacti
+cp -p %{SOURCE42} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/emacs
+cp -p %{SOURCE43} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/ghc
+cp -p %{SOURCE44} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/nagios
+cp -p %{SOURCE45} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/openldap
+cp -p %{SOURCE46} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/perl
+cp -p %{SOURCE47} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/python
+cp -p %{SOURCE48} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/systemd
+cp -p %{SOURCE49} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/tcl
+cp -p %{SOURCE50} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/upstart
+cp -p %{SOURCE51} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/webapp
+cp -p %{SOURCE52} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/xmms
+cp -p %{SOURCE53} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/xorg
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
 %{_usrlibrpm}/macros.build
+%{_usrlibrpm}/macros.d/browser-plugins
+%{_usrlibrpm}/macros.d/cacti
+%{_usrlibrpm}/macros.d/emacs
+%{_usrlibrpm}/macros.d/ghc
 %{_usrlibrpm}/macros.d/java
 %{_usrlibrpm}/macros.d/kernel
+%{_usrlibrpm}/macros.d/nagios
+%{_usrlibrpm}/macros.d/openldap
+%{_usrlibrpm}/macros.d/perl
 %{_usrlibrpm}/macros.d/php
+%{_usrlibrpm}/macros.d/python
 %{_usrlibrpm}/macros.d/ruby
+%{_usrlibrpm}/macros.d/systemd
+%{_usrlibrpm}/macros.d/tcl
+%{_usrlibrpm}/macros.d/upstart
+%{_usrlibrpm}/macros.d/webapp
+%{_usrlibrpm}/macros.d/xmms
+%{_usrlibrpm}/macros.d/xorg
 %attr(755,root,root) %{_usrlibrpm}/service_generator.sh
 %attr(755,root,root) %{_usrlibrpm}/find-lang.sh
 %attr(755,root,root) %{_usrlibrpm}/dokuwiki-find-lang.sh
This page took 0.103041 seconds and 4 git commands to generate.