From c06defc7196f3a649c61537d4e6ddbf22feeb0ef Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 27 Oct 2008 03:56:42 +0100 Subject: [PATCH] Replace run_stuff with post/pre_ variables. If there's a file called "$pkgname.{pre,post}_{configure,build,install} it will be automatically executed. In addition to this, templates may use {pre,post}_{configure,build,install}_cmd variables to run arbitrary commands. --HG-- extra : convert_revision : 62ad549b8299689ecf8c833e73eda436ffdb7aa7 --- ...uff-after-install.sh => bash.post_install} | 0 ...ff-before-build.sh => font-util.pre_build} | 0 ...tuff-after-install.sh => gcc.post_install} | 0 ...-before-configure.sh => gcc.pre_configure} | 0 templates/gimp.tmpl | 2 +- ...ff-after-install.sh => glibc.post_install} | 0 ...efore-configure.sh => glibc.pre_configure} | 0 ...ff-before-install.sh => glibc.pre_install} | 0 templates/groff.tmpl | 2 +- ...ff-before-build.sh => gtk-sharp.pre_build} | 0 ...onfigure.sh => libpciaccess.pre_configure} | 0 ...stuff-before-build.sh => libpng.pre_build} | 0 ...-before-configure.sh => mng.pre_configure} | 0 ...before-configure.sh => mono.pre_configure} | 0 ...-after-install.sh => openssl.post_install} | 0 ...unstuff-before-build.sh => perl.pre_build} | 0 ...uild.sh => shared-mime-info.pre_configure} | 0 ...uff-before-build.sh => syslinux.pre_build} | 0 ...uff-after-install.sh => udev.post_install} | 0 ...fter-install.sh => xmlcatmgr.post_install} | 0 ...efore-install.sh => xmlcatmgr.pre_install} | 0 xbps.sh | 32 +++++++++---------- 22 files changed, 17 insertions(+), 19 deletions(-) rename templates/{bash-runstuff-after-install.sh => bash.post_install} (100%) rename templates/{font-util-runstuff-before-build.sh => font-util.pre_build} (100%) rename templates/{gcc-runstuff-after-install.sh => gcc.post_install} (100%) rename templates/{gcc-runstuff-before-configure.sh => gcc.pre_configure} (100%) rename templates/{glibc-runstuff-after-install.sh => glibc.post_install} (100%) rename templates/{glibc-runstuff-before-configure.sh => glibc.pre_configure} (100%) rename templates/{glibc-runstuff-before-install.sh => glibc.pre_install} (100%) rename templates/{gtk-sharp-runstuff-before-build.sh => gtk-sharp.pre_build} (100%) rename templates/{libpciaccess-runstuff-before-configure.sh => libpciaccess.pre_configure} (100%) rename templates/{libpng-runstuff-before-build.sh => libpng.pre_build} (100%) rename templates/{mng-runstuff-before-configure.sh => mng.pre_configure} (100%) rename templates/{mono-runstuff-before-configure.sh => mono.pre_configure} (100%) rename templates/{openssl-runstuff-after-install.sh => openssl.post_install} (100%) rename templates/{perl-runstuff-before-build.sh => perl.pre_build} (100%) rename templates/{shared-mime-info-runstuff-before-build.sh => shared-mime-info.pre_configure} (100%) rename templates/{syslinux-runstuff-before-build.sh => syslinux.pre_build} (100%) rename templates/{udev-runstuff-after-install.sh => udev.post_install} (100%) rename templates/{xmlcatmgr-runstuff-after-install.sh => xmlcatmgr.post_install} (100%) rename templates/{xmlcatmgr-runstuff-before-install.sh => xmlcatmgr.pre_install} (100%) diff --git a/templates/bash-runstuff-after-install.sh b/templates/bash.post_install similarity index 100% rename from templates/bash-runstuff-after-install.sh rename to templates/bash.post_install diff --git a/templates/font-util-runstuff-before-build.sh b/templates/font-util.pre_build similarity index 100% rename from templates/font-util-runstuff-before-build.sh rename to templates/font-util.pre_build diff --git a/templates/gcc-runstuff-after-install.sh b/templates/gcc.post_install similarity index 100% rename from templates/gcc-runstuff-after-install.sh rename to templates/gcc.post_install diff --git a/templates/gcc-runstuff-before-configure.sh b/templates/gcc.pre_configure similarity index 100% rename from templates/gcc-runstuff-before-configure.sh rename to templates/gcc.pre_configure diff --git a/templates/gimp.tmpl b/templates/gimp.tmpl index e09d9f7b58f..1342b1824d5 100644 --- a/templates/gimp.tmpl +++ b/templates/gimp.tmpl @@ -17,7 +17,7 @@ long_desc=" support and more than 8 bits per channel." # This needs GNU gettext >= 0.16. -run_stuff_before_configure_cmd=". $XBPS_TMPLHELPDIR/external-gettext.sh" +pre_configure_cmd=". $XBPS_TMPLHELPDIR/external-gettext.sh" # Update shared-mime-info database. postinstall_helpers="update-mimedb.sh" diff --git a/templates/glibc-runstuff-after-install.sh b/templates/glibc.post_install similarity index 100% rename from templates/glibc-runstuff-after-install.sh rename to templates/glibc.post_install diff --git a/templates/glibc-runstuff-before-configure.sh b/templates/glibc.pre_configure similarity index 100% rename from templates/glibc-runstuff-before-configure.sh rename to templates/glibc.pre_configure diff --git a/templates/glibc-runstuff-before-install.sh b/templates/glibc.pre_install similarity index 100% rename from templates/glibc-runstuff-before-install.sh rename to templates/glibc.pre_install diff --git a/templates/groff.tmpl b/templates/groff.tmpl index 46f62793260..e4323159830 100644 --- a/templates/groff.tmpl +++ b/templates/groff.tmpl @@ -19,4 +19,4 @@ long_desc=" run_depends="glibc-2.8" # The install target fails if the dir is not there already. -run_stuff_before_install_cmd="mkdir -p $XBPS_DESTDIR/$pkgname-$version/usr" +pre_install_cmd="mkdir -p $XBPS_DESTDIR/$pkgname-$version/usr" diff --git a/templates/gtk-sharp-runstuff-before-build.sh b/templates/gtk-sharp.pre_build similarity index 100% rename from templates/gtk-sharp-runstuff-before-build.sh rename to templates/gtk-sharp.pre_build diff --git a/templates/libpciaccess-runstuff-before-configure.sh b/templates/libpciaccess.pre_configure similarity index 100% rename from templates/libpciaccess-runstuff-before-configure.sh rename to templates/libpciaccess.pre_configure diff --git a/templates/libpng-runstuff-before-build.sh b/templates/libpng.pre_build similarity index 100% rename from templates/libpng-runstuff-before-build.sh rename to templates/libpng.pre_build diff --git a/templates/mng-runstuff-before-configure.sh b/templates/mng.pre_configure similarity index 100% rename from templates/mng-runstuff-before-configure.sh rename to templates/mng.pre_configure diff --git a/templates/mono-runstuff-before-configure.sh b/templates/mono.pre_configure similarity index 100% rename from templates/mono-runstuff-before-configure.sh rename to templates/mono.pre_configure diff --git a/templates/openssl-runstuff-after-install.sh b/templates/openssl.post_install similarity index 100% rename from templates/openssl-runstuff-after-install.sh rename to templates/openssl.post_install diff --git a/templates/perl-runstuff-before-build.sh b/templates/perl.pre_build similarity index 100% rename from templates/perl-runstuff-before-build.sh rename to templates/perl.pre_build diff --git a/templates/shared-mime-info-runstuff-before-build.sh b/templates/shared-mime-info.pre_configure similarity index 100% rename from templates/shared-mime-info-runstuff-before-build.sh rename to templates/shared-mime-info.pre_configure diff --git a/templates/syslinux-runstuff-before-build.sh b/templates/syslinux.pre_build similarity index 100% rename from templates/syslinux-runstuff-before-build.sh rename to templates/syslinux.pre_build diff --git a/templates/udev-runstuff-after-install.sh b/templates/udev.post_install similarity index 100% rename from templates/udev-runstuff-after-install.sh rename to templates/udev.post_install diff --git a/templates/xmlcatmgr-runstuff-after-install.sh b/templates/xmlcatmgr.post_install similarity index 100% rename from templates/xmlcatmgr-runstuff-after-install.sh rename to templates/xmlcatmgr.post_install diff --git a/templates/xmlcatmgr-runstuff-before-install.sh b/templates/xmlcatmgr.pre_install similarity index 100% rename from templates/xmlcatmgr-runstuff-before-install.sh rename to templates/xmlcatmgr.pre_install diff --git a/xbps.sh b/xbps.sh index ad65498a721..9ca5172edef 100755 --- a/xbps.sh +++ b/xbps.sh @@ -214,9 +214,9 @@ reset_tmpl_vars() short_desc maintainer long_desc checksum wrksrc \ patch_files make_cmd base_package \ make_env make_build_target configure_script \ - run_stuff_before_configure_cmd run_stuff_before_build_cmd \ - run_stuff_before_install_cmd run_stuff_after_install_cmd \ - make_install_target postinstall_helpers version \ + pre_configure_cmd pre_build_cmd pre_install_cmd \ + post_install_cmd postinstall_helpers \ + make_install_target version \ ignore_files tar_override_cmd xml_entries sgml_entries \ build_depends libtool_fixup_la_stage no_fixup_libtool \ XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \ @@ -680,11 +680,10 @@ configure_src_phase() echo "=> Running configure phase for $pkgname-$version." - # Run stuff before configure. - local rbcf="$XBPS_TEMPLATESDIR/$pkgname-runstuff-before-configure.sh" + # Run pre_configure helpers. + local rbcf="$XBPS_TEMPLATESDIR/$pkgname.pre_configure" [ -f "$rbcf" ] && . $rbcf - [ -n "$run_stuff_before_configure_cmd" ] && \ - ${run_stuff_before_configure_cmd} + [ -n "$pre_configure_cmd" ] && ${pre_configure_cmd} unset rbcf # Export configure_env vars. @@ -797,11 +796,11 @@ build_src_phase() fi # - # Run template stuff before building. + # Run pre_build helpers. # - local rbbf="$XBPS_TEMPLATESDIR/$pkgname-runstuff-before-build.sh" + local rbbf="$XBPS_TEMPLATESDIR/$pkgname.pre_build" [ -f $rbbf ] && . $rbbf - [ -n "$run_stuff_before_build_cmd" ] && ${run_stuff_before_build_cmd} + [ -n "$pre_build_cmd" ] && ${pre_build_cmd} unset rbbf [ -z "$make_build_target" ] && make_build_target= @@ -826,12 +825,11 @@ build_src_phase() unset makejobs # - # Run template stuff before installing. + # Run pre_install helpers. # - local rbif="$XBPS_TEMPLATESDIR/$pkgname-runstuff-before-install.sh" + local rbif="$XBPS_TEMPLATESDIR/$pkgname.pre_install" [ -f $rbif ] && . $rbif - [ -n "$run_stuff_before_install_cmd" ] && \ - ${run_stuff_before_install_cmd} + [ -n "$pre_install_cmd" ] && ${pre_install_cmd} unset rbif if [ -z "$libtool_fixup_la_stage" \ @@ -896,11 +894,11 @@ install_src_phase() done # - # Run template stuff after installing. + # Run post_install helpers. # - local raif="$XBPS_TEMPLATESDIR/$pkgname-runstuff-after-install.sh" + local raif="$XBPS_TEMPLATESDIR/$pkgname.post_install" [ -f $raif ] && . $raif - [ -n "$run_stuff_after_install_cmd" ] && ${run_stuff_after_install_cmd} + [ -n "$post_install_cmd" ] && ${post_install_cmd} unset raif # Unset build vars.