]> git.ipfire.org Git - people/stevee/pakfire.git/blobdiff - macros/constants.macro
Hardening: Declare content of /usr/lib/grub as firmware files
[people/stevee/pakfire.git] / macros / constants.macro
index 5a2d93d807071cc5d897b65fe2f4aab0b415125e..e56d5865f56f383b171270b14b2679d1830f8251 100644 (file)
@@ -1,65 +1,27 @@
 
-BUILDROOT   = %{DIR_TMP}/buildroot_%{name}-%{thisver}
-
 DIR_APP     = %{DIR_SRC}/%{thisapp}
 DIR_DL      = %{BASEDIR}/files
 DIR_PATCHES = %{BASEDIR}/patches
-DIR_SRC     = /usr/src
+DIR_SRC     = /build/source
 DIR_TMP     = /tmp
 DIR_SOURCE  = %{BASEDIR}
 
-CONFIGURE_SCRIPT = configure
-configure_options = \
-       --host=%{DISTRO_MACHINE} \
-       --build=%{DISTRO_MACHINE} \
-       --prefix=/usr
-
-patches =
+# By default, take all patches from the patches directory
+# in alphabetical order.
+patches = %(find %{DIR_PATCHES} %{DIR_PATCHES}/%{DISTRO_ARCH} -not -type d -maxdepth 1 2>/dev/null | sort --version-sort)
 sources = %{thisapp}.tar.gz
 
 # Macro definitions
 
 # Macro to extract tarballs.
 # Guesses the compression type automatically.
-MACRO_EXTRACT = tar xaf
-
-MACRO_PATCHES
-       patches="%{patches}"
-
-       if [ -n "${patches}" ]; then
-               _patches=""
-               for patch in ${patches}; do
-                       _patches="${_patches} %{DIR_PATCHES}/${patch}"
-               done
-               patches="${_patches}"
-               unset _patches
-       else
-               for patch in %{DIR_PATCHES}/*.{diff,patch{,0}}; do
-                       [ -e "${patch}" ] || continue
-                       patches="${patches} ${patch}"
-               done
-       fi
-       
-       for patch in ${patches}; do
-               case "${patch}" in
-                       *.patch0)
-                               cmd="patch -Np0"
-                               ;;
-                       *.patch|*.diff)
-                               cmd="patch -Np1"
-                               ;;
-               esac
-
-               ${cmd} -i ${patch}
-       done
-       unset cmd patch patches
-end
+MACRO_EXTRACT = tar --no-same-owner --no-acls --no-xattrs -xaf
 
 # Remove rpath from libtool.
 MACRO_FIX_LIBTOOL
-       if [ -e "%{DIR_APP}/libtool" ]; then
-               sed -e %{DIR_APP}/libtool \
-                       -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g'
+       if [ -e "libtool" ]; then
+               sed -libtool \
+                       -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
                        -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g'
        fi
 end