Add macro %isu_package to generate ISU Package
[platform/upstream/rpm.git] / packaging / rpm-tizen_macros
index 78e38dc..843a658 100644 (file)
@@ -5,48 +5,51 @@
 %_localstatedir         /var
 %_defaultdocdir         %{_usr}/share/doc/packages
 
+# _rootprefix can be set to (/,%{_prefix}) to customize systemd installation)
+%_rootprefix %{_prefix}
+%_unitdir_user %{_prefix}/lib/systemd/user
+%_unitdir %{_rootprefix}/lib/systemd/system
+
 # package build macros
-%make_install           make install DESTDIR=%{?buildroot}
-%makeinstall            make DESTDIR=%{?buildroot:%{buildroot}} install
+%make_install           make install DESTDIR=%{?buildroot}
+%makeinstall            make DESTDIR=%{?buildroot:%{buildroot}} install
 %rb_arch                %(echo %{_host_cpu}-linux | sed -e "s/i686/i586/" -e "s/armv5tel/armv4l/" -e "s/hppa2.0/hppa/")
 %rb_ver                 %(/usr/bin/ruby -e 'puts VERSION.sub(/\\\.\\\d$/, "")')
 
-# this script calls all scripts in /usr/lib/rpm/brp-tizen.d
-%__os_install_post  \
-       /usr/lib/rpm/brp-compress \
-       /usr/lib/rpm/brp-tizen  \
-       %{!?disable_docs_package:/usr/lib/rpm/tizen/find-docs.sh %{buildroot}} \
+# external kernel module helper macro(s)
+%kernel_devel_uname_r %(/bin/rpm -q --provides $(/bin/rpm -q --whatprovides kernel-devel-uname-r) | sed -ne 's,kernel-devel-uname-r = ,, p')
+%kernel_release %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel))
+%kernel_name    %(/bin/rpm -q --queryformat '%{RPMTAG_NAME}' $(/bin/rpm -q --whatprovides kernel))
+
+# this script calls all scripts in %{_rpmconfigdir}/brp-tizen.d
+%__arch_install_post   %{_rpmconfigdir}/check-buildroot
+
+%__strip_install_post    \
+    %{!?__debug_package:%{_rpmconfigdir}/brp-strip %{__strip}} \
+    %{_rpmconfigdir}/brp-strip-static-archive %{__strip} \
+#    %{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \
 %{nil}
 
-# macro: %restart_on_update()
-#      Used to restart a service in postun section, if we are
-#      not running from YaST2 in instsys on update.
-%restart_on_update() \
-       test -n "$FIRST_ARG" || FIRST_ARG=$1 \
-       if test "$FIRST_ARG" -ge 1 ; then \
-          test -f /etc/sysconfig/services && . /etc/sysconfig/services \
-           if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_RESTART_ON_UPDATE" != yes ; then \
-              for service in %{?*} ; do \
-                 /etc/init.d/$service try-restart > /dev/null || : \
-              done \
-           fi \
-        fi \
-       %nil
+%__os_install_post    \
+    %{_rpmconfigdir}//brp-compress \
+    %{!?_rpm_strip_disable:%{__strip_install_post}}\
+    %{_rpmconfigdir}/brp-python-hardlink \
+    %{!?disable_docs_package:%{_rpmconfigdir}/tizen/find-docs.sh %{buildroot}} \
+%{nil}
+
+#    %{_rpmconfigdir}/tizen/brp-implant-ident-static
+#
+%__isu_install_post \
+    %{_rpmconfigdir}/tizen/find-isufiles.sh %{_builddir}/%{?buildsubdir}/isu.list \
+%{nil}
+
+%__spec_install_post\
+    %{?__debug_package:%{__debug_install_post}}\
+    %{__arch_install_post}\
+    %{__os_install_post}\
+    %{__isu_install_post}\
+%{nil}
 
-# macro: %stop_on_removal()
-#       Used to stop a service in preun section, if we are
-#       not running from YaST2 in instsys on removal of this package.
-%stop_on_removal() \
-        test -n "$FIRST_ARG" || FIRST_ARG=$1 \
-        if test "$FIRST_ARG" = "0" ; then \
-          test -f /etc/sysconfig/services && . /etc/sysconfig/services \
-           if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_STOP_ON_REMOVAL" != yes ; then \
-              for service in %{?*} ; do \
-                 /etc/init.d/$service stop > /dev/null \
-              done \
-           fi \
-        fi \
-        %nil
 # macro: %configure_kernel_source
 #
 #
