@@ -0,0 +1,306 @@
+# directories
+%_infodir %{_prefix}/share/info
+%_mandir %{_prefix}/share/man
+%_sysconfdir /etc
+%_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
+%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$/, "")')
+
+# 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 /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}} \
+%{nil}
+
+# macro: %configure_kernel_source
+#
+#
+%configure_kernel_source() \
+ if test -d /usr/src/linux ; then \
+ pushd /usr/src/linux \
+ test -f .config || cp arch/%_arch/defconfig.default .config \
+ yes "" | make oldconfig \
+ make dep \
+ popd \
+ fi \
+ %nil
+
+%install_info(:-:) \
+ ALL_ARGS=(%{**}) \
+ NUM_ARGS=${#ALL_ARGS[@]} \
+ if test -x /sbin/install-info ; then \
+ if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
+ /sbin/install-info "${ALL_ARGS[@]}" \
+ fi \
+ fi ;
+
+%install_info_delete(:-:) \
+ ALL_ARGS=(%{**}) \
+ NUM_ARGS=${#ALL_ARGS[@]} \
+ if test -x /sbin/install-info ; then \
+ if ! test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
+ /sbin/install-info --quiet --delete "${ALL_ARGS[@]}" \
+ 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)}
+
+%do_profiling 1
+%cflags_profile_generate -fprofile-generate
+%cflags_profile_feedback -fprofile-use
+
+
+
+# Tizen
+#
+%configure \
+ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
+ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
+ FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
+ ./configure --build=%{_build} --host=%{_host} \\\
+ --program-prefix=%{?_program_prefix} \\\
+ --prefix=%{_prefix} \\\
+ --exec-prefix=%{_exec_prefix} \\\
+ --bindir=%{_bindir} \\\
+ --sbindir=%{_sbindir} \\\
+ --sysconfdir=%{_sysconfdir} \\\
+ --datadir=%{_datadir} \\\
+ --includedir=%{_includedir} \\\
+ --libdir=%{_libdir} \\\
+ --libexecdir=%{_libexecdir} \\\
+ --localstatedir=%{_localstatedir} \\\
+ --sharedstatedir=%{_sharedstatedir} \\\
+ --mandir=%{_mandir} \\\
+ --infodir=%{_infodir}
+
+
+%reconfigure \
+ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
+ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
+ FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
+ autoreconf -v --install --force || exit 1 \
+ ./configure --build=%{_build} --host=%{_host} \\\
+ --program-prefix=%{?_program_prefix} \\\
+ --prefix=%{_prefix} \\\
+ --exec-prefix=%{_exec_prefix} \\\
+ --bindir=%{_bindir} \\\
+ --sbindir=%{_sbindir} \\\
+ --sysconfdir=%{_sysconfdir} \\\
+ --datadir=%{_datadir} \\\
+ --includedir=%{_includedir} \\\
+ --libdir=%{_libdir} \\\
+ --libexecdir=%{_libexecdir} \\\
+ --localstatedir=%{_localstatedir} \\\
+ --sharedstatedir=%{_sharedstatedir} \\\
+ --mandir=%{_mandir} \\\
+ --infodir=%{_infodir}
+
+%autogen \
+ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
+ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
+ FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
+ ./autogen.sh --build=%{_build} --host=%{_host} \\\
+ --program-prefix=%{?_program_prefix} \\\
+ --prefix=%{_prefix} \\\
+ --exec-prefix=%{_exec_prefix} \\\
+ --bindir=%{_bindir} \\\
+ --sbindir=%{_sbindir} \\\
+ --sysconfdir=%{_sysconfdir} \\\
+ --datadir=%{_datadir} \\\
+ --includedir=%{_includedir} \\\
+ --libdir=%{_libdir} \\\
+ --libexecdir=%{_libexecdir} \\\
+ --localstatedir=%{_localstatedir} \\\
+ --sharedstatedir=%{_sharedstatedir} \\\
+ --mandir=%{_mandir} \\\
+ --infodir=%{_infodir}
+
+
+%makeinstall \
+ %{__make} \\\
+ prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
+ exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
+ bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
+ sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
+ sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
+ datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
+ includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
+ libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
+ libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
+ localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
+ sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
+ mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
+ infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
+ install
+
+
+%make_install \
+ %{__make} \\\
+ DESTDIR=%{?buildroot:%{buildroot}} \\\
+ INSTALL_ROOT=%{?buildroot:%{buildroot}} \\\
+ install \
+ rm -f %{?buildroot:%{buildroot}}%{_infodir}/dir \
+ find %{?buildroot:%{buildroot}} -regex ".*\\.la$" | xargs rm -f -- \
+ %{!?keepstatic:find %{?buildroot:%{buildroot}} -regex ".*\\.a$" | xargs rm -f --}
+
+%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
+ && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
+ [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
+
+%lang_package(n:f:) \
+%package %{-n:-n %{-n*}-}locale \
+Summary: Translations and Locale for package %{name}\
+Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
+Provides: %{-n:%{-n*}}%{!-n:%{name}}-lang-all = %{version} \
+BuildArch: noarch \
+%description %{-n:-n %{-n*}-}locale\
+This package provides translations for package %{name}.\
+%files %{-n:-n %{-n*}-}locale -f %{-f:%{-f*}.lang} %{!-f:%{name}.lang}\
+%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}
+
+# Bad hack to set $LANG to C during all RPM builds
+%prep \
+%%prep\
+LANG=C\
+export LANG\
+unset DISPLAY\
+%{nil}
+
+%build %%build\
+LANG=C\
|