@@ -60,9 +63,6 @@
        fi \
        %nil
 
-%is_plus %(if test -f /.buildenv ; then source /.buildenv ; if [[ "$BUILD_BASENAME" == *+kde ]] ; then echo 1 ; else echo 0 ; fi ; else echo 0 ; fi)
-
-               
 %install_info(:-:) \
     ALL_ARGS=(%{**}) \
     NUM_ARGS=${#ALL_ARGS[@]} \
@@ -70,7 +70,7 @@
        if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
            /sbin/install-info "${ALL_ARGS[@]}" \
        fi \
-    fi ; 
+    fi ;
 
 %install_info_delete(:-:) \
     ALL_ARGS=(%{**}) \
        if ! test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
            /sbin/install-info --quiet --delete "${ALL_ARGS[@]}" \
        fi ; \
-    fi ; 
+    fi ;
 
 # find-supplements.ksyms parses this macro directly out of the spec file:
 %supplements_kernel_module() \
     %{expand:%(if ! rpm -q kernel-syms > /dev/null; then echo "%fail Please add the kernel-syms package to BuildRequires"; fi)}
 
-%tizen_version 100
-
 %do_profiling 1
 %cflags_profile_generate -fprofile-generate
 %cflags_profile_feedback -fprofile-use
 
 
 
-
-
 # Tizen
 #
 %configure \
   CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
   FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
   ./configure --build=%{_build} --host=%{_host} \\\
-        --target=%{_target_platform} \\\
         --program-prefix=%{?_program_prefix} \\\
         --prefix=%{_prefix} \\\
         --exec-prefix=%{_exec_prefix} \\\
   FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
   autoreconf -v --install --force || exit 1 \
   ./configure --build=%{_build} --host=%{_host} \\\
-        --target=%{_target_platform} \\\
         --program-prefix=%{?_program_prefix} \\\
         --prefix=%{_prefix} \\\
         --exec-prefix=%{_exec_prefix} \\\
   CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
   FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
   ./autogen.sh --build=%{_build} --host=%{_host} \\\
-        --target=%{_target_platform} \\\
         --program-prefix=%{?_program_prefix} \\\
         --prefix=%{_prefix} \\\
         --exec-prefix=%{_exec_prefix} \\\
   %{__make} \\\
         DESTDIR=%{?buildroot:%{buildroot}} \\\
         INSTALL_ROOT=%{?buildroot:%{buildroot}} \\\
-  install %* \
+  install  \
   rm -f %{?buildroot:%{buildroot}}%{_infodir}/dir \
   find %{?buildroot:%{buildroot}} -regex ".*\\.la$" | xargs rm -f -- \
   %{!?keepstatic:find %{?buildroot:%{buildroot}} -regex ".*\\.a$" | xargs rm -f --}
 %lang_package(n:f:) \
 %package %{-n:-n %{-n*}-}locale \
 Summary: Translations and Locale for package %{name}\
-Group: System/Localization\
 Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
 Provides: %{-n:%{-n*}}%{!-n:%{name}}-lang-all = %{version} \
 BuildArch:  noarch \
@@ -207,6 +199,25 @@ This package provides translations for package %{name}.\
 %defattr(-,root,root,-)\
 %{nil}
 
+%docs_package \
+%package docs \
+Summary: Documentation for package %{name}\
+AutoReqProv: 0\
+%description docs\
+This package provides documentation for package %{name}.\
+%files docs -f documentation.list\
+%defattr(-,root,root,-)\
+%{nil}
+
+%isu_package \
+%package isu \
+Summary: ISU Package configuration \
+AutoReqProv: 0\
+%description isu\
+This package provides ISU configuration for package %{name}.\
+%files isu -f isu.list\
+%defattr(-,root,root,-)\
+%{nil}
 
 # Bad hack to set $LANG to C during all RPM builds
 %prep \
@@ -223,13 +234,14 @@ unset DISPLAY\
 CFLAGS="%optflags" ; export CFLAGS ; \
 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
 FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
-LD_AS_NEEDED=1; export LD_AS_NEEDED ; \
+LDFLAGS="${LDFLAGS:-%{?global_LDFLAGS}}"; export LDFLAGS ; \
 %{nil}
 
 %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
 %%install\
 LANG=C\
 export LANG\
+%{?_enable_binutils_strip:export STRIP_DEFAULT_PACKAGE="binutils"} \
 unset DISPLAY\
 rm -rf %{?buildroot:%{buildroot}} \
 mkdir -p %{?buildroot:%{buildroot}} \
@@ -240,8 +252,8 @@ mkdir -p %{?buildroot:%{buildroot}} \
 rm -rf %{?buildroot:%{buildroot}} \
 %{nil}
 
-%find_lang      /usr/lib/rpm/find-lang.sh %{buildroot}
-%find_docs      /usr/lib/rpm/tizen/find-docs.sh %{buildroot}
+%find_lang      %{_rpmconfigdir}/find-lang.sh %{buildroot}
+%find_docs      %{_rpmconfigdir}/tizen/find-docs.sh %{buildroot}
 
 
 
@@ -278,7 +290,7 @@ rm -rf %{?buildroot:%{buildroot}} \
 # actually set up the filtering bits
 %filter_setup %{expand: \
 %global _use_internal_dependency_generator 0 \
-%global __deploop() while read FILE; do /usr/lib/rpm/rpmdeps -%{1} ${FILE}; done | /bin/sort -u \
+%global __deploop() while read FILE; do %{_rpmconfigdir}/rpmdeps -%{1} ${FILE}; done | /bin/sort -u \
 %global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \
 %global __find_requires /bin/sh -c "%{?__filter_req_cmd}  %{__deploop R} %{?__filter_from_req}" \
 }
@@ -294,3 +306,50 @@ rm -rf %{?buildroot:%{buildroot}} \
   find %{?buildroot:%{buildroot}} -regex ".*/man/man./.*\.[0-9]" | xargs rm -f -- \
   find %{?buildroot:%{buildroot}} -regex ".*/man/../man./.*\.[0-9]" | xargs rm -f -- \
   find %{?buildroot:%{buildroot}} -regex ".*/man/man./.*\.[0-9]pm" | xargs rm -f --
+
+
+%install_service() \
+mkdir -p %{buildroot}/%{_unitdir}/%{1} \
+ln -s ../%{2}  %{buildroot}/%{_unitdir}/%{1}/%{2}  \
+%{nil}
+
+
+%_fontsdir               %{_usr}/share/fonts
+%_ttfontsdir             %{_fontsdir}/truetype
+%_miscfontsdir           %{_fontsdir}/misc
+%_fontsconfdir           %{_sysconfdir}/fonts
+%_fontsconfddir          %{_fontsconfdir}/conf.d
+%_fontsconfavaildir      %{_datadir}/%{name}/conf.avail
+
+%devel_package \
+%package devel \
+Summary: Development files for package %{name}\
+Group: Development\
+%description devel\
+This package provides header files and other developer releated files for package %{name}.\
+%files devel \
+%{_includedir}/*\
+%{_libdir}/pkgconfig/*.pc\
+%{_libdir}/*.so\
+%{nil}
+
+%devel_desc This package contains all necessary include files and libraries needed \
+to develop applications that require %{name}.\
+%{nil}
+
+%posttrans(n:) %%posttrans %{?-n:-n %{-n*}}%{*} \
+echo "Running %{?-n:%{-n*}}%{!?-n:%{name}%{?1:-%{1}}} %%posttrans script" \
+%{nil}
+
+%_debug_manifest %{_rpmconfigdir}/debug.manifest
+
+%_install_debug_manifest \
+   cp %{_debug_manifest} %{_builddir}/%{?buildsubdir}/%{name}-debuginfo.manifest \
+   cp %{_debug_manifest} %{_builddir}/%{?buildsubdir}/%{name}-debugsource.manifest \
+%{nil}
+
+%_buildinfo "Tizen %tizen_full_version"\
+"%_project/%_repository"\
+"%(gcc --version | head -n 1)-%(rpm -q gcc --queryformat \"%{VCS}\" | sed -e 's/.*\#//')"\
+%{?_auxbuildinfo}\
+%{nil}